agentscope.exception module

AgentScope exception classes.

exception AgentCallError(host: str, port: int, message: str | None = None)[source]

Bases: AgentServerError

The exception class for failing to call agent.

exception AgentCreationError(host: str, port: int, message: str | None = None)[source]

Bases: AgentServerError

The exception class for failing to create agent.

exception AgentServerError(host: str, port: int, message: str | None = None)[source]

Bases: Exception

The exception class for agent server related errors.

host: str

Hostname of the server.

message: str

Error message

port: int

Port of the server.

exception AgentServerNotAliveError(host: str, port: int, message: str | None = None)[source]

Bases: AgentServerError

The exception class for agent server not alive error.

exception AgentServerUnsupportedMethodError(host: str, port: int, oid: str, func_name: str)[source]

Bases: AgentServerError

The exception class for agent server not supporting certain method.

exception ArgumentNotFoundError(message: str)[source]

Bases: FunctionCallError

The exception class for missing argument error.

exception ArgumentTypeError(message: str)[source]

Bases: FunctionCallError

The exception class for argument type error.

exception EnvAlreadyExistError(name: str)[source]

Bases: EnvError

The exception class for env already exist error.

exception EnvError(message: str)[source]

Bases: Exception

The exception class for env related errors.

exception EnvListenerError(message: str)[source]

Bases: Exception

The exception class for listener related errors.

exception EnvNotFoundError(name: str)[source]

Bases: EnvError

The exception class for env not found error.

exception EnvTypeError(env_name: str, type_name: str)[source]

Bases: EnvError

The exception class for use wrong type of env error.

exception EnvUnsupportedFunctionError(env_name: str, func_name: str)[source]

Bases: EnvError

The exception class for use unsupported function of env error.

exception FunctionCallError(message: str)[source]

Bases: Exception

The base class for exception raising during calling functions.

exception FunctionCallFormatError(message: str)[source]

Bases: FunctionCallError

The exception class for function calling format error.

exception FunctionNotFoundError(message: str)[source]

Bases: FunctionCallError

The exception class for function not found error.

exception JsonDictValidationError(message: str, raw_response: str | None = None)[source]

Bases: ResponseParsingError

The exception class for JSON dict validation error.

exception JsonParsingError(message: str, raw_response: str | None = None)[source]

Bases: ResponseParsingError

The exception class for JSON parsing error.

exception JsonTypeError(message: str, raw_response: str | None = None)[source]

Bases: ResponseParsingError

The exception class for JSON type error.

exception QuotaExceededError(name: str)[source]

Bases: Exception

An Exception used to indicate that a certain metric exceeds quota

exception RequiredFieldNotFoundError(message: str, raw_response: str | None = None)[source]

Bases: ResponseParsingError

The exception class for missing required field in model response, when the response is required to be a JSON dict object with required fields.

exception ResponseParsingError(message: str, raw_response: str | None = None)[source]

Bases: Exception

The exception class for response parsing error with uncertain reasons.

raw_response: str

Record the raw response.

exception StudioError(message: str)[source]

Bases: Exception

The base class for exception raising during interaction with agentscope studio.

exception StudioRegisterError(message: str)[source]

Bases: StudioError

The exception class for error when registering to agentscope studio.

exception TagNotFoundError(message: str, raw_response: str | None = None, missing_begin_tag: bool = True, missing_end_tag: bool = True)[source]

Bases: ResponseParsingError

The exception class for missing tagged content in model response.

missing_begin_tag: bool

If the response misses the begin tag.

missing_end_tag: bool

If the response misses the end tag.