UNPKG

anon-identity

Version:

Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure

89 lines 2.61 kB
/** * Anthropic MCP Provider Implementation * * Provider implementation for Anthropic Claude LLM services */ import { LLMRequest, LLMResponse, LLMResponseChunk, ProviderConfig, FunctionDefinition } from '../types'; import { BaseLLMProvider, ProviderRequestContext } from './base-provider'; /** * Anthropic MCP Provider */ export declare class AnthropicProvider extends BaseLLMProvider { private apiKey; private baseURL; private apiVersion; constructor(config: ProviderConfig); /** * Initialize the provider */ initialize(): Promise<void>; /** * Test connection to Anthropic API */ private testConnection; /** * Check provider health */ health(): Promise<{ status: 'healthy' | 'unhealthy'; latency?: number; details?: any; }>; /** * Send completion request */ completion(request: LLMRequest, context: ProviderRequestContext): Promise<LLMResponse>; /** * Send streaming completion request */ stream(request: LLMRequest, context: ProviderRequestContext): AsyncIterable<LLMResponseChunk>; /** * Generate embeddings (not supported by Anthropic) */ embed(request: LLMRequest, context: ProviderRequestContext): Promise<LLMResponse>; /** * Moderate content (not supported by Anthropic) */ moderate(request: LLMRequest, context: ProviderRequestContext): Promise<LLMResponse>; /** * Build message request body for Anthropic API */ private buildMessageRequest; /** * Build messages array for Anthropic API */ private buildMessages; /** * Convert Anthropic message response to standard format */ private convertMessageResponse; /** * Convert Anthropic stream event to standard format */ private convertStreamEvent; /** * Extract function calls from text response (basic implementation) */ private extractFunctionCallFromText; /** * Get HTTP headers for Anthropic API */ private getHeaders; /** * Handle Anthropic API errors */ private handleAPIError; /** * Override function conversion for Anthropic (currently not supported) */ protected convertFunctions(functions: FunctionDefinition[]): any[]; } /** * Anthropic Provider Factory */ export declare class AnthropicProviderFactory { static createProvider(config: ProviderConfig): AnthropicProvider; static validateConfig(config: ProviderConfig): boolean; static getProviderType(): string; } //# sourceMappingURL=anthropic-provider.d.ts.map