mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 18:30:15 +01:00
Move createPayload and sse to data-provider, create TSubmission type
This commit is contained in:
parent
0fb9820110
commit
7b7ba96786
4 changed files with 38 additions and 19 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { useEffect } from 'react';
|
||||
import { useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil';
|
||||
import { SSE } from '~/utils/sse.mjs';
|
||||
import createPayload from '~/utils/createPayload';
|
||||
import { SSE } from '~/data-provider/sse.mjs';
|
||||
import createPayload from '~/data-provider/createPayload';
|
||||
|
||||
import store from '~/store';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
export default function createPayload(submission) {
|
||||
import type { TSubmission } from './types';
|
||||
|
||||
export default function createPayload(submission: TSubmission) {
|
||||
const { conversation, message, endpointOption } = submission;
|
||||
const { conversationId } = conversation;
|
||||
const { endpoint } = endpointOption;
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
export type TMessage = {
|
||||
messageId: string,
|
||||
conversationId: string,
|
||||
// conversationSignature: string | null,
|
||||
clientId: string,
|
||||
// invocationId: string,
|
||||
parentMessageId: string,
|
||||
sender: string,
|
||||
text: string,
|
||||
|
|
@ -11,27 +9,40 @@ export type TMessage = {
|
|||
error: boolean,
|
||||
createdAt: string,
|
||||
updatedAt: string,
|
||||
// searchResult: string[],
|
||||
// submitting: boolean,
|
||||
// children?: any[] | undefined,
|
||||
// bgColor?: string,
|
||||
// model?: string,
|
||||
// cancelled?: boolean
|
||||
};
|
||||
|
||||
export type TMessageTreeNode = {}
|
||||
|
||||
export type TSearchMessage = {}
|
||||
|
||||
export type TSearchMessageTreeNode = {}
|
||||
|
||||
export type TMessageToAsk = {}
|
||||
export type TSubmission = {
|
||||
clientId?: string;
|
||||
context?: string;
|
||||
conversationId?: string;
|
||||
conversationSignature?: string;
|
||||
current: boolean;
|
||||
endpoint: EModelEndpoint;
|
||||
invocationId: number;
|
||||
isCreatedByUser: boolean;
|
||||
jailbreak: boolean;
|
||||
jailbreakConversationId?: string;
|
||||
messageId: string;
|
||||
overrideParentMessageId?: string | boolean;
|
||||
parentMessageId?: string;
|
||||
sender: string;
|
||||
systemMessage?: string;
|
||||
text: string;
|
||||
toneStyle?: string;
|
||||
model?: string;
|
||||
promptPrefix?: string;
|
||||
temperature?: number;
|
||||
top_p?: number;
|
||||
presence_penalty?: number;
|
||||
frequence_penalty?: number;
|
||||
}
|
||||
|
||||
|
||||
export enum EModelEndpoint {
|
||||
azureOpenAI = 'azureOpenAI',
|
||||
openAI = 'openAI',
|
||||
bingAI = 'bingAI',
|
||||
chatGPT = 'chatGPT',
|
||||
chatGPTBrowser = 'chatGPTBrowser'
|
||||
}
|
||||
|
||||
|
|
@ -144,3 +155,9 @@ export type TEndpoints = {
|
|||
export type TUpdateTokenCountResponse = {
|
||||
count: number,
|
||||
};
|
||||
|
||||
export type TMessageTreeNode = {}
|
||||
|
||||
export type TSearchMessage = {}
|
||||
|
||||
export type TSearchMessageTreeNode = {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue