Spaces:
Running
Running
TahaFawzyElshrif commited on
Commit ·
df2311d
1
Parent(s): 5df2fe2
solved bug
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import os
|
|
| 5 |
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
|
| 6 |
from Server import get_response
|
| 7 |
from pydantic import BaseModel
|
|
|
|
| 8 |
|
| 9 |
# Create app instance
|
| 10 |
app = FastAPI()
|
|
@@ -24,7 +25,12 @@ def read_root():
|
|
| 24 |
|
| 25 |
@app.post("/call/")
|
| 26 |
def call(request: RequestModel):
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
return {"answer": answer}
|
| 30 |
|
|
|
|
| 5 |
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
|
| 6 |
from Server import get_response
|
| 7 |
from pydantic import BaseModel
|
| 8 |
+
from agent.agent_graph.StateTasks import ProblemState
|
| 9 |
|
| 10 |
# Create app instance
|
| 11 |
app = FastAPI()
|
|
|
|
| 25 |
|
| 26 |
@app.post("/call/")
|
| 27 |
def call(request: RequestModel):
|
| 28 |
+
state: ProblemState = {
|
| 29 |
+
"question": request.prompt,
|
| 30 |
+
"memory": request.memory
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
answer = get_response(request.prompt, request.memory,request.ht_token,state,request.user_email,request.user_name)
|
| 34 |
|
| 35 |
return {"answer": answer}
|
| 36 |
|