From f83708ed4eb9d3e6939e6fcbdac0df9f3750b31b Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 22 Nov 2024 12:59:01 -0800 Subject: [PATCH] stash gemini JS test --- tests/pass_through_tests/test_gemini.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/pass_through_tests/test_gemini.js diff --git a/tests/pass_through_tests/test_gemini.js b/tests/pass_through_tests/test_gemini.js new file mode 100644 index 000000000..2b7d6c5c6 --- /dev/null +++ b/tests/pass_through_tests/test_gemini.js @@ -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(); \ No newline at end of file