/** * kosha-discovery — Tool-dialect and structured-output inference. * * Tool calling and structured output are two surfaces where every frontier * provider has settled on a *different* JSON shape. A consumer that wants * to route a single workload across multiple providers has to pick the * right adapter per model, and the registry is the natural place to tag * that. These helpers return best-effort hints inferred from the origin * provider plus the model ID — downstream callers treat them as defaults * and override with direct API probes when precision matters. * @module */ import type { StructuredOutputMode, ToolDialect } from "./types.js"; /** * Infer the tool-calling dialect a model natively speaks. * * The return value describes the wire format a consumer must emit to * invoke tools on this model. Returns `undefined` when the provider is * unknown and the model ID gives no signal — the caller should then * fall back to `"openai-tools"` (the de-facto compatibility dialect). * * Mapping summary: * - OpenAI GPT-4.1 / GPT-5 / o-series → `"openai-responses"` (new API) * - OpenAI GPT-4 / GPT-4o / GPT-3.5 → `"openai-tools"` * - Anthropic Claude 3+ → `"anthropic-tools"` * - Google Gemini 1.5+ → `"gemini-functions"` * - Cohere Command R / R+ → `"cohere-tools"` * - Mistral Large / Small → `"mistral-tools"` * - Meta Llama 3.1+ (instruct variants) → `"llama3-tools"` * - Embedding / image / audio-only models → `"none"` * * NOTE on serving-layer proxies: this helper infers the model's *native* * dialect from its origin provider. Managed serving layers such as Groq, * Together, Fireworks, and OpenRouter expose open-weight models behind * an OpenAI-compatible tools API regardless of the underlying family — * so if you are calling a Llama 3.1 model through Groq, you should use * `"openai-tools"` on the wire, not the `"llama3-tools"` hint returned * here. Callers that care about the serving-layer wire format should * check `ModelCard.provider` (the serving slug) first and fall back to * this inference only for direct-origin routes. A future revision may * take `servingProvider` as a second argument. * * @param originProvider - Model creator slug (e.g. `"anthropic"`). * @param modelId - Provider-canonical model ID. * @returns Best-effort dialect tag, or `undefined` when no safe guess exists. */ export declare function inferToolDialect(originProvider: string | undefined, modelId: string): ToolDialect | undefined; /** * Infer the structured-output modes a model supports. * * Returns an ordered list with the most precise mode first. An empty * array means no structured-output enforcement is available and the * caller must fall back to prompt-level coercion. * * Precision ranking: `json-schema` > `response-schema` > `grammar` * > `json-mode` > `response-format` > `tool-choice` > `xml`. * * @param originProvider - Model creator slug. * @param modelId - Provider-canonical model ID. * @returns Ordered list of supported modes (empty when unknown). */ export declare function inferStructuredOutputModes(originProvider: string | undefined, modelId: string): StructuredOutputMode[]; /** * Best-effort inference for whether a model supports parallel tool calls * (multiple tool invocations emitted in a single assistant turn). * * Frontier models (GPT-4o, Claude 3.5+, Gemini 1.5+) all support this; * older tool-capable models (GPT-3.5, early Claude 3) emit tool calls * serially. Returns `undefined` when the model does not appear to support * tool calling at all. * * @param originProvider - Model creator slug. * @param modelId - Provider-canonical model ID. * @returns `true`, `false`, or `undefined` when not tool-capable. */ export declare function inferParallelToolCalls(originProvider: string | undefined, modelId: string): boolean | undefined; //# sourceMappingURL=model-features.d.ts.map