Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Run Flow as Function With Variants #3476

Open
sashokbg opened this issue Jun 27, 2024 · 1 comment
Open

[Feature Request] Run Flow as Function With Variants #3476

sashokbg opened this issue Jun 27, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@sashokbg
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I would like to be able to load a flow as a function with 'load_flow' and specify node variants within it.

Describe the solution you'd like
N/A

Describe alternatives you've considered
Probably use the run function, but the API looks harder to use and less optimized ?

Additional context
N/A

@sashokbg sashokbg added the enhancement New feature or request label Jun 27, 2024
@D-W-
Copy link
Contributor

D-W- commented Jun 28, 2024

Hi @sashokbg , currently it's not supported to directly pass variant info in load_flow API. But you can set variant info after load flow as function, here's sample code:

from promptflow.entities import FlowContext

flow_func = load_flow(path/to/flow)
flow_func.context = FlowContext(
    variant="${node_name.variant_id}",
)

flow_func(params)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants