agentscope.models.anthropic_model module
The Anthropic model wrapper for AgentScope.
- class AnthropicChatWrapper(model_name: str, config_name: str | None = None, api_key: str | None = None, stream: bool = False, client_kwargs: dict | None = None)[source]
Bases:
ModelWrapperBase
The Anthropic model wrapper for AgentScope.
- format(*args: Msg | Sequence[Msg]) list[dict[str, object]] [source]
Format the messages for anthropic model input.
TODO: Add support for multimodal input.
- Parameters:
*args (Union[Msg, list[Msg]]) – The message(s) to be formatted.
- Returns:
A list of formatted messages.
- Return type:
list[dict[str, object]]
- config_name: str
The name of the model configuration.
- model_name: str
The name of the model, which is used in model api calling.
- model_type: str = 'anthropic_chat'
The type of the model wrapper, which is to identify the model wrapper class in model configuration.