opea-project / GenAIExamples

Generative AI Examples is a collection of GenAI examples such as ChatQnA, Copilot, which illustrate the pipeline capabilities of the Open Platform for Enterprise AI (OPEA) project.
https://opea.dev
Apache License 2.0
177 stars 86 forks source link

Retrievar microservice CURL command in ChatQnA example Readme for Xeon does not work. #155

Closed mandalrajiv closed 1 month ago

mandalrajiv commented 1 month ago

In the Readme.md at https://github.com/opea-project/GenAIExamples/tree/main/ChatQnA/microservice/xeon, there is a Retriever Microservice curl command, the command given is: curl http://${host_ip}:7000/v1/retrieval\ -X POST \ -d '{"text":"What is the revenue of Nike in 2023?","embedding":${your_embedding}}' \ -H 'Content-Type: application/json'

The above command does not work, gives an error `{"detail":[{"type":"json_invalid","loc":["body",59],"msg":"JSON decode error","input":{},"ctx":{"error":"Expecting value"}}]}'

The correct format of the command should be as below. curl http://${host_ip}:7000/v1/retrieval \ -X POST \ -d '{"text":"What is the revenue of Nike in 2023?","embedding":"'"${your_embedding}"'"}' \ -H 'Content-Type: application/json'

kding1 commented 1 month ago

You are expected to replace the ${your_embedding} with the actual value printed from the above code snippet in the readme. Basically it's 768 dimension 1-d array.