mirror of
https://github.com/aljazceru/enclava.git
synced 2025-12-21 17:34:24 +01:00
fixing kb selection
This commit is contained in:
@@ -61,7 +61,7 @@ interface ChatbotInstance {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface RagCollection {
|
interface RagCollection {
|
||||||
id: string
|
id: number | string // Can be either number (from API) or string (when stored)
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
document_count: number
|
document_count: number
|
||||||
@@ -614,15 +614,17 @@ export function ChatbotManager() {
|
|||||||
<div>
|
<div>
|
||||||
<Label htmlFor="collection">Knowledge Base Collection</Label>
|
<Label htmlFor="collection">Knowledge Base Collection</Label>
|
||||||
<Select
|
<Select
|
||||||
value={newChatbot.rag_collection ?? ''}
|
value={String(newChatbot.rag_collection ?? '')}
|
||||||
onValueChange={(value) => setNewChatbot(prev => ({ ...prev, rag_collection: String(value) }))}
|
onValueChange={(value) => setNewChatbot(prev => ({ ...prev, rag_collection: value }))}
|
||||||
>
|
>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
<SelectValue placeholder="Select a collection" />
|
<SelectValue placeholder="Select a collection">
|
||||||
|
{newChatbot.rag_collection && ragCollections.find(c => String(c.id) === String(newChatbot.rag_collection))?.name}
|
||||||
|
</SelectValue>
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
{ragCollections.map((collection) => (
|
{ragCollections.map((collection) => (
|
||||||
<SelectItem key={collection.id} value={collection.id}>
|
<SelectItem key={collection.id} value={String(collection.id)}>
|
||||||
<div className="text-foreground">
|
<div className="text-foreground">
|
||||||
<div className="font-medium">{collection.name}</div>
|
<div className="font-medium">{collection.name}</div>
|
||||||
<div className="text-sm text-muted-foreground">
|
<div className="text-sm text-muted-foreground">
|
||||||
@@ -880,15 +882,17 @@ export function ChatbotManager() {
|
|||||||
<div>
|
<div>
|
||||||
<Label htmlFor="edit-collection">Knowledge Base Collection</Label>
|
<Label htmlFor="edit-collection">Knowledge Base Collection</Label>
|
||||||
<Select
|
<Select
|
||||||
value={editChatbot.rag_collection ?? ''}
|
value={String(editChatbot.rag_collection ?? '')}
|
||||||
onValueChange={(value) => setEditChatbot(prev => ({ ...prev, rag_collection: String(value) }))}
|
onValueChange={(value) => setEditChatbot(prev => ({ ...prev, rag_collection: value }))}
|
||||||
>
|
>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
<SelectValue placeholder="Select a collection" />
|
<SelectValue placeholder="Select a collection">
|
||||||
|
{editChatbot.rag_collection && ragCollections.find(c => String(c.id) === String(editChatbot.rag_collection))?.name}
|
||||||
|
</SelectValue>
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
{ragCollections.map((collection) => (
|
{ragCollections.map((collection) => (
|
||||||
<SelectItem key={collection.id} value={collection.id}>
|
<SelectItem key={collection.id} value={String(collection.id)}>
|
||||||
<div className="text-foreground">
|
<div className="text-foreground">
|
||||||
<div className="font-medium">{collection.name}</div>
|
<div className="font-medium">{collection.name}</div>
|
||||||
<div className="text-sm text-muted-foreground">
|
<div className="text-sm text-muted-foreground">
|
||||||
|
|||||||
Reference in New Issue
Block a user