added flight assesment agent withj third party free api

This commit is contained in:
OwusuBlessing
2025-08-01 19:33:30 +01:00
parent 41248b1d78
commit d391e966cb
22 changed files with 1323 additions and 169 deletions
Binary file not shown.
Binary file not shown.
+2 -1
View File
@@ -16,5 +16,6 @@ class ChatRequest(BaseModel):
class SurveyRequest(BaseModel):
job_id: str
+6 -2
View File
@@ -1,8 +1,12 @@
# api/models/responses.py
from pydantic import BaseModel
from typing import Dict
class ChatResponse(BaseModel):
status: str
message: str
class SurveyAgentResponse(BaseModel):
status: str
result: Dict
Binary file not shown.
+27 -4
View File
@@ -1,17 +1,19 @@
# api/routes/chat_ai.py
from fastapi import APIRouter, Depends, HTTPException
from api.models.requests import ChatRequest, ChatMessage
from api.models.responses import ChatResponse
from api.models.requests import ChatRequest, ChatMessage,SurveyRequest
from api.models.responses import ChatResponse,SurveyAgentResponse
from api.dependencies.auth import get_api_key
from src.llm.orchestrator import DroneBot, Message # Adjust import as needed
from src.llm.agent.flight_assesment import DroneAssessmentAgent
import json
router = APIRouter(
prefix="/chat-ai",
prefix="/chat",
tags=["chat"]
)
@router.post("", response_model=ChatResponse)
@router.post("/booking-assistant", response_model=ChatResponse)
async def chat_ai(
request: ChatRequest,
_: str = Depends(get_api_key)
@@ -36,3 +38,24 @@ async def chat_ai(
status_code=500,
detail=str(e)
)
@router.post("/analyse-survey", response_model=SurveyAgentResponse)
async def run_survey_agent(
request: SurveyRequest,
_: str = Depends(get_api_key)
):
"""Chat with DroneBot using query and history."""
try:
from test2 import booking_form_input
agent = DroneAssessmentAgent()
result = await agent.run(booking_form_input)
return SurveyAgentResponse(
status="success",
result=result
)
except Exception as e:
raise HTTPException(
status_code=500,
detail=str(e)
)