Replies: 1 comment
-
Hey @azaidiuk! I'm here to help you with any issues or questions you have. I'm a bot designed to assist with bug fixes, answer questions, and guide you on becoming a contributor. Let me know how I can assist you! The For use cases previously handled by class ProcessResponse(BaseModel):
"""Process response schema."""
result: Any
status: Optional[str] = None
task: Optional[TaskResponse] = None
session_id: Optional[str] = None
backend: Optional[str] = None Additionally, the class RunResponse(BaseModel):
"""Run response schema."""
outputs: Optional[List[RunOutputs]] = []
session_id: Optional[str] = None
@model_serializer(mode="plain")
def serialize(self):
# Serialize all the outputs if they are base models
serialized = {"session_id": self.session_id, "outputs": []}
if self.outputs:
serialized_outputs = []
for output in self.outputs:
if isinstance(output, BaseModel) and not isinstance(output, RunOutputs):
serialized_outputs.append(output.model_dump(exclude_none=True))
else:
serialized_outputs.append(output)
serialized["outputs"] = serialized_outputs
return serialized For more specific use cases, you might also consider other schemas such as |
Beta Was this translation helpful? Give feedback.
-
I am looking for responseschema in the latest build, has this moved or not implemented yet ?
Beta Was this translation helpful? Give feedback.
All reactions