agentscope.exception module

AgentScope exception classes.

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

Bases: Exception

The exception class for response parsing error with uncertain reasons.

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

Initialize the exception with the message.

raw_response: str

Record the raw response.

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

Bases: ResponseParsingError

The exception class for JSON parsing error.

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

Bases: ResponseParsingError

The exception class for JSON dict validation error.

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

Bases: ResponseParsingError

The exception class for JSON type error.

exception agentscope.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 agentscope.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.

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

Initialize the exception with the message.

Parameters:
  • raw_response (str) – Record the raw response from the model.

  • missing_begin_tag (bool, defaults to True) – If the response misses the beginning tag, default to True.

  • missing_end_tag (bool, defaults to True) – If the response misses the end tag, default to True.

missing_begin_tag: bool

If the response misses the begin tag.

missing_end_tag: bool

If the response misses the end tag.

exception agentscope.exception.FunctionCallError(message: str)[source]

Bases: Exception

The base class for exception raising during calling functions.

__init__(message: str) None[source]
exception agentscope.exception.FunctionCallFormatError(message: str)[source]

Bases: FunctionCallError

The exception class for function calling format error.

exception agentscope.exception.FunctionNotFoundError(message: str)[source]

Bases: FunctionCallError

The exception class for function not found error.

exception agentscope.exception.ArgumentNotFoundError(message: str)[source]

Bases: FunctionCallError

The exception class for missing argument error.

exception agentscope.exception.ArgumentTypeError(message: str)[source]

Bases: FunctionCallError

The exception class for argument type error.

exception agentscope.exception.StudioError(message: str)[source]

Bases: Exception

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

__init__(message: str) None[source]
exception agentscope.exception.StudioRegisterError(message: str)[source]

Bases: StudioError

The exception class for error when registering to agentscope studio.

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

Bases: Exception

The exception class for agent server related errors.

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

Initialize the exception with the message.

host: str

Hostname of the server.

port: int

Port of the server.

message: str

Error message

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

Bases: AgentServerError

The exception class for agent server not alive error.

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

Bases: AgentServerError

The exception class for failing to create agent.

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

Bases: AgentServerError

The exception class for failing to call agent.

exception agentscope.exception.QuotaExceededError(name: str)[source]

Bases: Exception

An Exception used to indicate that a certain metric exceeds quota

__init__(name: str) None[source]

Init a QuotaExceedError instance.

Parameters:

name (str) – name of the metric which exceeds quota.