From 3a45a2991354bf1d5ba430721f7fa048920bf9b3 Mon Sep 17 00:00:00 2001 From: jakelorocco Date: Fri, 3 Oct 2025 10:56:06 -0400 Subject: [PATCH] fix: default sampling strats to None for m funcs --- docs/examples/mobject/table.py | 13 +++++++++---- mellea/stdlib/funcs.py | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/examples/mobject/table.py b/docs/examples/mobject/table.py index cfb7577b..cc7191c0 100644 --- a/docs/examples/mobject/table.py +++ b/docs/examples/mobject/table.py @@ -28,11 +28,16 @@ def update_sales(self, store: str, amount: str): header=0, index_col=False, ) - print(f"testing123 changes {store} to {amount}") + # Remove unnamed columns and columns that don't exist. + table_df.drop(table_df.filter(regex="Unname").columns, axis=1, inplace=True) + + # Sometimes extra whitespace gets added to the column names and row values. Remove it. + table_df.columns = table_df.columns.str.strip() + table_df = table_df.map(lambda x: x.strip() if isinstance(x, str) else x) + table_df.loc[table_df["Store"] == store, "Sales"] = amount - return MyCompanyDatabase( - table=table_df.to_csv(sep="|", index=False, header=True) - ) + self.table = table_df.to_csv(sep="|", index=False, header=True) + return self def transpose(self): """Transpose the table.""" diff --git a/mellea/stdlib/funcs.py b/mellea/stdlib/funcs.py index 6ce6e314..47607b53 100644 --- a/mellea/stdlib/funcs.py +++ b/mellea/stdlib/funcs.py @@ -335,6 +335,7 @@ def chat( user_message, context=context, backend=backend, + strategy=None, format=format, model_options=model_options, tool_calls=tool_calls, @@ -468,6 +469,7 @@ def query( q, context=context, backend=backend, + strategy=None, format=format, model_options=model_options, tool_calls=tool_calls, @@ -511,6 +513,7 @@ def transform( t, context=context, backend=backend, + strategy=None, format=format, model_options=model_options, tool_calls=True,