claude worker init improved
This commit is contained in:
parent
c7a43bbb21
commit
17fe989dec
1 changed files with 2 additions and 6 deletions
|
|
@ -23,8 +23,6 @@
|
||||||
import { Anthropic } from '../api/anthropic.js';
|
import { Anthropic } from '../api/anthropic.js';
|
||||||
import { taLogger } from '../mzta-logger.js';
|
import { taLogger } from '../mzta-logger.js';
|
||||||
|
|
||||||
let anthropic_api_key = null;
|
|
||||||
let anthropic_model = '';
|
|
||||||
let anthropic = null;
|
let anthropic = null;
|
||||||
let stopStreaming = false;
|
let stopStreaming = false;
|
||||||
let i18nStrings = null;
|
let i18nStrings = null;
|
||||||
|
|
@ -37,12 +35,10 @@ let assistantResponseAccumulator = '';
|
||||||
self.onmessage = async function(event) {
|
self.onmessage = async function(event) {
|
||||||
if (event.data.type === 'init') {
|
if (event.data.type === 'init') {
|
||||||
// console.log(">>>>>>>>>>>>>> event.data: " + JSON.stringify(event.data));
|
// console.log(">>>>>>>>>>>>>> event.data: " + JSON.stringify(event.data));
|
||||||
anthropic_api_key = event.data.anthropic_api_key;
|
|
||||||
anthropic_model = event.data.anthropic_model;
|
|
||||||
anthropic = new Anthropic({
|
anthropic = new Anthropic({
|
||||||
apiKey: anthropic_api_key,
|
apiKey: event.data.anthropic_api_key,
|
||||||
version: event.data.anthropic_version,
|
version: event.data.anthropic_version,
|
||||||
model: anthropic_model,
|
model: event.data.anthropic_model,
|
||||||
system_prompt: event.data.anthropic_system_prompt,
|
system_prompt: event.data.anthropic_system_prompt,
|
||||||
temperature: event.data.anthropic_temperature,
|
temperature: event.data.anthropic_temperature,
|
||||||
max_tokens: event.data.anthropic_max_tokens,
|
max_tokens: event.data.anthropic_max_tokens,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue