mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-10 10:48:45 +00:00
fix: ensure mcp tools are sanitized (#11984)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { APICallError, ModelMessage } from "ai"
|
||||
import { mergeDeep, unique } from "remeda"
|
||||
import type { JSONSchema7 } from "@ai-sdk/provider"
|
||||
import type { JSONSchema } from "zod/v4/core"
|
||||
import type { Provider } from "./provider"
|
||||
import type { ModelsDev } from "./models"
|
||||
@@ -719,7 +720,7 @@ export namespace ProviderTransform {
|
||||
return standardLimit
|
||||
}
|
||||
|
||||
export function schema(model: Provider.Model, schema: JSONSchema.BaseSchema) {
|
||||
export function schema(model: Provider.Model, schema: JSONSchema.BaseSchema | JSONSchema7): JSONSchema7 {
|
||||
/*
|
||||
if (["openai", "azure"].includes(providerID)) {
|
||||
if (schema.type === "object" && schema.properties) {
|
||||
@@ -793,7 +794,7 @@ export namespace ProviderTransform {
|
||||
schema = sanitizeGemini(schema)
|
||||
}
|
||||
|
||||
return schema
|
||||
return schema as JSONSchema7
|
||||
}
|
||||
|
||||
export function error(providerID: string, error: APICallError) {
|
||||
|
||||
Reference in New Issue
Block a user