note: note selector_func is not serializable (#6609)

Resolves #6519

---------

Co-authored-by: Victor Dibia <victor.dibia@gmail.com>
This commit is contained in:
Griffin Bassman
2025-06-02 12:11:28 -04:00
committed by GitHub
parent c683175120
commit cd49d71f2a
3 changed files with 9 additions and 0 deletions

View File

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

View File

@@ -438,6 +438,10 @@
"\n",
"```{note}\n",
"Returning `None` from the custom selector function will use the default model-based selection.\n",
"``` \n",
"\n",
"```{note}\n",
"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",
"```"
]
},

View File

@@ -19,6 +19,10 @@
" \n",
"```\n",
"\n",
"```{note}\n",
"`selector_func` is not serializable and will be ignored during serialization and deserialization process.\n",
"```\n",
"\n",
" \n",
"### Termination Condition Example \n",
"\n",