chore: generate
This commit is contained in:
parent
1520b0de20
commit
a0e4db3714
@ -104,7 +104,7 @@ export const layer = Layer.effect(
|
||||
? { ...model.api, url: provider.api.url, settings: { ...provider.api.settings, ...model.api.settings } }
|
||||
: model.api.type === "aisdk" && provider.api.type === "aisdk"
|
||||
? { ...model.api, settings: { ...provider.api.settings, ...model.api.settings } }
|
||||
: model.api
|
||||
: model.api
|
||||
const request = {
|
||||
headers: {
|
||||
...provider.request.headers,
|
||||
|
||||
@ -37,9 +37,7 @@ export const GitLabPlugin = PluginV2.define({
|
||||
if (evt.model.apiID.startsWith("duo-workflow-")) {
|
||||
const gitlab = yield* Effect.promise(() => import("gitlab-ai-provider")).pipe(Effect.orDie)
|
||||
const workflowRef =
|
||||
typeof evt.model.request.body.workflowRef === "string"
|
||||
? evt.model.request.body.workflowRef
|
||||
: undefined
|
||||
typeof evt.model.request.body.workflowRef === "string" ? evt.model.request.body.workflowRef : undefined
|
||||
const workflowDefinition =
|
||||
typeof evt.model.request.body.workflowDefinition === "string"
|
||||
? evt.model.request.body.workflowDefinition
|
||||
|
||||
@ -217,16 +217,14 @@ function migrateModel(info: typeof ConfigProviderV1.Model.Type, packageName?: st
|
||||
body: info.options && lowerer.request(info.options),
|
||||
},
|
||||
variants:
|
||||
info.variants &&
|
||||
Object.entries(info.variants).map(([id, options]) => ({ id, body: lowerer.request(options) })),
|
||||
info.variants && Object.entries(info.variants).map(([id, options]) => ({ id, body: lowerer.request(options) })),
|
||||
cost: costs,
|
||||
disabled: info.status === "deprecated" ? true : undefined,
|
||||
limit:
|
||||
info.limit && {
|
||||
context: int(info.limit.context),
|
||||
input: info.limit.input === undefined ? undefined : int(info.limit.input),
|
||||
output: int(info.limit.output),
|
||||
},
|
||||
limit: info.limit && {
|
||||
context: int(info.limit.context),
|
||||
input: info.limit.input === undefined ? undefined : int(info.limit.input),
|
||||
output: int(info.limit.output),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -185,7 +185,9 @@ function pick(options: Options, keys: ReadonlyArray<string>) {
|
||||
|
||||
function headers(input: unknown) {
|
||||
if (!isRecord(input)) return undefined
|
||||
return Object.fromEntries(Object.entries(input).filter((entry): entry is [string, string] => typeof entry[1] === "string"))
|
||||
return Object.fromEntries(
|
||||
Object.entries(input).filter((entry): entry is [string, string] => typeof entry[1] === "string"),
|
||||
)
|
||||
}
|
||||
|
||||
function compact(input: Record<string, string | undefined>) {
|
||||
|
||||
@ -60,9 +60,7 @@ describe("AzurePlugin", () => {
|
||||
})
|
||||
catalog.provider.update(ProviderV2.ID.openai, () => {})
|
||||
})
|
||||
expect((yield* catalog.provider.get(ProviderV2.ID.azure)).request.body.resourceName).toBe(
|
||||
"from-config",
|
||||
)
|
||||
expect((yield* catalog.provider.get(ProviderV2.ID.azure)).request.body.resourceName).toBe("from-config")
|
||||
expect((yield* catalog.provider.get(ProviderV2.ID.openai)).request.body.resourceName).toBeUndefined()
|
||||
}),
|
||||
),
|
||||
@ -103,9 +101,7 @@ describe("AzurePlugin", () => {
|
||||
item.api = { type: "aisdk", package: "@ai-sdk/azure" }
|
||||
})
|
||||
})
|
||||
expect((yield* catalog.provider.get(ProviderV2.ID.azure)).request.body.resourceName).toBe(
|
||||
"from-account",
|
||||
)
|
||||
expect((yield* catalog.provider.get(ProviderV2.ID.azure)).request.body.resourceName).toBe("from-account")
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
||||
@ -19312,90 +19312,8 @@
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"endpoint": {
|
||||
"api": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["unknown"]
|
||||
}
|
||||
},
|
||||
"required": ["type"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["openai/responses"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"websocket": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": ["type", "url"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["openai/completions"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"reasoning": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["reasoning_content"]
|
||||
}
|
||||
},
|
||||
"required": ["type"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["reasoning_details"]
|
||||
}
|
||||
},
|
||||
"required": ["type"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["type", "url"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["anthropic/messages"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["type", "url"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -19408,10 +19326,30 @@
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"settings": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["type", "package"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["native"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"settings": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["type", "settings"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -19437,7 +19375,7 @@
|
||||
"required": ["tools", "input", "output"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"options": {
|
||||
"request": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"headers": {
|
||||
@ -19449,24 +19387,11 @@
|
||||
"body": {
|
||||
"type": "object"
|
||||
},
|
||||
"aisdk": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"provider": {
|
||||
"type": "object"
|
||||
},
|
||||
"request": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["provider", "request"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"variant": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["headers", "body", "aisdk"],
|
||||
"required": ["headers", "body"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"variants": {
|
||||
@ -19485,22 +19410,9 @@
|
||||
},
|
||||
"body": {
|
||||
"type": "object"
|
||||
},
|
||||
"aisdk": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"provider": {
|
||||
"type": "object"
|
||||
},
|
||||
"request": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["provider", "request"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["id", "headers", "body", "aisdk"],
|
||||
"required": ["id", "headers", "body"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
@ -19606,9 +19518,9 @@
|
||||
"apiID",
|
||||
"providerID",
|
||||
"name",
|
||||
"endpoint",
|
||||
"api",
|
||||
"capabilities",
|
||||
"options",
|
||||
"request",
|
||||
"variants",
|
||||
"time",
|
||||
"cost",
|
||||
@ -22237,90 +22149,8 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"endpoint": {
|
||||
"api": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["unknown"]
|
||||
}
|
||||
},
|
||||
"required": ["type"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["openai/responses"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"websocket": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": ["type", "url"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["openai/completions"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"reasoning": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["reasoning_content"]
|
||||
}
|
||||
},
|
||||
"required": ["type"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["reasoning_details"]
|
||||
}
|
||||
},
|
||||
"required": ["type"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["type", "url"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["anthropic/messages"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["type", "url"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -22333,14 +22163,34 @@
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"settings": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["type", "package"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["native"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"settings": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["type", "settings"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"request": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"headers": {
|
||||
@ -22351,26 +22201,13 @@
|
||||
},
|
||||
"body": {
|
||||
"type": "object"
|
||||
},
|
||||
"aisdk": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"provider": {
|
||||
"type": "object"
|
||||
},
|
||||
"request": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["provider", "request"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["headers", "body", "aisdk"],
|
||||
"required": ["headers", "body"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["id", "name", "enabled", "env", "endpoint", "options"],
|
||||
"required": ["id", "name", "enabled", "env", "api", "request"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"PermissionV2Request": {
|
||||
@ -22546,90 +22383,8 @@
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"endpoint": {
|
||||
"api": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["unknown"]
|
||||
}
|
||||
},
|
||||
"required": ["type"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["openai/responses"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"websocket": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": ["type", "url"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["openai/completions"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"reasoning": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["reasoning_content"]
|
||||
}
|
||||
},
|
||||
"required": ["type"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["reasoning_details"]
|
||||
}
|
||||
},
|
||||
"required": ["type"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["type", "url"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["anthropic/messages"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["type", "url"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -22642,10 +22397,30 @@
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"settings": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["type", "package"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["native"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"settings": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["type", "settings"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -22671,7 +22446,7 @@
|
||||
"required": ["tools", "input", "output"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"options": {
|
||||
"request": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"headers": {
|
||||
@ -22683,24 +22458,11 @@
|
||||
"body": {
|
||||
"type": "object"
|
||||
},
|
||||
"aisdk": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"provider": {
|
||||
"type": "object"
|
||||
},
|
||||
"request": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["provider", "request"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"variant": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["headers", "body", "aisdk"],
|
||||
"required": ["headers", "body"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"variants": {
|
||||
@ -22719,22 +22481,9 @@
|
||||
},
|
||||
"body": {
|
||||
"type": "object"
|
||||
},
|
||||
"aisdk": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"provider": {
|
||||
"type": "object"
|
||||
},
|
||||
"request": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["provider", "request"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["id", "headers", "body", "aisdk"],
|
||||
"required": ["id", "headers", "body"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
@ -22836,9 +22585,9 @@
|
||||
"apiID",
|
||||
"providerID",
|
||||
"name",
|
||||
"endpoint",
|
||||
"api",
|
||||
"capabilities",
|
||||
"options",
|
||||
"request",
|
||||
"variants",
|
||||
"time",
|
||||
"cost",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user