semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Python: TypeError: Plan.__init__() got an unexpected keyword argument 'prompt'

Open taoari opened this issue 3 years ago • 5 comments

Describe the bug A clear and concise description of what the bug is.

When run 05-using-the-planner.ipynb, got error: TypeError: Plan.init() got an unexpected keyword argument 'prompt'.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://github.com/microsoft/semantic-kernel/tree/main/samples/notebooks/python'
  2. jupyter notebook
  3. run 05-using-the-planner.ipynb
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Screenshot 2023-07-18 at 1 44 15 PM

Platform

  • OS: [Mac]
  • IDE: [e.g. Jupyter Notebook]
  • Language: [Python]
  • Source: [e.g. main branch of repository]

Additional context Add any other context about the problem here.

taoari avatar Jul 18 '23 20:07 taoari

I got the same issue and managed to fix it by changing the last line of the function create_plan_async within basic_planner.py

image

febriy avatar Jul 20 '23 07:07 febriy

Confirmed I experiencing this. How did you change it? I see can print the generated plan fine in the create_async_plan, but not sure how to create the plan object.

nolanhurlburt avatar Jul 23 '23 17:07 nolanhurlburt

Fixed by replacing plan.py with old plan.py:

from typing import Any

class Plan: # The goal that wants to be achieved goal: str

# The prompt to be used to generate the plan
prompt: str

# The generated plan that consists of a list of steps to complete the goal
generated_plan: Any

def __init__(self, goal, prompt, plan):
    self.goal = goal
    self.prompt = prompt
    self.generated_plan = plan

nolanhurlburt avatar Jul 23 '23 18:07 nolanhurlburt

Yeah this notebook needs to be updated with the latest from the plan object model that got landed. #1907

We'll also have new planners coming in soon! #1770 #1916

alexchaomander avatar Jul 25 '23 13:07 alexchaomander

Closed because we will be deprecating the basic planner

madsbolaris avatar Nov 28 '23 04:11 madsbolaris