MCPcopy Index your code
hub / github.com/Noumena-Network/code / AnthropicInferenceClient

Class AnthropicInferenceClient

src/services/api/inferenceClient.ts:51–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51class AnthropicInferenceClient implements InferenceClient {
52 constructor(private readonly anthropic: Anthropic) {}
53
54 createMessage(
55 ...args: InferenceCreateMessageArgs
56 ): InferenceCreateMessageResult {
57 return this.anthropic.beta.messages.create(...args)
58 }
59
60 countTokens(
61 ...args: InferenceCountTokensArgs
62 ): InferenceCountTokensResult {
63 return this.anthropic.beta.messages.countTokens(...args)
64 }
65
66 listModels(...args: InferenceListModelsArgs): InferenceListModelsResult {
67 return this.anthropic.models.list(...args)
68 }
69}
70
71function getLegacyOpenAICompatBaseUrl(): string | undefined {
72 const legacyBaseUrl = process.env.ANTHROPIC_BASE_URL?.trim()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected