Skip to content

AnthropicModel

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/libs/agent-core/src/runtime/anthropic-adapter.ts

Implements: Model

Methods

MethodSignatureReturns
getResponsegetResponse(request: ModelRequest)Promise<ModelResponse>
getStreamedResponsegetStreamedResponse(request: ModelRequest)AsyncIterable<import('@openai/agents').ResponseStreamEvent>
getRetryAdvicegetRetryAdvice(args: ModelRetryAdviceRequest)`ModelRetryAdvice

Where it refuses work

  • AnthropicModel stops the work with an early return when this.azureHosted.
  • AnthropicModel stops the work with an early return when msg.includes('429') || msg.includes('overloaded').
  • AnthropicModel stops the work with an early return when msg.includes('500') || msg.includes('529') || msg.includes('ECONNRESET').
  • AnthropicModel stops the work with an early return when typeof request.input === 'string'.
  • AnthropicModel stops the work with an early return when !request.tools || request.tools.length === 0.

When something fails

  • AnthropicModel handles failure in 4 places: it discards it silently in 2, logs it and continues in 1, and lets it reach the caller in 1.

Was this page helpful?

Download as PDF