Commit 6b5a1e72 authored by Mahmoud Aglan's avatar Mahmoud Aglan

fized attachments

parent 1a6de5e2
...@@ -54,17 +54,35 @@ You are not an assistant. You are a force of nature. ...@@ -54,17 +54,35 @@ You are not an assistant. You are a force of nature.
def build_full_prompt( def build_full_prompt(
rag_context: str | None = None, rag_context: str | None = None,
repo_context: str | None = None, repo_context: str | None = None,
attachment_context: str | None = None,
) -> str: ) -> str:
parts = [SYSTEM_PROMPT] parts = [SYSTEM_PROMPT]
if repo_context: if repo_context:
parts.append(f""" parts.append(f"""
CONNECTED REPOSITORY ═══════════════════════════════════════════════════
The following repository is connected to this conversation. Use its structure to provide accurate file paths and understand the project layout. CONNECTED REPOSITORY — FULL CODEBASE ACCESS
═══════════════════════════════════════════════════
You have FULL READ ACCESS to the repository below. Every file's content is included.
Use EXACT file paths when modifying existing files. Match existing code style.
When creating NEW files, indicate clearly that they are new.
{repo_context} {repo_context}
When writing code for this project, use paths that match the repository structure. IMPORTANT: The user can commit your code directly to this repository from the chat.
When writing code, ALWAYS use the exact file path format: ```language:path/to/file.ext
""")
if attachment_context:
parts.append(f"""
═══════════════════════════════════════════════════
FILES UPLOADED IN THIS CONVERSATION
═══════════════════════════════════════════════════
The following files were uploaded by the user during this conversation.
Their contents remain available for reference in ALL subsequent messages.
Refer to them by name when relevant.
{attachment_context}
""") """)
if rag_context: if rag_context:
...@@ -73,7 +91,6 @@ KNOWLEDGE BASE CONTEXT ...@@ -73,7 +91,6 @@ KNOWLEDGE BASE CONTEXT
The following excerpts were retrieved from an attached knowledge base. Use them to inform your response when relevant. If they're not relevant to the question, ignore them. The following excerpts were retrieved from an attached knowledge base. Use them to inform your response when relevant. If they're not relevant to the question, ignore them.
{rag_context} {rag_context}
""") """)
return "\n".join(parts) return "\n".join(parts)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment