Source code for agentscope.service.service_response
# -*- coding: utf-8 -*-""" Service response module """fromtypingimportAnyfromagentscope.service.service_statusimportServiceExecStatus
[docs]classServiceResponse(dict):"""Used to wrap the execution results of the services"""__setattr__=dict.__setitem____getattr__=dict.__getitem__def__init__(self,status:ServiceExecStatus,content:Any,):"""Constructor of ServiceResponse Args: status (`ServiceExeStatus`): The execution status of the service. content (`Any`) If the argument`status` is `SUCCESS`, `content` is the response. We use `object` here to support various objects, e.g. str, dict, image, video, etc. Otherwise, `content` is the error message. """self.status=statusself.content=content