Skip to content

Commit

Permalink
Fix bug in question answering and semantic search:
Browse files Browse the repository at this point in the history
- add "params" as a function parameter
  • Loading branch information
juliensalinas committed Nov 29, 2023
1 parent 16bc89f commit 7d5b410
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class Client {
return axios.post(this.rootURL + '/' + 'paraphrasing', payload, { headers: this.headers })
}

question(question, context = null) {
question(params) {
var question = params.question
var context = params.context ?? null

Expand All @@ -252,7 +252,7 @@ class Client {
return axios.post(this.rootURL + '/' + 'question', payload, { headers: this.headers })
}

semanticSearch() {
semanticSearch(params) {
var text = params.text
var numResults = params.numResults ?? null

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nlpcloud",
"version": "2.0.0",
"version": "2.0.1",
"description": "NLP Cloud serves high performance pre-trained or custom models for NER, sentiment-analysis, classification, summarization, paraphrasing, text generation, image generation, code generation, question answering, automatic speech recognition, machine translation, language detection, semantic search, semantic similarity, tokenization, POS tagging, speech synthesis, embeddings, and dependency parsing. It is ready for production, served through a REST API.\n\nThis is the Node.js client for the NLP Cloud API.\n\nMore details here: https://nlpcloud.io\n\nDocumentation: https://docs.nlpcloud.io",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 7d5b410

Please sign in to comment.