Anthropic
Installation
Make sure the Anthropic SDK is installed:
pip install anthropicuv add anthropicpoetry add anthropicMake sure the Voker Python SDK is installed.
Note: the SDK does not currently support Audio, Video or Image modalities.
Messages Create
from anthropic import Anthropic
from voker.ai.provider_anthropic import Anthropic
client = Anthropic()
client.messages.create(
model="claude-haiku-4-5",
messages=[
{
"role": "user",
"content": "Write a haiku about autumn.",
}
],
max_tokens=1024,
)Async Messages Create
from anthropic import AsyncAnthropic
from voker.ai.provider_anthropic import AsyncAnthropic
client = AsyncAnthropic()
await client.messages.create(
model="claude-haiku-4-5",
messages=[
{
"role": "user",
"content": "Write a haiku about autumn.",
}
],
max_tokens=1024,
)