edgedb-python
edgedb-python copied to clipboard
Improve error messages in gel.ai
Currently, the Python RAG client handles errors like this:
class AsyncRAGClient(BaseRAGClient):
client: httpx.AsyncClient
async def query_rag():
resp = await self.client.post()
resp.raise_for_status()
As a result, the error messages are not very specific, like in this this Discord thread:
httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://localhost:10702/branch/main/ext/ai/rag'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
The server actually seems to put useful information into errors, so if we just logged that before raising for status, that'd be an improvement.