chatgpt ui
This commit is contained in:
1 parent
523ab178a4
commit
ed43ab5afd
24 files changed
+495
-34
No files matched your search
@@ -0,0 +1,10 @@
|
||||
export interface IRequest {
|
||||
question: string;
|
||||
stateful?: boolean;
|
||||
conversation_id?: string;
|
||||
}
|
||||
|
||||
export interface IResponse {
|
||||
answer: string;
|
||||
conversation_id?: string;
|
||||
}
|
||||
@@ -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();
|
||||
@@ -0,0 +1,11 @@
|
||||
import { IUser, IBot } from '../user';
|
||||
|
||||
export interface IContent {
|
||||
value: string;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface IMessage {
|
||||
content: IContent;
|
||||
author: IUser | IBot;
|
||||
}
|
||||
@@ -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 {}
|
||||
Reference in new issue
Block a user