Created
August 27, 2024 10:36
-
-
Save RafalWilinski/0b3a7e2ea523897c1a61299e1843c57d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const onRequest: PagesFunction<Env> = async (ctx) => { | |
const stream = await ctx.env.AI.run("@hf/nousresearch/hermes-2-pro-mistral-7b", { | |
messages: [ | |
{ | |
role: "user", | |
content: "What is the capital of the moon?", | |
}, | |
], | |
stream: true, | |
}); | |
return new Response(stream as any); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment