mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-17 06:58:09 +01:00
Auto-start workflow if one isn't found to get rid of startup error
This commit is contained in:
12
api/main.py
12
api/main.py
@@ -113,10 +113,14 @@ async def get_conversation_history():
|
|||||||
status_code=404, detail="Workflow worker unavailable or not found."
|
status_code=404, detail="Workflow worker unavailable or not found."
|
||||||
)
|
)
|
||||||
|
|
||||||
# For other Temporal errors, return a 500
|
if "workflow not found" in error_message:
|
||||||
raise HTTPException(
|
await start_workflow()
|
||||||
status_code=500, detail="Internal server error while querying workflow."
|
return []
|
||||||
)
|
else:
|
||||||
|
# For other Temporal errors, return a 500
|
||||||
|
raise HTTPException(
|
||||||
|
status_code=500, detail="Internal server error while querying workflow."
|
||||||
|
)
|
||||||
|
|
||||||
@app.get("/agent-goal")
|
@app.get("/agent-goal")
|
||||||
async def get_agent_goal():
|
async def get_agent_goal():
|
||||||
|
|||||||
2
todo.md
2
todo.md
@@ -34,3 +34,5 @@
|
|||||||
|
|
||||||
[ ] non-retry the api key error - "Invalid API Key provided: sk_test_**J..." and "AuthenticationError"
|
[ ] non-retry the api key error - "Invalid API Key provided: sk_test_**J..." and "AuthenticationError"
|
||||||
[ ] make it so you can yeet yourself out of a goal and pick a new one
|
[ ] make it so you can yeet yourself out of a goal and pick a new one
|
||||||
|
|
||||||
|
[ ] add visual feedback when workflow starting
|
||||||
Reference in New Issue
Block a user