ai-platform-converter
Version:
Lossless API parameter conversion between multiple AI platforms (OpenAI, Anthropic, Gemini, DeepSeek, Wenwen, Vertex AI, Huawei, BigModel)
23 lines • 1.31 kB
TypeScript
/**
* Convert Anthropic response to OpenAI format
*/
import { AnthropicResponse, AnthropicStreamEvent } from '../../types/anthropic';
import { OpenAIResponse, OpenAIStreamChunk } from '../../types/openai';
import { ConvertOptions } from '../../types/common';
export declare function convertAnthropicResponseToOpenAI(response: AnthropicResponse, options?: ConvertOptions): OpenAIResponse;
/**
* Generate a clean OpenAI response that strictly follows official API specification
* This removes all non-standard fields including _extensions
*/
export declare function convertAnthropicResponseToOpenAIClean(response: AnthropicResponse, options?: ConvertOptions): OpenAIResponse;
/**
* Convert Anthropic streaming event to OpenAI streaming chunk format
* Supports content_block_delta events for streaming responses
*/
export declare function convertAnthropicStreamToOpenAI(event: AnthropicStreamEvent, options?: ConvertOptions): OpenAIStreamChunk | null;
/**
* Generate a clean OpenAI streaming chunk that strictly follows official API specification
* This removes all non-standard fields including _extensions
*/
export declare function convertAnthropicStreamToOpenAIClean(event: AnthropicStreamEvent, options?: ConvertOptions): OpenAIStreamChunk | null;
//# sourceMappingURL=anthropic-to-openai.d.ts.map