mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-24 23:58:15 +00:00
Enhance Flow class to support custom flow names (#3234)
- Added an optional `name` attribute to the Flow class for better identification. - Updated event emissions to utilize the new `name` attribute, ensuring accurate flow naming in events. - Added tests to verify the correct flow name is set and emitted during flow execution.
This commit is contained in:
@@ -755,3 +755,15 @@ def test_multiple_routers_from_same_trigger():
|
||||
assert execution_order.index("anemia_analysis") > execution_order.index(
|
||||
"anemia_router"
|
||||
)
|
||||
|
||||
|
||||
def test_flow_name():
|
||||
class MyFlow(Flow):
|
||||
name = "MyFlow"
|
||||
|
||||
@start()
|
||||
def start(self):
|
||||
return "Hello, world!"
|
||||
|
||||
flow = MyFlow()
|
||||
assert flow.name == "MyFlow"
|
||||
|
||||
Reference in New Issue
Block a user