Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Blazick committed Mar 5, 2024
1 parent 16f879f commit c7039b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions backend/agent/coding_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,9 @@ def call_model_streaming(self, command: Optional[str] | None = None, **kwargs):
modelId="anthropic.claude-3-sonnet-20240229-v1:0",
body=json.dumps(
{

"messages": kwargs["messages"][1:],
"system": kwargs["messages"][0]["content"],
"system": self.generate_anthropic_prompt(sys_only=True),
"max_tokens": max(kwargs["max_tokens"], 2000),
"temperature": kwargs["temperature"],
"anthropic_version": "bedrock-2023-05-31",
Expand Down Expand Up @@ -344,7 +345,7 @@ def call_model_streaming(self, command: Optional[str] | None = None, **kwargs):
print("UnboundLocalError")
break

def generate_anthropic_prompt(self, include_messages=True) -> str:
def generate_anthropic_prompt(self, include_messages: Optional[bool]=True, sys_only: Optional[bool]=None) -> str:
"""
Generates a prompt for the Gaive model.
Expand Down Expand Up @@ -406,6 +407,9 @@ def generate_anthropic_prompt(self, include_messages=True) -> str:
else:
sys_prompt = self.memory_manager.identity + "\n\n" + tree + file_context

if sys_only:
return sys_prompt

return (
"\n\nHuman: The folllowing is your system prompt: "
+ sys_prompt
Expand Down
2 changes: 1 addition & 1 deletion backend/app_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def flush(self):
# from agent.agent_functions.changes import Changes

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

def create_database_connection() -> sqlite3.Connection:
try:
Expand Down

0 comments on commit c7039b3

Please sign in to comment.