Skip to content

AzureResponsesModel

reference
1 min readUpdated

Kind: Class

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

Azure OpenAI Model — implements the SDK's Model interface using Azure Responses API.

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

  • AzureResponsesModel stops the work with an early return when !event?.type.
  • AzureResponsesModel stops the work with an early return when !usage.
  • AzureResponsesModel stops the work with an early return when !Array.isArray(output).
  • AzureResponsesModel stops the work with an early return when !item || typeof item !== 'object'.
  • AzureResponsesModel stops the work with an early return when message.includes('429') || message.includes('throttled').
  • AzureResponsesModel stops the work with an early return when message.includes('500') || message.includes('502') || message.includes('503').

When something fails

  • AzureResponsesModel handles failure in 4 places: it lets it reach the caller in 2, turns it into a return value in 1, and discards it silently in 1. A failure discarded silently leaves no trace for whoever debugs this later.

Was this page helpful?

Download as PDF