[Misc] Support more collective_rpc return types (#21845)

Signed-off-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
Nick Hill
2025-07-30 10:20:20 -07:00
committed by GitHub
parent 8f0d516715
commit 56bd537dde
5 changed files with 121 additions and 6 deletions
+8 -1
View File
@@ -123,6 +123,13 @@ class EngineCoreOutput(
return self.finish_reason is not None
class UtilityResult:
"""Wrapper for special handling when serializing/deserializing."""
def __init__(self, r: Any = None):
self.result = r
class UtilityOutput(
msgspec.Struct,
array_like=True, # type: ignore[call-arg]
@@ -132,7 +139,7 @@ class UtilityOutput(
# Non-None implies the call failed, result should be None.
failure_message: Optional[str] = None
result: Any = None
result: Optional[UtilityResult] = None
class EngineCoreOutputs(