-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/209-pagina-embeddings-chatbot
- Loading branch information
Showing
15 changed files
with
187 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ node_modules | |
.DS_Store | ||
.history | ||
.vscode | ||
|
||
feature_items.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<div class="space-y-8 leading-tight"> | ||
<div class="flex justify-between items-center pb-4 mb-4 s\m:mb-5"> | ||
<h3 class="text-xl font-semibold text-gray-900">{{ $t('SYSTEM_INFO') }}</h3> | ||
<Icon class="text-2xl hover:cursor-pointer hover:bg-sky-100" name="ph:x-bold" @click="$closeModal()" /> | ||
</div> | ||
|
||
<div class="gap-3 tracking-wider"> | ||
<span class="col-span-3 justify-self-end whitespace-nowrap"> | ||
Brevia App <strong>v{{ appVersion }}</strong> | ||
</span> | ||
</div> | ||
|
||
<hr class="border-t border-gray-300" /> | ||
|
||
<div class="gap-3 tracking-wider"> | ||
<template v-if="versions?.brevia"> | ||
<span class="col-span-3 justify-self-end whitespace-nowrap"> | ||
Brevia API <strong>v{{ versions.brevia }}</strong> | ||
</span> | ||
<br /> | ||
</template> | ||
<template v-if="versions?.apiName && versions?.apiVersion"> | ||
<span class="col-span-3 justify-self-end whitespace-nowrap"> | ||
{{ versions.apiName }} API <strong>v{{ versions.apiVersion }}</strong> | ||
</span> | ||
<br /> | ||
</template> | ||
<span class="col-span-3 justify-self-end whitespace-nowrap"> | ||
API Base URL <strong>{{ versions.baseUrl }}</strong> | ||
</span> | ||
</div> | ||
|
||
<hr v-if="integration !== 'brevia'" class="border-t border-gray-300" /> | ||
|
||
<div v-if="integration !== 'brevia'" class="gap-3 tracking-wider"> | ||
<template v-if="integrationVersions?.get(integration)"> | ||
<span class="col-span-3 justify-self-end whitespace-nowrap"> | ||
{{ integrationName }} API <strong>v{{ integrationVersions?.get(integration) }}</strong> | ||
</span> | ||
<br /> | ||
</template> | ||
<template v-if="integrationVersions?.get('apiName') && integrationVersions?.get('apiVersion')"> | ||
<span class="col-span-3 justify-self-end whitespace-nowrap"> | ||
{{ integrationVersions?.get('apiName') }} API <strong>v{{ integrationVersions?.get('apiVersion') }}</strong> | ||
</span> | ||
<br /> | ||
</template> | ||
<span class="col-span-3 justify-self-end whitespace-nowrap"> | ||
API Base URL <strong>{{ integrationVersions?.get('baseUrl') }}</strong> | ||
</span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
const appVersion = useRuntimeConfig().public.version; | ||
const response = await fetch('/api/brevia/versions'); | ||
const versions = await response.json(); | ||
const integration = useIntegration(); | ||
const integrationName = integration.charAt(0).toUpperCase() + integration.slice(1); | ||
const integrationVersions = await useIntegrationVersion(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const useIntegrationVersion = async (): Promise<Map<string, string>> => { | ||
const integration = useIntegration(); | ||
if (integration === 'brevia') { | ||
return new Map(); | ||
} | ||
const response: any = await $fetch(`/api/${integration}/versions`); | ||
|
||
return new Map(Object.entries(response)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[ | ||
{ | ||
"feature_type": "summary", | ||
"uname": "summary", | ||
"title": "Document Summary", | ||
"description": "" | ||
}, | ||
{ | ||
"feature_type": "transcription", | ||
"uname": "transcription", | ||
"title": "Audio Transcription", | ||
"description": "" | ||
}, | ||
{ | ||
"feature_type": "analysis", | ||
"uname": "questions_generator", | ||
"title": "Questions Generator", | ||
"description": "Upload a PDF or TXT file and get a questionnaire with multiple questions and answers on the text provided", | ||
"feature_params": { | ||
"service": "brevia.services.RefineTextAnalysisService", | ||
"accept": "application/pdf,text/plain", | ||
"payload": { | ||
"max_duration": 60, | ||
"max_attempts": 3 | ||
} | ||
}, | ||
"prompts": { | ||
"initial_prompt": { | ||
"_type": "prompt", | ||
"input_variables": ["text"], | ||
"template": "Analyze the following text and generate 1-2 multiple choice questions, each with four options\n(A, B, C, D), of which only one is correct.\nHighlight the correct answer and make sure that the questions are relevant and understandable.\n\nReference text:\n-------------------\n{text}\n" | ||
}, | ||
"refine_prompt": { | ||
"_type": "prompt", | ||
"input_variables": ["existing_answer", "text"], | ||
"template": "You are given the following partial document containing a list of multiple choice questions:\nPartial Document:\n-------------------\n{existing_answer}\n-------------------\nRewrite the list of questions by adding 1-2 more questions at the bottom from the context provided below:\n\n-------------\n{text}\n-------------------" | ||
} | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default defineEventHandler(async (event) => { | ||
try { | ||
const client = await beditaApiClient(event); | ||
const response = await client.get('/home'); | ||
|
||
return { | ||
bedita: response.headers.get('X-BEdita-Version'), | ||
apiName: response.headers.get('X-API-Name'), | ||
apiVersion: response.headers.get('X-API-Version'), | ||
baseUrl: useRuntimeConfig().bedita.apiBaseUrl, | ||
}; | ||
} catch (error) { | ||
return handleBeditaApiError(event, error); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default defineEventHandler(async (event) => { | ||
try { | ||
const response: Response = await fetch(apiUrl('/status'), { | ||
method: 'HEAD', | ||
headers: authorizationHeaders(), | ||
}); | ||
|
||
return { | ||
brevia: response.headers.get('X-Brevia-Version'), | ||
apiName: response.headers.get('X-API-Name'), | ||
apiVersion: response.headers.get('X-API-Version'), | ||
baseUrl: useRuntimeConfig().apiBaseUrl, | ||
}; | ||
} catch (error) { | ||
return handleApiError(event, error); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters