Open neeravkumar opened 5 months ago
For context, in JavaScript you would write:
import { Ai } from '@cloudflare/ai'
export interface Env {
// If you set another name in wrangler.toml as the value for 'binding',
// replace "AI" with the variable name you defined.
AI: any;
}
async function fetch(request: Request, env: Env) {
const ai = new Ai(env.AI);
const response = await ai.run('@cf/meta/llama-2-7b-chat-int8', {
prompt: "What is the origin of the phrase Hello, World"
}
);
}
So the run
method is on the Ai
wrapper and not on env.AI
itself. We need some plan for how to allow Python workers to access equivalent functionality.
Can't create a python worker that can access the AI bindings
returns