Se correige el error de la importación de la API del modulo server pero surge un nuevo error.
This commit is contained in:
		| @@ -29,7 +29,7 @@ from dotenv import load_dotenv | |||||||
|  |  | ||||||
| load_dotenv() | load_dotenv() | ||||||
|  |  | ||||||
| app = FastAPI() | fa_app = FastAPI() | ||||||
| llm = ChatOpenAI( | llm = ChatOpenAI( | ||||||
|     model="gpt-4o-mini", |     model="gpt-4o-mini", | ||||||
|     temperature=0.9 |     temperature=0.9 | ||||||
| @@ -119,20 +119,20 @@ graph = create_react_agent( | |||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| @app.get("/") | @fa_app.get("/") | ||||||
| async def redirect_root_to_docs(): | async def redirect_root_to_docs(): | ||||||
|     return RedirectResponse("/docs") |     return RedirectResponse("/docs") | ||||||
|  |  | ||||||
|  |  | ||||||
| # # Edit this to add the chain you want to add | # # Edit this to add the chain you want to add | ||||||
| add_routes( | add_routes( | ||||||
|     app, |     fa_app, | ||||||
|     llm, |     llm, | ||||||
|     path="/openai" |     path="/openai" | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| @app.post("/process_text") | @fa_app.post("/process_text") | ||||||
| async def process_text(request: Request): | async def process_text(request: Request): | ||||||
|     data = await request.json() |     data = await request.json() | ||||||
|     user_input = data.get("text") |     user_input = data.get("text") | ||||||
| @@ -157,4 +157,4 @@ async def process_text(request: Request): | |||||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||||
|     import uvicorn |     import uvicorn | ||||||
|  |  | ||||||
|     uvicorn.run(app, host="0.0.0.0", port=8000) |     uvicorn.run(fa_app, host="0.0.0.0", port=8000) | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| #!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||||
| from fastapi.testclient import TestClient | 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): | def test_process_text(mocker): | ||||||
|   | |||||||
| @@ -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"} | {"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"} | ||||||
		Reference in New Issue
	
	Block a user