Spaces:
Sleeping
Sleeping
Fix naive prompt to a more develop prompt
Browse files
app.py
CHANGED
|
@@ -41,6 +41,12 @@ embedding_model = SentenceTransformer("sentence-transformers/all-mpnet-base-v2")
|
|
| 41 |
SUPPORTED_EXTENSIONS = {".py", ".java", ".js", ".ts", ".cpp", ".h", ".ipynb"}
|
| 42 |
IGNORED_DIRS = {"node_modules", "venv", "env", ".git", "__pycache__"}
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
# Backend Logic: Clone Repository
|
| 45 |
def clone_repository(repo_url: str) -> str:
|
| 46 |
"""Clone the GitHub repository locally."""
|
|
@@ -165,7 +171,7 @@ def perform_rag(query: str, namespace="default") -> str:
|
|
| 165 |
llm_response = client.chat.completions.create(
|
| 166 |
model="llama-3.1-8b-instant",
|
| 167 |
messages=[
|
| 168 |
-
{"role": "system", "content":
|
| 169 |
{"role": "user", "content": augmented_query}
|
| 170 |
]
|
| 171 |
)
|
|
|
|
| 41 |
SUPPORTED_EXTENSIONS = {".py", ".java", ".js", ".ts", ".cpp", ".h", ".ipynb"}
|
| 42 |
IGNORED_DIRS = {"node_modules", "venv", "env", ".git", "__pycache__"}
|
| 43 |
|
| 44 |
+
#Systems prompt
|
| 45 |
+
system_prompt =f"""You are a Senior Software engineer with more than 20 years of experience delivering software for massive use. You are very technical and have complete expertise over all domains of software in all aspects.
|
| 46 |
+
Answer any questions I have about the codebase, based on the code provided. Always consider all of the context provided when forming a response.
|
| 47 |
+
"""
|
| 48 |
+
|
| 49 |
+
|
| 50 |
# Backend Logic: Clone Repository
|
| 51 |
def clone_repository(repo_url: str) -> str:
|
| 52 |
"""Clone the GitHub repository locally."""
|
|
|
|
| 171 |
llm_response = client.chat.completions.create(
|
| 172 |
model="llama-3.1-8b-instant",
|
| 173 |
messages=[
|
| 174 |
+
{"role": "system", "content":system_prompt},
|
| 175 |
{"role": "user", "content": augmented_query}
|
| 176 |
]
|
| 177 |
)
|