factor_agent.llm.anthropic.AnthropicBackend#

class AnthropicBackend(model, max_tokens=16000, effort=None, base_url=None, timeout_seconds=600.0)[source]#

Bases: object

Complete a request with one Messages API call.

Parameters:
modelstr

The model of every call.

max_tokensint

The max_tokens of every call.

effortstr, optional

The output_config.effort of every call; the model’s default if None.

base_urlstr, optional

Another endpoint than Anthropic’s.

timeout_secondsfloat

Seconds a call may take.

Methods#

AnthropicBackend.complete

Send request's prompt as one user message.

AnthropicBackend.from_config

Build from a role's config: model and optionally max_tokens, effort, base_url, timeout_seconds.

Attributes#

AnthropicBackend.OPTIONS = ('max_tokens', 'effort', 'base_url', 'timeout_seconds')#

The options a role’s config may give besides backend and model.

AnthropicBackend.params#

The parameters every call sends with the prompt.