Skip to content

Commit

Permalink
Merge pull request #1063 from Pythagora-io/logging_fixes
Browse files Browse the repository at this point in the history
Logging fixes
  • Loading branch information
LeonOstrez authored Jul 29, 2024
2 parents 75d2f53 + 694438d commit 74a24a9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion core/agents/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async def handle_command_error(self, message: str, details: dict) -> AgentRespon
"description": llm_response,
"alternative_solutions": [],
"attempts": 1,
"status": IterationStatus.HUNTING_FOR_BUG,
"status": IterationStatus.IMPLEMENT_SOLUTION,
"bug_hunting_cycles": [],
}
]
Expand Down
6 changes: 6 additions & 0 deletions core/llm/anthropic_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

# Maximum number of tokens supported by Anthropic Claude 3
MAX_TOKENS = 4096
MAX_TOKENS_SONNET = 8192


class AnthropicClient(BaseLLMClient):
Expand Down Expand Up @@ -72,6 +73,11 @@ async def _make_request(
"messages": messages,
"temperature": self.config.temperature if temperature is None else temperature,
}

if "sonnet" in self.config.model:
completion_kwargs["extra_headers"] = {"anthropic-beta": "max-tokens-3-5-sonnet-2024-07-15"}
completion_kwargs["max_tokens"] = MAX_TOKENS_SONNET

if json_mode:
completion_kwargs["response_format"] = {"type": "json_object"}

Expand Down
31 changes: 16 additions & 15 deletions core/prompts/developer/breakdown.prompt
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,6 @@ You are working on an app called "{{ state.branch.project.name }}" and you need
{% include "partials/features_list.prompt" %}
{% include "partials/files_list.prompt" %}

We've broken the development of this {% if state.epics|length > 1 %}feature{% else %}app{% endif %} down to these tasks:
```
{% for task in state.tasks %}
{{ loop.index }}. {{ task.description }}{% if task.get("status") == "done" %} (completed){% endif %}
{% endfor %}
```

You are currently working on task #{{ current_task_index + 1 }} with the following description:
```
{{ task.description }}
```
{% if current_task_index != 0 %}All previous tasks are finished and you don't have to work on them.{% endif %}

Now, tell me all the code that needs to be written to implement ONLY this task and have it fully working and all commands that need to be run to implement this task.

{% include "partials/doc_snippets.prompt" %}

{%- if state.epics|length == 1 %}
Expand All @@ -35,3 +20,19 @@ DO NOT specify commands to create any folders or files, they will be created aut
{% include "partials/file_size_limit.prompt" %}

Never use the port 5000 to run the app, it's reserved.

--IMPLEMENTATION INSTRUCTIONS--
We've broken the development of this {% if state.epics|length > 1 %}feature{% else %}app{% endif %} down to these tasks:
```
{% for task in state.tasks %}
{{ loop.index }}. {{ task.description }}{% if task.get("status") == "done" %} (completed){% endif %}
{% endfor %}
```

You are currently working on task #{{ current_task_index + 1 }} with the following description:
```
{{ task.description }}
```
{% if current_task_index != 0 %}All previous tasks are finished and you don't have to work on them.{% endif %}

Now, tell me all the code that needs to be written to implement ONLY this task and have it fully working and all commands that need to be run to implement this task.

0 comments on commit 74a24a9

Please sign in to comment.