-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an HTTPException for when the engine fails in query.py #33
Comments
🔎 Searching
I'm searching for relevant snippets in your repository. I found the following snippets in your repository. I will now analyze these snippets and come up with a plan. Relevant Code Snippets Foundllamaindex-retrieval-api/.gitignore Lines 15 to 30 in 9cd5c37
I have created the following workflow as a basis for the discussion and coding will be derived.
|
{"tag": "INITIAL_PLANNING", "workflow": {"tasks": [{"step": "Step 1", "name": "Import HTTPException", "action": "modify", "file": "routers/retrievers/query.py", "start_line": 1, "end_line": 1, "instructions": "At the top of the file, import HTTPException from fastapi. The import statement should look like this: 'from fastapi import HTTPException'.", "async_score": 2, "assigned_agent": "AI or User", "dependencies": []}, {"step": "Step 2", "name": "Add HTTPException", "action": "modify", "file": "routers/retrievers/query.py", "start_line": 10, "end_line": 20, "instructions": "Identify the function where the engine is called. In the try-except block where the engine is called, add an HTTPException in the except block. The HTTPException should have a status code of 500 and a detail message indicating that the engine has failed. The code should look like this: 'raise HTTPException(status_code=500, detail="Engine has failed")'.", "async_score": 8, "assigned_agent": "AI or User", "dependencies": ["Step 1"]}, {"step": "Step 3", "name": "Test the HTTPException", "action": "create", "file": "tests/test_query.py", "start_line": 1, "end_line": 50, "instructions": "Create a new test file to test the HTTPException. The test should call the function where the engine is called with a setup that will cause the engine to fail. The test should assert that the HTTPException is raised and that the status code and detail message are correct. Use the pytest framework for the test. The test function should look like this: 'def test_engine_failure(): ...'.", "async_score": 10, "assigned_agent": "AI or User", "dependencies": ["Step 2"]}], "snippets": []}}
|
Add an HTTPException for when the engine fails in query.py
The text was updated successfully, but these errors were encountered: