diff --git a/clients/ts-sdk/openapi.json b/clients/ts-sdk/openapi.json index e15a5e3d25..ca06bb6f05 100644 --- a/clients/ts-sdk/openapi.json +++ b/clients/ts-sdk/openapi.json @@ -6268,6 +6268,11 @@ ], "nullable": true }, + "no_result_message": { + "type": "string", + "description": "Options for handling the response for the llm to return when no results are found", + "nullable": true + }, "page_size": { "type": "integer", "format": "int64", @@ -8539,6 +8544,11 @@ "type": "string", "description": "The content of the user message to attach to the topic and then generate an assistant message in response to." }, + "no_result_message": { + "type": "string", + "description": "No result message for when there are no chunks found above the score threshold.", + "nullable": true + }, "page_size": { "type": "integer", "format": "int64", @@ -9244,6 +9254,11 @@ "type": "string", "description": "The new content of the message to replace the old content with." }, + "no_result_message": { + "type": "string", + "description": "No result message for when there are no chunks found above the score threshold.", + "nullable": true + }, "page_size": { "type": "integer", "format": "int64", @@ -9476,7 +9491,8 @@ "group_chunks_updated", "group_chunks_action_failed", "crawl_completed", - "crawl_failed" + "crawl_failed", + "crawl_started" ] }, "EventTypes": { @@ -12699,6 +12715,11 @@ ], "nullable": true }, + "no_result_message": { + "type": "string", + "description": "No result message for when there are no chunks found above the score threshold.", + "nullable": true + }, "page_size": { "type": "integer", "format": "int64", diff --git a/clients/ts-sdk/src/types.gen.ts b/clients/ts-sdk/src/types.gen.ts index e21976eb74..669041667a 100644 --- a/clients/ts-sdk/src/types.gen.ts +++ b/clients/ts-sdk/src/types.gen.ts @@ -19,6 +19,10 @@ export type AddChunkToGroupReqPayload = { export type ApiKeyRequestParams = { filters?: ((ChunkFilter) | null); highlight_options?: ((HighlightOptions) | null); + /** + * Options for handling the response for the llm to return when no results are found + */ + no_result_message?: (string) | null; /** * Page size is the number of chunks to fetch. This can be used to fetch more than 10 chunks at a time. */ @@ -707,6 +711,10 @@ export type CreateMessageReqPayload = { * The content of the user message to attach to the topic and then generate an assistant message in response to. */ new_message_content: string; + /** + * No result message for when there are no chunks found above the score threshold. + */ + no_result_message?: (string) | null; /** * Page size is the number of chunks to fetch during RAG. If 0, then no search will be performed. If specified, this will override the N retrievals to include in the dataset configuration. Default is None. */ @@ -1012,6 +1020,10 @@ export type EditMessageReqPayload = { * The new content of the message to replace the old content with. */ new_message_content: string; + /** + * No result message for when there are no chunks found above the score threshold. + */ + no_result_message?: (string) | null; /** * Page size is the number of chunks to fetch during RAG. If 0, then no search will be performed. If specified, this will override the N retrievals to include in the dataset configuration. Default is None. */ @@ -1120,7 +1132,7 @@ export type EventReturn = { page_count: number; }; -export type EventTypeRequest = 'file_uploaded' | 'file_upload_failed' | 'chunks_uploaded' | 'chunk_action_failed' | 'chunk_updated' | 'bulk_chunks_deleted' | 'dataset_delete_failed' | 'qdrant_upload_failed' | 'bulk_chunk_upload_failed' | 'group_chunks_updated' | 'group_chunks_action_failed' | 'crawl_completed' | 'crawl_failed'; +export type EventTypeRequest = 'file_uploaded' | 'file_upload_failed' | 'chunks_uploaded' | 'chunk_action_failed' | 'chunk_updated' | 'bulk_chunks_deleted' | 'dataset_delete_failed' | 'qdrant_upload_failed' | 'bulk_chunk_upload_failed' | 'group_chunks_updated' | 'group_chunks_action_failed' | 'crawl_completed' | 'crawl_failed' | 'crawl_started'; export type EventTypes = { /** @@ -2140,6 +2152,10 @@ export type RegenerateMessageReqPayload = { filters?: ((ChunkFilter) | null); highlight_options?: ((HighlightOptions) | null); llm_options?: ((LLMOptions) | null); + /** + * No result message for when there are no chunks found above the score threshold. + */ + no_result_message?: (string) | null; /** * Page size is the number of chunks to fetch during RAG. If 0, then no search will be performed. If specified, this will override the N retrievals to include in the dataset configuration. Default is None. */ diff --git a/frontends/chat/src/components/Layouts/MainLayout.tsx b/frontends/chat/src/components/Layouts/MainLayout.tsx index ab67e286bc..9ffae64493 100644 --- a/frontends/chat/src/components/Layouts/MainLayout.tsx +++ b/frontends/chat/src/components/Layouts/MainLayout.tsx @@ -92,6 +92,7 @@ const MainLayout = (props: LayoutProps) => { const [minScore, setMinScore] = createSignal(null); const [streamingCompletion, setStreamingCompletion] = createSignal(false); + const [noResultMessage, setNoResultMessage] = createSignal(); const [completionAbortController, setCompletionAbortController] = createSignal(new AbortController()); const [showFilterModal, setShowFilterModal] = createSignal(false); @@ -231,6 +232,7 @@ const MainLayout = (props: LayoutProps) => { use_images: useImages(), }, }, + no_result_message: noResultMessage(), use_group_search: useGroupSearch(), search_type: searchType(), context_options: contextOptions(), @@ -549,6 +551,18 @@ const MainLayout = (props: LayoutProps) => { }} /> +
+ + { + setNoResultMessage(e.target.value); + }} + /> +