Haste171 / llamaindex-retrieval-api

API to load and query documents using RAG
MIT License
15 stars 3 forks source link

Add an HTTPException for when the engine fails in query.py #29 #30

Closed Haste171 closed 5 months ago

Haste171 commented 5 months ago

Add an HTTPException for when the engine fails in query.py #29

Haste171 commented 5 months ago

{"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", "dependencies": []}, {"step": "Step 2", "name": "Add HTTPException", "action": "modify", "file": "routers/retrievers/query.py", "start_line": 10, "end_line": 20, "instructions": "Identify the section of the code where the engine is called. If the engine fails, raise an HTTPException with 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": 5, "assigned_agent": "AI", "dependencies": ["Step 1"]}, {"step": "Step 3", "name": "Write tests for HTTPException", "action": "create", "file": "tests/test_query.py", "start_line": 1, "end_line": 20, "instructions": "Create a new file in the tests directory to test the HTTPException. The tests should simulate a situation where the engine fails and check if the HTTPException is raised with the correct status code and detail message. Use the pytest framework for writing the tests. Make sure to import the necessary modules and functions, including HTTPException and the function that calls the engine from query.py.", "async_score": 8, "assigned_agent": "User", "dependencies": ["Step 2"]}], "snippets": []}}

Step 1: 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
    Dependencies: []
Step 2: Add HTTPException
    Action: modify
    File: routers/retrievers/query.py
    Start Line: 10
    End Line: 20
    Instructions: Identify the section of the code where the engine is called. If the engine fails, raise an HTTPException with 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: 5
    Assigned Agent: AI
    Dependencies: ['Step 1']
Step 3: Write tests for HTTPException
    Action: create
    File: tests/test_query.py
    Start Line: 1
    End Line: 20
    Instructions: Create a new file in the tests directory to test the HTTPException. The tests should simulate a situation where the engine fails and check if the HTTPException is raised with the correct status code and detail message. Use the pytest framework for writing the tests. Make sure to import the necessary modules and functions, including HTTPException and the function that calls the engine from query.py.
    Async Score: 8
    Assigned Agent: User
    Dependencies: ['Step 2']