mirror of
https://github.com/arc53/DocsGPT.git
synced 2026-02-26 14:21:47 +00:00
fix: count history tokens from chunks, remove old UI setting limit (#2196)
This commit is contained in:
@@ -11,7 +11,6 @@ export function handleFetchAnswer(
|
||||
conversationId: string | null,
|
||||
promptId: string | null,
|
||||
chunks: string,
|
||||
token_limit: number,
|
||||
agentId?: string,
|
||||
attachments?: string[],
|
||||
save_conversation = true,
|
||||
@@ -42,7 +41,6 @@ export function handleFetchAnswer(
|
||||
conversation_id: conversationId,
|
||||
prompt_id: promptId,
|
||||
chunks: chunks,
|
||||
token_limit: token_limit,
|
||||
isNoneDoc: selectedDocs.length === 0,
|
||||
agent_id: agentId,
|
||||
save_conversation: save_conversation,
|
||||
@@ -100,7 +98,6 @@ export function handleFetchAnswerSteaming(
|
||||
conversationId: string | null,
|
||||
promptId: string | null,
|
||||
chunks: string,
|
||||
token_limit: number,
|
||||
onEvent: (event: MessageEvent) => void,
|
||||
indx?: number,
|
||||
agentId?: string,
|
||||
@@ -113,7 +110,6 @@ export function handleFetchAnswerSteaming(
|
||||
conversation_id: conversationId,
|
||||
prompt_id: promptId,
|
||||
chunks: chunks,
|
||||
token_limit: token_limit,
|
||||
isNoneDoc: selectedDocs.length === 0,
|
||||
index: indx,
|
||||
agent_id: agentId,
|
||||
@@ -198,13 +194,11 @@ export function handleSearch(
|
||||
selectedDocs: Doc[],
|
||||
conversation_id: string | null,
|
||||
chunks: string,
|
||||
token_limit: number,
|
||||
) {
|
||||
const payload: RetrievalPayload = {
|
||||
question: question,
|
||||
conversation_id: conversation_id,
|
||||
chunks: chunks,
|
||||
token_limit: token_limit,
|
||||
isNoneDoc: selectedDocs.length === 0,
|
||||
};
|
||||
if (selectedDocs.length > 0) {
|
||||
|
||||
@@ -59,7 +59,6 @@ export interface RetrievalPayload {
|
||||
conversation_id: string | null;
|
||||
prompt_id?: string | null;
|
||||
chunks: string;
|
||||
token_limit: number;
|
||||
isNoneDoc: boolean;
|
||||
index?: number;
|
||||
agent_id?: string;
|
||||
|
||||
@@ -63,7 +63,6 @@ export const fetchAnswer = createAsyncThunk<
|
||||
currentConversationId,
|
||||
state.preference.prompt.id,
|
||||
state.preference.chunks,
|
||||
state.preference.token_limit,
|
||||
(event) => {
|
||||
const data = JSON.parse(event.data);
|
||||
const targetIndex = indx ?? state.conversation.queries.length - 1;
|
||||
@@ -171,7 +170,6 @@ export const fetchAnswer = createAsyncThunk<
|
||||
state.conversation.conversationId,
|
||||
state.preference.prompt.id,
|
||||
state.preference.chunks,
|
||||
state.preference.token_limit,
|
||||
state.preference.selectedAgent?.id,
|
||||
attachmentIds,
|
||||
true,
|
||||
|
||||
Reference in New Issue
Block a user