Skip to content

Commit

Permalink
Documentation: Update planning-tasks.md (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
taziksh authored Dec 4, 2023
1 parent 7a9f57b commit 8d3c255
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/examples/planning-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down Expand Up @@ -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,
Expand All @@ -108,27 +108,27 @@ 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"

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': <QueryType.SINGLE_QUESTION: 'SINGLE'>,
'question': "Identify Jason's home country"},
{'dependancies': [],
{'dependencies': [],
'id': 2,
'node_type': <QueryType.SINGLE_QUESTION: 'SINGLE'>,
'question': 'Find the population of Canada'},
{'dependancies': [1],
{'dependencies': [1],
'id': 3,
'node_type': <QueryType.SINGLE_QUESTION: 'SINGLE'>,
'question': "Find the population of Jason's home country"},
{'dependancies': [2, 3],
{'dependencies': [2, 3],
'id': 4,
'node_type': <QueryType.SINGLE_QUESTION: 'SINGLE'>,
'question': 'Calculate the difference in populations between Canada and Jason's home country"}]}
Expand Down

0 comments on commit 8d3c255

Please sign in to comment.