AnthropicBackendAdapter
Defined in: backend/src/providers/anthropic.ts:141
Backend adapter for Anthropic Messages API.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AnthropicBackendAdapter(
config):AnthropicBackendAdapter
Defined in: backend/src/providers/anthropic.ts:149
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”AnthropicBackendAdapter
Properties
Section titled “Properties”metadata
Section titled “metadata”
readonlymetadata:AdapterMetadata
Defined in: backend/src/providers/anthropic.ts:145
Adapter metadata for identification and capabilities.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”estimateCost()
Section titled “estimateCost()”estimateCost(
request):Promise<number|null>
Defined in: backend/src/providers/anthropic.ts:456
Estimate cost for a request (rough heuristic).
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<number | null>
Implementation of
Section titled “Implementation of”execute()
Section titled “execute()”execute(
request,signal?):Promise<IRChatResponse>
Defined in: backend/src/providers/anthropic.ts:180
Execute non-streaming chat completion request.
Parameters
Section titled “Parameters”request
Section titled “request”signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<IRChatResponse>
Implementation of
Section titled “Implementation of”executeStream()
Section titled “executeStream()”executeStream(
request,signal?):IRChatStream
Defined in: backend/src/providers/anthropic.ts:219
Execute streaming chat completion request.
Parameters
Section titled “Parameters”request
Section titled “request”signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”fromIR()
Section titled “fromIR()”fromIR(
request):AnthropicRequest
Defined in: backend/src/providers/anthropic.ts:497
Convert IR request to Anthropic format.
Public method for testing and debugging - see what will be sent to Anthropic.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”healthCheck()
Section titled “healthCheck()”healthCheck():
Promise<boolean>
Defined in: backend/src/providers/anthropic.ts:433
Health check to verify Anthropic API is accessible.
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”listModels()
Section titled “listModels()”listModels(
options?):Promise<ListModelsResult>
Defined in: backend/src/providers/anthropic.ts:470
List available Anthropic models.
Since Anthropic doesn’t have a public models endpoint, this uses:
- Static config (config.models) - if provided
- Default model list - built-in list of Claude models
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Promise<ListModelsResult>
Implementation of
Section titled “Implementation of”toIR()
Section titled “toIR()”toIR(
response,originalRequest,latencyMs):IRChatResponse
Defined in: backend/src/providers/anthropic.ts:553
Convert Anthropic response to IR format.
Public method for testing and debugging - parse Anthropic responses manually.
Parameters
Section titled “Parameters”response
Section titled “response”originalRequest
Section titled “originalRequest”latencyMs
Section titled “latencyMs”number