I’m currently querying an index I created. When I query via the web UI the summary is generated as expected (yay!). However, I’m trying to query via the Python Rest API and the summary is not returned. I see the responseSet returned but the summary itself is not returned. For reference, this is the code example that I am using to query my index:
Please let me know if you would be able to assist me with the above.
I do not work for Vectara so someone can probably give you a better answer but I believe you have to include something to this effect to return the summary:
Awesome. Thanks Ed. I did try adding the Summary section earlier in the day. I end up getting an error:
'summary': [{'text': 'The returned results did not contain sufficient information to be summarized into a useful answer for your query. Please try a different search or restate your query differently.', 'lang': 'eng', 'prompt': '', 'status': [], 'futureId': 2}], 'futureId': 1}]
I don’t get this error when I query from the UI. So I find it odd. Thanks for replying! (Hopefully, you have useful insights for the new error as well haha).
Does it respond with all of the results? This response would suggest there is nothing for it to use as a summary. Obviously when you use the UI, it handles all the retrieval and then summarising of the documents so it would suggest that your python script is not getting any results back OR the results it is getting back are not relevant to your query which could be the case if you are asking something super specific (or for me sometimes super broad).
If you can share the full response you get I might be able to assist.
Personally, I like to test these things first in Postman before moving to writing python scripts as it is much easier to solve issues fast so that might be worth trying!
Yep responds with all the results. I’m using the same query in both cases. I’m using a curl command and still have the same issue haha. I think I must be missing something the query parameters.
Also, the results are in the same order and with the same similarity scores as those in the UI which confuses me further.
I just tried it in Postman and my first question came back with the same response you got about there not being enough info to make a summary, but I asked it a very specific question and it got a result so I guess it is potentially an issue with the API (but I think you already had worked that out!), sorry I couldn’t be more help!
Thanks! This was the solution to the problem. All results are now essentially identical to the web UI! Do you know if there is any way to know the exact query parameters that are used when querying from the UI?