I'm executing it according to the examples provided in the document, but it will report an error.
--- 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
Hey @gxin0426! How can I assist you today? I'm here to help you with bug fixes, answer questions, and guide you on contributing.
To resolve the "INVALID_PROMPT_INPUT" error in LangChain when executing the smart_scraper_graph, ensure that all required variables are provided to the PromptTemplate. Specifically, the error indicates that the 'content' variable is missing. You should verify that the PromptTemplate is correctly receiving both the 'content' and 'question' variables.
Here are some steps you can take:
-
Check the PromptTemplate: Ensure that the
PromptTemplateis correctly defined and that both 'content' and 'question' are included in the inputs. -
Provide All Required Variables: Make sure that when you are executing the graph, both 'content' and 'question' are being passed to the
PromptTemplate. -
Escape Curly Braces: If 'content' is intended to be a part of the string and not a variable, escape it with double curly braces like
{{"content"}}. -
Inspect Inputs: Use logging or debugging tools to inspect the inputs being passed to the
PromptTemplateto ensure they are correct.
If the error persists, consider downgrading the scrapegraphai library to version 1.37.0, as this has been a solution for similar issues in the past:
pip install scrapegraphai==1.37.0
This approach should help you resolve the error and ensure that the PromptTemplate receives all necessary inputs [1].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
After creating a virtual environment and running in version 1.37.0, following error pops up:
File "...Scrapegraph-ai/camilo/lib/python3.11/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 61] Connection refused
Thank you
Please update to the new version
Hi, @gxin0426. I'm Dosu, and I'm helping the Scrapegraph-ai team manage their backlog. I'm marking this issue as stale.
Issue Summary:
- You reported an error with the GenerateAnswer Node due to a missing 'content' variable in the PromptTemplate.
- I suggested ensuring all required variables are provided and recommended downgrading to version 1.37.0.
- After downgrading, cecabrera encountered a connection error.
- VinciGit00 suggested updating to a newer version as a potential solution.
Next Steps:
- Please confirm if this issue is still relevant with the latest version of the Scrapegraph-ai repository by commenting here.
- If there is no further activity, this issue will be automatically closed in 7 days.
Thank you for your understanding and contribution!