mirror of
https://github.com/kennethreitz/simplemind.git
synced 2026-06-05 22:50:18 +00:00
Refactor messages parameter in Anthropic provider
This commit is contained in:
@@ -68,8 +68,15 @@ class Anthropic(BaseProvider):
|
||||
) -> T:
|
||||
model = llm_model or self.DEFAULT_MODEL
|
||||
|
||||
# Extract the prompt from kwargs if it exists
|
||||
prompt = kwargs.pop("prompt", kwargs.pop("messages", ""))
|
||||
|
||||
# Format the messages properly
|
||||
messages = [{"role": "user", "content": prompt}]
|
||||
|
||||
response = self.structured_client.messages.create(
|
||||
model=model,
|
||||
messages=messages, # Add the messages parameter
|
||||
response_model=response_model,
|
||||
**{**self.DEFAULT_KWARGS, **kwargs},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user