File size: 691 Bytes
39b2718
 
 
 
 
 
 
 
 
4f78a88
39b2718
 
 
 
 
 
4f78a88
39b2718
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
FastAPI application for the customer support system.
"""
from fastapi import FastAPI, Request

# Import the customer support workflow
from Customer_Support.workflow import run_customer_support

# Create FastAPI application
app = FastAPI(
    title="Customer Support API",
    description="An API for processing customer support queries using LangGraph and Gemini AI",
    version="1.0.0"
)


@app.post("/process")
async def process_query(request: Request):
    """Process a customer support query"""
    data = await request.json()
    query = data.get("query")
    if not query:
        return {"error": "Query is required"}

    result = run_customer_support(query)
    return result