TaskWeaver icon indicating copy to clipboard operation
TaskWeaver copied to clipboard

name 'sql_pull_data' is not defined

Open STEARGAZER opened this issue 10 months ago • 4 comments
trafficstars

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 avatar Dec 25 '24 06:12 STEARGAZER

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

STEARGAZER avatar Dec 25 '24 06:12 STEARGAZER

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

liqul avatar Jan 02 '25 06:01 liqul

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

STEARGAZER avatar Jan 03 '25 05:01 STEARGAZER

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.

liqul avatar Jan 03 '25 06:01 liqul