mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
remove topp default value 0.0 (#785)
This commit is contained in:
@@ -434,8 +434,6 @@ describe('Gemini Client (client.ts)', () => {
|
||||
config: {
|
||||
abortSignal,
|
||||
systemInstruction: getCoreSystemPrompt(''),
|
||||
temperature: 0,
|
||||
topP: 1,
|
||||
tools: [
|
||||
{
|
||||
functionDeclarations: [
|
||||
@@ -486,7 +484,6 @@ describe('Gemini Client (client.ts)', () => {
|
||||
abortSignal,
|
||||
systemInstruction: getCoreSystemPrompt(''),
|
||||
temperature: 0.9,
|
||||
topP: 1, // from default
|
||||
topK: 20,
|
||||
tools: [
|
||||
{
|
||||
@@ -2461,7 +2458,6 @@ ${JSON.stringify(
|
||||
abortSignal,
|
||||
systemInstruction: getCoreSystemPrompt(''),
|
||||
temperature: 0.5,
|
||||
topP: 1,
|
||||
},
|
||||
contents,
|
||||
},
|
||||
|
||||
@@ -115,10 +115,7 @@ export class GeminiClient {
|
||||
private chat?: GeminiChat;
|
||||
private contentGenerator?: ContentGenerator;
|
||||
private readonly embeddingModel: string;
|
||||
private readonly generateContentConfig: GenerateContentConfig = {
|
||||
temperature: 0,
|
||||
topP: 1,
|
||||
};
|
||||
private readonly generateContentConfig: GenerateContentConfig = {};
|
||||
private sessionTurnCount = 0;
|
||||
|
||||
private readonly loopDetector: LoopDetectionService;
|
||||
|
||||
@@ -302,9 +302,9 @@ export class ContentGenerationPipeline {
|
||||
};
|
||||
|
||||
const params = {
|
||||
// Parameters with request fallback and defaults
|
||||
temperature: getParameterValue('temperature', 'temperature', 0.0),
|
||||
top_p: getParameterValue('top_p', 'topP', 1.0),
|
||||
// Parameters with request fallback but no defaults
|
||||
...addParameterIfDefined('temperature', 'temperature', 'temperature'),
|
||||
...addParameterIfDefined('top_p', 'top_p', 'topP'),
|
||||
|
||||
// Max tokens (special case: different property names)
|
||||
...addParameterIfDefined('max_tokens', 'max_tokens', 'maxOutputTokens'),
|
||||
|
||||
Reference in New Issue
Block a user