-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
Steps to reproduce:
import { generateObject } from "ai";
// @ts-ignore
import { githubModels } from "@github/models";
import { z } from "zod";
const { object } = await generateObject({
model: githubModels("openai/gpt-4o-mini"),
schema: z.object({
name: z.string(),
age: z.number(),
}),
prompt: "Generate a person",
});
console.log(object);
The SDK has a nice abstraction around structured outputs but they don't currently work with compatible models.
Fix is very simple: just add supportsStructuredOutput
to the provider. However, the hard part is that not all GitHub Models support it. and there's no metadata that I know of that can tell us which ones do and which ones don't
maraisr
Metadata
Metadata
Assignees
Labels
No labels