Skip to content

Commit

Permalink
read modelConfig from character file
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Latzke committed Feb 4, 2025
1 parent 8b9d7d4 commit 6216ff9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions packages/core/src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ export const CharacterSchema = z.object({
})
.optional(),
model: z.string().optional(),
modelConfig: z.object({
maxInputTokens: z.number().optional(),
maxOutputTokens: z.number().optional(),
temperature: z.number().optional(),
frequency_penalty: z.number().optional(),
presence_penalty:z.number().optional()
})
.optional(),
embeddingModel: z.string().optional(),
})
.optional(),
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ export async function generateText({
const max_context_length =
modelConfiguration?.maxInputTokens || modelSettings.maxInputTokens;
const max_response_length =
modelConfiguration?.max_response_length ||
modelConfiguration?.maxOutputTokens ||
modelSettings.maxOutputTokens;
const experimental_telemetry =
modelConfiguration?.experimental_telemetry ||
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ export type TelemetrySettings = {

export interface ModelConfiguration {
temperature?: number;
max_response_length?: number;
maxOutputTokens?: number;
frequency_penalty?: number;
presence_penalty?: number;
maxInputTokens?: number;
Expand Down

0 comments on commit 6216ff9

Please sign in to comment.