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 { useEffect } from 'react';
|
||||||
import { useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil';
|
import { useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil';
|
||||||
import { SSE } from '~/utils/sse.mjs';
|
import { SSE } from '~/data-provider/sse.mjs';
|
||||||
import createPayload from '~/utils/createPayload';
|
import createPayload from '~/data-provider/createPayload';
|
||||||
|
|
||||||
import store from '~/store';
|
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 { conversation, message, endpointOption } = submission;
|
||||||
const { conversationId } = conversation;
|
const { conversationId } = conversation;
|
||||||
const { endpoint } = endpointOption;
|
const { endpoint } = endpointOption;
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
export type TMessage = {
|
export type TMessage = {
|
||||||
messageId: string,
|
messageId: string,
|
||||||
conversationId: string,
|
conversationId: string,
|
||||||
// conversationSignature: string | null,
|
|
||||||
clientId: string,
|
clientId: string,
|
||||||
// invocationId: string,
|
|
||||||
parentMessageId: string,
|
parentMessageId: string,
|
||||||
sender: string,
|
sender: string,
|
||||||
text: string,
|
text: string,
|
||||||
|
|
@ -11,27 +9,40 @@ export type TMessage = {
|
||||||
error: boolean,
|
error: boolean,
|
||||||
createdAt: string,
|
createdAt: string,
|
||||||
updatedAt: string,
|
updatedAt: string,
|
||||||
// searchResult: string[],
|
|
||||||
// submitting: boolean,
|
|
||||||
// children?: any[] | undefined,
|
|
||||||
// bgColor?: string,
|
|
||||||
// model?: string,
|
|
||||||
// cancelled?: boolean
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TMessageTreeNode = {}
|
export type TSubmission = {
|
||||||
|
clientId?: string;
|
||||||
export type TSearchMessage = {}
|
context?: string;
|
||||||
|
conversationId?: string;
|
||||||
export type TSearchMessageTreeNode = {}
|
conversationSignature?: string;
|
||||||
|
current: boolean;
|
||||||
export type TMessageToAsk = {}
|
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 {
|
export enum EModelEndpoint {
|
||||||
azureOpenAI = 'azureOpenAI',
|
azureOpenAI = 'azureOpenAI',
|
||||||
openAI = 'openAI',
|
openAI = 'openAI',
|
||||||
bingAI = 'bingAI',
|
bingAI = 'bingAI',
|
||||||
|
chatGPT = 'chatGPT',
|
||||||
chatGPTBrowser = 'chatGPTBrowser'
|
chatGPTBrowser = 'chatGPTBrowser'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -143,4 +154,10 @@ export type TEndpoints = {
|
||||||
|
|
||||||
export type TUpdateTokenCountResponse = {
|
export type TUpdateTokenCountResponse = {
|
||||||
count: number,
|
count: number,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type TMessageTreeNode = {}
|
||||||
|
|
||||||
|
export type TSearchMessage = {}
|
||||||
|
|
||||||
|
export type TSearchMessageTreeNode = {}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue