New RunLLM response generated: >>>*# Question* I ...
# runllm-flyte-trial
a
New RunLLM response generated: >>>*# Question* I want to add an option to my workflow, so when I want to start it from the UI, one of the arguments for the workflow can be chosen only from a list of predetermined options. Anyone got to do something like that? # Answer Yes, you can add an option to your workflow where one of the arguments can be chosen from a list of predetermined options. This feature allows you to limit the inputs to a specific set of values, preventing invalid inputs. According to this GitHub issue, you can define an input with options in your workflow like this:
Copy code
from flytekit import workflow, task
from flytekit.types.schema import FlyteSchema

@task
def example_task(color: str) -> str:
    return f"Selected color is {color}"

@workflow
def example_workflow(color: str) -> str:
    return example_task(color=color)

example_workflow.add_input("color", str, default='green', options=['green', 'blue', 'orange'])
Would you like more detail on this or other related features? Sources: - GitHub Issue: Support "Enum/Options" type as Flyte Input Slack Link https://flyte-org.slack.com/archives/CP2HDHKE1/p1718865437.745509 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.