Skip to content

Docs: Python example uses nonexistent selection_func in add_fan_out_edges #353

@Kimcheolhui

Description

@Kimcheolhui

```python
from agent_framework import WorkflowBuilder
builder = WorkflowBuilder()
builder.set_start_executor(splitter_executor)
builder.add_fan_out_edges(splitter_executor, [worker1, worker2, worker3])
workflow = builder.build()
# Send to specific targets based on partitioner function
builder = WorkflowBuilder()
builder.set_start_executor(splitter_executor)
builder.add_fan_out_edges(
splitter_executor,
[worker1, worker2, worker3],
selection_func=lambda message, target_ids: (
[0] if message.priority == Priority.HIGH else
[1, 2] if message.priority == Priority.NORMAL else
list(range(target_count))
)
)
workflow = builder.build()
```

The Python example in the Edges guide shows add_fan_out_edges(..., selection_func=...), but this parameter does not exist in the actual Python SDK.

According to the Python API reference, add_fan_out_edges does not support selection_func. Selection logic in Python is handled by a different API (add_multi_selection_edge_group).

The documentation and the real Python API surface are inconsistent.

References

Edges guide (problematic example):
https://learn.microsoft.com/en-us/agent-framework/user-guide/workflows/core-concepts/edges?pivots=programming-language-python

Python API spec for add_fan_out_edges:
https://learn.microsoft.com/en-us/python/api/agent-framework-core/agent_framework.workflowbuilder?view=agent-framework-python-latest#agent-framework-workflowbuilder-add-fan-out-edges

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions