From 7d5b410602e6c6de2f472efb2979b5824d649c38 Mon Sep 17 00:00:00 2001 From: Julien Salinas Date: Wed, 29 Nov 2023 10:17:21 +0100 Subject: [PATCH] Fix bug in question answering and semantic search: - add "params" as a function parameter --- index.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index cee67f4..04dc3e9 100644 --- a/index.js +++ b/index.js @@ -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 @@ -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 diff --git a/package.json b/package.json index a49c472..a12854f 100644 --- a/package.json +++ b/package.json @@ -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": {