Skip to content

Planner Occasional Issue with Workflow Generation #291

@paridhi-parajuli

Description

@paridhi-parajuli

Describe the bug

Sometimes chatting with Planner gives:

{
  "detail": "Chat operation failed: No workflow plan available. Continue the conversation first."
}

Might be coming from :

if not self.workflow_plan:
    raise ValueError("No workflow plan available. Continue the conversation first.")

because the planner reached a state where response.ready_to_generate = True,
even though the LLM did NOT return a workflow_plan

Steps to reproduce the behavior

Note: Its hard to reproduce this issue

  1. Go to http://akdbac-apise-ulverh4gaexc-980808868.us-east-1.elb.amazonaws.com/api/v1/docs
  2. Create a new chat
curl -X 'POST' \
  'http://akdbac-apise-ulverh4gaexc-980808868.us-east-1.elb.amazonaws.com/api/v1/chats/' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NmY5ZGRjOC01OTJjLTRmNzItYWIyYS03YmE5MDIzMTg2YjAiLCJhdWQiOlsiZmFzdGFwaS11c2VyczphdXRoIl0sImV4cCI6MTc2MDA1OTQ4OH0.t1Lj_79FL6rhY6zTTojiVgsLQ-VWinnPeg6mRNXWi8Y' \
  -H 'Content-Type: application/json' \
  -d '{
  "initial_request": "social impacts of covid 19 in nepal"
}'
  1. To continue back and forth with the planner, send a request with the chat_id and the response to recent planner message as user_message:
curl -X 'POST' \
  'http://akdbac-apise-ulverh4gaexc-980808868.us-east-1.elb.amazonaws.com/api/v1/chats/' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NmY5ZGRjOC01OTJjLTRmNzItYWIyYS03YmE5MDIzMTg2YjAiLCJhdWQiOlsiZmFzdGFwaS11c2VyczphdXRoIl0sImV4cCI6MTc2MDA1OTQ4OH0.t1Lj_79FL6rhY6zTTojiVgsLQ-VWinnPeg6mRNXWi8Y' \
  -H 'Content-Type: application/json' \
  -d '{
  "initial_request": "social impacts of covid 19 in nepal",
 "chat_id": "0477cd2b-3248-457b-8413-b7060add28d4",
"user_message": "mental health"

}'

Expected Behavior

Chat with planner should be smooth and should eventually generate a workflow.

Relevant log output

{
  "message": "I will create a workflow to explore the social impacts of COVID-19 in Nepal. To refine this, could you specify if you're looking for academic papers, reports, or specific types of social impacts (e.g., mental health, economic effects)?",
  "ready_to_generate": false,
  "conversation_history": [
    {
      "role": "user",
      "content": "social impacts of covid 19 in nepal"
    },
    {
      "role": "assistant",
      "content": "I will create a workflow to explore the social impacts of COVID-19 in Nepal. To refine this, could you specify if you're looking for academic papers, reports, or specific types of social impacts (e.g., mental health, economic effects)?"
    }
  ],
  "workflow_config": null,
  "chat_id": "788d9826-962b-488c-b24f-2bbf6c20bd93",
  "user_id": "66f9ddc8-592c-4f72-ab2a-7ba9023186b0"
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions