format content

This commit is contained in:
ss27588709 2026-03-03 23:05:50 +08:00 committed by GitHub
parent 7889f888f6
commit 0e747b4476
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,13 +41,13 @@ const buildOptions = async (input: AIInput<any>, config: AIConfig = {}) => {
const outputBuilders: Record<string, (schema: any) => any> = {
schema: (s) => {
const schemaPrompt = `\n请按照以下 schema 格式返回结果:\n${JSON.stringify(
z.toJSONSchema(z.object(s)),
null,
2,
)}\n请输出JSON格式Schema返回`;
input.system = (input.system ?? "") + schemaPrompt;
// 返回验证模式
return Output.object({ schema: z.object(s) });
z.toJSONSchema(z.object(s)),
null,
2,
)}\n请输出JSON格式Schema返回`;
input.system = (input.system ?? "") + schemaPrompt;
// 返回验证模式
return Output.object({ schema: z.object(s) });
},
object: () => {
const jsonSchemaPrompt = `\n请按照以下 JSON Schema 格式返回结果:\n${JSON.stringify(