dspy
dspy copied to clipboard
Claude does not work with the new experimental setting.
Using Claude lm with the new experimental setting (new_generate) causes the following error:
TypeError: Messages.create() got an unexpected keyword argument 'stop'
Hi @Xargonus , thanks for raising this. The new experimental setting does configure the stop condition, but this may not be applicable for all supported LM providers.
I am not familiar with the latest Claude API, but a fix could be assigning the value of stop to Claude's equivalent of a stopping condition and removing stop before the request is sent. Feel free to open a PR to correct this within anthropic.py.
Just a heads-up that this also applies to the AwsAnthropic module. The correct parameter for Anthropic would be stop_sequences. Maybe it could be an idea to parameterize this inside of the new_generate function so that it will work with all language model providers.
Closing because of LiteLLM migration