fix: model selection
This commit is contained in:
@@ -55,6 +55,8 @@
|
||||
right: 0;
|
||||
margin-top: 4px;
|
||||
min-width: 160px;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
background-color: var(--vscode-dropdown-background);
|
||||
border: 1px solid var(--vscode-dropdown-border);
|
||||
border-radius: 4px;
|
||||
|
||||
@@ -44,7 +44,7 @@ export const ChatPanel: React.FC<ChatPanelProps> = ({ conversationId }) => {
|
||||
// Load conversation and messages
|
||||
const loadData = useCallback(async () => {
|
||||
try {
|
||||
const [conv, msgs, models] = await Promise.all([
|
||||
const [conv, msgs, modelsResult] = await Promise.all([
|
||||
window.electronAPI?.chat.getConversation(conversationId),
|
||||
window.electronAPI?.chat.getHistory(conversationId),
|
||||
window.electronAPI?.chat.getAvailableModels()
|
||||
@@ -52,7 +52,7 @@ export const ChatPanel: React.FC<ChatPanelProps> = ({ conversationId }) => {
|
||||
|
||||
if (conv) setConversation(conv);
|
||||
if (msgs) setMessages(msgs);
|
||||
if (models) setAvailableModels(models);
|
||||
if (modelsResult?.models) setAvailableModels(modelsResult.models);
|
||||
} catch (error) {
|
||||
console.error('Failed to load chat data:', error);
|
||||
}
|
||||
|
||||
2
src/renderer/types/electron.d.ts
vendored
2
src/renderer/types/electron.d.ts
vendored
@@ -341,7 +341,7 @@ export interface ElectronAPI {
|
||||
getApiKey: () => Promise<ChatApiKeyStatus>;
|
||||
|
||||
// Settings
|
||||
getAvailableModels: () => Promise<ChatModel[]>;
|
||||
getAvailableModels: () => Promise<{ success: boolean; models?: ChatModel[]; selectedModel?: string; error?: string }>;
|
||||
setDefaultModel: (modelId: string) => Promise<void>;
|
||||
getSystemPrompt: () => Promise<string | null>;
|
||||
setSystemPrompt: (prompt: string) => Promise<void>;
|
||||
|
||||
Reference in New Issue
Block a user