This commit is contained in:
AceDataCloud committed 2023-12-11 01:39:36 +08:00
1 parent cea31c5011
commit 297dd3ef2f
30 files changed
+55 -1386

No files matched your search

-10
View File
@@ -1,10 +0,0 @@
export interface IRequest {
question: string;
stateful?: boolean;
conversation_id?: string;
}
export interface IResponse {
answer: string;
conversation_id?: string;
}
-28
View File
@@ -1,28 +0,0 @@
import axios, { AxiosResponse, AxiosRequestConfig } from 'axios';
import { IRequest, IResponse } from './models';
export interface IQuery {
token: string;
}
class ChatGPTOperator {
async post(data: IRequest, query: IQuery, config?: AxiosRequestConfig): Promise<AxiosResponse<IResponse>> {
return await axios.post(`/chatgpt`, data, {
...config,
params: query
});
}
}
export const chatgptOperator = new ChatGPTOperator();
class ChatGPT4Operator {
async post(data: IRequest, query: IQuery, config?: AxiosRequestConfig): Promise<AxiosResponse<IResponse>> {
return await axios.post(`/chatgpt4`, data, {
...config,
params: query
});
}
}
export const chatgpt4Operator = new ChatGPT4Operator();
+1
View File
@@ -73,6 +73,7 @@ export interface IChatAskResponse {
export enum IChatConversationAction {
RETRIEVE = 'retrieve',
UPDATE = 'update',
DELETE = 'delete',
RETRIEVE_BATCH = 'retrieve_batch'
}
-5
View File
@@ -3,14 +3,9 @@ import {
IChatAskOptions,
IChatAskRequest,
IChatAskResponse,
IChatConversationRequest,
IChatConversationOptions,
IChatConversationResponse,
IChatConversation,
IChatConversationAction
} from './models';
import { IApplication } from '../application';
import { IApi } from '../api';
import { ENDPOINT_API } from '../common/contants';
class ChatOperator {
-7
View File
@@ -1,7 +0,0 @@
import { IMessage } from '../message/models';
export interface IConversation {
messages: IMessage[];
title: string;
id: string;
}
-1
View File
@@ -1,7 +1,6 @@
export * from './instance';
export * from './application';
export * from './user';
export * from './api';
export * from './chat';
export * from './midjourney';
export * from './usage';
-30
View File
@@ -1,30 +0,0 @@
import { IUser, IBot } from '../user';
export interface IContent {
value: string;
type?: string;
}
export interface IError {
code: string;
detail?: string;
}
export enum IMessageState {
PENDING = 'pending',
ANSWERING = 'answering',
FINISHED = 'finished',
FAILED = 'failed'
}
export const ROLE_SYSTEM = 'system';
export const ROLE_ASSISTANT = 'assistant';
export const ROLE_USER = 'user';
export interface IMessage {
state?: IMessageState;
content: string;
author?: IUser | IBot;
role?: typeof ROLE_SYSTEM | typeof ROLE_ASSISTANT | typeof ROLE_USER;
error?: IError;
}