Anthropic Developer Kit

class ractogateway.anthropic_developer_kit.AnthropicDeveloperKit(model='claude-sonnet-4-5-20250929', *, api_key=None, default_prompt=None)[source]

Bases: object

Complete Anthropic Claude developer kit — chat and streaming.

Parameters:
  • model (str) – Claude model (e.g. "claude-sonnet-4-5-20250929", "claude-opus-4-6").

  • api_key (str | None) – Anthropic API key. Falls back to ANTHROPIC_API_KEY env var.

  • default_prompt (RactoPrompt | None) – RACTO prompt used when ChatConfig.prompt is None.

async achat(config)[source]

Async chat completion.

Return type:

LLMResponse

async astream(config)[source]

Async streaming via Anthropic’s async messages.stream().

Return type:

AsyncIterator[StreamChunk]

chat(config)[source]

Synchronous chat completion.

Return type:

LLMResponse

provider: str = 'anthropic'
stream(config)[source]

Synchronous streaming via Anthropic’s messages.stream().

Example:

for chunk in kit.stream(config):
    print(chunk.delta.text, end="", flush=True)
    if chunk.is_final:
        print(f"\nTokens: {chunk.usage}")
Return type:

Iterator[StreamChunk]

Short alias

Chat is an alias for AnthropicDeveloperKit:

.. code-block:: python

from ractogateway import anthropic_developer_kit as claude kit = claude.Chat(model=”claude-sonnet-4-6”)