Skip to content

Commit c7039b3

Browse files
author
Joseph Blazick
committed
update
1 parent 16f879f commit c7039b3

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

backend/agent/coding_agent.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,9 @@ def call_model_streaming(self, command: Optional[str] | None = None, **kwargs):
296296
modelId="anthropic.claude-3-sonnet-20240229-v1:0",
297297
body=json.dumps(
298298
{
299+
299300
"messages": kwargs["messages"][1:],
300-
"system": kwargs["messages"][0]["content"],
301+
"system": self.generate_anthropic_prompt(sys_only=True),
301302
"max_tokens": max(kwargs["max_tokens"], 2000),
302303
"temperature": kwargs["temperature"],
303304
"anthropic_version": "bedrock-2023-05-31",
@@ -344,7 +345,7 @@ def call_model_streaming(self, command: Optional[str] | None = None, **kwargs):
344345
print("UnboundLocalError")
345346
break
346347

347-
def generate_anthropic_prompt(self, include_messages=True) -> str:
348+
def generate_anthropic_prompt(self, include_messages: Optional[bool]=True, sys_only: Optional[bool]=None) -> str:
348349
"""
349350
Generates a prompt for the Gaive model.
350351
@@ -406,6 +407,9 @@ def generate_anthropic_prompt(self, include_messages=True) -> str:
406407
else:
407408
sys_prompt = self.memory_manager.identity + "\n\n" + tree + file_context
408409

410+
if sys_only:
411+
return sys_prompt
412+
409413
return (
410414
"\n\nHuman: The folllowing is your system prompt: "
411415
+ sys_prompt

backend/app_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def flush(self):
7575
# from agent.agent_functions.changes import Changes
7676

7777
IGNORE_DIRS = ["node_modules", ".next", ".venv", "__pycache__", ".git"]
78-
FILE_EXTENSIONS = [".js", ".py", ".md", "Dockerfile", '.txt']
78+
FILE_EXTENSIONS = [".js", ".py", ".md", "Dockerfile", '.txt', '.ts', '.yaml']
7979

8080
def create_database_connection() -> sqlite3.Connection:
8181
try:

0 commit comments

Comments
 (0)