Skip to content

Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.

Add needs_model_specs=True to all library-loading CLI commands

Louis Choquelb6f5b7a9595b
diff --git a/pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py b/pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py
index b2bfd67fc..75ab02881 100644
--- a/pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py
+++ b/pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py
@@ -84,7 +84,7 @@ def inputs_bundle_cmd(
pipe_code: str | None = pipe
library_dirs = [Path(lib_dir) for lib_dir in library_dir] if library_dir else None
- make_pipelex_for_agent_cli(library_dirs=library_dirs, log_level=ctx.obj["log_level"], needs_inference=False)
+ make_pipelex_for_agent_cli(library_dirs=library_dirs, log_level=ctx.obj["log_level"], needs_inference=False, needs_model_specs=True)
try:
result = asyncio.run(inputs_core(pipe_code=pipe_code, bundle_path=Path(bundle_path), library_dirs=library_dirs)) # type: ignore[arg-type]
diff --git a/pipelex/cli/agent_cli/commands/inputs/method_cmd.py b/pipelex/cli/agent_cli/commands/inputs/method_cmd.py
index 1a407036f..943a07ea2 100644
--- a/pipelex/cli/agent_cli/commands/inputs/method_cmd.py
+++ b/pipelex/cli/agent_cli/commands/inputs/method_cmd.py
@@ -56,7 +56,7 @@ def inputs_method_cmd(
if library_dir:
library_dirs_paths.extend(Path(lib_dir) for lib_dir in library_dir)
- make_pipelex_for_agent_cli(library_dirs=library_dirs_paths, log_level=ctx.obj["log_level"], needs_inference=False)
+ make_pipelex_for_agent_cli(library_dirs=library_dirs_paths, log_level=ctx.obj["log_level"], needs_inference=False, needs_model_specs=True)
try:
result = asyncio.run(inputs_core(pipe_code=pipe_code, bundle_path=bundle_path, library_dirs=library_dirs_paths))
diff --git a/pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py b/pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py
index 51b310251..4aff3c409 100644
--- a/pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py
+++ b/pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py
@@ -64,7 +64,7 @@ def inputs_pipe_cmd(
library_dir = [*export_dirs, *library_dir]
library_dirs = [Path(lib_dir) for lib_dir in library_dir] if library_dir else None
- make_pipelex_for_agent_cli(library_dirs=library_dirs, log_level=ctx.obj["log_level"], needs_inference=False)
+ make_pipelex_for_agent_cli(library_dirs=library_dirs, log_level=ctx.obj["log_level"], needs_inference=False, needs_model_specs=True)
try:
result = asyncio.run(inputs_core(pipe_code=pipe_code, bundle_path=None, library_dirs=library_dirs))
diff --git a/pipelex/cli/commands/build/inputs/_inputs_core.py b/pipelex/cli/commands/build/inputs/_inputs_core.py
index 1fa56dd9d..b6de68973 100644
--- a/pipelex/cli/commands/build/inputs/_inputs_core.py
+++ b/pipelex/cli/commands/build/inputs/_inputs_core.py
@@ -116,7 +116,9 @@ def execute_generate_inputs(
telemetry_command_label: str = f"{COMMAND} {SUB_COMMAND_INPUTS}",
) -> None:
"""Synchronous entry point wrapping the async inputs generation with Pipelex setup/teardown."""
- pipelex_instance = make_pipelex_for_cli(context=ErrorContext.VALIDATION_BEFORE_BUILD_INPUTS, library_dirs=library_dir, needs_inference=False)
+ pipelex_instance = make_pipelex_for_cli(
+ context=ErrorContext.VALIDATION_BEFORE_BUILD_INPUTS, library_dirs=library_dir, needs_inference=False, needs_model_specs=True
+ )
try:
with get_telemetry_manager().telemetry_context():
diff --git a/pipelex/cli/commands/build/output/_output_core.py b/pipelex/cli/commands/build/output/_output_core.py
index 192e95082..899bc50ed 100644
--- a/pipelex/cli/commands/build/output/_output_core.py
+++ b/pipelex/cli/commands/build/output/_output_core.py
@@ -131,7 +131,9 @@ def execute_generate_output(
telemetry_command_label: str = f"{COMMAND} {SUB_COMMAND_OUTPUT}",
) -> None:
"""Synchronous entry point wrapping the async output generation with Pipelex setup/teardown."""
- pipelex_instance = make_pipelex_for_cli(context=ErrorContext.VALIDATION_BEFORE_BUILD_OUTPUT, library_dirs=library_dir, needs_inference=False)
+ pipelex_instance = make_pipelex_for_cli(
+ context=ErrorContext.VALIDATION_BEFORE_BUILD_OUTPUT, library_dirs=library_dir, needs_inference=False, needs_model_specs=True
+ )
try:
with get_telemetry_manager().telemetry_context():
diff --git a/pipelex/cli/commands/show_cmd.py b/pipelex/cli/commands/show_cmd.py
index 5ab571a9e..2a07542c8 100644
--- a/pipelex/cli/commands/show_cmd.py
+++ b/pipelex/cli/commands/show_cmd.py
@@ -230,7 +230,7 @@ def show_pipe_cmd(
raise typer.Exit(1)
library_dirs = [Path(lib_dir) for lib_dir in library_dir] if library_dir else None
- make_pipelex_for_cli(context=ErrorContext.VALIDATION_BEFORE_SHOW_PIPE, library_dirs=library_dirs, needs_inference=False)
+ make_pipelex_for_cli(context=ErrorContext.VALIDATION_BEFORE_SHOW_PIPE, library_dirs=library_dirs, needs_inference=False, needs_model_specs=True)
try:
library_manager = get_library_manager()
diff --git a/pipelex/cli/commands/which_cmd.py b/pipelex/cli/commands/which_cmd.py
index 4ab5df934..93c2b72d0 100644
--- a/pipelex/cli/commands/which_cmd.py
+++ b/pipelex/cli/commands/which_cmd.py
@@ -82,7 +82,7 @@ def which_cmd(
pipelex which my_domain.my_pipe -L ./my_pipes
PIPELEXPATH=/path/to/pipes pipelex which some_pipe
"""
- make_pipelex_for_cli(context=ErrorContext.VALIDATION_BEFORE_SHOW_PIPE, needs_inference=False)
+ make_pipelex_for_cli(context=ErrorContext.VALIDATION_BEFORE_SHOW_PIPE, needs_inference=False, needs_model_specs=True)
try:
library_manager = get_library_manager()