refactor: streamline conversation initialization and enhance log handling

- Refactored AssistantConsole to utilize a dedicated initializeConversation function for improved clarity and organization.
- Updated DependencyLogsDialog to rename computed property from content to logs for better semantic understanding.
- Enhanced LogsView component by wrapping logs in an el-scrollbar for improved user experience.
- Adjusted ChatInput to call updateSelectedProviderModel on onBeforeMount for better state management.
- Simplified default model handling in ai.ts by introducing a DEFAULT_OPENAI_MODELS constant for consistency.
This commit is contained in:
Marvin Zhang
2025-04-18 16:58:42 +08:00
parent 32f0802f8b
commit de680d8ebd
7 changed files with 66 additions and 59 deletions

View File

@@ -1,31 +1,28 @@
export const DEFAULT_OPENAI_MODELS = [
'gpt-4o',
'gpt-4o-mini',
'gpt-4.1',
'gpt-4.1-mini',
'gpt-4.1-nano',
'o1-mini',
'o1',
'o3-mini',
'o3',
];
export const getLLMProviderItems = (): LLMProviderItem[] => {
return [
{
key: 'openai',
name: 'OpenAI',
icon: ['svg', 'openai'],
defaultModels: [
'gpt-4o',
'gpt-4o-mini',
'o1-mini',
'o1',
'o3-mini',
'o3',
],
defaultModels: DEFAULT_OPENAI_MODELS,
},
{
key: 'azure-openai',
name: 'Azure OpenAI',
icon: ['svg', 'azure'],
defaultModels: [
'gpt-4o',
'gpt-4o-mini',
'o1',
'o1-mini',
'o1-pro',
'o3-mini',
'gpt-4.5-preview',
],
defaultModels: DEFAULT_OPENAI_MODELS,
defaultApiVersions: ['2025-02-01-preview'],
},
{