Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

name 'sql_pull_data' is not defined #452

Open
STEARGAZER opened this issue Dec 25, 2024 · 4 comments
Open

name 'sql_pull_data' is not defined #452

STEARGAZER opened this issue Dec 25, 2024 · 4 comments

Comments

@STEARGAZER
Copy link

Environment Information :
OS: Windows
Python Version: 3.11.11
LLM being used: gpt-4o (also tried qwen-max,qwen2.5:14b, encountered the same problem)
Additional context

(company) PS E:\PyFile\TaskWeaver\playground\UI> chainlit run app.py
If UI is not started, please go to the folder playground/UI and run chainlit run app.py to start the UI
2024-12-25 14:40:00 - Your app is available at http://localhost:8000
2024-12-25 14:40:02 - Translated markdown file for zh-CN not found. Defaulting to chainlit.md.
2024-12-25 14:40:03 - Session 20241225-064003-d439d3cf is initialized
2024-12-25 14:40:03 - CodeGenerator initialized successfully
2024-12-25 14:40:03 - CodeInterpreter initialized successfully.
2024-12-25 14:40:03 - Planner initialized successfully
Starting new session
2024-12-25 14:40:05 - Example loaded successfully for Planner, there are 2 examples with filter []
2024-12-25 14:40:08 - HTTP Request: POST https://xiaoai.plus/v1/chat/completions "HTTP/1.1 200 OK"
2024-12-25 14:40:12 - LLM output: {"response": {"init_plan": "1. Pull the data from the time_series table in the database and show its schema.", "plan": "1. Pull the data from the time
_series table in the database and show its schema.", "current_plan_step": "1. Pull the data from the time_series table in the database and show its schema.", "send_to": "CodeInterpreter", "message": "Please pull the data from the time_series table in the database and show its schema."}}
2024-12-25 14:40:12 - Planner talk to CodeInterpreter: Please pull the data from the time_series table in the database and show its schema.
2024-12-25 14:40:12 - Example loaded successfully for CodeInterpreter, there are 2 examples with filter []
2024-12-25 14:40:14 - HTTP Request: POST https://xiaoai.plus/v1/chat/completions "HTTP/1.1 200 OK"
2024-12-25 14:40:17 - LLM output: {"response": {"thought": "The request is to pull data from the time_series table using the sql_pull_data function and show its schema. The program sho
uld also handle displaying the schema using pandas functions.", "reply_type": "python", "reply_content": "df, description = sql_pull_data("pull data from time_series table")\nschema = df.dtypes\nschema"}}
2024-12-25 14:40:17 - Code to be verified: df, description = sql_pull_data("pull data from time_series table")
schema = df.dtypes
schema
2024-12-25 14:40:17 - Code to be executed: df, description = sql_pull_data("pull data from time_series table")
schema = df.dtypes
schema
2024-12-25 14:40:27 - Local image sha256:93bb50b8eed94f11453025d8b10fc53231c6142c57cd8f871dd9f8b14769ac96 does not match registry image sha256:19eed230dfac33c041a1c185c61756b6fb7c6f537e2ce1155bb578e40cbe737e.
2024-12-25 14:40:27 - Pulling image from docker.io.
2024-12-25 14:40:30 - Environment local is created.
2024-12-25 14:40:34 - Container is running and connection file is ready.
Plugin sql_pull_data failed to load: Plugin sql_pull_data failed to register: failed to load plugin sql_pull_data No module named 'langchain'
2024-12-25 14:40:36 - CodeInterpreter talk to CodeInterpreter: The following python code has been executed:

df, description = sql_pull_data("pull data from time_series table")
schema = df.dtypes
schema

The execution of the generated python code above has failed

During execution, the following messages were logged:
Traceback (most recent call last):

Cell In[1], line 1
df, description = sql_pull_data("pull data from time_series table")

NameError: name 'sql_pull_data' is not defined

@STEARGAZER
Copy link
Author

I am trying to reproduce the effect of the demo video, but this error keeps occurring. I hope to receive help

@liqul
Copy link
Contributor

liqul commented Jan 2, 2025

Image
You can see this error log from what you posted. It is because the lack of certain module.

@STEARGAZER
Copy link
Author

@liqul
I have already installed the Langchain library with version 0.3.13, but the same error still occurs
Image

@liqul
Copy link
Contributor

liqul commented Jan 3, 2025

This usually happens when you are running taskweaver in a different environment. You can check if this is the case. The error log is saying that the python in the working environment cannot find the langchain package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants