A clean and minimal youtube frontend, without all the ads and whistles
JavaScript
only: apiKey instead of apiHeader
Christian Fei094eb34df488
diff --git a/lib/llm/providers/anthropic.js b/lib/llm/providers/anthropic.jsindex bfacbe7..b1b4bf3 100644--- a/lib/llm/providers/anthropic.js+++ b/lib/llm/providers/anthropic.js@@ -4,20 +4,19 @@ const MAX_TOKENS = 1024export class Anthropic {constructor(system, {- model,- host,- endpoint,- apiKey,- temperature,- max_tokens = MAX_TOKENS,- }) {-+ model,+ host,+ endpoint,+ apiKey,+ temperature,+ max_tokens = MAX_TOKENS,+ }) {this.system = system- const auth = apiKey ? { 'x-api-key': apiKey } : {}- this.headers = Object.assign({+ this.headers = {'Content-Type': 'application/json','anthropic-version': ANTHROPIC_VERSION,- }, auth)+ 'x-api-key': apiKey+ }this.settings = {model,diff --git a/lib/llm/providers/generic.js b/lib/llm/providers/generic.jsindex e6aa397..f17910c 100644--- a/lib/llm/providers/generic.js+++ b/lib/llm/providers/generic.js@@ -9,7 +9,6 @@ export class Generic {temperature,max_tokens,}) {-this.system = systemthis.headers = Object.assign({'Content-Type': 'application/json',diff --git a/lib/router/api.js b/lib/router/api.jsindex e7e2eb0..86a979c 100644--- a/lib/router/api.js+++ b/lib/router/api.js@@ -11,7 +11,6 @@ const llmDefaults = {host: 'http://127.0.0.1:1234',endpoint: '/v1/chat/completions',apiKey: '',- apiHeader: '',temperature: 0}@@ -20,7 +19,6 @@ const llmSettings = {host: process.env.AI_HOST ?? llmDefaults.host,endpoint: process.env.AI_ENDPOINT ?? llmDefaults.endpoint,apiKey: process.env.AI_APIKEY ?? llmDefaults.apiKey,- apiHeader: process.env.AI_AUTH_HEADER ?? llmDefaults.apiHeader,temperature: process.env.AI_TEMPERATURE ?? llmDefaults.temperature,}