fix: rm maxTokens from api
This commit is contained in:
@@ -38,7 +38,6 @@ export class OpenAIClient implements LLMClient {
|
|||||||
modelPatch({
|
modelPatch({
|
||||||
model: this.config.model,
|
model: this.config.model,
|
||||||
temperature: this.config.temperature,
|
temperature: this.config.temperature,
|
||||||
max_tokens: this.config.maxTokens,
|
|
||||||
messages,
|
messages,
|
||||||
|
|
||||||
tools: openaiTools,
|
tools: openaiTools,
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ export class OpenAIClient implements LLMClient {
|
|||||||
modelPatch({
|
modelPatch({
|
||||||
model: this.config.model,
|
model: this.config.model,
|
||||||
temperature: this.config.temperature,
|
temperature: this.config.temperature,
|
||||||
max_tokens: this.config.maxTokens,
|
|
||||||
messages,
|
messages,
|
||||||
|
|
||||||
tools: openaiTools,
|
tools: openaiTools,
|
||||||
|
|||||||
@@ -18,4 +18,3 @@ export const DEFAULT_BASE_URL: string =
|
|||||||
|
|
||||||
export const LLM_MAX_RETRIES = 2
|
export const LLM_MAX_RETRIES = 2
|
||||||
export const DEFAULT_TEMPERATURE = 0.7 // higher randomness helps auto-recovery
|
export const DEFAULT_TEMPERATURE = 0.7 // higher randomness helps auto-recovery
|
||||||
export const DEFAULT_MAX_TOKENS = 16000
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import { OpenAIClient } from './OpenAILenientClient'
|
|||||||
import {
|
import {
|
||||||
DEFAULT_API_KEY,
|
DEFAULT_API_KEY,
|
||||||
DEFAULT_BASE_URL,
|
DEFAULT_BASE_URL,
|
||||||
DEFAULT_MAX_TOKENS,
|
|
||||||
DEFAULT_MODEL_NAME,
|
DEFAULT_MODEL_NAME,
|
||||||
DEFAULT_TEMPERATURE,
|
DEFAULT_TEMPERATURE,
|
||||||
LLM_MAX_RETRIES,
|
LLM_MAX_RETRIES,
|
||||||
@@ -69,7 +68,6 @@ export function parseLLMConfig(config: LLMConfig): Required<LLMConfig> {
|
|||||||
apiKey: config.apiKey ?? DEFAULT_API_KEY,
|
apiKey: config.apiKey ?? DEFAULT_API_KEY,
|
||||||
model: config.model ?? DEFAULT_MODEL_NAME,
|
model: config.model ?? DEFAULT_MODEL_NAME,
|
||||||
temperature: config.temperature ?? DEFAULT_TEMPERATURE,
|
temperature: config.temperature ?? DEFAULT_TEMPERATURE,
|
||||||
maxTokens: config.maxTokens ?? DEFAULT_MAX_TOKENS,
|
|
||||||
maxRetries: config.maxRetries ?? LLM_MAX_RETRIES,
|
maxRetries: config.maxRetries ?? LLM_MAX_RETRIES,
|
||||||
customFetch: (config.customFetch ?? fetch).bind(globalThis), // fetch will be illegal unless bound
|
customFetch: (config.customFetch ?? fetch).bind(globalThis), // fetch will be illegal unless bound
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ export interface LLMConfig {
|
|||||||
model?: string
|
model?: string
|
||||||
|
|
||||||
temperature?: number
|
temperature?: number
|
||||||
maxTokens?: number
|
|
||||||
maxRetries?: number
|
maxRetries?: number
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ interface LLMConfig {
|
|||||||
apiKey?: string
|
apiKey?: string
|
||||||
model?: string
|
model?: string
|
||||||
temperature?: number
|
temperature?: number
|
||||||
maxTokens?: number
|
|
||||||
maxRetries?: number
|
maxRetries?: number
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user