feat(configuration): update asynq concurrency settings and enhance FAQ handling
- Increased the default worker pool size for the asynq server from 16 to 32 to improve performance during concurrent uploads. - Updated the .env.example and docker-compose.yml files to reflect the new default concurrency setting. - Enhanced the handling of FAQ entries in the tool results, ensuring distinct identification through standard questions, improving user experience and clarity in the output. - Refactored related components to utilize the new FAQ attributes, ensuring consistent display and interaction across the application.
This commit is contained in:
@@ -36,6 +36,12 @@ export interface SearchResultItem {
|
||||
knowledge_id: string;
|
||||
knowledge_title: string;
|
||||
match_type: string;
|
||||
knowledge_base_type?: string;
|
||||
// FAQ entries share the owning document's title; the standard question
|
||||
// gives each entry a distinct, human-readable label.
|
||||
faq_standard_question?: string;
|
||||
faq_similar_questions?: string[];
|
||||
faq_answers?: string[];
|
||||
}
|
||||
|
||||
// Chunk item
|
||||
@@ -203,6 +209,9 @@ export interface GrepKnowledgeResult {
|
||||
knowledge_id: string;
|
||||
knowledge_base_id: string;
|
||||
knowledge_title: string;
|
||||
// Standard question of the first matched FAQ entry, used as the row label
|
||||
// since FAQ entries share the owning document's title.
|
||||
faq_question?: string;
|
||||
title_match?: boolean;
|
||||
chunk_hit_count: number;
|
||||
match_snippet?: string;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
v-for="(result, index) in results"
|
||||
:key="result.knowledge_id"
|
||||
:index="index + 1"
|
||||
:title="result.knowledge_title || $t('knowledge.untitledDocument')"
|
||||
:title="result.faq_question || result.knowledge_title || $t('knowledge.untitledDocument')"
|
||||
:meta="formatMeta(result)"
|
||||
:popup-key="result.knowledge_id || index"
|
||||
:show-popup="!!cleanedSnippet(result)"
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<div v-if="groupedResults.length > 0" class="results-list">
|
||||
<ResultRow
|
||||
v-for="(group, idx) in groupedResults"
|
||||
:key="group.knowledge_id"
|
||||
:key="group.key"
|
||||
:index="idx + 1"
|
||||
:title="group.knowledge_title"
|
||||
:title="group.title"
|
||||
:meta="$t('agentStream.grepResults.chunkHits', { count: group.chunks.length })"
|
||||
:popup-key="group.knowledge_id"
|
||||
:chunks="group.chunks"
|
||||
@@ -41,22 +41,28 @@ const results = computed(() => props.data.results || []);
|
||||
const kbCounts = computed(() => props.data.kb_counts);
|
||||
|
||||
interface GroupedResult {
|
||||
key: string;
|
||||
knowledge_id: string;
|
||||
knowledge_title: string;
|
||||
title: string;
|
||||
chunks: { content: string; chunk_id: string; knowledge_id: string }[];
|
||||
}
|
||||
|
||||
// Hybrid retrieval can return several chunks from the same document; collapse
|
||||
// them into one row so the same file is not listed repeatedly.
|
||||
// them into one row so the same file is not listed repeatedly. FAQ entries are
|
||||
// the exception: they all share the owning document's title, so each entry is
|
||||
// kept as its own row labelled by its standard question to stay distinguishable.
|
||||
const groupedResults = computed<GroupedResult[]>(() => {
|
||||
const map = new Map<string, GroupedResult>();
|
||||
const order: string[] = [];
|
||||
for (const r of results.value) {
|
||||
const key = r.knowledge_id || r.chunk_id;
|
||||
const faqQuestion = r.faq_standard_question?.trim();
|
||||
const isFaq = !!faqQuestion;
|
||||
const key = isFaq ? r.chunk_id : r.knowledge_id || r.chunk_id;
|
||||
if (!map.has(key)) {
|
||||
map.set(key, {
|
||||
key,
|
||||
knowledge_id: r.knowledge_id,
|
||||
knowledge_title: r.knowledge_title,
|
||||
title: (isFaq ? faqQuestion : r.knowledge_title) || r.knowledge_title,
|
||||
chunks: [],
|
||||
});
|
||||
order.push(key);
|
||||
|
||||
Reference in New Issue
Block a user