Skip to main content

Overview

Anthropic provides the Claude family of models known for safety, accuracy, and extended thinking capabilities. Upsonic supports all Claude models including Claude 3.5, Claude 3.7, and Claude 4. Model Class: AnthropicModel

Authentication

export ANTHROPIC_API_KEY="sk-ant-..."

Examples

from upsonic import Agent, Task
from upsonic.models.anthropic import AnthropicModel

model = AnthropicModel(model_name="claude-3-5-sonnet-20241022")
agent = Agent(model=model)

task = Task("Hello, how are you?")
result = agent.do(task)
print(result)

Parameters

ParameterTypeDescriptionDefaultSource
max_tokensintMaximum tokens to generate4096Base
temperaturefloatSampling temperature (0.0-1.0)1.0Base
top_pfloatNucleus sampling threshold1.0Base
stop_sequenceslist[str]Sequences that stop generationNoneBase
timeoutfloatRequest timeout in seconds600Base
extra_headersdict[str, str]Additional HTTP headersNoneBase
anthropic_metadatadictRequest metadata with user_idNoneSpecific
anthropic_thinkingdictExtended thinking configurationNoneSpecific