This commit is contained in:
XIE7654
2025-07-18 10:39:05 +08:00
parent 66d5971570
commit aef25112f6
16 changed files with 83 additions and 74 deletions

View File

@@ -5,6 +5,16 @@ export async function getConversations() {
return await res.json();
}
export async function createConversation() {
const response = await fetchWithAuth('/chat/api/v1/conversations', {
method: 'POST',
});
if (!response.ok) {
throw new Error('创建对话失败');
}
return await response.json();
}
export async function getMessages(conversationId: number) {
const res = await fetchWithAuth(
`/chat/api/v1/messages?conversation_id=${conversationId}`,