Skip to content

Commit

Permalink
fix(qna): source categories from nlu contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
slvnperron committed Sep 16, 2019
1 parent dfdc479 commit cb261eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions modules/qna/src/backend/storage.ts
Expand Up @@ -294,11 +294,9 @@ export default class Storage {
await Promise.all(ids.map(deletePromise))
}

getCategories() {
return this.categories
}

hasCategories() {
return this.categories && this.categories.length > 0
async getCategories() {
const axiosConfig = await this.getAxiosConfig()
const { data: contexts } = await axios.get(`/mod/nlu/contexts`, axiosConfig)
return _.uniq([...contexts, ...this.categories])
}
}
2 changes: 1 addition & 1 deletion modules/qna/src/config.ts
Expand Up @@ -13,7 +13,7 @@ export interface Config {
qnaMakerKnowledgebase?: string
/**
* List of categories, separated by a comma
* @default global
* @deprecated use NLU intent contexts instead, this will be removed in Botpress 13
*/
qnaCategories?: string
}

0 comments on commit cb261eb

Please sign in to comment.