Skip to content

Commit cd49d71

Browse files
note: note selector_func is not serializable (#6609)
Resolves #6519 --------- Co-authored-by: Victor Dibia <victor.dibia@gmail.com>
1 parent c683175 commit cd49d71

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_selector_group_chat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ class SelectorGroupChat(BaseGroupChat, Component[SelectorGroupChatConfig]):
384384
function that takes the conversation history and returns the name of the next speaker.
385385
If provided, this function will be used to override the model to select the next speaker.
386386
If the function returns None, the model will be used to select the next speaker.
387+
NOTE: `selector_func` is not serializable and will be ignored during serialization and deserialization process.
387388
candidate_func (Callable[[Sequence[BaseAgentEvent | BaseChatMessage]], List[str]], Callable[[Sequence[BaseAgentEvent | BaseChatMessage]], Awaitable[List[str]]], optional):
388389
A custom function that takes the conversation history and returns a filtered list of candidates for the next speaker
389390
selection using model. If the function returns an empty list or `None`, `SelectorGroupChat` will raise a `ValueError`.

python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/selector-group-chat.ipynb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,10 @@
438438
"\n",
439439
"```{note}\n",
440440
"Returning `None` from the custom selector function will use the default model-based selection.\n",
441+
"``` \n",
442+
"\n",
443+
"```{note}\n",
444+
"Custom selector functions are not [serialized](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/serialize-components.html) when `.dump_component()` is called on the SelectorGroupChat team . If you need to serialize team configurations with custom selector functions, consider implementing custom workflows and serialization logic.\n",
441445
"```"
442446
]
443447
},

python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/serialize-components.ipynb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
" \n",
2020
"```\n",
2121
"\n",
22+
"```{note}\n",
23+
"`selector_func` is not serializable and will be ignored during serialization and deserialization process.\n",
24+
"```\n",
25+
"\n",
2226
" \n",
2327
"### Termination Condition Example \n",
2428
"\n",

0 commit comments

Comments
 (0)