-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #727 from UN-OCHA/develop
Develop -> Main - v2.4.0
- Loading branch information
Showing
12 changed files
with
843 additions
and
210 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
Large diffs are not rendered by default.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
config/block.block.common_design_subtheme_ochaaichatpopup.yml
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,33 @@ | ||
uuid: b9a70ca4-c0f1-435d-9d2f-4ad6abc77a99 | ||
langcode: en | ||
status: true | ||
dependencies: | ||
module: | ||
- node | ||
- ocha_ai_chat | ||
- system | ||
theme: | ||
- common_design_subtheme | ||
id: common_design_subtheme_ochaaichatpopup | ||
theme: common_design_subtheme | ||
region: content | ||
weight: 0 | ||
provider: null | ||
plugin: ocha_ai_chat_chat_popup | ||
settings: | ||
id: ocha_ai_chat_chat_popup | ||
label: 'OCHA AI Chat popup' | ||
label_display: '0' | ||
provider: ocha_ai_chat | ||
visibility: | ||
'entity_bundle:node': | ||
id: 'entity_bundle:node' | ||
negate: false | ||
context_mapping: | ||
node: '@node.node_route_context:node' | ||
bundles: | ||
report: report | ||
request_path: | ||
id: request_path | ||
negate: true | ||
pages: '/node/*/*' |
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,81 @@ | ||
plugins: | ||
completion: | ||
aws_bedrock: | ||
model: amazon.titan-text-express-v1 | ||
endpoint: '' | ||
version: '' | ||
region: REPLACE_WITH_REGION | ||
api_key: REPLACE_WITH_KEY | ||
max_tokens: 512 | ||
prompt_template: |- | ||
{{ context }} | ||
Based solely on the information above, please answer the following question. Please do not make things up and say you don't know if you cannot answer. | ||
{{ question }} | ||
api_secret: REPLACE_WITH_SECRET | ||
role_arn: null | ||
azure_openai: | ||
model: gpt-3.5-turbo | ||
endpoint: REPLACE_WITH_ENDPOINT | ||
version: '2023-05-15' | ||
region: REPLACE_WITH_REGION | ||
api_key: REPLACE_WITH_KEY | ||
max_tokens: 512 | ||
prompt_template: |- | ||
Based solely on the information below, please answer the user's question. Please do not make things up and say you don't know if you cannot answer. | ||
{{ context }} | ||
embedding: | ||
aws_bedrock: | ||
model: amazon.titan-embed-text-v1 | ||
endpoint: '' | ||
version: '' | ||
region: REPLACE_WITH_REGION | ||
api_key: REPLACE_WITH_KEY | ||
batch_size: 1 | ||
dimensions: 1536 | ||
max_tokens: 8192 | ||
api_secret: REPLACE_WITH_SECRET | ||
role_arn: null | ||
azure_openai: | ||
model: text-embedding-ada-002 | ||
endpoint: REPLACE_WITH_ENDPOINT | ||
version: '2023-05-15' | ||
region: REPLACE_WITH_REGION | ||
api_key: REPLACE_WITH_KEY | ||
batch_size: 16 | ||
dimensions: 1536 | ||
max_tokens: 4096 | ||
source: | ||
reliefweb: | ||
api_url: 'https://api.reliefweb.int/v1' | ||
converter_url: 'https://reliefweb.int/search/converter/json' | ||
site_url: 'https://reliefweb.int' | ||
appname: ocha-ai | ||
cache_enabled: true | ||
cache_lifetime: 600 | ||
text_extractor: | ||
mupdf: | ||
mutool: /usr/bin/mutool | ||
text_splitter: | ||
token: | ||
length: 384 | ||
overlap: 96 | ||
sentence: | ||
length: 4 | ||
overlap: 2 | ||
page: | ||
length: 1 | ||
overlap: 0 | ||
vector_store: | ||
elasticsearch: | ||
url: REPLACE_WITH_URL | ||
base_index_name: ocha_ai | ||
shards: 1 | ||
replicas: 0 | ||
nested_object_limit: 100000 | ||
indexing_batch_size: 10 | ||
topk: 5 | ||
min_similarity: 0.3 | ||
cutoff_coefficient: 0.5 |
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,19 @@ | ||
defaults: | ||
form: | ||
instructions: | ||
value: '' | ||
format: markdown_editor | ||
plugins: | ||
completion: | ||
plugin_id: aws_bedrock | ||
embedding: | ||
plugin_id: aws_bedrock | ||
source: | ||
plugin_id: reliefweb | ||
text_extractor: | ||
application/pdf: | ||
plugin_id: mupdf | ||
text_splitter: | ||
plugin_id: token | ||
vector_store: | ||
plugin_id: elasticsearch |
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
uuid: d32877fc-1a02-4626-902d-577e71464493 | ||
langcode: en | ||
status: true | ||
dependencies: { } | ||
dependencies: | ||
module: | ||
- ocha_ai_chat | ||
id: beta_tester | ||
label: 'Beta tester' | ||
weight: 7 | ||
is_admin: null | ||
permissions: { } | ||
permissions: | ||
- 'access ocha ai chat' |
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
52 changes: 52 additions & 0 deletions
52
html/themes/custom/common_design_subtheme/templates/layout/page--ai--chat--popup.html.twig
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,52 @@ | ||
{# | ||
/** | ||
* @file | ||
* Theme override to display a single page. | ||
* | ||
* The doctype, html, head and body tags are not in this template. Instead they | ||
* can be found in the html.html.twig template in this directory. | ||
* | ||
* Available variables: | ||
* | ||
* General utility variables: | ||
* - base_path: The base URL path of the Drupal installation. Will usually be | ||
* "/" unless you have installed Drupal in a sub-directory. | ||
* - is_front: A flag indicating if the current page is the front page. | ||
* - logged_in: A flag indicating if the user is registered and signed in. | ||
* - is_admin: A flag indicating if the user has permission to access | ||
* administration pages. | ||
* | ||
* Site identity: | ||
* - front_page: The URL of the front page. Use this instead of base_path when | ||
* linking to the front page. This includes the language domain or prefix. | ||
* | ||
* Page content (in order of occurrence in the default page.html.twig): | ||
* - node: Fully loaded node, if there is an automatically-loaded node | ||
* associated with the page and the node ID is the second argument in the | ||
* page's path (e.g. node/12345 and node/12345/revisions, but not | ||
* comment/reply/12345). | ||
* | ||
* Regions: | ||
* - page.header: Items for the header region. | ||
* - page.primary_menu: Items for the primary menu region. | ||
* - page.secondary_menu: Items for the secondary menu region. | ||
* - page.highlighted: Items for the highlighted content region. | ||
* - page.help: Dynamic help text, mostly for admin pages. | ||
* - page.content: The main content of the current page. | ||
* - page.sidebar_first: Items for the first sidebar. | ||
* - page.sidebar_second: Items for the second sidebar. | ||
* - page.footer: Items for the footer region. | ||
* - page.breadcrumb: Items for the breadcrumb region. | ||
* | ||
* @see template_preprocess_page() | ||
* @see html.html.twig | ||
*/ | ||
#} | ||
<div class="ocha-ai-chat"> | ||
{# Link to skip to the main content is in html.html.twig #} | ||
<main aria-label="{{ 'Chat'|t }}" id="main-content"> | ||
<div class="ocha-ai-chat__content"> | ||
{{ page.content }} | ||
</div> | ||
</main> | ||
</div> |