You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following error when I try to pass df to a tool.
This cell raised an exception: PydanticUserError('`filter_dataset` is not fully defined; you should define `pl`, then call `filter_dataset.model_rebuild()`.
For further information visit https://errors.pydantic.dev/2.10/u/class-not-fully-defined')
import polars as pl
import ell
Code:
@ell.tool()deffilter_dataset(df: pl.DataFrame, sql_query: str):
""" Filter a polars dataframe using SQL. Please only use fields from the schema. """returndf.sql(sql_query, table_name="data")
@ell.complex(model="deepseek-chat",client=deepseek_client,tools=[chart_data, filter_dataset],)defanalyze_dataset(df: pl.DataFrame, prompt: str):
"""You are a data scientist that can analyze a dataset"""returnf"""I have a dataset with schema: {df.schema}.\n These are the first 5 rows: {df.head()}.\n{prompt}"""analyze_dataset(df, 'What is the min and median of petal length?')
I face the same issue with pandas dataframes, how do I resolve this?
The text was updated successfully, but these errors were encountered:
I get the following error when I try to pass df to a tool.
import polars as pl
import ell
Code:
I face the same issue with pandas dataframes, how do I resolve this?
The text was updated successfully, but these errors were encountered: