mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-31 07:38:52 +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,22 +0,0 @@
|
|||
export default function createPayload(submission) {
|
||||
const { conversation, message, endpointOption } = submission;
|
||||
const { conversationId } = conversation;
|
||||
const { endpoint } = endpointOption;
|
||||
|
||||
const endpointUrlMap = {
|
||||
azureOpenAI: '/api/ask/azureOpenAI',
|
||||
openAI: '/api/ask/openAI',
|
||||
bingAI: '/api/ask/bingAI',
|
||||
chatGPTBrowser: '/api/ask/chatGPTBrowser'
|
||||
};
|
||||
|
||||
const server = endpointUrlMap[endpoint];
|
||||
|
||||
let payload = {
|
||||
...message,
|
||||
...endpointOption,
|
||||
conversationId
|
||||
};
|
||||
|
||||
return { server, payload };
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue