Skip to content

I'm executing it according to the examples provided in the document, but it will report an error. #928

Closed as not planned
@gxin0426

Description

@gxin0426

--- Executing Fetch Node ---
--- (Fetching HTML from: https://scrapegraphai.com/) ---
--- Executing ParseNode Node ---
--- Executing GenerateAnswer Node ---
Error during chain execution: 'Input to PromptTemplate is missing variables {'"content"'}. Expected: ['"content"', 'question'] Received: ['question']\nNote: if you intended {"content"} to be part of the string and not a variable, please escape it with double curly braces like: '{{"content"}}'.\nFor troubleshooting, visit: https://python.langchain.com/docs/troubleshooting/errors/INVALID_PROMPT_INPUT '
Traceback (most recent call last):
File "/Users/xg/project/py-project/scrape/scrape2.py", line 21, in
result = smart_scraper_graph.run()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/scrapegraphai/graphs/smart_scraper_graph.py", line 296, in run
self.final_state, self.execution_info = self.graph.execute(inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/scrapegraphai/graphs/base_graph.py", line 358, in execute
return self._execute_standard(initial_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/scrapegraphai/graphs/base_graph.py", line 303, in _execute_standard
raise e
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/scrapegraphai/graphs/base_graph.py", line 276, in _execute_standard
result, node_exec_time, cb_data = self._execute_node(
^^^^^^^^^^^^^^^^^^^
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/scrapegraphai/graphs/base_graph.py", line 200, in _execute_node
result = current_node.execute(state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/scrapegraphai/nodes/generate_answer_node.py", line 178, in execute
answer = self.invoke_with_timeout(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/scrapegraphai/nodes/generate_answer_node.py", line 79, in invoke_with_timeout
response = chain.invoke(inputs)
^^^^^^^^^^^^^^^^^^^^
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 3022, in invoke
input = context.run(step.invoke, input, config, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/langchain_core/prompts/base.py", line 210, in invoke
return self._call_with_config(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 1922, in _call_with_config
context.run(
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/langchain_core/runnables/config.py", line 396, in call_func_with_variable_args
return func(input, **kwargs) # type: ignore[call-arg]
^^^^^^^^^^^^^^^^^^^^^
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/langchain_core/prompts/base.py", line 184, in _format_prompt_with_error_handling
_inner_input = self._validate_input(inner_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xg/project/py-project/ENTER/envs/scrape/lib/python3.11/site-packages/langchain_core/prompts/base.py", line 178, in _validate_input
raise KeyError(
KeyError: 'Input to PromptTemplate is missing variables {'"content"'}. Expected: ['"content"', 'question'] Received: ['question']\nNote: if you intended {"content"} to be part of the string and not a variable, please escape it with double curly braces like: '{{"content"}}'.\nFor troubleshooting, visit: https://python.langchain.com/docs/troubleshooting/errors/INVALID_PROMPT_INPUT '

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions