Skip to content

No Vercel AI SDK provider / LangChain.js integration; openai-compatible path rejects video #4

Description

Severity: Medium (strategic) — no Vercel AI SDK provider / LangChain.js integration; the openai-compatible path can't carry video or custom response fields

The SDK wraps openai; it ships no @ai-sdk provider and no @langchain/* integration. Framework users fall back to @ai-sdk/openai-compatible / ChatOpenAI({configuration:{baseURL}}), where (source-verified against vercel/ai and langchainjs main):

Vercel AI SDK v6 (spec V3) / v7 (spec V4):

  • Request precontext: works via providerOptions.<name> (openai-compatible spreads unknown keys into the top-level body). A base-URL swap on @ai-sdk/openai forwards nothing.
  • Custom response fields: reach the typed result only via a metadataExtractor (→ providerMetadata); otherwise only in raw result.response.body. The response is a closed typed union.
  • Video hard-fails: convert-to-openai-compatible-chat-messages throws UnsupportedFunctionalityError on any video/* (also audio-by-URL, pdf-by-URL). Middleware can't fix it (throws pre-HTTP).

LangChain.js: request precontext via modelKwargs (no extra_body field exists — issue #8845 closed); custom response fields silently dropped unless the converter is overridden (or __includeRawResponse:true); unsupported modality source_types throw.

Both also leak the inline <precontext>/<think> tags.

Recommendation

To deliver an "own SDK" for these ecosystems, ship a custom providerLanguageModelV3 (v6) + LanguageModelV4 (v7), one class per spec generation — with your own message converter (accept video/*), supportedUrls declaring video/*/audio, response mapping into providerMetadata (v7: first-class type:"custom" content for OCR bounds/task output), and self-owned doStream SSE parsing. Optionally subclass OpenAICompatibleChatLanguageModel and override the converter to inherit its error/usage handling. Plus a @interfaze/langchain package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions