@encorp.ai/llm-open-proxy - v0.2.2
    Preparing search index...

    Interface ChatMessage

    @encorp.ai/llm-open-proxy — OpenAI-canonical chat translator for LLM providers.

    Three layers of API, pick whatever fits:

    1. Pure conversion — give it a canonical request + a provider name, get back a provider-shaped body. No HTTP, no I/O. Best for users who already have their own transport.

      import { convertChatRequest } from '@encorp.ai/llm-open-proxy'; const { body, warnings } = convertChatRequest(canonical, 'anthropic');

    2. Transport — convenience wrappers that handle HTTP + response translation. Returns the response in canonical (OpenAI) shape regardless of the upstream.

      import { sendChatRequest, // OpenAI-shaped providers (openai/google/...) sendAnthropicRequest, // Anthropic-shaped provider } from '@encorp.ai/llm-open-proxy';

    3. Tree-shakeable submodules — import a single provider's adapter when you only care about one upstream:

      import { anthropicChatConfig, toAnthropicRequest } from '@encorp.ai/llm-open-proxy/providers/anthropic';

    interface ChatMessage {
        role: Role;
        content: string | ContentPart[] | null;
        name?: string;
        tool_call_id?: string;
        tool_calls?: ChatToolCall[];
        reasoning_content?: string;
    }
    Index

    Properties

    role: Role
    content: string | ContentPart[] | null
    name?: string
    tool_call_id?: string
    tool_calls?: ChatToolCall[]
    reasoning_content?: string

    DeepSeek v4 thinking-mode: assistant messages may carry reasoning_content, which MUST be sent back unchanged on subsequent turns. All other providers reject the field on assistant messages, so it is stripped automatically.