forked from phoenix/litellm-mirror
stash gemini JS test
This commit is contained in:
parent
d8e5134935
commit
f83708ed4e
1 changed files with 23 additions and 0 deletions
23
tests/pass_through_tests/test_gemini.js
Normal file
23
tests/pass_through_tests/test_gemini.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
// const { GoogleGenerativeAI } = require("@google/generative-ai");
|
||||
|
||||
// const genAI = new GoogleGenerativeAI("sk-1234");
|
||||
// const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash" });
|
||||
|
||||
// const prompt = "Explain how AI works in 2 pages";
|
||||
|
||||
// async function run() {
|
||||
// try {
|
||||
// const result = await model.generateContentStream(prompt, { baseUrl: "http://localhost:4000/gemini" });
|
||||
// const response = await result.response;
|
||||
// console.log(response.text());
|
||||
// for await (const chunk of result.stream) {
|
||||
// const chunkText = chunk.text();
|
||||
// console.log(chunkText);
|
||||
// process.stdout.write(chunkText);
|
||||
// }
|
||||
// } catch (error) {
|
||||
// console.error("Error:", error);
|
||||
// }
|
||||
// }
|
||||
|
||||
// run();
|
Loading…
Add table
Add a link
Reference in a new issue