@swiss-ai-hub/web 0.290.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +479 -0
- package/app.config.ts +1 -0
- package/app.vue +52 -0
- package/assets/css/main.css +4 -0
- package/assets/images/logo.png +0 -0
- package/components/Agent/Avatar.vue +40 -0
- package/components/Agent/Card.vue +139 -0
- package/components/Agent/Configuration.vue +20 -0
- package/components/Agent/CreateModal.vue +287 -0
- package/components/Agent/EmptyCard.vue +35 -0
- package/components/Agent/List.vue +85 -0
- package/components/Agent/TemplateCard.vue +58 -0
- package/components/AppLoader.vue +55 -0
- package/components/Chat/Message.vue +90 -0
- package/components/Chat/SourceNodes.vue +120 -0
- package/components/Chat/Thread.vue +134 -0
- package/components/Costs/Table.vue +56 -0
- package/components/Dashboard/Component/BarChart.vue +46 -0
- package/components/Dashboard/Component/LineChart.vue +138 -0
- package/components/Dashboard/Component/Number.vue +31 -0
- package/components/Dashboard/Grid.vue +214 -0
- package/components/Dashboard/Item.vue +75 -0
- package/components/Dashboard/Trend.vue +34 -0
- package/components/Display/List/DisplayList.vue +93 -0
- package/components/Evaluation/Dataset/Card.vue +70 -0
- package/components/Evaluation/Dataset/Create.vue +81 -0
- package/components/Evaluation/Dataset/Edit.vue +132 -0
- package/components/Event/Display/AddMemoryToChatHistoryEvent.vue +60 -0
- package/components/Event/Display/AgentInTheLoopRequestEvent.vue +56 -0
- package/components/Event/Display/AgentInTheLoopResponseEvent.vue +17 -0
- package/components/Event/Display/Base.vue +125 -0
- package/components/Event/Display/BaseRetrieveMemoryEvent.vue +101 -0
- package/components/Event/Display/BaseStoreMemoryEvent.vue +182 -0
- package/components/Event/Display/ChunkEvent.vue +40 -0
- package/components/Event/Display/EmbeddingEvent.vue +25 -0
- package/components/Event/Display/ExceptionEvent.vue +21 -0
- package/components/Event/Display/GuardAcceptEvent.vue +25 -0
- package/components/Event/Display/GuardEvent.vue +17 -0
- package/components/Event/Display/GuardRejectionEvent.vue +25 -0
- package/components/Event/Display/HumanInTheLoopRequestEvent.vue +53 -0
- package/components/Event/Display/HumanInTheLoopResponseEvent.vue +40 -0
- package/components/Event/Display/LLMCostEvent.vue +25 -0
- package/components/Event/Display/LLMEvent.vue +92 -0
- package/components/Event/Display/LimitChatHistoryEvent.vue +60 -0
- package/components/Event/Display/RAGFailureStopEvent.vue +28 -0
- package/components/Event/Display/RAGStartEvent.vue +77 -0
- package/components/Event/Display/RAGSuccessStopEvent.vue +16 -0
- package/components/Event/Display/RawDataContent.vue +69 -0
- package/components/Event/Display/RerankerEvent.vue +39 -0
- package/components/Event/Display/RetrieverEvent.vue +22 -0
- package/components/Event/Display/RouterEvent.vue +54 -0
- package/components/Event/Display/StandaloneQuestionCondenserEvent.vue +38 -0
- package/components/Event/Display/StopEvent.vue +16 -0
- package/components/Event/Display/ThoughtEvent.vue +20 -0
- package/components/Event/Display/ToolEvent.vue +38 -0
- package/components/Event/Display/UnknownEvent.vue +17 -0
- package/components/Event/Display/UserMessageEvent.vue +35 -0
- package/components/Event/List/EventList.vue +249 -0
- package/components/Event/Statistics.vue +49 -0
- package/components/Event/Timeseries.vue +224 -0
- package/components/FormKit/AgentSelector.vue +307 -0
- package/components/FormKit/ChipsInput.vue +62 -0
- package/components/FormKit/DynamicConfiguration.vue +155 -0
- package/components/FormKit/IconSelector.vue +72 -0
- package/components/FormKit/KnowledgeDatabaseSelector.vue +92 -0
- package/components/FormKit/LocaleInput.vue +150 -0
- package/components/FormKit/ModelSelect.vue +110 -0
- package/components/FormKit/Repeater.vue +93 -0
- package/components/FormKit/VectorStoreInput.vue +247 -0
- package/components/Knowledge/Document/List.vue +140 -0
- package/components/Knowledge/Document/Overview.vue +28 -0
- package/components/Knowledge/Document/UploadModal.vue +298 -0
- package/components/Knowledge/Document/WithNodes.vue +105 -0
- package/components/Knowledge/Namespace/Card.vue +108 -0
- package/components/Knowledge/Namespace/CreateModal.vue +203 -0
- package/components/Knowledge/Namespace/EditModal.vue +134 -0
- package/components/Knowledge/Namespace/EmptyCard.vue +35 -0
- package/components/Knowledge/Node/Content.vue +71 -0
- package/components/Markdown/Renderer.vue +87 -0
- package/components/Memory/DetailPage.vue +48 -0
- package/components/Memory/Edit.vue +241 -0
- package/components/Memory/Graph.vue +318 -0
- package/components/Memory/List.vue +155 -0
- package/components/Memory/MemoryManagementPage.vue +178 -0
- package/components/Memory/OpenWebUIContent.vue +96 -0
- package/components/Memory/PageLayout.vue +72 -0
- package/components/Models/ModelDetailsPanel.vue +250 -0
- package/components/Models/NamespaceCard.vue +79 -0
- package/components/Navigation/Left.vue +85 -0
- package/components/Navigation/Top.vue +31 -0
- package/components/Notification/Item.vue +88 -0
- package/components/Notification/NotificationsOverlay.vue +164 -0
- package/components/Process/Card.vue +119 -0
- package/components/Process/Configuration.vue +20 -0
- package/components/Process/CreateModal.vue +276 -0
- package/components/Process/EmptyCard.vue +35 -0
- package/components/Process/Form.vue +153 -0
- package/components/Process/Starts.vue +44 -0
- package/components/Process/Walkthrough/List.vue +162 -0
- package/components/Role/AccessRulesEditor.vue +132 -0
- package/components/Role/Card.vue +68 -0
- package/components/Role/Create.vue +55 -0
- package/components/Role/Edit.vue +82 -0
- package/components/Role/UsageLimitsEditor.vue +225 -0
- package/components/Service/Selection.vue +148 -0
- package/components/Structural/Column.vue +74 -0
- package/components/Structural/Screen.vue +10 -0
- package/components/Structural/Substructure.vue +5 -0
- package/components/Tenant/Switcher.vue +102 -0
- package/components/Thread/Details.vue +135 -0
- package/components/Thread/Hierarchy.vue +136 -0
- package/components/Thread/Info.vue +41 -0
- package/components/Thread/List.vue +136 -0
- package/components/User/Bar.vue +74 -0
- package/components/User/List.vue +86 -0
- package/components/User/RoleChips.vue +83 -0
- package/components/User/Settings.vue +79 -0
- package/components/Workflow/Modal.vue +39 -0
- package/components/Workflow/NodeCard.vue +41 -0
- package/components/Workflow/StartNode.vue +24 -0
- package/components/Workflow/StepNode.vue +27 -0
- package/components/Workflow/StopNode.vue +24 -0
- package/components/Workflow/Visualization.vue +265 -0
- package/components/mdc/MarkdownFigure.vue +9 -0
- package/components/mdc/MarkdownTable.vue +9 -0
- package/components/mdc/ResolveImageComponent.vue +58 -0
- package/composables/agent/useAgentClass.ts +27 -0
- package/composables/agent/useAgentClassInstances.ts +27 -0
- package/composables/agent/useAgentClasses.ts +27 -0
- package/composables/agent/useAgentIconFromThread.ts +8 -0
- package/composables/agent/useAgentInstance.ts +28 -0
- package/composables/agent/useAgentInstanceThreads.ts +76 -0
- package/composables/agent/useAgentInstances.ts +25 -0
- package/composables/agent/useAgentNavigation.ts +35 -0
- package/composables/agent/useCreateAgentInstance.ts +33 -0
- package/composables/agent/useDeleteAgentInstance.ts +31 -0
- package/composables/agent/useUpdateAgentInstance.ts +40 -0
- package/composables/auth/useAuth.ts +54 -0
- package/composables/auth/useAuthProviders.ts +14 -0
- package/composables/chat/useChatCompletions.ts +30 -0
- package/composables/dashboard/useAgentNameFromDashboardWidget.ts +27 -0
- package/composables/dashboard/useDashboardComponent.ts +27 -0
- package/composables/dashboard/useSaveDashboard.ts +21 -0
- package/composables/document/useCreateNamespace.ts +26 -0
- package/composables/document/useDatabases.ts +23 -0
- package/composables/document/useDocument.ts +29 -0
- package/composables/document/useDocumentUrl.ts +20 -0
- package/composables/document/useDocuments.ts +107 -0
- package/composables/document/useNodes.ts +29 -0
- package/composables/document/useSummaryNodes.ts +32 -0
- package/composables/document/useUpdateNamespace.ts +22 -0
- package/composables/evaluation/useCreateDataset.ts +19 -0
- package/composables/evaluation/useDataset.ts +26 -0
- package/composables/evaluation/useDatasets.ts +25 -0
- package/composables/evaluation/useUpdateDataset.ts +23 -0
- package/composables/event/useBasicEventStatistics.ts +83 -0
- package/composables/event/useEventColor.ts +25 -0
- package/composables/event/useEventComponent.ts +87 -0
- package/composables/event/useEventTimeseries.ts +39 -0
- package/composables/event/useEventTimeseriesStats.ts +26 -0
- package/composables/file/useFileUpload.ts +91 -0
- package/composables/file/useSupportedFileTypes.ts +22 -0
- package/composables/form/useCreateInstanceForm.ts +251 -0
- package/composables/form/useFormKitTransform.ts +753 -0
- package/composables/memory/useMemoryCRUD.ts +88 -0
- package/composables/memory/useMemoryFactory.ts +319 -0
- package/composables/memory/useMemorySearchFilter.ts +74 -0
- package/composables/models/useModelsList.ts +24 -0
- package/composables/models/useSingleModel.ts +30 -0
- package/composables/notification/useNotificationPoller.ts +58 -0
- package/composables/notification/useNotifications.ts +57 -0
- package/composables/notification/useUpdateMultipleNotifications.ts +17 -0
- package/composables/notification/useUpdateNotification.ts +17 -0
- package/composables/process/useCreateProcessInstance.ts +32 -0
- package/composables/process/useDeleteProcessInstance.ts +31 -0
- package/composables/process/useProcessClasses.ts +27 -0
- package/composables/process/useProcessInstance.ts +28 -0
- package/composables/process/useProcessInstances.ts +27 -0
- package/composables/process/useProcessWalkthroughs.ts +73 -0
- package/composables/process/useSendProcessStartForm.ts +43 -0
- package/composables/process/useUpdateProcessInstance.ts +40 -0
- package/composables/role/useCreateRole.ts +19 -0
- package/composables/role/useDeleteRole.ts +21 -0
- package/composables/role/useRole.ts +30 -0
- package/composables/role/useRoles.ts +25 -0
- package/composables/role/useUpdateRole.ts +22 -0
- package/composables/suite/useApps.ts +31 -0
- package/composables/suite/useSuite.ts +26 -0
- package/composables/tenant/useActiveTenant.ts +27 -0
- package/composables/tenant/useSysadminNavigation.ts +19 -0
- package/composables/tenant/useTenant.ts +38 -0
- package/composables/tenant/useTenantMemberships.ts +15 -0
- package/composables/tenant/useTenantPath.ts +20 -0
- package/composables/tenant/useTenantPolling.ts +30 -0
- package/composables/tenant/useTenantReady.ts +12 -0
- package/composables/theme/useDarkMode.ts +5 -0
- package/composables/thread/useThread.ts +27 -0
- package/composables/thread/useThreadEvents.ts +91 -0
- package/composables/thread/useThreadUtils.ts +49 -0
- package/composables/thread/useThreads.ts +64 -0
- package/composables/thread/useThreadsInfinite.ts +56 -0
- package/composables/translation/useTranslate.ts +20 -0
- package/composables/useRouteReady.ts +21 -0
- package/composables/useTimeAgo.ts +40 -0
- package/composables/user/useAssignRoleToUser.ts +22 -0
- package/composables/user/useMyUser.ts +25 -0
- package/composables/user/useRevokeRoleFromUser.ts +21 -0
- package/composables/user/useUser.ts +30 -0
- package/composables/user/useUsers.ts +63 -0
- package/composables/utils/useJsonTree.ts +138 -0
- package/formkit.config.ts +44 -0
- package/i18n/locales/de.yaml +815 -0
- package/i18n/locales/en.yaml +804 -0
- package/i18n/locales/fr.yaml +812 -0
- package/i18n/locales/it.yaml +808 -0
- package/layouts/anonymous.vue +8 -0
- package/layouts/default.vue +116 -0
- package/middleware/auth.global.ts +62 -0
- package/nuxt.config.ts +145 -0
- package/package.json +114 -0
- package/pages/[tenant]/index.vue +31 -0
- package/pages/[tenant]/notifications/index.vue +235 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/chat.vue +67 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/configuration.vue +122 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/memories/[memory_id].vue +3 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/memories.vue +20 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/overview.vue +72 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/threads.vue +52 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/workflow.vue +19 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id].vue +63 -0
- package/pages/[tenant]/service/agents/templates.vue +102 -0
- package/pages/[tenant]/service/agents.vue +185 -0
- package/pages/[tenant]/service/datasets/[dataset_id].vue +81 -0
- package/pages/[tenant]/service/datasets.vue +53 -0
- package/pages/[tenant]/service/health/index.vue +3 -0
- package/pages/[tenant]/service/knowledge/[db]/[namespace]/[document_id]/nodes.vue +20 -0
- package/pages/[tenant]/service/knowledge/[db]/[namespace]/[document_id]/overview.vue +40 -0
- package/pages/[tenant]/service/knowledge/[db]/[namespace]/[document_id]/summary.vue +88 -0
- package/pages/[tenant]/service/knowledge/[db]/[namespace]/[document_id].vue +48 -0
- package/pages/[tenant]/service/knowledge/[db]/[namespace].vue +144 -0
- package/pages/[tenant]/service/knowledge.vue +126 -0
- package/pages/[tenant]/service/models/[model_name].vue +84 -0
- package/pages/[tenant]/service/models.vue +61 -0
- package/pages/[tenant]/service/my-account.vue +117 -0
- package/pages/[tenant]/service/openai/[thread_id]/[display_id]/memories.vue +66 -0
- package/pages/[tenant]/service/openai/[thread_id]/[display_id]/sources.vue +100 -0
- package/pages/[tenant]/service/openai/[thread_id]/[display_id]/tracing.vue +49 -0
- package/pages/[tenant]/service/openai.vue +101 -0
- package/pages/[tenant]/service/organization-memories/graph.vue +97 -0
- package/pages/[tenant]/service/organization-memories/list/[memory_id].vue +3 -0
- package/pages/[tenant]/service/organization-memories/list.vue +150 -0
- package/pages/[tenant]/service/organization-memories.vue +3 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id]/[process_walkthrough_id].vue +7 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id]/configuration.vue +106 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id]/overview.vue +67 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id]/start.vue +26 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id]/walkthroughs/[process_walkthrough_id]/overview.vue +14 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id]/walkthroughs.vue +54 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id].vue +60 -0
- package/pages/[tenant]/service/processes.vue +129 -0
- package/pages/[tenant]/service/roles/[role_id].vue +54 -0
- package/pages/[tenant]/service/roles.vue +84 -0
- package/pages/[tenant]/service/threads/[thread_id]/chat.vue +51 -0
- package/pages/[tenant]/service/threads/[thread_id]/display/[display_id].vue +21 -0
- package/pages/[tenant]/service/threads/[thread_id]/display.vue +29 -0
- package/pages/[tenant]/service/threads/[thread_id]/hierarchy.vue +14 -0
- package/pages/[tenant]/service/threads/[thread_id]/memories/[memory_id].vue +3 -0
- package/pages/[tenant]/service/threads/[thread_id]/memories.vue +19 -0
- package/pages/[tenant]/service/threads/[thread_id]/overview.vue +100 -0
- package/pages/[tenant]/service/threads/[thread_id].vue +54 -0
- package/pages/[tenant]/service/threads.vue +52 -0
- package/pages/[tenant]/service/user-memories/graph.vue +97 -0
- package/pages/[tenant]/service/user-memories/list/[memory_id].vue +3 -0
- package/pages/[tenant]/service/user-memories/list.vue +150 -0
- package/pages/[tenant]/service/user-memories.vue +3 -0
- package/pages/[tenant]/service/users/[user_id].vue +117 -0
- package/pages/[tenant]/service/users.vue +88 -0
- package/pages/auth/callback.vue +52 -0
- package/pages/auth/login.vue +80 -0
- package/pages/auth/renew.vue +24 -0
- package/pages/index.vue +59 -0
- package/pages/select-tenant.vue +76 -0
- package/plugins/0.runtime-config.client.ts +55 -0
- package/plugins/apexcharts.client.ts +5 -0
- package/plugins/api-client.client.ts +38 -0
- package/plugins/dark-mode.client.ts +12 -0
- package/plugins/keycloak-client.ts +41 -0
- package/plugins/oidc-client.ts +78 -0
- package/sdk/client/client/client.gen.ts +237 -0
- package/sdk/client/client/index.ts +24 -0
- package/sdk/client/client/types.gen.ts +213 -0
- package/sdk/client/client/utils.gen.ts +407 -0
- package/sdk/client/client.gen.ts +25 -0
- package/sdk/client/core/auth.gen.ts +42 -0
- package/sdk/client/core/bodySerializer.gen.ts +96 -0
- package/sdk/client/core/params.gen.ts +181 -0
- package/sdk/client/core/pathSerializer.gen.ts +180 -0
- package/sdk/client/core/queryKeySerializer.gen.ts +136 -0
- package/sdk/client/core/serverSentEvents.gen.ts +265 -0
- package/sdk/client/core/types.gen.ts +118 -0
- package/sdk/client/core/utils.gen.ts +143 -0
- package/sdk/client/index.ts +1013 -0
- package/sdk/client/schemas.gen.ts +35395 -0
- package/sdk/client/sdk.gen.ts +3438 -0
- package/sdk/client/transformers.gen.ts +143 -0
- package/sdk/client/types.gen.ts +27567 -0
- package/tailwind.config.mjs +27 -0
- package/themes/aihub-theme.ts +125 -0
- package/types/DashboardWidget.ts +13 -0
- package/types/EventChartInput.ts +7 -0
- package/types/NavItem.ts +6 -0
- package/types/TimeseriesInput.ts +7 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<StructuralColumn
|
|
3
|
+
:title="t(`${translationPrefix}.memories.title`)"
|
|
4
|
+
:loading="memoriesAreLoading || contextLoading"
|
|
5
|
+
>
|
|
6
|
+
<div class="flex h-full flex-col gap-2">
|
|
7
|
+
<div class="mb-4">
|
|
8
|
+
<span class="text-sm text-surface-500 dark:text-surface-400">
|
|
9
|
+
{{ t(`${translationPrefix}.memories.description`, { [contextNameKey]: contextName }) }}
|
|
10
|
+
</span>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div class="flex w-full items-center justify-between gap-2">
|
|
14
|
+
<div class="flex flex-1 items-center gap-2">
|
|
15
|
+
<IconField class="flex-1">
|
|
16
|
+
<InputIcon>
|
|
17
|
+
<i class="pi pi-search" />
|
|
18
|
+
</InputIcon>
|
|
19
|
+
<InputText
|
|
20
|
+
v-model="searchInput"
|
|
21
|
+
:placeholder="t('memory.search.placeholder')"
|
|
22
|
+
class="w-full"
|
|
23
|
+
@keyup.enter="handleSearch"
|
|
24
|
+
/>
|
|
25
|
+
</IconField>
|
|
26
|
+
<Button
|
|
27
|
+
icon="pi pi-search"
|
|
28
|
+
:label="t('memory.search.button')"
|
|
29
|
+
:loading="isSearchButtonLoading"
|
|
30
|
+
@click="handleSearch"
|
|
31
|
+
/>
|
|
32
|
+
<Button
|
|
33
|
+
v-if="isSearchActive"
|
|
34
|
+
icon="pi pi-times"
|
|
35
|
+
severity="secondary"
|
|
36
|
+
:label="t('memory.search.clear')"
|
|
37
|
+
@click="handleClearSearch"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
<Button
|
|
41
|
+
v-tooltip.top="t('memory.delete_all.button')"
|
|
42
|
+
icon="pi pi-trash"
|
|
43
|
+
severity="danger"
|
|
44
|
+
text
|
|
45
|
+
rounded
|
|
46
|
+
@click="handleDeleteAll"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="flex-1">
|
|
51
|
+
<MemoryList
|
|
52
|
+
:memories="displayedMemories"
|
|
53
|
+
:current-page="displayedCurrentPage"
|
|
54
|
+
:total-pages="displayedTotalPages"
|
|
55
|
+
:selected-memory-id="selectedMemoryId"
|
|
56
|
+
:hide-agent-column="hideAgentColumn"
|
|
57
|
+
@select-memory="handleSelectMemory"
|
|
58
|
+
@next-page="nextPage"
|
|
59
|
+
@prev-page="prevPage"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</StructuralColumn>
|
|
64
|
+
|
|
65
|
+
<NuxtPage :selected-memory-id="selectedMemoryId" />
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script setup lang="ts">
|
|
69
|
+
import { useConfirm } from 'primevue/useconfirm'
|
|
70
|
+
import { useToast } from 'primevue/usetoast'
|
|
71
|
+
|
|
72
|
+
interface Props {
|
|
73
|
+
translationPrefix: 'thread' | 'agent'
|
|
74
|
+
contextName: string
|
|
75
|
+
contextLoading: boolean
|
|
76
|
+
memoryContext: {
|
|
77
|
+
type: 'user'
|
|
78
|
+
thread_id?: string
|
|
79
|
+
agent_class?: string
|
|
80
|
+
agent_id?: string
|
|
81
|
+
}
|
|
82
|
+
basePath: string
|
|
83
|
+
hideAgentColumn?: boolean
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
87
|
+
hideAgentColumn: false,
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
const { t } = useI18n()
|
|
91
|
+
const router = useRouter()
|
|
92
|
+
const route = useRoute()
|
|
93
|
+
const tenantPath = useTenantPath()
|
|
94
|
+
const confirm = useConfirm()
|
|
95
|
+
const toast = useToast()
|
|
96
|
+
|
|
97
|
+
// Context-specific key for translation (threadName vs agentName)
|
|
98
|
+
const contextNameKey = computed(() => {
|
|
99
|
+
return props.translationPrefix === 'thread' ? 'threadName' : 'agentName'
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
// Create memory composables with provided context
|
|
103
|
+
const { useMemories, useMemorySearch, useDeleteMemory } = createMemoryComposables(props.memoryContext)
|
|
104
|
+
|
|
105
|
+
const {
|
|
106
|
+
paginatedMemories,
|
|
107
|
+
currentPage,
|
|
108
|
+
totalPages,
|
|
109
|
+
memoriesAreLoading,
|
|
110
|
+
nextPage,
|
|
111
|
+
prevPage,
|
|
112
|
+
} = useMemories()
|
|
113
|
+
|
|
114
|
+
const {
|
|
115
|
+
searchData,
|
|
116
|
+
searchIsLoading,
|
|
117
|
+
isSearchActive,
|
|
118
|
+
setSearchQuery,
|
|
119
|
+
clearSearch,
|
|
120
|
+
} = useMemorySearch()
|
|
121
|
+
|
|
122
|
+
const { deleteAllMemories } = useDeleteMemory()
|
|
123
|
+
|
|
124
|
+
// Use shared search filter composable
|
|
125
|
+
const {
|
|
126
|
+
searchInput,
|
|
127
|
+
isSearchButtonLoading,
|
|
128
|
+
displayedMemories,
|
|
129
|
+
displayedCurrentPage,
|
|
130
|
+
displayedTotalPages,
|
|
131
|
+
handleSearch,
|
|
132
|
+
handleClearSearch,
|
|
133
|
+
} = useMemorySearchFilter({
|
|
134
|
+
searchData,
|
|
135
|
+
paginatedMemories,
|
|
136
|
+
isSearchActive,
|
|
137
|
+
setSearchQuery,
|
|
138
|
+
clearSearch,
|
|
139
|
+
searchIsLoading,
|
|
140
|
+
currentPage,
|
|
141
|
+
totalPages,
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
const selectedMemoryId = computed(() => route.params.memory_id as string | undefined)
|
|
145
|
+
|
|
146
|
+
const handleSelectMemory = (memory: { id: string }) => {
|
|
147
|
+
router.push(tenantPath(`${props.basePath}/${memory.id}?q=${searchInput.value ?? ''}`))
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const handleDeleteAll = () => {
|
|
151
|
+
confirm.require({
|
|
152
|
+
message: t(`${props.translationPrefix}.memories.delete_all.confirm_message`),
|
|
153
|
+
header: t(`${props.translationPrefix}.memories.delete_all.confirm_header`),
|
|
154
|
+
icon: 'pi pi-exclamation-triangle',
|
|
155
|
+
acceptClass: 'p-button-danger',
|
|
156
|
+
accept: async () => {
|
|
157
|
+
try {
|
|
158
|
+
await deleteAllMemories()
|
|
159
|
+
toast.add({
|
|
160
|
+
severity: 'success',
|
|
161
|
+
summary: t(`${props.translationPrefix}.memories.delete_all.success.title`),
|
|
162
|
+
detail: t(`${props.translationPrefix}.memories.delete_all.success.message`),
|
|
163
|
+
life: 3000,
|
|
164
|
+
})
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
console.error(`Failed to delete ${props.translationPrefix} memories:`, error)
|
|
168
|
+
toast.add({
|
|
169
|
+
severity: 'error',
|
|
170
|
+
summary: t(`${props.translationPrefix}.memories.delete_all.error.title`),
|
|
171
|
+
detail: t(`${props.translationPrefix}.memories.delete_all.error.message`),
|
|
172
|
+
life: 5000,
|
|
173
|
+
})
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
})
|
|
177
|
+
}
|
|
178
|
+
</script>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-4">
|
|
3
|
+
<!-- SelectButton for List/Graph toggle -->
|
|
4
|
+
<SelectButton
|
|
5
|
+
v-model="selectedView"
|
|
6
|
+
:options="viewOptions"
|
|
7
|
+
option-label="label"
|
|
8
|
+
option-value="value"
|
|
9
|
+
size="small"
|
|
10
|
+
/>
|
|
11
|
+
|
|
12
|
+
<!-- List View -->
|
|
13
|
+
<div v-if="selectedView === 'list'">
|
|
14
|
+
<div
|
|
15
|
+
v-if="agentMemoriesAreLoading"
|
|
16
|
+
class="flex items-center justify-center p-8"
|
|
17
|
+
>
|
|
18
|
+
<ProgressSpinner />
|
|
19
|
+
</div>
|
|
20
|
+
<div v-else>
|
|
21
|
+
<MemoryList
|
|
22
|
+
:memories="agentPaginatedMemories"
|
|
23
|
+
:current-page="agentCurrentPage"
|
|
24
|
+
:total-pages="agentTotalPages"
|
|
25
|
+
:hide-agent-column="true"
|
|
26
|
+
@next-page="agentNextPage"
|
|
27
|
+
@prev-page="agentPrevPage"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<!-- Graph View -->
|
|
33
|
+
<div v-else-if="selectedView === 'graph'">
|
|
34
|
+
<div
|
|
35
|
+
v-if="allMemoriesAreLoading"
|
|
36
|
+
class="flex items-center justify-center p-8"
|
|
37
|
+
>
|
|
38
|
+
<ProgressSpinner />
|
|
39
|
+
</div>
|
|
40
|
+
<div
|
|
41
|
+
v-else
|
|
42
|
+
class="h-[600px]"
|
|
43
|
+
>
|
|
44
|
+
<MemoryGraph
|
|
45
|
+
:memories="allMemoriesData?.memories || []"
|
|
46
|
+
:relations="allRelations"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script setup lang="ts">
|
|
54
|
+
const props = defineProps<{
|
|
55
|
+
agentClass: string
|
|
56
|
+
agentId: string
|
|
57
|
+
}>()
|
|
58
|
+
|
|
59
|
+
const { t } = useI18n()
|
|
60
|
+
|
|
61
|
+
// View selection
|
|
62
|
+
const selectedView = ref<'list' | 'graph'>('list')
|
|
63
|
+
const viewOptions = [
|
|
64
|
+
{ label: t('openwebui.memories.list'), value: 'list' },
|
|
65
|
+
{ label: t('openwebui.memories.graph'), value: 'graph' },
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
// Query 1: Agent-specific memories for LIST view (filtered by agent)
|
|
69
|
+
const { useMemories: useAgentMemories } = createMemoryComposables({
|
|
70
|
+
type: 'user',
|
|
71
|
+
agent_class: props.agentClass,
|
|
72
|
+
agent_id: props.agentId,
|
|
73
|
+
// No thread_id filter - show all memories from this agent
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
const {
|
|
77
|
+
paginatedMemories: agentPaginatedMemories,
|
|
78
|
+
currentPage: agentCurrentPage,
|
|
79
|
+
totalPages: agentTotalPages,
|
|
80
|
+
memoriesAreLoading: agentMemoriesAreLoading,
|
|
81
|
+
nextPage: agentNextPage,
|
|
82
|
+
prevPage: agentPrevPage,
|
|
83
|
+
} = useAgentMemories()
|
|
84
|
+
|
|
85
|
+
// Query 2: ALL user memories for GRAPH view (no agent filter to get relations)
|
|
86
|
+
const { useMemories: useAllMemories } = createMemoryComposables({
|
|
87
|
+
type: 'user',
|
|
88
|
+
// No filters - fetch ALL user memories to get relations across all agents
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
const {
|
|
92
|
+
memoriesData: allMemoriesData,
|
|
93
|
+
allRelations,
|
|
94
|
+
memoriesAreLoading: allMemoriesAreLoading,
|
|
95
|
+
} = useAllMemories()
|
|
96
|
+
</script>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<StructuralScreen>
|
|
3
|
+
<template #top>
|
|
4
|
+
<SelectButton
|
|
5
|
+
v-if="navItems"
|
|
6
|
+
:model-value="activeNavItem"
|
|
7
|
+
:options="navItems"
|
|
8
|
+
data-key="key"
|
|
9
|
+
option-label="name"
|
|
10
|
+
size="small"
|
|
11
|
+
@update:model-value="toNavItem"
|
|
12
|
+
/>
|
|
13
|
+
</template>
|
|
14
|
+
<NuxtPage />
|
|
15
|
+
</StructuralScreen>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { useI18n } from 'vue-i18n'
|
|
20
|
+
|
|
21
|
+
import type { NavItem } from '@core/types/NavItem'
|
|
22
|
+
|
|
23
|
+
const props = defineProps<{
|
|
24
|
+
memoryType: 'user' | 'organization'
|
|
25
|
+
}>()
|
|
26
|
+
|
|
27
|
+
const router = useRouter()
|
|
28
|
+
const route = useRoute()
|
|
29
|
+
const tenantPath = useTenantPath()
|
|
30
|
+
const { t } = useI18n()
|
|
31
|
+
|
|
32
|
+
const basePath = computed(() => `/service/${props.memoryType}-memories`)
|
|
33
|
+
|
|
34
|
+
const subPath = (path: string) => {
|
|
35
|
+
return `${basePath.value}/${path}`
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
onMounted(() => {
|
|
39
|
+
// Redirect to graph view by default
|
|
40
|
+
if (route.path === tenantPath(basePath.value)) {
|
|
41
|
+
router.push({
|
|
42
|
+
path: tenantPath(subPath('list')),
|
|
43
|
+
query: route.query,
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const isActive = (path: string) => {
|
|
49
|
+
return () => {
|
|
50
|
+
const localizedPath = tenantPath(subPath(path))
|
|
51
|
+
return route.path.startsWith(localizedPath)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const navItems = computed<NavItem[]>(() => {
|
|
56
|
+
return [
|
|
57
|
+
{ name: t('memory.list.title'), key: 'list', path: subPath('list'), isActive: isActive('list') },
|
|
58
|
+
{ name: t('memory.graph.title'), key: 'graph', path: subPath('graph'), isActive: isActive('graph') },
|
|
59
|
+
]
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const toNavItem = (navItem: NavItem) => {
|
|
63
|
+
router.push({
|
|
64
|
+
path: tenantPath(navItem.path),
|
|
65
|
+
query: route.query,
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const activeNavItem = computed<NavItem | undefined>(() => {
|
|
70
|
+
return navItems.value?.find(navItem => navItem.isActive())
|
|
71
|
+
})
|
|
72
|
+
</script>
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Accordion>
|
|
3
|
+
<AccordionPanel value="0">
|
|
4
|
+
<AccordionHeader class="text-lg font-semibold">
|
|
5
|
+
{{ t('models.modelDetails.additionalInfo') }}
|
|
6
|
+
</AccordionHeader>
|
|
7
|
+
<AccordionContent>
|
|
8
|
+
<div
|
|
9
|
+
v-if="hasAdvancedPricing"
|
|
10
|
+
class="mb-6"
|
|
11
|
+
>
|
|
12
|
+
<h4 class="mb-4 text-base font-semibold">
|
|
13
|
+
{{ t('models.modelDetails.advancedPricing') }}
|
|
14
|
+
</h4>
|
|
15
|
+
<div class="grid grid-cols-3 gap-6">
|
|
16
|
+
<div
|
|
17
|
+
v-for="priceItem in advancedPricingItems"
|
|
18
|
+
:key="priceItem.key"
|
|
19
|
+
class="flex flex-col items-start gap-2"
|
|
20
|
+
>
|
|
21
|
+
<span class="font-semibold">{{ priceItem.label }}</span>
|
|
22
|
+
<span class="text-lg font-light">${{ priceItem.value.toFixed(4) }}</span>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div
|
|
28
|
+
v-if="hasRateLimits"
|
|
29
|
+
class="mb-6"
|
|
30
|
+
>
|
|
31
|
+
<h4 class="mb-4 text-base font-semibold">
|
|
32
|
+
{{ t('models.modelDetails.rateLimits') }}
|
|
33
|
+
</h4>
|
|
34
|
+
<div class="grid grid-cols-3 gap-6">
|
|
35
|
+
<div
|
|
36
|
+
v-if="props.model.model_info?.tpm"
|
|
37
|
+
class="flex flex-col items-start gap-2"
|
|
38
|
+
>
|
|
39
|
+
<span class="font-semibold">{{ t('models.modelDetails.tokensPerMinute') }}</span>
|
|
40
|
+
<span class="text-lg font-light">{{ formatNumber(props.model.model_info.tpm) }}</span>
|
|
41
|
+
</div>
|
|
42
|
+
<div
|
|
43
|
+
v-if="props.model.model_info?.rpm"
|
|
44
|
+
class="flex flex-col items-start gap-2"
|
|
45
|
+
>
|
|
46
|
+
<span class="font-semibold">{{ t('models.modelDetails.requestsPerMinute') }}</span>
|
|
47
|
+
<span class="text-lg font-light">{{ formatNumber(props.model.model_info.rpm) }}</span>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div
|
|
53
|
+
v-if="hasCapabilities"
|
|
54
|
+
class="mb-6"
|
|
55
|
+
>
|
|
56
|
+
<h4 class="mb-4 text-base font-semibold">
|
|
57
|
+
{{ t('models.modelDetails.capabilities') }}
|
|
58
|
+
</h4>
|
|
59
|
+
<div class="flex flex-wrap gap-2">
|
|
60
|
+
<Badge
|
|
61
|
+
v-for="capability in capabilities"
|
|
62
|
+
:key="capability"
|
|
63
|
+
:value="capability"
|
|
64
|
+
severity="secondary"
|
|
65
|
+
class="text-sm"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<div
|
|
71
|
+
v-if="hasOtherDetails"
|
|
72
|
+
class="mb-6"
|
|
73
|
+
>
|
|
74
|
+
<h4 class="mb-4 text-base font-semibold">
|
|
75
|
+
{{ t('models.modelDetails.otherDetails') }}
|
|
76
|
+
</h4>
|
|
77
|
+
<div
|
|
78
|
+
class="grid grid-cols-3 gap-6
|
|
79
|
+
"
|
|
80
|
+
>
|
|
81
|
+
<div
|
|
82
|
+
v-if="props.model.model_info?.output_vector_size"
|
|
83
|
+
class="flex flex-col items-start gap-2"
|
|
84
|
+
>
|
|
85
|
+
<span class="text-sm font-medium">{{ t('models.modelDetails.outputVectorSize') }}</span>
|
|
86
|
+
<Tag
|
|
87
|
+
:value="formatNumber(props.model.model_info.output_vector_size)"
|
|
88
|
+
severity="secondary"
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
<div
|
|
92
|
+
v-if="props.model.model_info?.supports_embedding_image_input !== null"
|
|
93
|
+
class="flex flex-col items-start gap-2"
|
|
94
|
+
>
|
|
95
|
+
<span class="text-sm font-medium">{{ t('models.modelDetails.supportsEmbeddingImageInput') }}</span>
|
|
96
|
+
<Tag
|
|
97
|
+
:value="props.model.model_info?.supports_embedding_image_input ? 'Yes' : 'No'"
|
|
98
|
+
:severity="props.model.model_info?.supports_embedding_image_input ? 'success' : 'secondary'"
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div v-if="props.model.model_info?.supported_openai_params?.length">
|
|
105
|
+
<h4 class="mb-4 text-base font-semibold">
|
|
106
|
+
{{ t('models.modelDetails.supportedParams') }}
|
|
107
|
+
</h4>
|
|
108
|
+
<div class="flex flex-wrap gap-2">
|
|
109
|
+
<Badge
|
|
110
|
+
v-for="param in props.model.model_info.supported_openai_params"
|
|
111
|
+
:key="param"
|
|
112
|
+
:value="param"
|
|
113
|
+
severity="secondary"
|
|
114
|
+
class="text-sm"
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</AccordionContent>
|
|
119
|
+
</AccordionPanel>
|
|
120
|
+
</Accordion>
|
|
121
|
+
</template>
|
|
122
|
+
|
|
123
|
+
<script setup lang="ts">
|
|
124
|
+
import type { ModelDto } from '@core/sdk/client'
|
|
125
|
+
|
|
126
|
+
const props = defineProps<{
|
|
127
|
+
model: ModelDto | null
|
|
128
|
+
}>()
|
|
129
|
+
|
|
130
|
+
const { t } = useI18n()
|
|
131
|
+
|
|
132
|
+
const formatNumber = (num: number): string => {
|
|
133
|
+
return new Intl.NumberFormat().format(num)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const capabilities = computed<string[]>(() => {
|
|
137
|
+
const info = props.model?.model_info
|
|
138
|
+
if (!info) return []
|
|
139
|
+
const capabilityMap = {
|
|
140
|
+
supports_system_messages: t('models.modelDetails.supportsSystemMessages'),
|
|
141
|
+
supports_response_schema: t('models.modelDetails.supportsResponseSchema'),
|
|
142
|
+
supports_vision: t('models.modelDetails.supportsVision'),
|
|
143
|
+
supports_function_calling: t('models.modelDetails.supportsFunctionCalling'),
|
|
144
|
+
supports_tool_choice: t('models.modelDetails.supportsToolChoice'),
|
|
145
|
+
supports_assistant_prefill: t('models.modelDetails.supportsAssistantPrefill'),
|
|
146
|
+
supports_prompt_caching: t('models.modelDetails.supportsPromptCaching'),
|
|
147
|
+
supports_audio_input: t('models.modelDetails.supportsAudioInput'),
|
|
148
|
+
supports_audio_output: t('models.modelDetails.supportsAudioOutput'),
|
|
149
|
+
supports_pdf_input: t('models.modelDetails.supportsPdfInput'),
|
|
150
|
+
supports_native_streaming: t('models.modelDetails.supportsNativeStreaming'),
|
|
151
|
+
supports_web_search: t('models.modelDetails.supportsWebSearch'),
|
|
152
|
+
supports_url_context: t('models.modelDetails.supportsUrlContext'),
|
|
153
|
+
supports_reasoning: t('models.modelDetails.supportsReasoning'),
|
|
154
|
+
supports_computer_use: t('models.modelDetails.supportsComputerUse'),
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return Object.keys(capabilityMap)
|
|
158
|
+
.filter(key => info[key as keyof typeof info] != null)
|
|
159
|
+
.map(key => capabilityMap[key as keyof typeof capabilityMap])
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
const advancedPricingItems = computed<Array<{ key: string, label: string, value: number }>>(() => {
|
|
163
|
+
if (!props.model?.model_info) return []
|
|
164
|
+
|
|
165
|
+
const info = props.model.model_info
|
|
166
|
+
const items = [
|
|
167
|
+
{
|
|
168
|
+
key: 'cache_creation_input_token_cost',
|
|
169
|
+
label: t('models.modelDetails.cacheCreationCost'),
|
|
170
|
+
value: info.cache_creation_input_token_cost,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
key: 'cache_read_input_token_cost',
|
|
174
|
+
label: t('models.modelDetails.cacheReadCost'),
|
|
175
|
+
value: info.cache_read_input_token_cost,
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
key: 'input_cost_per_token_above_128k_tokens',
|
|
179
|
+
label: t('models.modelDetails.inputCostAbove128k'),
|
|
180
|
+
value: info.input_cost_per_token_above_128k_tokens,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
key: 'input_cost_per_token_above_200k_tokens',
|
|
184
|
+
label: t('models.modelDetails.inputCostAbove200k'),
|
|
185
|
+
value: info.input_cost_per_token_above_200k_tokens,
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
key: 'input_cost_per_audio_token',
|
|
189
|
+
label: t('models.modelDetails.inputAudioCost'),
|
|
190
|
+
value: info.input_cost_per_audio_token,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
key: 'input_cost_per_token_batches',
|
|
194
|
+
label: t('models.modelDetails.inputBatchCost'),
|
|
195
|
+
value: info.input_cost_per_token_batches,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
key: 'output_cost_per_token_batches',
|
|
199
|
+
label: t('models.modelDetails.outputBatchCost'),
|
|
200
|
+
value: info.output_cost_per_token_batches,
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
key: 'output_cost_per_audio_token',
|
|
204
|
+
label: t('models.modelDetails.outputAudioCost'),
|
|
205
|
+
value: info.output_cost_per_audio_token,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
key: 'output_cost_per_reasoning_token',
|
|
209
|
+
label: t('models.modelDetails.reasoningTokenCost'),
|
|
210
|
+
value: info.output_cost_per_reasoning_token,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
key: 'output_cost_per_token_above_128k_tokens',
|
|
214
|
+
label: t('models.modelDetails.outputCostAbove128k'),
|
|
215
|
+
value: info.output_cost_per_token_above_128k_tokens,
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
key: 'output_cost_per_token_above_200k_tokens',
|
|
219
|
+
label: t('models.modelDetails.outputCostAbove200k'),
|
|
220
|
+
value: info.output_cost_per_token_above_200k_tokens,
|
|
221
|
+
},
|
|
222
|
+
{ key: 'output_cost_per_image', label: t('models.modelDetails.imageCost'), value: info.output_cost_per_image },
|
|
223
|
+
{
|
|
224
|
+
key: 'search_context_cost_per_query',
|
|
225
|
+
label: t('models.modelDetails.searchContextCost'),
|
|
226
|
+
value: info.search_context_cost_per_query,
|
|
227
|
+
},
|
|
228
|
+
]
|
|
229
|
+
|
|
230
|
+
return items.filter(item => item.value !== null && item.value !== undefined)
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
const hasAdvancedPricing = computed<boolean>(() => {
|
|
234
|
+
return advancedPricingItems.value.length > 0
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
const hasCapabilities = computed<boolean>(() => {
|
|
238
|
+
return capabilities.value.length > 0
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
const hasRateLimits = computed<boolean>(() => {
|
|
242
|
+
if (!props.model) return false
|
|
243
|
+
return !!(props.model.model_info?.tpm || props.model.model_info?.rpm)
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
const hasOtherDetails = computed<boolean>(() => {
|
|
247
|
+
if (!props.model) return false
|
|
248
|
+
return props.model.model_info?.output_vector_size || props.model.model_info?.supports_embedding_image_input !== null
|
|
249
|
+
})
|
|
250
|
+
</script>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="flex cursor-pointer flex-col gap-3 rounded-xl border border-surface-200 p-5 hover:bg-surface-100 dark:border-surface-800 hover:dark:bg-surface-800"
|
|
4
|
+
>
|
|
5
|
+
<div class="flex items-center gap-4">
|
|
6
|
+
<div
|
|
7
|
+
class="flex items-center justify-center rounded-full bg-white p-3 dark:bg-surface-900"
|
|
8
|
+
>
|
|
9
|
+
<Icon
|
|
10
|
+
:name="props.model.icon"
|
|
11
|
+
size="1.5em"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="flex-1">
|
|
15
|
+
<h3 class="font-semibold opacity-80">
|
|
16
|
+
{{ props.model.model_name }}
|
|
17
|
+
</h3>
|
|
18
|
+
<div class="mt-3 flex flex-col gap-2">
|
|
19
|
+
<div class="flex items-center gap-2">
|
|
20
|
+
<span class="text-sm font-bold text-surface-600 dark:text-surface-400">
|
|
21
|
+
{{ t('models.card.costPer1M') }}:
|
|
22
|
+
</span>
|
|
23
|
+
<span class="text-sm font-light text-surface-900 dark:text-surface-100">
|
|
24
|
+
${{ inputCostPerToken }}
|
|
25
|
+
<span class="mx-1 text-surface-500">•</span>
|
|
26
|
+
${{ outputCostPerToken }}
|
|
27
|
+
</span>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="flex items-center gap-2">
|
|
30
|
+
<span class="text-sm font-bold text-surface-600 dark:text-surface-400">
|
|
31
|
+
{{ t('models.card.tokens') }}:
|
|
32
|
+
</span>
|
|
33
|
+
<span class="text-sm font-light text-surface-900 dark:text-surface-100">
|
|
34
|
+
{{ formatTokenLimits }}
|
|
35
|
+
</span>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import type { ModelDTO } from '@core/sdk/client'
|
|
45
|
+
|
|
46
|
+
const props = defineProps<{
|
|
47
|
+
model: ModelDTO
|
|
48
|
+
}>()
|
|
49
|
+
|
|
50
|
+
const { t } = useI18n()
|
|
51
|
+
|
|
52
|
+
const formatNumber = (num: number): string => {
|
|
53
|
+
return new Intl.NumberFormat().format(num)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const formatTokenLimits = computed<string>(() => {
|
|
57
|
+
const input = props.model?.model_info?.max_input_tokens
|
|
58
|
+
const output = props.model?.model_info?.max_output_tokens
|
|
59
|
+
|
|
60
|
+
if (input && output) {
|
|
61
|
+
return `${formatNumber(input)} / ${formatNumber(output)}`
|
|
62
|
+
}
|
|
63
|
+
else if (input) {
|
|
64
|
+
return `${formatNumber(input)} / -`
|
|
65
|
+
}
|
|
66
|
+
else if (output) {
|
|
67
|
+
return `- / ${formatNumber(output)}`
|
|
68
|
+
}
|
|
69
|
+
return '- / -'
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
const inputCostPerToken = computed<string | number>(() => {
|
|
73
|
+
return props.model?.model_info?.input_cost_per_token?.toFixed(2) ?? '-'
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
const outputCostPerToken = computed<string | number>(() => {
|
|
77
|
+
return props.model?.model_info?.output_cost_per_token?.toFixed(2) ?? '-'
|
|
78
|
+
})
|
|
79
|
+
</script>
|