Merge pull request #1269 from QwenLM/mingholy/fix/sampling-params

fix: default values of sampling params
This commit is contained in:
tanzhenxin
2025-12-19 15:14:26 +08:00
committed by GitHub
4 changed files with 5 additions and 8 deletions

View File

@@ -151,8 +151,7 @@ describe('BaseLlmClient', () => {
contents: defaultOptions.contents,
config: {
abortSignal: defaultOptions.abortSignal,
temperature: 0,
topP: 1,
topP: 0.8,
tools: [
{
functionDeclarations: [
@@ -189,7 +188,7 @@ describe('BaseLlmClient', () => {
expect.objectContaining({
config: expect.objectContaining({
temperature: 0.8,
topP: 1, // Default should remain if not overridden
topP: 0.8, // Default should remain if not overridden
topK: 10,
tools: expect.any(Array),
}),

View File

@@ -66,8 +66,7 @@ export interface GenerateJsonOptions {
export class BaseLlmClient {
// Default configuration for utility tasks
private readonly defaultUtilityConfig: GenerateContentConfig = {
temperature: 0,
topP: 1,
topP: 0.8,
};
constructor(

View File

@@ -2310,7 +2310,7 @@ ${JSON.stringify(
abortSignal,
systemInstruction: getCoreSystemPrompt(''),
temperature: 0.5,
topP: 1,
topP: 0.8,
},
contents,
},

View File

@@ -94,8 +94,7 @@ const MAX_TURNS = 100;
export class GeminiClient {
private chat?: GeminiChat;
private readonly generateContentConfig: GenerateContentConfig = {
temperature: 0,
topP: 1,
topP: 0.8,
};
private sessionTurnCount = 0;