dspy icon indicating copy to clipboard operation
dspy copied to clipboard

Claude does not work with the new experimental setting.

Open Xargonus opened this issue 1 year ago • 2 comments
trafficstars

Using Claude lm with the new experimental setting (new_generate) causes the following error:

TypeError: Messages.create() got an unexpected keyword argument 'stop'

Xargonus avatar Jul 11 '24 16:07 Xargonus

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.

arnavsinghvi11 avatar Jul 11 '24 17:07 arnavsinghvi11

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.

lsickert avatar Aug 06 '24 14:08 lsickert

Closing because of LiteLLM migration

isaacbmiller avatar Nov 01 '24 23:11 isaacbmiller