diff --git a/README.md b/README.md index a2d99f6..b51b29f 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,18 @@ When set, this will calculate the [Factual Consistency Score (FCS)](https://docs Define the [summarizer and prompt](https://docs.vectara.com/docs/learn/grounded-generation/select-a-summarizer) to use to generate the chat response. +##### `numberOfSearchResults` (optional) + +Define the number of search results to be used to generate summary. Default is set to 15. + +##### `rerankerId` (optional) + +Define the reranker Id to be used , Defaults to 272725718. + +##### `lambda` (optional) + +How much to weigh lexical scores compared to the embedding score. 0 means lexical search is not used at all, and 1 means only lexical search is used. + ### Use your own views with the useChat hook Install React-Chatbot: diff --git a/src/components/ChatView.tsx b/src/components/ChatView.tsx index e851a9c..02bd1f4 100644 --- a/src/components/ChatView.tsx +++ b/src/components/ChatView.tsx @@ -60,6 +60,8 @@ export interface Props { // Define the reranker Id to be used , Defaults to "272725718" rerankerId?: RerankerId; + // How much to weigh lexical scores compared to the embedding score. 0 means lexical search is not used at all, + // and 1 means only lexical search is used. lambda?: number; // Enables streaming responses from the API. Defaults to true. diff --git a/src/useChat.ts b/src/useChat.ts index 3774ff5..f0a31c8 100644 --- a/src/useChat.ts +++ b/src/useChat.ts @@ -235,7 +235,7 @@ export const useChat = ({ } }) - + resultsWithSnippets = response.search_results.map((result: SearchResult) => { const { pre, text, post } = parseSnippet(result.text);