init repo

This commit is contained in:
VaalaCat
2024-08-28 00:02:28 +08:00
committed by vaalacat
commit 13148b95e3
97 changed files with 10214 additions and 0 deletions

21
src/api/ai.ts Normal file
View File

@@ -0,0 +1,21 @@
import { type Message } from 'ai/react'
import api from './api'
import { ChatShareAPIPrefix } from '@/const/api';
export interface ChatShareRequest {
chatId: string
}
export interface ChatShareResp {
userID: number;
id: string;
messages: Message[];
}
export const getSharedChat = async (id: string) => {
const res = await api.post(ChatShareAPIPrefix + '/v1/chat/messages/share',
{ chatId: id } as ChatShareRequest,
)
console.log("getSharedChat api response: ", res.data)
return res.data as ChatShareResp
}