You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { GoogleGenerativeAI, SchemaType } from "npm:@google/generative-ai";
const genAI = new GoogleGenerativeAI("<MY_KEY>");
const schema = {
description: "List of recipes",
type: SchemaType.ARRAY,
items: {
type: SchemaType.OBJECT,
properties: {
recipeName: {
type: SchemaType.STRING,
description: "Name of the recipe",
nullable: false,
},
},
required: ["recipeName"],
},
};
const model = genAI.getGenerativeModel({
model: "gemini-1.5-pro",
generationConfig: {
responseMimeType: "application/json",
responseSchema: schema,
},
});
const result = await model.generateContent(
"List a few popular cookie recipes.",
);
console.log(result.response.text());
yields
error: Uncaught SyntaxError: The requested module 'npm:@google/generative-ai' does not provide an export named 'SchemaType'
import { GoogleGenerativeAI, SchemaType } from "npm:@google/generative-ai";
also it seems that GeneratorConfig doesn't have these fields:
I think this is a version issue, it does work with @21.0.0
but this is strange - the latest version is 22.0.0? I guess it should work ootb with deno, so leaving this open.
Description of the bug:
yields
also it seems that GeneratorConfig doesn't have these fields:
Actual vs expected behavior:
No response
Any other information you'd like to share?
No response
The text was updated successfully, but these errors were encountered: