Skip to content

Commit feab6e2

Browse files
authored
Merge pull request #117 from JetBrains/mhostnik/default-prefix
Remove the "default" prefix from the top level api parameters
2 parents a9ed088 + 6f9c62f commit feab6e2

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

databao/api.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ def new_agent(
1111
data_executor: Executor | None = None,
1212
visualizer: Visualizer | None = None,
1313
cache: Cache | None = None,
14-
default_rows_limit: int = 1000,
15-
default_stream_ask: bool = True,
16-
default_stream_plot: bool = False,
17-
default_lazy_threads: bool = False,
18-
default_auto_output_modality: bool = True,
14+
rows_limit: int = 1000,
15+
stream_ask: bool = True,
16+
stream_plot: bool = False,
17+
lazy_threads: bool = False,
18+
auto_output_modality: bool = True,
1919
) -> Agent:
2020
"""This is an entry point for users to create a new agent.
2121
Agent can't be modified after it's created. Only new data sources can be added.
@@ -27,9 +27,9 @@ def new_agent(
2727
data_executor=data_executor or LighthouseExecutor(),
2828
visualizer=visualizer or VegaChatVisualizer(llm_config),
2929
cache=cache or InMemCache(),
30-
default_rows_limit=default_rows_limit,
31-
default_stream_ask=default_stream_ask,
32-
default_stream_plot=default_stream_plot,
33-
default_lazy_threads=default_lazy_threads,
34-
default_auto_output_modality=default_auto_output_modality,
30+
rows_limit=rows_limit,
31+
stream_ask=stream_ask,
32+
stream_plot=stream_plot,
33+
lazy_threads=lazy_threads,
34+
auto_output_modality=auto_output_modality,
3535
)

databao/core/agent.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ def __init__(
2929
cache: "Cache",
3030
*,
3131
name: str = "default_agent",
32-
default_rows_limit: int,
33-
default_stream_ask: bool = True,
34-
default_stream_plot: bool = False,
35-
default_lazy_threads: bool = False,
36-
default_auto_output_modality: bool = True,
32+
rows_limit: int,
33+
stream_ask: bool = True,
34+
stream_plot: bool = False,
35+
lazy_threads: bool = False,
36+
auto_output_modality: bool = True,
3737
):
3838
self.__name = name
3939
self.__llm = llm.chat_model
@@ -51,11 +51,11 @@ def __init__(
5151
self.__cache = cache
5252

5353
# Pipe/thread defaults
54-
self.__default_rows_limit = default_rows_limit
55-
self.__default_lazy_threads = default_lazy_threads
56-
self.__default_auto_output_modality = default_auto_output_modality
57-
self.__default_stream_ask = default_stream_ask
58-
self.__default_stream_plot = default_stream_plot
54+
self.__rows_limit = rows_limit
55+
self.__lazy_threads = lazy_threads
56+
self.__auto_output_modality = auto_output_modality
57+
self.__stream_ask = stream_ask
58+
self.__stream_plot = stream_plot
5959

6060
def _parse_context_arg(self, context: str | Path | None) -> str | None:
6161
if context is None:
@@ -140,13 +140,13 @@ def thread(
140140
raise ValueError("No databases or dataframes registered in this agent.")
141141
return Pipe(
142142
self,
143-
default_rows_limit=self.__default_rows_limit,
144-
default_stream_ask=stream_ask if stream_ask is not None else self.__default_stream_ask,
145-
default_stream_plot=stream_plot if stream_plot is not None else self.__default_stream_plot,
146-
lazy=lazy if lazy is not None else self.__default_lazy_threads,
143+
rows_limit=self.__rows_limit,
144+
stream_ask=stream_ask if stream_ask is not None else self.__stream_ask,
145+
stream_plot=stream_plot if stream_plot is not None else self.__stream_plot,
146+
lazy=lazy if lazy is not None else self.__lazy_threads,
147147
auto_output_modality=auto_output_modality
148148
if auto_output_modality is not None
149-
else self.__default_auto_output_modality,
149+
else self.__auto_output_modality,
150150
)
151151

152152
@property

databao/core/pipe.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ def __init__(
2323
self,
2424
agent: "Agent",
2525
*,
26-
default_rows_limit: int = 1000,
27-
default_stream_ask: bool = True,
28-
default_stream_plot: bool = False,
26+
rows_limit: int = 1000,
27+
stream_ask: bool = True,
28+
stream_plot: bool = False,
2929
lazy: bool = False,
3030
auto_output_modality: bool = True,
3131
):
3232
self._agent = agent
33-
self._default_rows_limit = default_rows_limit
33+
self._default_rows_limit = rows_limit
3434

3535
self._lazy_mode = lazy
3636

@@ -43,8 +43,8 @@ def __init__(
4343

4444
self._stream_ask: bool | None = None
4545
self._stream_plot: bool | None = None
46-
self._default_stream_ask: bool = default_stream_ask
47-
self._default_stream_plot: bool = default_stream_plot
46+
self._default_stream_ask: bool = stream_ask
47+
self._default_stream_plot: bool = stream_plot
4848

4949
self._data_materialized_rows: int | None = None
5050
self._data_result: ExecutionResult | None = None

0 commit comments

Comments
 (0)