AIX: fix Gemini with JSON outputs

This commit is contained in:
Enrico Ros
2024-07-09 19:31:52 -07:00
parent 0fbdc465a7
commit cab726a327
2 changed files with 8 additions and 1 deletions
@@ -123,7 +123,7 @@ export const anthropicWireMessageCreateSchema = z.object({
]).optional(),
/**
*
* (optional) Tools that the model can use to generate the response.
*/
tools: z.array(anthropicWire_ToolUL_Schema).optional(),
@@ -176,8 +176,15 @@ const geminiSafetySettingSchema = z.object({
threshold: geminiBlockSafetyLevelEnum,
});
const geminiResponseMimeTypeEnum = z.enum([
'text/plain',
'application/json',
]);
const geminiGenerationConfigSchema = z.object({
stopSequences: z.array(z.string()).optional(),
responseMimeType: geminiResponseMimeTypeEnum.optional(), // defaults to 'text/plain'
responseSchema: z.record(z.any()).optional(), // This is a simplified representation of the Schema object
candidateCount: z.number().int().optional(),
maxOutputTokens: z.number().int().optional(),
temperature: z.number().optional(),