fix(AssistantService): add default settings configuration to assistant initialization (#7371)

This commit is contained in:
Tristan Zhang 2025-06-19 22:56:46 +08:00 committed by GitHub
parent ed0bb7fd16
commit b4b456ae06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,7 +14,17 @@ export function getDefaultAssistant(): Assistant {
topics: [getDefaultTopic('default')],
messages: [],
type: 'assistant',
regularPhrases: [] // Added regularPhrases
regularPhrases: [], // Added regularPhrases
settings: {
temperature: DEFAULT_TEMPERATURE,
contextCount: DEFAULT_CONTEXTCOUNT,
enableMaxTokens: false,
maxTokens: 0,
streamOutput: true,
topP: 1,
toolUseMode: 'prompt',
customParameters: []
}
}
}
@ -127,7 +137,17 @@ export async function createAssistantFromAgent(agent: Agent) {
topics: [topic],
model: agent.defaultModel,
type: 'assistant',
regularPhrases: agent.regularPhrases || [] // Ensured regularPhrases
regularPhrases: agent.regularPhrases || [], // Ensured regularPhrases
settings: agent.settings || {
temperature: DEFAULT_TEMPERATURE,
contextCount: DEFAULT_CONTEXTCOUNT,
enableMaxTokens: false,
maxTokens: 0,
streamOutput: true,
topP: 1,
toolUseMode: 'prompt',
customParameters: []
}
}
store.dispatch(addAssistant(assistant))