mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 11:03:44 +00:00
feat(ai): add Vercel AI Gateway routing support (#1051)
* feat(ai): add Vercel AI Gateway routing support Add vercelGatewayRouting to OpenAICompletionsCompat, parallel to openRouterRouting. When a model targets ai-gateway.vercel.sh and has vercelGatewayRouting configured, the openai-completions provider passes providerOptions.gateway with only/order in the request body. Changes: - types.ts: VercelGatewayRouting interface + field on OpenAICompletionsCompat - openai-completions.ts: buildParams passes providerOptions.gateway, detectCompat/getCompat include the new field - model-registry.ts: VercelGatewayRoutingSchema for models.json validation - test: updated Required<OpenAICompletionsCompat> in test fixture * docs(coding-agent): add vercelGatewayRouting to custom models documentation
This commit is contained in:
parent
d1560a9640
commit
e045a9f142
5 changed files with 67 additions and 0 deletions
|
|
@ -31,6 +31,12 @@ const OpenRouterRoutingSchema = Type.Object({
|
|||
order: Type.Optional(Type.Array(Type.String())),
|
||||
});
|
||||
|
||||
// Schema for Vercel AI Gateway routing preferences
|
||||
const VercelGatewayRoutingSchema = Type.Object({
|
||||
only: Type.Optional(Type.Array(Type.String())),
|
||||
order: Type.Optional(Type.Array(Type.String())),
|
||||
});
|
||||
|
||||
// Schema for OpenAI compatibility settings
|
||||
const OpenAICompletionsCompatSchema = Type.Object({
|
||||
supportsStore: Type.Optional(Type.Boolean()),
|
||||
|
|
@ -44,6 +50,7 @@ const OpenAICompletionsCompatSchema = Type.Object({
|
|||
requiresMistralToolIds: Type.Optional(Type.Boolean()),
|
||||
thinkingFormat: Type.Optional(Type.Union([Type.Literal("openai"), Type.Literal("zai")])),
|
||||
openRouterRouting: Type.Optional(OpenRouterRoutingSchema),
|
||||
vercelGatewayRouting: Type.Optional(VercelGatewayRoutingSchema),
|
||||
});
|
||||
|
||||
const OpenAIResponsesCompatSchema = Type.Object({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue