Object literal may only specify known properties, and 'sessionOptions' does not exist in type 'AiOpt

For the following code,
import { Hono } from 'hono'
import { Ai } from '@cloudflare/ai'
import { Bindings } from 'hono/types';
const app = new Hono<{Bindings: Bindings}>()

app.get('/', async(c) => {
const ai = new Ai(c.env.AI, { sessionOptions: { ctx: c } });
const stream = await ai.run(
"@cf/mistral/mistral-7b-instruct-v0.1",
{ prompt: "where is new york?", stream: true }
) as any;
return new Response(stream,
{ headers: { "content-type": "text/event-stream" } }
);
})

export default app
import { Hono } from 'hono'
import { Ai } from '@cloudflare/ai'
import { Bindings } from 'hono/types';
const app = new Hono<{Bindings: Bindings}>()

app.get('/', async(c) => {
const ai = new Ai(c.env.AI, { sessionOptions: { ctx: c } });
const stream = await ai.run(
"@cf/mistral/mistral-7b-instruct-v0.1",
{ prompt: "where is new york?", stream: true }
) as any;
return new Response(stream,
{ headers: { "content-type": "text/event-stream" } }
);
})

export default app
I am getting the error show in the attachment. How can I fix this?
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server