Claude Sonnet won't write complete code
Describe the bug
When using a custom profile with claude-3-5-sonnet-20240620, the code generated is never complete and always results in an error. This usually occurs after a : or a number but not always. I updated the profile to use openai/gpt-4o and it was able to write code correctly, even when asked to make the code more robust to test for length limits.
Reproduce
Create a profile with:
from interpreter import interpreter
# LLM settings
interpreter.llm.model = "claude-3-5-sonnet-20240620"
interpreter.llm.supports_functions = False
interpreter.llm.execution_instructions = False
interpreter.llm.max_tokens = 4096
interpreter.llm.context_window = 10000
# Computer settings
interpreter.computer.import_computer_api = False
# Misc settings
interpreter.auto_run = False
interpreter.offline = False
# Custom Instructions
interpreter.custom_instructions=f"""
..."""
Run interpreter --profile <name of profile.py>
Ask it to do something that requires code, for example "Summarize this pdf: "
Expected behavior
Writes complete code
Screenshots
Open Interpreter version
Open Interpreter 0.3.4 Local III
Python version
Python 3.11.7
Operating System name and version
MacOS
Additional context
No response
I met similar issue. It seems that the last line of the code output will be discard.
Using verbose does it send a stop token?
Interesting development. I set interpreter.llm.supports_functions to True.
Now it writes code like execute("bash", "ls ~/Desktop | wc -l") and then exits immediately. Doesn't run the code
Using
verbosedoes it send a stop token?
In my last couple tests, yes
"Chunk in terminal_interface: {'role': 'assistant', 'type': 'code', 'format': 'bash', 'end': True}"