add llm config panel

This commit is contained in:
bridge
2025-12-30 21:23:30 +08:00
parent 5b0bba517a
commit b8a4850e80
6 changed files with 830 additions and 6 deletions

View File

@@ -59,6 +59,14 @@ export interface PhenomenonDTO {
effect_desc: string;
}
export interface LLMConfigDTO {
base_url: string;
api_key: string;
model_name: string;
fast_model_name: string;
mode: string;
}
export const gameApi = {
// --- World State ---
@@ -149,5 +157,19 @@ export const gameApi = {
deleteAvatar(avatarId: string) {
return httpClient.post<{ status: string; message: string }>('/api/action/delete_avatar', { avatar_id: avatarId });
},
// --- LLM Config ---
fetchLLMConfig() {
return httpClient.get<LLMConfigDTO>('/api/config/llm');
},
testLLMConnection(config: LLMConfigDTO) {
return httpClient.post<{ status: string; message: string }>('/api/config/llm/test', config);
},
saveLLMConfig(config: LLMConfigDTO) {
return httpClient.post<{ status: string; message: string }>('/api/config/llm/save', config);
}
};