Closed yangyangyangOngithub closed 1 month ago
The error you're encountering, ValueError: Could not parse dynamic plan
, indicates an issue with the format or content of the dynamic plan string used in the ChainOfTableQueryEngine
. To resolve this:
Ensure Correct Format: The dynamic plan should follow a specific format, with operations and arguments properly defined. It typically involves operation names followed by arguments, separated by specific delimiters.
Check Operation Names: Verify that the operation names in your dynamic plan match those expected by the parser. Any discrepancy in operation names can lead to parsing errors.
Dynamic Plan Completeness: Confirm that your dynamic plan string concludes with an <END>
marker to signify the end of the plan.
Compatibility Check: The version of the llama_index library you're using might not fully support Python 3.11. Consider using a Python version that is known to be compatible with llama_index version 0.10.33, or check if there's an updated version of the library that supports Python 3.11.
If after these checks the issue persists, it might be beneficial to consult the library's documentation for examples of valid dynamic plans or reach out to the library's support community for further assistance.
To continue the conversation, mention @dosu.
Bug Description
Traceback (most recent call last): File "/data/test.py", line 29, in
response = query_engine.query("Who won best Director in the 1972 Academy Awards?")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/anaconda/envs/Qwenagent/lib/python3.11/site-packages/llama_index/core/query_engine/custom.py", line 45, in query
raw_response = self.custom_query(query_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/anaconda/envs/Qwenagent/lib/python3.11/site-packages/llama_index/packs/tables/chain_of_table/base.py", line 676, in custom_query
key = dynamic_plan_chain.run(question=query_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/anaconda/envs/Qwenagent/lib/python3.11/site-packages/llama_index/core/querypipeline/query.py", line 320, in run
outputs, = self._run(
^^^^^^^^^^
File "/data/anaconda/envs/Qwenagent/lib/python3.11/site-packages/llama_index/core/query_pipeline/query.py", line 544, in _run
result_outputs, intermediates = self._run_multi(
^^^^^^^^^^^^^^^^
File "/data/anaconda/envs/Qwenagent/lib/python3.11/site-packages/llama_index/core/query_pipeline/query.py", line 717, in _run_multi
output_dict = module.run_component(module_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/anaconda/envs/Qwenagent/lib/python3.11/site-packages/llama_index/core/base/query_pipeline/query.py", line 199, in run_component
component_outputs = self._run_component(kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/anaconda/envs/Qwenagent/lib/python3.11/site-packages/llama_index/core/query_pipeline/components/function.py", line 97, in _run_component
return {self.output_key: self.fn(**kwargs)}
^^^^^^^^^^^^^^^^^
File "/data/anaconda/envs/Qwenagent/lib/python3.11/site-packages/llama_index/packs/tables/chain_of_table/base.py", line 584, in _dynamic_plan_parser
raise ValueError(f"Could not parse dynamic plan: {dynamic_plan_str}")
ValueError: Could not parse dynamic plan:
Version
0.10.33
Steps to Reproduce
from llama_index.packs.tables.chain_of_table.base import ChainOfTableQueryEngine, serialize_table import pandas as pd from llama_index.llms.openai_like import OpenAILike
df = pd.read_csv("/data/WikiTableQuestions/csv/200-csv/42.csv")
llm = OpenAILike(model="Qwen", api_base="http://127.0.0.1:8000/v1", api_key="EMPTY")
from llama_index.packs.tables.chain_of_table.base import ChainOfTablePack
query_engine = ChainOfTableQueryEngine(df, llm=llm, verbose=True) response = query_engine.query("Who won best Director in the 1972 Academy Awards?")
Relevant Logs/Tracbacks
No response