样式优化,markdown优化
This commit is contained in:
@@ -45,6 +45,17 @@ export const useConversationStore = defineStore('conversation', {
|
||||
this.messages.push({ role: 'system', content: notify, transient: true });
|
||||
}
|
||||
},
|
||||
async createConversation(modelId: string, messages: any[] = [], title?: string) {
|
||||
const auth = useAuthStore();
|
||||
if (!auth.token) return null;
|
||||
try {
|
||||
const { data } = await axios.post('/api/conversations', { modelId, messages, title }, { headers: { Authorization: 'Bearer ' + auth.token } });
|
||||
// prepend to list
|
||||
this.list.unshift(data);
|
||||
this.currentId = data._id;
|
||||
return data;
|
||||
} catch (e:any) { this.error = e.response?.data?.error || e.message; return null; }
|
||||
},
|
||||
pushMessage(m: ConversationMessage) { this.messages.push(m); },
|
||||
patchLastAssistant(content: string) {
|
||||
for (let i = this.messages.length - 1; i >=0; i--) {
|
||||
|
Reference in New Issue
Block a user