route-claudecode
Version:
Advanced routing and transformation system for Claude Code outputs to multiple AI providers
54 lines • 1.52 kB
TypeScript
/**
* CodeWhisperer Provider Adapter
* 将基于demo2的新实现适配到现有的provider系统
* 项目所有者: Jason Zhang
*/
import { BaseRequest, BaseResponse, Provider, ProviderConfig } from '@/types';
export declare class CodeWhispererProvider implements Provider {
name: string;
type: string;
config: ProviderConfig;
private client;
private providerId;
constructor(providerId?: string);
/**
* Provider接口实现 - 健康检查
*/
isHealthy(): Promise<boolean>;
/**
* Provider接口实现 - 发送请求
*/
sendRequest(request: BaseRequest): Promise<BaseResponse>;
/**
* Provider接口实现 - 发送流式请求
*/
sendStreamRequest(request: BaseRequest): AsyncIterable<any>;
/**
* 处理请求 - 适配现有provider接口
*/
processRequest(request: BaseRequest, writeSSE?: (event: string, data: any) => void): Promise<BaseResponse | void>;
/**
* 将BaseRequest转换为AnthropicRequest格式
*/
private convertToAnthropicRequest;
/**
* 获取provider信息
*/
getProviderInfo(): {
id: string;
name: string;
type: string;
version: string;
capabilities: {
streaming: boolean;
tools: boolean;
system_messages: boolean;
conversation_history: boolean;
};
};
/**
* 健康检查
*/
healthCheck(): Promise<boolean>;
}
//# sourceMappingURL=adapter.d.ts.map