gemini worker init improved
This commit is contained in:
parent
7c3d3458c8
commit
c7a43bbb21
1 changed files with 2 additions and 6 deletions
|
|
@ -23,8 +23,6 @@
|
||||||
import { GoogleGemini } from '../api/google_gemini.js';
|
import { GoogleGemini } from '../api/google_gemini.js';
|
||||||
import { taLogger } from '../mzta-logger.js';
|
import { taLogger } from '../mzta-logger.js';
|
||||||
|
|
||||||
let google_gemini_api_key = null;
|
|
||||||
let google_gemini_model = '';
|
|
||||||
let google_gemini = null;
|
let google_gemini = null;
|
||||||
let stopStreaming = false;
|
let stopStreaming = false;
|
||||||
let i18nStrings = null;
|
let i18nStrings = null;
|
||||||
|
|
@ -36,11 +34,9 @@ let assistantResponseAccumulator = '';
|
||||||
|
|
||||||
self.onmessage = async function(event) {
|
self.onmessage = async function(event) {
|
||||||
if (event.data.type === 'init') {
|
if (event.data.type === 'init') {
|
||||||
google_gemini_api_key = event.data.google_gemini_api_key;
|
|
||||||
google_gemini_model = event.data.google_gemini_model;
|
|
||||||
google_gemini = new GoogleGemini({
|
google_gemini = new GoogleGemini({
|
||||||
apiKey: google_gemini_api_key,
|
apiKey: event.data.google_gemini_api_key,
|
||||||
model: google_gemini_model,
|
model: event.data.google_gemini_model,
|
||||||
system_instruction: event.data.google_gemini_system_instruction,
|
system_instruction: event.data.google_gemini_system_instruction,
|
||||||
temperature: event.data.google_gemini_temperature,
|
temperature: event.data.google_gemini_temperature,
|
||||||
thinking_budget: event.data.google_gemini_thinking_budget,
|
thinking_budget: event.data.google_gemini_thinking_budget,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue