max token rename
This commit is contained in:
@@ -119,7 +119,7 @@ const ai = new Ai({
|
|||||||
system: 'You are a helpful assistant.',
|
system: 'You are a helpful assistant.',
|
||||||
compress: {max: 90_000, min: 50_000}, // Compress chat history to min tokens when max is reached
|
compress: {max: 90_000, min: 50_000}, // Compress chat history to min tokens when max is reached
|
||||||
temperature: 0.8,
|
temperature: 0.8,
|
||||||
max_tokens: 100_000,
|
maxTokens: 100_000,
|
||||||
memoryModel: 'gpt-4o', // Cheap model for managing memories in background, defaults to current model
|
memoryModel: 'gpt-4o', // Cheap model for managing memories in background, defaults to current model
|
||||||
models: {
|
models: {
|
||||||
'claude-3-5-sonnet': {proto: 'anthropic', token: process.env.ANTHROPIC_TOKEN},
|
'claude-3-5-sonnet': {proto: 'anthropic', token: process.env.ANTHROPIC_TOKEN},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ztimson/ai-utils",
|
"name": "@ztimson/ai-utils",
|
||||||
"version": "1.4.6",
|
"version": "1.5.0",
|
||||||
"description": "AI Utility library",
|
"description": "AI Utility library",
|
||||||
"author": "Zak Timson",
|
"author": "Zak Timson",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export class Anthropic extends LLMProvider {
|
|||||||
const tools = options.tools || this.ai.options.llm?.tools || [];
|
const tools = options.tools || this.ai.options.llm?.tools || [];
|
||||||
const requestParams: any = {
|
const requestParams: any = {
|
||||||
model: options.model || this.model,
|
model: options.model || this.model,
|
||||||
max_tokens: options.max_tokens || this.ai.options.llm?.max_tokens || 4096,
|
max_tokens: options.maxTokens || this.ai.options.llm?.maxTokens || 4096,
|
||||||
system: options.system || this.ai.options.llm?.system || '',
|
system: options.system || this.ai.options.llm?.system || '',
|
||||||
temperature: options.temperature || this.ai.options.llm?.temperature || undefined,
|
temperature: options.temperature || this.ai.options.llm?.temperature || undefined,
|
||||||
tools: tools.map(t => ({
|
tools: tools.map(t => ({
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export type LLMRequest = {
|
|||||||
/** Message history */
|
/** Message history */
|
||||||
history?: LLMMessage[];
|
history?: LLMMessage[];
|
||||||
/** Max tokens for request */
|
/** Max tokens for request */
|
||||||
max_tokens?: number;
|
maxTokens?: number;
|
||||||
/** 0 = Rigid Logic, 1 = Balanced, 2 = Hyper Creative **/
|
/** 0 = Rigid Logic, 1 = Balanced, 2 = Hyper Creative **/
|
||||||
temperature?: number;
|
temperature?: number;
|
||||||
/** Available tools */
|
/** Available tools */
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export class OpenAi extends LLMProvider {
|
|||||||
const requestParams: any = {
|
const requestParams: any = {
|
||||||
model: options.model || this.model,
|
model: options.model || this.model,
|
||||||
stream: !!options.stream,
|
stream: !!options.stream,
|
||||||
max_completion_tokens: options.max_tokens || this.ai.options.llm?.max_tokens || undefined,
|
max_completion_tokens: options.maxTokens || this.ai.options.llm?.maxTokens || undefined,
|
||||||
temperature: options.temperature || this.ai.options.llm?.temperature || undefined,
|
temperature: options.temperature || this.ai.options.llm?.temperature || undefined,
|
||||||
tools: tools.map(t => ({
|
tools: tools.map(t => ({
|
||||||
type: 'function',
|
type: 'function',
|
||||||
|
|||||||
Reference in New Issue
Block a user