Skip to content

feat: register imported pipeline wrappers when creating an app - #292

Open
666666999999666 wants to merge 1 commit into
deepset-ai:mainfrom
666666999999666:feat/register-imported-pipeline-wrappers
Open

666666999999666 wants to merge 1 commit into
deepset-ai:mainfrom
666666999999666:feat/register-imported-pipeline-wrappers

Conversation

@666666999999666

Copy link
Copy Markdown

Closes #145.

An application that already ships its Haystack agents and pipelines in a Python package can give them service names when it creates the app:

from hayhooks import create_app
from my_app.agents import Support

app = create_app(pipelines={"support": Support})

The factory instantiates each wrapper in its original package and uses the existing setup, schema and routing paths. This also works with durable execution. Declarations belong to their app and cannot be overwritten or undeployed through the HTTP API. Other names can still be deployed from files when runtime deployment is enabled. Omitting pipelines preserves the existing registry behavior.

For apps that pass a mapping, file deployments get a private import package per generation. Two apps can use the same name, and replacing a file deployment lets a response already in progress finish with its original code, including imports made by a streaming generator.

Verification

  • Non-integration suite on Python 3.12: 1,544 passed on Haystack 2.31.1 and 1,634 passed on 3.5.0. On 3.5.0 the integration suite had 129 passed and 12 skipped for lack of a live model key.
  • Ruff, formatting, type checks on both Haystack versions, and the strict docs build passed.
  • Also verified a packaged durable wrapper with real Redis and two Uvicorn processes: the second process resumed the same waiting execution after the first was killed, returned 42, and did not repeat the checkpointed preparation step.

Codex implemented and tested this change. Separate Codex sessions reviewed the proposal and patch.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Programmatically start and load pipelines

1 participant