diff --git a/app/server.py b/app/server.py index 3e1a5ac..ab26865 100644 --- a/app/server.py +++ b/app/server.py @@ -29,7 +29,7 @@ from dotenv import load_dotenv load_dotenv() -app = FastAPI() +fa_app = FastAPI() llm = ChatOpenAI( model="gpt-4o-mini", temperature=0.9 @@ -119,20 +119,20 @@ graph = create_react_agent( ) -@app.get("/") +@fa_app.get("/") async def redirect_root_to_docs(): return RedirectResponse("/docs") # # Edit this to add the chain you want to add add_routes( - app, + fa_app, llm, path="/openai" ) -@app.post("/process_text") +@fa_app.post("/process_text") async def process_text(request: Request): data = await request.json() user_input = data.get("text") @@ -157,4 +157,4 @@ async def process_text(request: Request): if __name__ == "__main__": import uvicorn - uvicorn.run(app, host="0.0.0.0", port=8000) + uvicorn.run(fa_app, host="0.0.0.0", port=8000) diff --git a/app/test/test_main.py b/app/test/test_main.py index f6da7ad..01e729a 100644 --- a/app/test/test_main.py +++ b/app/test/test_main.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 from fastapi.testclient import TestClient -from ..server import app +from app.server import fa_app -client = TestClient(app) +client = TestClient(fa_app) def test_process_text(mocker): diff --git a/token.json b/token.json index c7f243b..afaac64 100644 --- a/token.json +++ b/token.json @@ -1 +1 @@ -{"token": "ya29.a0AeDClZDWOmi-pisR05swqcNfWKrk00_kCCuAKb2p32nt21MTcb7hkKHvq0kdlZDVy0XmSQ4jqaZoctWRpNnUgO3Fh3rH7Vd2XHMD-Fkt6wfpwwoM5F_LQi0MCWpbeIzbcc8udg2iGgZWAybdLgdv6qWk1f9torD86yTP1TKxaCgYKAf4SARASFQHGX2MibK9x4kdIcpCGg5XnV9xu3Q0175", "refresh_token": "1//05Hc2PufwLWe2CgYIARAAGAUSNwF-L9IrU2s--kkp6Q2fCzN5uf2vLBvEcYHyJOFZjCQAUpBSC0FWiCUg9wgm8cCMccEGe4Q7MPg", "token_uri": "https://oauth2.googleapis.com/token", "client_id": "19011937557-bi5nh4afvg4tuqr87v6dp55qj9a9o1h2.apps.googleusercontent.com", "client_secret": "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", "scopes": ["https://mail.google.com/"], "universe_domain": "googleapis.com", "account": "", "expiry": "2024-11-02T23:43:17.823902Z"} \ No newline at end of file +{"token": "ya29.a0AeDClZCdMN1pUVQq1VZ-JAmvsbbFB4DrG0quqUv_872wH26j4FzaqAjWAcEzMDuOYr-3IEe9iMHq7NASw9YxhFDbr55jRPQulkJNo2xYomFZtUyfFfRMkA61b-A6HRZKY29cAY4p7yqOfKlY83Vs38fwkDdrNRPGsIHOGP-C-QaCgYKAV8SARASFQHGX2MivlXIMkOipbeCpzWZtT90Ow0177", "refresh_token": "1//05Hc2PufwLWe2CgYIARAAGAUSNwF-L9IrU2s--kkp6Q2fCzN5uf2vLBvEcYHyJOFZjCQAUpBSC0FWiCUg9wgm8cCMccEGe4Q7MPg", "token_uri": "https://oauth2.googleapis.com/token", "client_id": "19011937557-bi5nh4afvg4tuqr87v6dp55qj9a9o1h2.apps.googleusercontent.com", "client_secret": "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", "scopes": ["https://mail.google.com/"], "universe_domain": "googleapis.com", "account": "", "expiry": "2024-11-07T16:31:54.151130Z"} \ No newline at end of file