Spaces:
Runtime error
Runtime error
feat: implement full project generation engine and LLM router for conversational state management
Browse files- src/recommendation_engine/__pycache__/config.cpython-313.pyc +0 -0
- src/recommendation_engine/__pycache__/full_project_generator.cpython-313.pyc +0 -0
- src/recommendation_engine/__pycache__/llm_router.cpython-313.pyc +0 -0
- src/recommendation_engine/__pycache__/prompt_builder.cpython-313.pyc +0 -0
- src/recommendation_engine/full_project_generator.py +4 -3
- src/recommendation_engine/llm_router.py +7 -10
- src/recommendation_engine/prompt_builder.py +3 -0
src/recommendation_engine/__pycache__/config.cpython-313.pyc
CHANGED
|
Binary files a/src/recommendation_engine/__pycache__/config.cpython-313.pyc and b/src/recommendation_engine/__pycache__/config.cpython-313.pyc differ
|
|
|
src/recommendation_engine/__pycache__/full_project_generator.cpython-313.pyc
CHANGED
|
Binary files a/src/recommendation_engine/__pycache__/full_project_generator.cpython-313.pyc and b/src/recommendation_engine/__pycache__/full_project_generator.cpython-313.pyc differ
|
|
|
src/recommendation_engine/__pycache__/llm_router.cpython-313.pyc
CHANGED
|
Binary files a/src/recommendation_engine/__pycache__/llm_router.cpython-313.pyc and b/src/recommendation_engine/__pycache__/llm_router.cpython-313.pyc differ
|
|
|
src/recommendation_engine/__pycache__/prompt_builder.cpython-313.pyc
CHANGED
|
Binary files a/src/recommendation_engine/__pycache__/prompt_builder.cpython-313.pyc and b/src/recommendation_engine/__pycache__/prompt_builder.cpython-313.pyc differ
|
|
|
src/recommendation_engine/full_project_generator.py
CHANGED
|
@@ -225,9 +225,10 @@ Your task is to update their custom text to incorporate the following NEW FEATUR
|
|
| 225 |
|
| 226 |
CRITICAL RULES:
|
| 227 |
1. You MUST preserve the exact tone, style, and core phrasing of the user's original text!
|
| 228 |
-
2.
|
| 229 |
-
3.
|
| 230 |
-
4.
|
|
|
|
| 231 |
|
| 232 |
NEW FEATURES:
|
| 233 |
{features_text}
|
|
|
|
| 225 |
|
| 226 |
CRITICAL RULES:
|
| 227 |
1. You MUST preserve the exact tone, style, and core phrasing of the user's original text!
|
| 228 |
+
2. Just weave the new features in naturally.
|
| 229 |
+
3. EXPAND the content significantly to ensure it is highly detailed.
|
| 230 |
+
4. The rewritten ABSTRACT MUST contain a minimum of 130 words.
|
| 231 |
+
5. The rewritten DESCRIPTION MUST contain a minimum of 160 words.
|
| 232 |
|
| 233 |
NEW FEATURES:
|
| 234 |
{features_text}
|
src/recommendation_engine/llm_router.py
CHANGED
|
@@ -5,8 +5,6 @@ from src.recommendation_engine.llm_client import generate_text
|
|
| 5 |
|
| 6 |
def word_to_number(text: str):
|
| 7 |
cleaned = text.strip()
|
| 8 |
-
if cleaned in ["1", "2"]:
|
| 9 |
-
return None
|
| 10 |
|
| 11 |
mapping = {
|
| 12 |
"one": 1, "two": 2, "three": 3, "four": 4, "five": 5,
|
|
@@ -88,14 +86,13 @@ JSON Format:
|
|
| 88 |
try:
|
| 89 |
raw_response = generate_text(prompt, task="intent").strip()
|
| 90 |
|
| 91 |
-
#
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
raw_response = "\n".join(lines).strip()
|
| 99 |
|
| 100 |
parsed = json.loads(raw_response)
|
| 101 |
import logging
|
|
|
|
| 5 |
|
| 6 |
def word_to_number(text: str):
|
| 7 |
cleaned = text.strip()
|
|
|
|
|
|
|
| 8 |
|
| 9 |
mapping = {
|
| 10 |
"one": 1, "two": 2, "three": 3, "four": 4, "five": 5,
|
|
|
|
| 86 |
try:
|
| 87 |
raw_response = generate_text(prompt, task="intent").strip()
|
| 88 |
|
| 89 |
+
# Extract JSON using regex if there's conversational text
|
| 90 |
+
import re
|
| 91 |
+
json_match = re.search(r'(\{.*\})', raw_response, re.DOTALL)
|
| 92 |
+
if json_match:
|
| 93 |
+
raw_response = json_match.group(1)
|
| 94 |
+
else:
|
| 95 |
+
raw_response = raw_response.strip()
|
|
|
|
| 96 |
|
| 97 |
parsed = json.loads(raw_response)
|
| 98 |
import logging
|
src/recommendation_engine/prompt_builder.py
CHANGED
|
@@ -206,6 +206,7 @@ REQUIREMENTS:
|
|
| 206 |
- Keep the description realistic and implementable
|
| 207 |
- Write clearly and professionally
|
| 208 |
- Avoid unnecessary marketing language
|
|
|
|
| 209 |
|
| 210 |
STRUCTURE:
|
| 211 |
1. Problem
|
|
@@ -304,6 +305,8 @@ STRICT RULES:
|
|
| 304 |
13. TECHNOLOGIES must contain at least 5 technologies
|
| 305 |
14. METHODOLOGY must be detailed and multi-step
|
| 306 |
15. AI_SUMMARY must never be empty
|
|
|
|
|
|
|
| 307 |
|
| 308 |
====================================================
|
| 309 |
|
|
|
|
| 206 |
- Keep the description realistic and implementable
|
| 207 |
- Write clearly and professionally
|
| 208 |
- Avoid unnecessary marketing language
|
| 209 |
+
- The description MUST be highly detailed and contain a minimum of 160 words.
|
| 210 |
|
| 211 |
STRUCTURE:
|
| 212 |
1. Problem
|
|
|
|
| 305 |
13. TECHNOLOGIES must contain at least 5 technologies
|
| 306 |
14. METHODOLOGY must be detailed and multi-step
|
| 307 |
15. AI_SUMMARY must never be empty
|
| 308 |
+
16. The ABSTRACT section MUST be highly detailed and contain a minimum of 130 words.
|
| 309 |
+
17. The DESCRIPTION section MUST be highly detailed and contain a minimum of 160 words.
|
| 310 |
|
| 311 |
====================================================
|
| 312 |
|