Merge branch 'arc53:feature/api-key-create' into feature/api-key-create

This commit is contained in:
Manish Madan
2024-03-28 19:28:23 +05:30
committed by GitHub
4 changed files with 78 additions and 48 deletions

View File

@@ -6,7 +6,6 @@ const apiHost = import.meta.env.VITE_API_HOST || 'https://docsapi.arc53.com';
export function fetchAnswerApi(
question: string,
signal: AbortSignal,
apiKey: string,
selectedDocs: Doc,
history: Array<any> = [],
conversationId: string | null,
@@ -59,8 +58,6 @@ export function fetchAnswerApi(
},
body: JSON.stringify({
question: question,
api_key: apiKey,
embeddings_key: apiKey,
history: history,
active_docs: docPath,
conversation_id: conversationId,
@@ -90,7 +87,6 @@ export function fetchAnswerApi(
export function fetchAnswerSteaming(
question: string,
signal: AbortSignal,
apiKey: string,
selectedDocs: Doc,
history: Array<any> = [],
conversationId: string | null,
@@ -124,8 +120,6 @@ export function fetchAnswerSteaming(
return new Promise<Answer>((resolve, reject) => {
const body = {
question: question,
api_key: apiKey,
embeddings_key: apiKey,
active_docs: docPath,
history: JSON.stringify(history),
conversation_id: conversationId,
@@ -188,7 +182,6 @@ export function fetchAnswerSteaming(
}
export function searchEndpoint(
question: string,
apiKey: string,
selectedDocs: Doc,
conversation_id: string | null,
history: Array<any> = [],

View File

@@ -23,7 +23,6 @@ export const fetchAnswer = createAsyncThunk<Answer, { question: string }>(
await fetchAnswerSteaming(
question,
signal,
state.preference.apiKey,
state.preference.selectedDocs!,
state.conversation.queries,
state.conversation.conversationId,
@@ -47,7 +46,6 @@ export const fetchAnswer = createAsyncThunk<Answer, { question: string }>(
searchEndpoint(
//search for sources post streaming
question,
state.preference.apiKey,
state.preference.selectedDocs!,
state.conversation.conversationId,
state.conversation.queries,
@@ -81,7 +79,6 @@ export const fetchAnswer = createAsyncThunk<Answer, { question: string }>(
const answer = await fetchAnswerApi(
question,
signal,
state.preference.apiKey,
state.preference.selectedDocs!,
state.conversation.queries,
state.conversation.conversationId,