Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

fix: args in anthropic provider

Christian Fei63017d486730
diff --git a/lib/llm/providers/anthropic.js b/lib/llm/providers/anthropic.js
index af72fbc..944777b 100644
--- a/lib/llm/providers/anthropic.js
+++ b/lib/llm/providers/anthropic.js
@@ -4,22 +4,22 @@ const ANTHROPIC_VERSION = '2023-06-01'
const MAX_TOKENS = 1024
export class Anthropic extends Generic {
- constructor(system, {
+ constructor(system, args = {
model,
host,
endpoint,
apiKey,
temperature,
- maxTokens = MAX_TOKENS,
- } = args) {
+ maxTokens
+ }) {
super(system, args)
this.system = system
- this.model = model
- this.host = host
- this.endpoint = endpoint
- this.apiKey = apiKey
- this.temperature = temperature
- this.maxTokens = maxTokens
+ this.model = args.model
+ this.host = args.host
+ this.endpoint = args.endpoint
+ this.apiKey = args.apiKey
+ this.temperature = args.temperature
+ this.maxTokens = args.maxTokens || MAX_TOKENS
}
getHeaders () {