init repo
This commit is contained in:
21
src/api/ai.ts
Normal file
21
src/api/ai.ts
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user