From 8d3c255240f85bbdc9271710c8b8fc56ee8c856d Mon Sep 17 00:00:00 2001 From: Tazik Shahjahan <35576188+taziksh@users.noreply.github.com> Date: Mon, 4 Dec 2023 11:55:28 -0800 Subject: [PATCH] Documentation: Update planning-tasks.md (#250) --- docs/examples/planning-tasks.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/examples/planning-tasks.md b/docs/examples/planning-tasks.md index 1192566..18716d6 100644 --- a/docs/examples/planning-tasks.md +++ b/docs/examples/planning-tasks.md @@ -41,7 +41,7 @@ class Query(BaseModel): ..., description="Question asked using a question answering system", ) - dependancies: List[int] = Field( + dependencies: List[int] = Field( default_factory=list, description="List of sub questions that need to be answered before asking this question", ) @@ -94,7 +94,7 @@ def query_planner(question: str) -> QueryPlan: }, ] - QueryPlan = client.chat.completions.create( + root = client.chat.completions.create( model=PLANNING_MODEL, temperature=0, response_model=QueryPlan, @@ -108,7 +108,7 @@ def query_planner(question: str) -> QueryPlan: plan = query_planner( "What is the difference in populations of Canada and the Jason's home country?" ) -plan.dict() +plan.model_dump() ``` !!! warning "No RAG" @@ -116,19 +116,19 @@ plan.dict() While we build the query plan in this example, we do not propose a method to actually answer the question. You can implement your own answer function that perhaps makes a retrival and calls openai for retrival augmented generation. That step would also make use of function calls but goes beyond the scope of this example. ```python -{'query_graph': [{'dependancies': [], +{'query_graph': [{'dependencies': [], 'id': 1, 'node_type': , 'question': "Identify Jason's home country"}, - {'dependancies': [], + {'dependencies': [], 'id': 2, 'node_type': , 'question': 'Find the population of Canada'}, - {'dependancies': [1], + {'dependencies': [1], 'id': 3, 'node_type': , 'question': "Find the population of Jason's home country"}, - {'dependancies': [2, 3], + {'dependencies': [2, 3], 'id': 4, 'node_type': , 'question': 'Calculate the difference in populations between Canada and Jason's home country"}]}