chatgpt ui

This commit is contained in:
AceDataCloud committed 2023-04-06 20:13:16 +08:00
1 parent 523ab178a4
commit ed43ab5afd
24 files changed
+495 -34

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
export interface IRequest {
question: string;
stateful?: boolean;
conversation_id?: string;
}
export interface IResponse {
answer: string;
conversation_id?: string;
}
+20
View File
@@ -0,0 +1,20 @@
import { AxiosResponse } from 'axios';
import { httpClient } from '../../instance';
import { IRequest, IResponse } from './models';
export interface IQuery {
token: string;
}
const baseUrl = 'https://api.zhishuyun.com';
class ChatGPTOperator {
async post(data: IRequest, query: IQuery): Promise<AxiosResponse<IResponse>> {
return await httpClient.post(`/chatgpt`, data, {
params: query,
baseURL: baseUrl
});
}
}
export const chatgptOperator = new ChatGPTOperator();
+11
View File
@@ -0,0 +1,11 @@
import { IUser, IBot } from '../user';
export interface IContent {
value: string;
type?: string;
}
export interface IMessage {
content: IContent;
author: IUser | IBot;
}
+9
View File
@@ -10,6 +10,15 @@ export interface IUser {
province?: string;
country?: string;
avatar?: string;
type: 'user';
}
export interface IBot {
id?: string;
username?: string;
nickname?: string;
avatar?: string;
type: 'bot';
}
export interface IUserDetailResponse extends IUser {}