Open CarlosPSR opened 1 year ago
you can use https://webapp-url/chat
to make api calls to the backend.
Make sure you add the below values in the body
self, retrieval_mode: str = "hybrid", semantic_ranker: bool = True, semantic_captions: bool = True, top: int = 20, suggest_followup_questions: bool = False,
Hi @kishorerv93, would it be possible for you to elaborate a little more in detailed on the approach.
Hi @kishorerv93 , i tried to make a post request to https://webapp-url/chat with the below values in JSON body { "retrieval_mode": "hybrid", "semantic_ranker": true, "semantic_captions": true, "top": 20, "suggest_followup_questions": false, "use_summaries": true }, Do i miss something?I 'm getting a method not allowed error. @CarlosPSR
Here is the corrected version @mikepaplegend @jkongWPJK @CarlosPSR
POST https://app-backend-exexexex.azurewebsites.net/chat
BODY:
{ "history": [ { "user": "Tell me about Quantum Computing" } ], "approach": "rrr", "overrides": { "retrieval_mode": "hybrid", "semantic_ranker": true, "semantic_captions": true, "top": 5, "temperature": 1, "prompt_template": "example_template", "prompt_template_prefix": "example_prefix", "prompt_template_suffix": "example_suffix", "exclude_category": "example_category", "suggest_followup_questions": true } }
Headers:
{"Content-Type": "application/json"}
Can you explain what does "semantic_captions" mean? Also I don't see "retrieval_mode": "hybrid" in the code, could you mention where it is in the code? Thanks!
Hi @vrajroutu kindly help check why my api call is returning HTTP error 500
curl -v -v -X POST "https://app-backend-xxxxxxxx.azurewebsites.net/chat" \ -H "Content-Type: application/json" \ -d '{ "history": [ { "user": "Tell me about Quantum Computing" } ], "approach": "rrr", "overrides": { "retrieval_mode": "hybrid", "semantic_ranker": true, "semantic_captions": true, "top": 5, "temperature": 1, "prompt_template": "example_template", "prompt_template_prefix": "example_prefix", "prompt_template_suffix": "example_suffix", "exclude_category": "example_category", "suggest_followup_questions": true } }'
User-Agent: curl/7.88.1 Accept: / Content-Type: application/json Content-Length: 449
< HTTP/1.1 500 Internal Server Error < Content-Length: 23 < Content-Type: application/json < Date: Mon, 30 Oct 2023 14:53:25 GMT < Server: uvicorn < {"error":"'messages'"}
The best way to debug a 500 is to look at the App Service logs, specifically the default_docker logs. The README has info on doing that, both at the bottom of troubleshooting section and in FAQ about looking at logs.
Thanks Pamela, it seems like the chat route does not accept requests in the format Vraj had suggested earlier. I did get it to work with azure openai format. But how do I get it to stop giving citations?
This body payload that works is as follows
{ "messages": [ { "role": "system", "content": "XXXXXX system prompt here XXXXXXXXX" }, { "role": "user", "content": "XXXXXXXXXXXXXXXX my prompt here XXXXXXXX" } ], "temperature": 1 }
The output is perfect for my needs except that it cites sources which I don't need.
Sources: [ABC.pdf#page=1] [DEF.pdf#page=1] [GHK.pdf#page=1]
I would like the API endpoint not to output sources. Any advice in this regard would be appreciated.
If you do not want those sources, you should modify the prompt in https://github.com/Azure-Samples/azure-search-openai-demo/blob/36478266c221930257a7a4888c097ba1b58b4926/app/backend/approaches/chatreadretrieveread.py#L30 and re-deploy the backend.
And yes, we changed the request format to be a closer match to the openAI format, we are trying to standardize the request/response protocol across Chat apps.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
OS and Version?
azd version?
Versions
Mention any other details that might be useful
I recently deployed the app on Azure. However, as a newcomer to this domain, I still have some questions regarding how to interact with my chatbot from an external chat client.
I kind of understand that, in the repository, some POST request are being made to /chat or /ask endpoints, but I'm not entirely sure about the endpoint I should be using to communicate with my chatbot from an external app instead of using the provided frontend. I have gone through the documentation and explored the Azure portal, but I couldn't find the exact resource or endpoint I need to connect to.
I would greatly appreciate it if anyone could provide guidance.
Thanks in advance, Carlos