Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
fix: trying to get policies back in
Browse files Browse the repository at this point in the history
(why were they not in the context???)
  • Loading branch information
thomasrosen committed Jul 24, 2023
1 parent f0015a6 commit 01bdcda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/bots.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Welt
},
policy: {
title: 'Volt Policy Chat Bot',
context_sources: ['facts','policy'], // facts / policy
context_sources: ['policy'], // facts / policy
accepted_categories: 'Policy|Challenges|Chatbot|Programmierung|Abkürzung|Glossar',
options: {
temperature: 1,
Expand Down
7 changes: 4 additions & 3 deletions backend/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ async function get_matching_policies(text) {
frequency_penalty: 0.1,
},
only_context: true,
return_urls: true,
}

// use fetch to get the response
Expand Down Expand Up @@ -259,13 +260,13 @@ async function get_system_setup(options, text) {
}

let found_facts = ''
if (context_sources.includes('policy')) {
found_facts += await get_matching_policies(text)
}
if (context_sources.includes('facts')) {
const filtered_facts = filter_fact_by_bot(facts, bot)
found_facts += await get_matching_facts(filtered_facts, text)
}
if (context_sources.includes('policy')) {
found_facts += await get_matching_policies(text)
}

const max_amount_of_letters = 4000 // otherwise loading the chat would take too long
found_facts = found_facts.slice(0, max_amount_of_letters)
Expand Down

0 comments on commit 01bdcda

Please sign in to comment.