This commit is contained in:
andrea.terzani
2024-07-31 14:32:22 +02:00
parent 8dd4417d0e
commit e466ff879e
7 changed files with 147 additions and 21 deletions

4
package-lock.json generated
View File

@@ -1,11 +1,11 @@
{
"name": "sakai-vue",
"name": "Hermione",
"version": "4.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sakai-vue",
"name": "Hermione",
"version": "4.0.0",
"dependencies": {
"@primevue/themes": "^4.0.0",

View File

@@ -5,15 +5,10 @@ import AppMenuItem from './AppMenuItem.vue';
const model = ref([
{
label: 'Knowledge Source',
items: [{ label: 'Documents', icon: 'pi pi-fw pi-id-card', to: '/ksdocuments' },
{ label: 'Code Repository', icon: 'pi pi-fw pi-id-card', to: '/ks_code_repo' }
label: 'Scenarios',
items: [{ label: 'Scenario List', icon: 'pi pi-fw pi-id-card', to: '/scenario-list' }
]
},
{
label: 'Vector Database',
items: [{ label: 'Dashboard', icon: 'pi pi-fw pi-home', to: '/' }]
},
}
]);
</script>

View File

@@ -26,7 +26,7 @@ const { onMenuToggle, toggleDarkMode, isDarkTheme } = useLayout();
/>
</svg>
<span>APOLLO</span>
<span>HERMIONE</span>
</router-link>
</div>

View File

@@ -9,16 +9,10 @@ const router = createRouter({
component: AppLayout,
children: [
{
path: '/',
name: 'dashboard',
component: () => import('@/views/Dashboard.vue')
},
{
path: '/ksdocuments',
path: '/scenario',
children: [
{path: '', name: 'ks-document', component: () => import('@/views/pages/KsDocuments.vue')},
{path: 'new', name: 'ks-document-new', component: () => import('@/views/pages/KsDocumentForm.vue')},
{path: ':id', name: 'ks-document-edit', component: () => import('@/views/pages/KsDocumentForm.vue')}
{path: 'list', name: 'scenario-list', component: () => import('@/views/pages/ScenarioExec.vue')},
{path: ':id', name: 'scenario-exec', component: () => import('@/views/pages/ScenarioExec.vue')}
]

131
src/service/Scenarios.js Normal file
View File

@@ -0,0 +1,131 @@
export const ScenarioService = {
getScenari(){
return {
"id": "66a5ff66fc2ae458a491f161",
"name": "simple rag for ATF",
"steps": [
{
"type": "RAG_QUERY",
"description": null,
"name": "Query Vector DB Rag",
"order": 1,
"attributes": {
"rag_threasold": 0.8,
"rag_topk": 5,
"rag_filter": "KsApplicatioName == 'atf'",
"rag_output_variable": "rag_output",
"rag_input": "$shared.user_input$"
}
},
{
"type": "SIMPLE_QUERY_AI",
"description": null,
"name": "Query AI",
"order": 2,
"attributes": {
"qai_system_prompt_template": "You are the most expert about ATF application. \nUse the following documentation to provide answer to the user question : \ncontext:\n\n$shared.rag_output$",
"qai_user_input": "$shared.user_input$",
"qai_output_variable": "scenario_output"
}
}
],
"inputs": [
{
"name": "input_question",
"type": "text",
"label": "Question"
}
]
}
},
getScenarios() {
return [
{
"id": "66a5ff66fc2ae458a491f161",
"name": "simple rag for ATF",
"steps": [
{
"type": "RAG_QUERY",
"description": null,
"name": "Query Vector DB Rag",
"order": 1,
"attributes": {
"rag_threasold": 0.8,
"rag_topk": 5,
"rag_filter": "KsApplicatioName == 'atf'",
"rag_output_variable": "rag_output",
"rag_input": "$shared.user_input$"
}
},
{
"type": "SIMPLE_QUERY_AI",
"description": null,
"name": "Query AI",
"order": 2,
"attributes": {
"qai_system_prompt_template": "You are the most expert about ATF application. \nUse the following documentation to provide answer to the user question : \ncontext:\n\n$shared.rag_output$",
"qai_user_input": "$shared.user_input$",
"qai_output_variable": "scenario_output"
}
}
],
"inputs": [
{
"name": "input_question",
"type": "text",
"label": "Question"
}
]
},
{
"id": "66a7bbb7c5c2e1863e5d6db0",
"name": "better rag",
"steps": [
{
"type": "SIMPLE_QUERY_AI",
"description": null,
"name": "Extract Keywords AI",
"order": 0,
"attributes": {
"qai_system_prompt_template": "You are able to identify all the keywords from user sentence or question. Reply to the user with only a list of the keywords seprated by spaces and nothing else.",
"qai_user_input": "$shared.user_input$",
"qai_output_variable": "keywords"
}
},
{
"type": "RAG_QUERY",
"description": null,
"name": "Query Rag",
"order": 1,
"attributes": {
"rag_threasold": 0.7,
"rag_topk": 5,
"rag_filter": "KsApplicatioName == 'atf'",
"rag_output_variable": "rag_output",
"rag_input": "$shared.keywords$"
}
},
{
"type": "SIMPLE_QUERY_AI",
"description": null,
"name": "Query AI",
"order": 2,
"attributes": {
"qai_system_prompt_template": "You are the most expert about ATF application. \nUse the following documentation to provide answer to the user question : \ncontext:\n\n$shared.rag_output$",
"qai_user_input": "$shared.user_input$",
"qai_output_variable": "scenario_output"
}
}
],
"inputs": [
{
"name": "input_question",
"type": "text",
"label": "Question"
}
]
}
];
}
}

View File

@@ -38,10 +38,10 @@ import { onMounted } from 'vue'
import axios from 'axios';
import { useRoute, useRouter } from 'vue-router'
import { data } from 'autoprefixer';
const router = useRouter()
const ksdocuments = ref(null);
const scenario = ref([])
onMounted(() => {
axios.get('http://localhost:8082/fe-api/ksdocuments')

View File

@@ -0,0 +1,6 @@
<template>
<div className="card">
<h5>Empty Page</h5>
<p>Use this page to start from scratch and place your custom content.</p>
</div>
</template>