Skip to content

API Models

Agent

Bases: BaseModel

A description of an agent supported by this server

Show JSON schema:
{
  "$defs": {
    "AgentMetadata": {
      "description": "Basic information associated to the agent",
      "properties": {
        "ref": {
          "$ref": "#/$defs/AgentRef"
        },
        "description": {
          "description": "Description of this agent, which should include what the intended use is, what tasks it accomplishes and how uses input and configs to produce the output and any other side effect",
          "title": "Description",
          "type": "string"
        }
      },
      "required": [
        "ref",
        "description"
      ],
      "title": "AgentMetadata",
      "type": "object"
    },
    "AgentRef": {
      "description": "Reference to an Agent Record in the Agent Directory, it includes name, version and a locator.",
      "properties": {
        "name": {
          "description": "Name of the agent that identifies the agent in its record",
          "title": "Name",
          "type": "string"
        },
        "version": {
          "description": "Version of the agent in its record. Should be formatted according to semantic versioning (https://semver.org)",
          "title": "Version",
          "type": "string"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL of the record. Can be a network location, i.e. an entry in the Agent Directory or a file.",
          "title": "Url"
        }
      },
      "required": [
        "name",
        "version"
      ],
      "title": "AgentRef",
      "type": "object"
    }
  },
  "description": "A description of an agent supported by this server",
  "properties": {
    "agent_id": {
      "description": "Unique identifier of the agent in this server.",
      "title": "Agent Id",
      "type": "string"
    },
    "metadata": {
      "$ref": "#/$defs/AgentMetadata"
    }
  },
  "required": [
    "agent_id",
    "metadata"
  ],
  "title": "Agent",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
class Agent(BaseModel):
    """
    A description of an agent supported by this server
    """ # noqa: E501
    agent_id: StrictStr = Field(description="Unique identifier of the agent in this server.")
    metadata: AgentMetadata
    __properties: ClassVar[List[str]] = ["agent_id", "metadata"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of Agent from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of metadata
        if self.metadata:
            _dict['metadata'] = self.metadata.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of Agent from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "agent_id": obj.get("agent_id"),
            "metadata": AgentMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None
        })
        return _obj

agent_id pydantic-field

Unique identifier of the agent in this server.

from_dict(obj) classmethod

Create an instance of Agent from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of Agent from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "agent_id": obj.get("agent_id"),
        "metadata": AgentMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of Agent from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent.py
52
53
54
55
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of Agent from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of metadata
    if self.metadata:
        _dict['metadata'] = self.metadata.to_dict()
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent.py
47
48
49
50
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent.py
43
44
45
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

AgentACPDescriptor

Bases: BaseModel

Describe all the ACP specs of an agent, including schemas and protocol features.

Show JSON schema:
{
  "$defs": {
    "AgentACPSpec": {
      "description": "Specification of agent capabilities, config, input, output, and interrupts",
      "properties": {
        "capabilities": {
          "$ref": "#/$defs/AgentCapabilities"
        },
        "input": {
          "additionalProperties": true,
          "description": "This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
          "title": "Input",
          "type": "object"
        },
        "output": {
          "additionalProperties": true,
          "description": "This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
          "title": "Output",
          "type": "object"
        },
        "custom_streaming_update": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "This describes the format of an Update in the streaming.  Must be specified if `streaming.custom` capability is true and cannot be specified otherwise. Format follows: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
          "title": "Custom Streaming Update"
        },
        "thread_state": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "This describes the format of ThreadState.  Cannot be specified if `threads` capability is false. If not specified, when `threads` capability is true, then the API to retrieve ThreadState from a Thread or a Run is not available. This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
          "title": "Thread State"
        },
        "config": {
          "additionalProperties": true,
          "description": "This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
          "title": "Config",
          "type": "object"
        },
        "interrupts": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/AgentACPSpecInterruptsInner"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "List of possible interrupts that can be provided by the agent. If `interrupts` capability is true, this needs to have at least one item.",
          "title": "Interrupts"
        }
      },
      "required": [
        "capabilities",
        "input",
        "output",
        "config"
      ],
      "title": "AgentACPSpec",
      "type": "object"
    },
    "AgentACPSpecInterruptsInner": {
      "description": "AgentACPSpecInterruptsInner",
      "properties": {
        "interrupt_type": {
          "description": "Name of this interrupt type. Needs to be unique in the list of interrupts.",
          "title": "Interrupt Type",
          "type": "string"
        },
        "interrupt_payload": {
          "additionalProperties": true,
          "description": "This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
          "title": "Interrupt Payload",
          "type": "object"
        },
        "resume_payload": {
          "additionalProperties": true,
          "description": "This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
          "title": "Resume Payload",
          "type": "object"
        }
      },
      "required": [
        "interrupt_type",
        "interrupt_payload",
        "resume_payload"
      ],
      "title": "AgentACPSpecInterruptsInner",
      "type": "object"
    },
    "AgentCapabilities": {
      "description": "Declares what invocation features this agent is capable of.",
      "properties": {
        "threads": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "description": "This is `true` if the agent supports run threads. If this is `false`, then the threads tagged with `Threads` are not available. If missing, it means `false`",
          "title": "Threads"
        },
        "interrupts": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "description": "This is `true` if the agent runs can interrupt to request additional input and can be subsequently resumed. If missing, it means `false`",
          "title": "Interrupts"
        },
        "callbacks": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "description": "This is `true` if the agent supports a webhook to report run results. If this is `false`, providing a `webhook` at run creation has no effect. If missing, it means `false`",
          "title": "Callbacks"
        },
        "streaming": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamingModes"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "title": "AgentCapabilities",
      "type": "object"
    },
    "AgentMetadata": {
      "description": "Basic information associated to the agent",
      "properties": {
        "ref": {
          "$ref": "#/$defs/AgentRef"
        },
        "description": {
          "description": "Description of this agent, which should include what the intended use is, what tasks it accomplishes and how uses input and configs to produce the output and any other side effect",
          "title": "Description",
          "type": "string"
        }
      },
      "required": [
        "ref",
        "description"
      ],
      "title": "AgentMetadata",
      "type": "object"
    },
    "AgentRef": {
      "description": "Reference to an Agent Record in the Agent Directory, it includes name, version and a locator.",
      "properties": {
        "name": {
          "description": "Name of the agent that identifies the agent in its record",
          "title": "Name",
          "type": "string"
        },
        "version": {
          "description": "Version of the agent in its record. Should be formatted according to semantic versioning (https://semver.org)",
          "title": "Version",
          "type": "string"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL of the record. Can be a network location, i.e. an entry in the Agent Directory or a file.",
          "title": "Url"
        }
      },
      "required": [
        "name",
        "version"
      ],
      "title": "AgentRef",
      "type": "object"
    },
    "StreamingModes": {
      "description": "Supported streaming modes. If missing, streaming is not supported.  If no mode is supported attempts to stream output will result in an error.",
      "properties": {
        "values": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "This is `true` if the agent supports values streaming. If `false` or missing, values streaming is not supported. Values streaming consists of a stream of objects of type `ValueRunResultUpdate`, where each one sent over the stream fully replace the previous one.",
          "title": "Values"
        },
        "custom": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "This is `true` if the agent supports custom objects streaming. If `false` or missing, custom streaming is not supported. Custom Objects streaming consists of a stream of object whose schema is specified by the agent ACP descriptor under `specs.custom_streaming_update`.",
          "title": "Custom"
        }
      },
      "title": "StreamingModes",
      "type": "object"
    }
  },
  "description": "Describe all the ACP specs of an agent, including schemas and protocol features.",
  "properties": {
    "metadata": {
      "$ref": "#/$defs/AgentMetadata"
    },
    "specs": {
      "$ref": "#/$defs/AgentACPSpec"
    }
  },
  "required": [
    "metadata",
    "specs"
  ],
  "title": "AgentACPDescriptor",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_descriptor.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class AgentACPDescriptor(BaseModel):
    """
    Describe all the ACP specs of an agent, including schemas and protocol features.
    """ # noqa: E501
    metadata: AgentMetadata
    specs: AgentACPSpec
    __properties: ClassVar[List[str]] = ["metadata", "specs"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of AgentACPDescriptor from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of metadata
        if self.metadata:
            _dict['metadata'] = self.metadata.to_dict()
        # override the default output from pydantic by calling `to_dict()` of specs
        if self.specs:
            _dict['specs'] = self.specs.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of AgentACPDescriptor from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "metadata": AgentMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None,
            "specs": AgentACPSpec.from_dict(obj["specs"]) if obj.get("specs") is not None else None
        })
        return _obj

from_dict(obj) classmethod

Create an instance of AgentACPDescriptor from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_descriptor.py
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of AgentACPDescriptor from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "metadata": AgentMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None,
        "specs": AgentACPSpec.from_dict(obj["specs"]) if obj.get("specs") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of AgentACPDescriptor from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_descriptor.py
53
54
55
56
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of AgentACPDescriptor from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_descriptor.py
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of metadata
    if self.metadata:
        _dict['metadata'] = self.metadata.to_dict()
    # override the default output from pydantic by calling `to_dict()` of specs
    if self.specs:
        _dict['specs'] = self.specs.to_dict()
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_descriptor.py
48
49
50
51
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_descriptor.py
44
45
46
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

AgentACPSpec

Bases: BaseModel

Specification of agent capabilities, config, input, output, and interrupts

Show JSON schema:
{
  "$defs": {
    "AgentACPSpecInterruptsInner": {
      "description": "AgentACPSpecInterruptsInner",
      "properties": {
        "interrupt_type": {
          "description": "Name of this interrupt type. Needs to be unique in the list of interrupts.",
          "title": "Interrupt Type",
          "type": "string"
        },
        "interrupt_payload": {
          "additionalProperties": true,
          "description": "This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
          "title": "Interrupt Payload",
          "type": "object"
        },
        "resume_payload": {
          "additionalProperties": true,
          "description": "This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
          "title": "Resume Payload",
          "type": "object"
        }
      },
      "required": [
        "interrupt_type",
        "interrupt_payload",
        "resume_payload"
      ],
      "title": "AgentACPSpecInterruptsInner",
      "type": "object"
    },
    "AgentCapabilities": {
      "description": "Declares what invocation features this agent is capable of.",
      "properties": {
        "threads": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "description": "This is `true` if the agent supports run threads. If this is `false`, then the threads tagged with `Threads` are not available. If missing, it means `false`",
          "title": "Threads"
        },
        "interrupts": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "description": "This is `true` if the agent runs can interrupt to request additional input and can be subsequently resumed. If missing, it means `false`",
          "title": "Interrupts"
        },
        "callbacks": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "description": "This is `true` if the agent supports a webhook to report run results. If this is `false`, providing a `webhook` at run creation has no effect. If missing, it means `false`",
          "title": "Callbacks"
        },
        "streaming": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamingModes"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "title": "AgentCapabilities",
      "type": "object"
    },
    "StreamingModes": {
      "description": "Supported streaming modes. If missing, streaming is not supported.  If no mode is supported attempts to stream output will result in an error.",
      "properties": {
        "values": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "This is `true` if the agent supports values streaming. If `false` or missing, values streaming is not supported. Values streaming consists of a stream of objects of type `ValueRunResultUpdate`, where each one sent over the stream fully replace the previous one.",
          "title": "Values"
        },
        "custom": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "This is `true` if the agent supports custom objects streaming. If `false` or missing, custom streaming is not supported. Custom Objects streaming consists of a stream of object whose schema is specified by the agent ACP descriptor under `specs.custom_streaming_update`.",
          "title": "Custom"
        }
      },
      "title": "StreamingModes",
      "type": "object"
    }
  },
  "description": "Specification of agent capabilities, config, input, output, and interrupts",
  "properties": {
    "capabilities": {
      "$ref": "#/$defs/AgentCapabilities"
    },
    "input": {
      "additionalProperties": true,
      "description": "This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
      "title": "Input",
      "type": "object"
    },
    "output": {
      "additionalProperties": true,
      "description": "This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
      "title": "Output",
      "type": "object"
    },
    "custom_streaming_update": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "This describes the format of an Update in the streaming.  Must be specified if `streaming.custom` capability is true and cannot be specified otherwise. Format follows: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
      "title": "Custom Streaming Update"
    },
    "thread_state": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "This describes the format of ThreadState.  Cannot be specified if `threads` capability is false. If not specified, when `threads` capability is true, then the API to retrieve ThreadState from a Thread or a Run is not available. This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
      "title": "Thread State"
    },
    "config": {
      "additionalProperties": true,
      "description": "This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
      "title": "Config",
      "type": "object"
    },
    "interrupts": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/AgentACPSpecInterruptsInner"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "List of possible interrupts that can be provided by the agent. If `interrupts` capability is true, this needs to have at least one item.",
      "title": "Interrupts"
    }
  },
  "required": [
    "capabilities",
    "input",
    "output",
    "config"
  ],
  "title": "AgentACPSpec",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_spec.py
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class AgentACPSpec(BaseModel):
    """
    Specification of agent capabilities, config, input, output, and interrupts
    """ # noqa: E501
    capabilities: AgentCapabilities
    input: Dict[str, Any] = Field(description="This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object")
    output: Dict[str, Any] = Field(description="This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object")
    custom_streaming_update: Optional[Dict[str, Any]] = Field(default=None, description="This describes the format of an Update in the streaming.  Must be specified if `streaming.custom` capability is true and cannot be specified otherwise. Format follows: https://spec.openapis.org/oas/v3.1.1.html#schema-object")
    thread_state: Optional[Dict[str, Any]] = Field(default=None, description="This describes the format of ThreadState.  Cannot be specified if `threads` capability is false. If not specified, when `threads` capability is true, then the API to retrieve ThreadState from a Thread or a Run is not available. This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object")
    config: Dict[str, Any] = Field(description="This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object")
    interrupts: Optional[List[AgentACPSpecInterruptsInner]] = Field(default=None, description="List of possible interrupts that can be provided by the agent. If `interrupts` capability is true, this needs to have at least one item.")
    __properties: ClassVar[List[str]] = ["capabilities", "input", "output", "custom_streaming_update", "thread_state", "config", "interrupts"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of AgentACPSpec from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of capabilities
        if self.capabilities:
            _dict['capabilities'] = self.capabilities.to_dict()
        # override the default output from pydantic by calling `to_dict()` of each item in interrupts (list)
        _items = []
        if self.interrupts:
            for _item_interrupts in self.interrupts:
                if _item_interrupts:
                    _items.append(_item_interrupts.to_dict())
            _dict['interrupts'] = _items
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of AgentACPSpec from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "capabilities": AgentCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None,
            "input": obj.get("input"),
            "output": obj.get("output"),
            "custom_streaming_update": obj.get("custom_streaming_update"),
            "thread_state": obj.get("thread_state"),
            "config": obj.get("config"),
            "interrupts": [AgentACPSpecInterruptsInner.from_dict(_item) for _item in obj["interrupts"]] if obj.get("interrupts") is not None else None
        })
        return _obj

config pydantic-field

This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object

custom_streaming_update = None pydantic-field

This describes the format of an Update in the streaming. Must be specified if streaming.custom capability is true and cannot be specified otherwise. Format follows: https://spec.openapis.org/oas/v3.1.1.html#schema-object

input pydantic-field

This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object

interrupts = None pydantic-field

List of possible interrupts that can be provided by the agent. If interrupts capability is true, this needs to have at least one item.

output pydantic-field

This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object

thread_state = None pydantic-field

This describes the format of ThreadState. Cannot be specified if threads capability is false. If not specified, when threads capability is true, then the API to retrieve ThreadState from a Thread or a Run is not available. This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object

from_dict(obj) classmethod

Create an instance of AgentACPSpec from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_spec.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of AgentACPSpec from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "capabilities": AgentCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None,
        "input": obj.get("input"),
        "output": obj.get("output"),
        "custom_streaming_update": obj.get("custom_streaming_update"),
        "thread_state": obj.get("thread_state"),
        "config": obj.get("config"),
        "interrupts": [AgentACPSpecInterruptsInner.from_dict(_item) for _item in obj["interrupts"]] if obj.get("interrupts") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of AgentACPSpec from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_spec.py
58
59
60
61
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of AgentACPSpec from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_spec.py
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of capabilities
    if self.capabilities:
        _dict['capabilities'] = self.capabilities.to_dict()
    # override the default output from pydantic by calling `to_dict()` of each item in interrupts (list)
    _items = []
    if self.interrupts:
        for _item_interrupts in self.interrupts:
            if _item_interrupts:
                _items.append(_item_interrupts.to_dict())
        _dict['interrupts'] = _items
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_spec.py
53
54
55
56
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_spec.py
49
50
51
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

AgentACPSpecInterruptsInner

Bases: BaseModel

AgentACPSpecInterruptsInner

Show JSON schema:
{
  "description": "AgentACPSpecInterruptsInner",
  "properties": {
    "interrupt_type": {
      "description": "Name of this interrupt type. Needs to be unique in the list of interrupts.",
      "title": "Interrupt Type",
      "type": "string"
    },
    "interrupt_payload": {
      "additionalProperties": true,
      "description": "This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
      "title": "Interrupt Payload",
      "type": "object"
    },
    "resume_payload": {
      "additionalProperties": true,
      "description": "This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object",
      "title": "Resume Payload",
      "type": "object"
    }
  },
  "required": [
    "interrupt_type",
    "interrupt_payload",
    "resume_payload"
  ],
  "title": "AgentACPSpecInterruptsInner",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_spec_interrupts_inner.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
class AgentACPSpecInterruptsInner(BaseModel):
    """
    AgentACPSpecInterruptsInner
    """ # noqa: E501
    interrupt_type: StrictStr = Field(description="Name of this interrupt type. Needs to be unique in the list of interrupts.")
    interrupt_payload: Dict[str, Any] = Field(description="This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object")
    resume_payload: Dict[str, Any] = Field(description="This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object")
    __properties: ClassVar[List[str]] = ["interrupt_type", "interrupt_payload", "resume_payload"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of AgentACPSpecInterruptsInner from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of AgentACPSpecInterruptsInner from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "interrupt_type": obj.get("interrupt_type"),
            "interrupt_payload": obj.get("interrupt_payload"),
            "resume_payload": obj.get("resume_payload")
        })
        return _obj

interrupt_payload pydantic-field

This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object

interrupt_type pydantic-field

Name of this interrupt type. Needs to be unique in the list of interrupts.

resume_payload pydantic-field

This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#schema-object

from_dict(obj) classmethod

Create an instance of AgentACPSpecInterruptsInner from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_spec_interrupts_inner.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of AgentACPSpecInterruptsInner from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "interrupt_type": obj.get("interrupt_type"),
        "interrupt_payload": obj.get("interrupt_payload"),
        "resume_payload": obj.get("resume_payload")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of AgentACPSpecInterruptsInner from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_spec_interrupts_inner.py
52
53
54
55
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of AgentACPSpecInterruptsInner from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_spec_interrupts_inner.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_spec_interrupts_inner.py
47
48
49
50
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_acp_spec_interrupts_inner.py
43
44
45
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

AgentCapabilities

Bases: BaseModel

Declares what invocation features this agent is capable of.

Show JSON schema:
{
  "$defs": {
    "StreamingModes": {
      "description": "Supported streaming modes. If missing, streaming is not supported.  If no mode is supported attempts to stream output will result in an error.",
      "properties": {
        "values": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "This is `true` if the agent supports values streaming. If `false` or missing, values streaming is not supported. Values streaming consists of a stream of objects of type `ValueRunResultUpdate`, where each one sent over the stream fully replace the previous one.",
          "title": "Values"
        },
        "custom": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "This is `true` if the agent supports custom objects streaming. If `false` or missing, custom streaming is not supported. Custom Objects streaming consists of a stream of object whose schema is specified by the agent ACP descriptor under `specs.custom_streaming_update`.",
          "title": "Custom"
        }
      },
      "title": "StreamingModes",
      "type": "object"
    }
  },
  "description": "Declares what invocation features this agent is capable of.",
  "properties": {
    "threads": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": false,
      "description": "This is `true` if the agent supports run threads. If this is `false`, then the threads tagged with `Threads` are not available. If missing, it means `false`",
      "title": "Threads"
    },
    "interrupts": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": false,
      "description": "This is `true` if the agent runs can interrupt to request additional input and can be subsequently resumed. If missing, it means `false`",
      "title": "Interrupts"
    },
    "callbacks": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": false,
      "description": "This is `true` if the agent supports a webhook to report run results. If this is `false`, providing a `webhook` at run creation has no effect. If missing, it means `false`",
      "title": "Callbacks"
    },
    "streaming": {
      "anyOf": [
        {
          "$ref": "#/$defs/StreamingModes"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "title": "AgentCapabilities",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_capabilities.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class AgentCapabilities(BaseModel):
    """
    Declares what invocation features this agent is capable of.
    """ # noqa: E501
    threads: Optional[StrictBool] = Field(default=False, description="This is `true` if the agent supports run threads. If this is `false`, then the threads tagged with `Threads` are not available. If missing, it means `false`")
    interrupts: Optional[StrictBool] = Field(default=False, description="This is `true` if the agent runs can interrupt to request additional input and can be subsequently resumed. If missing, it means `false`")
    callbacks: Optional[StrictBool] = Field(default=False, description="This is `true` if the agent supports a webhook to report run results. If this is `false`, providing a `webhook` at run creation has no effect. If missing, it means `false`")
    streaming: Optional[StreamingModes] = None
    __properties: ClassVar[List[str]] = ["threads", "interrupts", "callbacks", "streaming"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of AgentCapabilities from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of streaming
        if self.streaming:
            _dict['streaming'] = self.streaming.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of AgentCapabilities from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "threads": obj.get("threads") if obj.get("threads") is not None else False,
            "interrupts": obj.get("interrupts") if obj.get("interrupts") is not None else False,
            "callbacks": obj.get("callbacks") if obj.get("callbacks") is not None else False,
            "streaming": StreamingModes.from_dict(obj["streaming"]) if obj.get("streaming") is not None else None
        })
        return _obj

callbacks = False pydantic-field

This is true if the agent supports a webhook to report run results. If this is false, providing a webhook at run creation has no effect. If missing, it means false

interrupts = False pydantic-field

This is true if the agent runs can interrupt to request additional input and can be subsequently resumed. If missing, it means false

threads = False pydantic-field

This is true if the agent supports run threads. If this is false, then the threads tagged with Threads are not available. If missing, it means false

from_dict(obj) classmethod

Create an instance of AgentCapabilities from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_capabilities.py
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of AgentCapabilities from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "threads": obj.get("threads") if obj.get("threads") is not None else False,
        "interrupts": obj.get("interrupts") if obj.get("interrupts") is not None else False,
        "callbacks": obj.get("callbacks") if obj.get("callbacks") is not None else False,
        "streaming": StreamingModes.from_dict(obj["streaming"]) if obj.get("streaming") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of AgentCapabilities from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_capabilities.py
54
55
56
57
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of AgentCapabilities from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_capabilities.py
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of streaming
    if self.streaming:
        _dict['streaming'] = self.streaming.to_dict()
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_capabilities.py
49
50
51
52
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_capabilities.py
45
46
47
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

AgentMetadata

Bases: BaseModel

Basic information associated to the agent

Show JSON schema:
{
  "$defs": {
    "AgentRef": {
      "description": "Reference to an Agent Record in the Agent Directory, it includes name, version and a locator.",
      "properties": {
        "name": {
          "description": "Name of the agent that identifies the agent in its record",
          "title": "Name",
          "type": "string"
        },
        "version": {
          "description": "Version of the agent in its record. Should be formatted according to semantic versioning (https://semver.org)",
          "title": "Version",
          "type": "string"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL of the record. Can be a network location, i.e. an entry in the Agent Directory or a file.",
          "title": "Url"
        }
      },
      "required": [
        "name",
        "version"
      ],
      "title": "AgentRef",
      "type": "object"
    }
  },
  "description": "Basic information associated to the agent",
  "properties": {
    "ref": {
      "$ref": "#/$defs/AgentRef"
    },
    "description": {
      "description": "Description of this agent, which should include what the intended use is, what tasks it accomplishes and how uses input and configs to produce the output and any other side effect",
      "title": "Description",
      "type": "string"
    }
  },
  "required": [
    "ref",
    "description"
  ],
  "title": "AgentMetadata",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_metadata.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
class AgentMetadata(BaseModel):
    """
    Basic information associated to the agent
    """ # noqa: E501
    ref: AgentRef
    description: StrictStr = Field(description="Description of this agent, which should include what the intended use is, what tasks it accomplishes and how uses input and configs to produce the output and any other side effect")
    __properties: ClassVar[List[str]] = ["ref", "description"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of AgentMetadata from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of ref
        if self.ref:
            _dict['ref'] = self.ref.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of AgentMetadata from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "ref": AgentRef.from_dict(obj["ref"]) if obj.get("ref") is not None else None,
            "description": obj.get("description")
        })
        return _obj

description pydantic-field

Description of this agent, which should include what the intended use is, what tasks it accomplishes and how uses input and configs to produce the output and any other side effect

from_dict(obj) classmethod

Create an instance of AgentMetadata from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_metadata.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of AgentMetadata from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "ref": AgentRef.from_dict(obj["ref"]) if obj.get("ref") is not None else None,
        "description": obj.get("description")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of AgentMetadata from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_metadata.py
52
53
54
55
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of AgentMetadata from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_metadata.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of ref
    if self.ref:
        _dict['ref'] = self.ref.to_dict()
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_metadata.py
47
48
49
50
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_metadata.py
43
44
45
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

AgentRef

Bases: BaseModel

Reference to an Agent Record in the Agent Directory, it includes name, version and a locator.

Show JSON schema:
{
  "description": "Reference to an Agent Record in the Agent Directory, it includes name, version and a locator.",
  "properties": {
    "name": {
      "description": "Name of the agent that identifies the agent in its record",
      "title": "Name",
      "type": "string"
    },
    "version": {
      "description": "Version of the agent in its record. Should be formatted according to semantic versioning (https://semver.org)",
      "title": "Version",
      "type": "string"
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "URL of the record. Can be a network location, i.e. an entry in the Agent Directory or a file.",
      "title": "Url"
    }
  },
  "required": [
    "name",
    "version"
  ],
  "title": "AgentRef",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_ref.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
class AgentRef(BaseModel):
    """
    Reference to an Agent Record in the Agent Directory, it includes name, version and a locator.
    """ # noqa: E501
    name: StrictStr = Field(description="Name of the agent that identifies the agent in its record")
    version: StrictStr = Field(description="Version of the agent in its record. Should be formatted according to semantic versioning (https://semver.org)")
    url: Optional[StrictStr] = Field(default=None, description="URL of the record. Can be a network location, i.e. an entry in the Agent Directory or a file.")
    __properties: ClassVar[List[str]] = ["name", "version", "url"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of AgentRef from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of AgentRef from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "name": obj.get("name"),
            "version": obj.get("version"),
            "url": obj.get("url")
        })
        return _obj

name pydantic-field

Name of the agent that identifies the agent in its record

url = None pydantic-field

URL of the record. Can be a network location, i.e. an entry in the Agent Directory or a file.

version pydantic-field

Version of the agent in its record. Should be formatted according to semantic versioning (https://semver.org)

from_dict(obj) classmethod

Create an instance of AgentRef from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_ref.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of AgentRef from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "name": obj.get("name"),
        "version": obj.get("version"),
        "url": obj.get("url")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of AgentRef from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_ref.py
52
53
54
55
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of AgentRef from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_ref.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_ref.py
47
48
49
50
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_ref.py
43
44
45
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

AgentSearchRequest

Bases: BaseModel

Payload for listing agents.

Show JSON schema:
{
  "description": "Payload for listing agents.",
  "properties": {
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Match all agents with the name specified.",
      "title": "Name"
    },
    "version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Match all agents with the version specified. Formatted according to semantic versioning (https://semver.org)",
      "title": "Version"
    },
    "limit": {
      "anyOf": [
        {
          "maximum": 1000,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 10,
      "description": "Maximum number to return.",
      "title": "Limit"
    },
    "offset": {
      "anyOf": [
        {
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 0,
      "description": "Offset to start from.",
      "title": "Offset"
    }
  },
  "title": "AgentSearchRequest",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

  • name (Optional[StrictStr])
  • version (Optional[StrictStr])
  • limit (Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]])
  • offset (Optional[Annotated[int, Field(strict=True, ge=0)]])
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_search_request.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
class AgentSearchRequest(BaseModel):
    """
    Payload for listing agents.
    """ # noqa: E501
    name: Optional[StrictStr] = Field(default=None, description="Match all agents with the name specified.")
    version: Optional[StrictStr] = Field(default=None, description="Match all agents with the version specified. Formatted according to semantic versioning (https://semver.org)")
    limit: Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]] = Field(default=10, description="Maximum number to return.")
    offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=0, description="Offset to start from.")
    __properties: ClassVar[List[str]] = ["name", "version", "limit", "offset"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of AgentSearchRequest from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of AgentSearchRequest from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "name": obj.get("name"),
            "version": obj.get("version"),
            "limit": obj.get("limit") if obj.get("limit") is not None else 10,
            "offset": obj.get("offset") if obj.get("offset") is not None else 0
        })
        return _obj

limit = 10 pydantic-field

Maximum number to return.

name = None pydantic-field

Match all agents with the name specified.

offset = 0 pydantic-field

Offset to start from.

version = None pydantic-field

Match all agents with the version specified. Formatted according to semantic versioning (https://semver.org)

from_dict(obj) classmethod

Create an instance of AgentSearchRequest from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_search_request.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of AgentSearchRequest from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "name": obj.get("name"),
        "version": obj.get("version"),
        "limit": obj.get("limit") if obj.get("limit") is not None else 10,
        "offset": obj.get("offset") if obj.get("offset") is not None else 0
    })
    return _obj

from_json(json_str) classmethod

Create an instance of AgentSearchRequest from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_search_request.py
54
55
56
57
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of AgentSearchRequest from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_search_request.py
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_search_request.py
49
50
51
52
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/agent_search_request.py
45
46
47
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

Config

Bases: BaseModel

The configuration for the agent.

Show JSON schema:
{
  "description": "The configuration for the agent.",
  "properties": {
    "tags": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Tags"
    },
    "recursion_limit": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Recursion Limit"
    },
    "configurable": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The configuration for this agent. The schema is described in agent ACP descriptor under 'spec.config'. If missing, default values are used.",
      "title": "Configurable"
    }
  },
  "title": "Config",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

  • tags (Optional[List[StrictStr]])
  • recursion_limit (Optional[StrictInt])
  • configurable (Optional[Dict[str, Any]])
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/config.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
class Config(BaseModel):
    """
    The configuration for the agent.
    """ # noqa: E501
    tags: Optional[List[StrictStr]] = None
    recursion_limit: Optional[StrictInt] = None
    configurable: Optional[Dict[str, Any]] = Field(default=None, description="The configuration for this agent. The schema is described in agent ACP descriptor under 'spec.config'. If missing, default values are used.")
    __properties: ClassVar[List[str]] = ["tags", "recursion_limit", "configurable"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of Config from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of Config from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "tags": obj.get("tags"),
            "recursion_limit": obj.get("recursion_limit"),
            "configurable": obj.get("configurable")
        })
        return _obj

configurable = None pydantic-field

The configuration for this agent. The schema is described in agent ACP descriptor under 'spec.config'. If missing, default values are used.

from_dict(obj) classmethod

Create an instance of Config from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/config.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of Config from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "tags": obj.get("tags"),
        "recursion_limit": obj.get("recursion_limit"),
        "configurable": obj.get("configurable")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of Config from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/config.py
52
53
54
55
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of Config from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/config.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/config.py
47
48
49
50
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/config.py
43
44
45
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

Content

Bases: BaseModel

The content of the message.

Show JSON schema:
{
  "$defs": {
    "ContentOneOfInner": {
      "description": "ContentOneOfInner",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageTextBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageAnyBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "MessageTextBlock",
            "MessageAnyBlock"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ContentOneOfInner",
      "type": "object"
    },
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    }
  },
  "description": "The content of the message.",
  "properties": {
    "oneof_schema_1_validator": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Oneof Schema 1 Validator"
    },
    "oneof_schema_2_validator": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/ContentOneOfInner"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Oneof Schema 2 Validator"
    },
    "actual_instance": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/ContentOneOfInner"
          },
          "type": "array"
        },
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Actual Instance"
    },
    "one_of_schemas": {
      "default": [
        "List[ContentOneOfInner]",
        "str"
      ],
      "items": {
        "type": "string"
      },
      "title": "One Of Schemas",
      "type": "array",
      "uniqueItems": true
    }
  },
  "title": "Content",
  "type": "object"
}

Config:

  • validate_assignment: True
  • protected_namespaces: ()

Fields:

  • oneof_schema_1_validator (Optional[StrictStr])
  • oneof_schema_2_validator (Optional[List[ContentOneOfInner]])
  • actual_instance (Optional[Union[List[ContentOneOfInner], str]])
  • one_of_schemas (Set[str])

Validators:

  • actual_instance_must_validate_oneofactual_instance
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/content.py
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
class Content(BaseModel):
    """
    The content of the message.
    """
    # data type: str
    oneof_schema_1_validator: Optional[StrictStr] = None
    # data type: List[ContentOneOfInner]
    oneof_schema_2_validator: Optional[List[ContentOneOfInner]] = None
    actual_instance: Optional[Union[List[ContentOneOfInner], str]] = None
    one_of_schemas: Set[str] = { "List[ContentOneOfInner]", "str" }

    model_config = ConfigDict(
        validate_assignment=True,
        protected_namespaces=(),
    )


    def __init__(self, *args, **kwargs) -> None:
        if args:
            if len(args) > 1:
                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
            if kwargs:
                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
            super().__init__(actual_instance=args[0])
        else:
            super().__init__(**kwargs)

    @field_validator('actual_instance')
    def actual_instance_must_validate_oneof(cls, v):
        instance = Content.model_construct()
        error_messages = []
        match = 0
        # validate data type: str
        try:
            instance.oneof_schema_1_validator = v
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # validate data type: List[ContentOneOfInner]
        try:
            instance.oneof_schema_2_validator = v
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        if match > 1:
            # more than 1 match
            raise ValueError("Multiple matches found when setting `actual_instance` in Content with oneOf schemas: List[ContentOneOfInner], str. Details: " + ", ".join(error_messages))
        elif match == 0:
            # no match
            raise ValueError("No match found when setting `actual_instance` in Content with oneOf schemas: List[ContentOneOfInner], str. Details: " + ", ".join(error_messages))
        else:
            return v

    @classmethod
    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
        return cls.from_json(json.dumps(obj))

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Returns the object represented by the json string"""
        instance = cls.model_construct()
        error_messages = []
        match = 0

        # deserialize data into str
        try:
            # validation
            instance.oneof_schema_1_validator = json.loads(json_str)
            # assign value to actual_instance
            instance.actual_instance = instance.oneof_schema_1_validator
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into List[ContentOneOfInner]
        try:
            # validation
            instance.oneof_schema_2_validator = json.loads(json_str)
            # assign value to actual_instance
            instance.actual_instance = instance.oneof_schema_2_validator
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))

        if match > 1:
            # more than 1 match
            raise ValueError("Multiple matches found when deserializing the JSON string into Content with oneOf schemas: List[ContentOneOfInner], str. Details: " + ", ".join(error_messages))
        elif match == 0:
            # no match
            raise ValueError("No match found when deserializing the JSON string into Content with oneOf schemas: List[ContentOneOfInner], str. Details: " + ", ".join(error_messages))
        else:
            return instance

    def to_json(self) -> str:
        """Returns the JSON representation of the actual instance"""
        if self.actual_instance is None:
            return "null"

        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
            return self.actual_instance.to_json()
        else:
            return json.dumps(self.actual_instance)

    def to_dict(self) -> Optional[Union[Dict[str, Any], List[ContentOneOfInner], str]]:
        """Returns the dict representation of the actual instance"""
        if self.actual_instance is None:
            return None

        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
            return self.actual_instance.to_dict()
        else:
            # primitive type
            return self.actual_instance

    def to_str(self) -> str:
        """Returns the string representation of the actual instance"""
        return pprint.pformat(self.model_dump())

from_json(json_str) classmethod

Returns the object represented by the json string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/content.py
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@classmethod
def from_json(cls, json_str: str) -> Self:
    """Returns the object represented by the json string"""
    instance = cls.model_construct()
    error_messages = []
    match = 0

    # deserialize data into str
    try:
        # validation
        instance.oneof_schema_1_validator = json.loads(json_str)
        # assign value to actual_instance
        instance.actual_instance = instance.oneof_schema_1_validator
        match += 1
    except (ValidationError, ValueError) as e:
        error_messages.append(str(e))
    # deserialize data into List[ContentOneOfInner]
    try:
        # validation
        instance.oneof_schema_2_validator = json.loads(json_str)
        # assign value to actual_instance
        instance.actual_instance = instance.oneof_schema_2_validator
        match += 1
    except (ValidationError, ValueError) as e:
        error_messages.append(str(e))

    if match > 1:
        # more than 1 match
        raise ValueError("Multiple matches found when deserializing the JSON string into Content with oneOf schemas: List[ContentOneOfInner], str. Details: " + ", ".join(error_messages))
    elif match == 0:
        # no match
        raise ValueError("No match found when deserializing the JSON string into Content with oneOf schemas: List[ContentOneOfInner], str. Details: " + ", ".join(error_messages))
    else:
        return instance

to_dict()

Returns the dict representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/content.py
131
132
133
134
135
136
137
138
139
140
def to_dict(self) -> Optional[Union[Dict[str, Any], List[ContentOneOfInner], str]]:
    """Returns the dict representation of the actual instance"""
    if self.actual_instance is None:
        return None

    if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
        return self.actual_instance.to_dict()
    else:
        # primitive type
        return self.actual_instance

to_json()

Returns the JSON representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/content.py
121
122
123
124
125
126
127
128
129
def to_json(self) -> str:
    """Returns the JSON representation of the actual instance"""
    if self.actual_instance is None:
        return "null"

    if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
        return self.actual_instance.to_json()
    else:
        return json.dumps(self.actual_instance)

to_str()

Returns the string representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/content.py
142
143
144
def to_str(self) -> str:
    """Returns the string representation of the actual instance"""
    return pprint.pformat(self.model_dump())

ContentOneOfInner

Bases: BaseModel

ContentOneOfInner

Show JSON schema:
{
  "$defs": {
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    }
  },
  "description": "ContentOneOfInner",
  "properties": {
    "anyof_schema_1_validator": {
      "anyOf": [
        {
          "$ref": "#/$defs/MessageTextBlock"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "anyof_schema_2_validator": {
      "anyOf": [
        {
          "$ref": "#/$defs/MessageAnyBlock"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "actual_instance": {
      "default": null,
      "title": "Actual Instance"
    },
    "any_of_schemas": {
      "default": [
        "MessageTextBlock",
        "MessageAnyBlock"
      ],
      "items": {
        "type": "string"
      },
      "title": "Any Of Schemas",
      "type": "array",
      "uniqueItems": true
    }
  },
  "title": "ContentOneOfInner",
  "type": "object"
}

Config:

  • default: {'validate_assignment': True, 'protected_namespaces': ()}

Fields:

Validators:

  • actual_instance_must_validate_anyofactual_instance
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/content_one_of_inner.py
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
class ContentOneOfInner(BaseModel):
    """
    ContentOneOfInner
    """

    # data type: MessageTextBlock
    anyof_schema_1_validator: Optional[MessageTextBlock] = None
    # data type: MessageAnyBlock
    anyof_schema_2_validator: Optional[MessageAnyBlock] = None
    if TYPE_CHECKING:
        actual_instance: Optional[Union[MessageAnyBlock, MessageTextBlock]] = None
    else:
        actual_instance: Any = None
    any_of_schemas: Set[str] = { "MessageAnyBlock", "MessageTextBlock" }

    model_config = {
        "validate_assignment": True,
        "protected_namespaces": (),
    }

    def __init__(self, *args, **kwargs) -> None:
        if args:
            if len(args) > 1:
                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
            if kwargs:
                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
            super().__init__(actual_instance=args[0])
        else:
            super().__init__(**kwargs)

    @field_validator('actual_instance')
    def actual_instance_must_validate_anyof(cls, v):
        instance = ContentOneOfInner.model_construct()
        error_messages = []
        # validate data type: MessageTextBlock
        if not isinstance(v, MessageTextBlock):
            error_messages.append(f"Error! Input type `{type(v)}` is not `MessageTextBlock`")
        else:
            return v

        # validate data type: MessageAnyBlock
        if not isinstance(v, MessageAnyBlock):
            error_messages.append(f"Error! Input type `{type(v)}` is not `MessageAnyBlock`")
        else:
            return v

        if error_messages:
            # no match
            raise ValueError("No match found when setting the actual_instance in ContentOneOfInner with anyOf schemas: MessageAnyBlock, MessageTextBlock. Details: " + ", ".join(error_messages))
        else:
            return v

    @classmethod
    def from_dict(cls, obj: Dict[str, Any]) -> Self:
        return cls.from_json(json.dumps(obj))

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Returns the object represented by the json string"""
        instance = cls.model_construct()
        error_messages = []
        # anyof_schema_1_validator: Optional[MessageTextBlock] = None
        try:
            instance.actual_instance = MessageTextBlock.from_json(json_str)
            return instance
        except (ValidationError, ValueError) as e:
             error_messages.append(str(e))
        # anyof_schema_2_validator: Optional[MessageAnyBlock] = None
        try:
            instance.actual_instance = MessageAnyBlock.from_json(json_str)
            return instance
        except (ValidationError, ValueError) as e:
             error_messages.append(str(e))

        if error_messages:
            # no match
            raise ValueError("No match found when deserializing the JSON string into ContentOneOfInner with anyOf schemas: MessageAnyBlock, MessageTextBlock. Details: " + ", ".join(error_messages))
        else:
            return instance

    def to_json(self) -> str:
        """Returns the JSON representation of the actual instance"""
        if self.actual_instance is None:
            return "null"

        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
            return self.actual_instance.to_json()
        else:
            return json.dumps(self.actual_instance)

    def to_dict(self) -> Optional[Union[Dict[str, Any], MessageAnyBlock, MessageTextBlock]]:
        """Returns the dict representation of the actual instance"""
        if self.actual_instance is None:
            return None

        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
            return self.actual_instance.to_dict()
        else:
            return self.actual_instance

    def to_str(self) -> str:
        """Returns the string representation of the actual instance"""
        return pprint.pformat(self.model_dump())

from_json(json_str) classmethod

Returns the object represented by the json string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/content_one_of_inner.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
@classmethod
def from_json(cls, json_str: str) -> Self:
    """Returns the object represented by the json string"""
    instance = cls.model_construct()
    error_messages = []
    # anyof_schema_1_validator: Optional[MessageTextBlock] = None
    try:
        instance.actual_instance = MessageTextBlock.from_json(json_str)
        return instance
    except (ValidationError, ValueError) as e:
         error_messages.append(str(e))
    # anyof_schema_2_validator: Optional[MessageAnyBlock] = None
    try:
        instance.actual_instance = MessageAnyBlock.from_json(json_str)
        return instance
    except (ValidationError, ValueError) as e:
         error_messages.append(str(e))

    if error_messages:
        # no match
        raise ValueError("No match found when deserializing the JSON string into ContentOneOfInner with anyOf schemas: MessageAnyBlock, MessageTextBlock. Details: " + ", ".join(error_messages))
    else:
        return instance

to_dict()

Returns the dict representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/content_one_of_inner.py
122
123
124
125
126
127
128
129
130
def to_dict(self) -> Optional[Union[Dict[str, Any], MessageAnyBlock, MessageTextBlock]]:
    """Returns the dict representation of the actual instance"""
    if self.actual_instance is None:
        return None

    if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
        return self.actual_instance.to_dict()
    else:
        return self.actual_instance

to_json()

Returns the JSON representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/content_one_of_inner.py
112
113
114
115
116
117
118
119
120
def to_json(self) -> str:
    """Returns the JSON representation of the actual instance"""
    if self.actual_instance is None:
        return "null"

    if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
        return self.actual_instance.to_json()
    else:
        return json.dumps(self.actual_instance)

to_str()

Returns the string representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/content_one_of_inner.py
132
133
134
def to_str(self) -> str:
    """Returns the string representation of the actual instance"""
    return pprint.pformat(self.model_dump())

CustomRunResultUpdate

Bases: BaseModel

Object holding a custom defined update of the agent result during streaming.

Show JSON schema:
{
  "$defs": {
    "RunStatus": {
      "description": "RunStatus",
      "enum": [
        "pending",
        "error",
        "success",
        "timeout",
        "interrupted"
      ],
      "title": "RunStatus",
      "type": "string"
    }
  },
  "description": "Object holding a custom defined update of the agent result during streaming.",
  "properties": {
    "type": {
      "title": "Type",
      "type": "string"
    },
    "run_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the run.",
      "title": "Run Id"
    },
    "status": {
      "$ref": "#/$defs/RunStatus",
      "description": "Status of the Run when this result was generated"
    },
    "update": {
      "additionalProperties": true,
      "description": "An update in the SSE event streaming where streaming mode is set to custom. The schema is described in agent ACP descriptor under 'spec.custom_streaming_update'.",
      "title": "Update",
      "type": "object"
    }
  },
  "required": [
    "type",
    "status",
    "update"
  ],
  "title": "CustomRunResultUpdate",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Validators:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/custom_run_result_update.py
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
class CustomRunResultUpdate(BaseModel):
    """
    Object holding a custom defined update of the agent result during streaming.
    """ # noqa: E501
    type: StrictStr
    run_id: Optional[StrictStr] = Field(default=None, description="The ID of the run.")
    status: RunStatus = Field(description="Status of the Run when this result was generated")
    update: Dict[str, Any] = Field(description="An update in the SSE event streaming where streaming mode is set to custom. The schema is described in agent ACP descriptor under 'spec.custom_streaming_update'.")
    __properties: ClassVar[List[str]] = ["type", "run_id", "status", "update"]

    @field_validator('type')
    def type_validate_enum(cls, value):
        """Validates the enum"""
        if value not in set(['custom']):
            raise ValueError("must be one of enum values ('custom')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of CustomRunResultUpdate from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of CustomRunResultUpdate from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "type": obj.get("type"),
            "run_id": obj.get("run_id"),
            "status": obj.get("status"),
            "update": obj.get("update")
        })
        return _obj

run_id = None pydantic-field

The ID of the run.

status pydantic-field

Status of the Run when this result was generated

update pydantic-field

An update in the SSE event streaming where streaming mode is set to custom. The schema is described in agent ACP descriptor under 'spec.custom_streaming_update'.

from_dict(obj) classmethod

Create an instance of CustomRunResultUpdate from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/custom_run_result_update.py
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of CustomRunResultUpdate from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "type": obj.get("type"),
        "run_id": obj.get("run_id"),
        "status": obj.get("status"),
        "update": obj.get("update")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of CustomRunResultUpdate from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/custom_run_result_update.py
61
62
63
64
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of CustomRunResultUpdate from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/custom_run_result_update.py
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/custom_run_result_update.py
56
57
58
59
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/custom_run_result_update.py
52
53
54
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

type_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/custom_run_result_update.py
38
39
40
41
42
43
@field_validator('type')
def type_validate_enum(cls, value):
    """Validates the enum"""
    if value not in set(['custom']):
        raise ValueError("must be one of enum values ('custom')")
    return value

Message

Bases: BaseModel

Message

Show JSON schema:
{
  "$defs": {
    "Content": {
      "description": "The content of the message.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 1 Validator"
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 2 Validator"
        },
        "actual_instance": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "List[ContentOneOfInner]",
            "str"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "Content",
      "type": "object"
    },
    "ContentOneOfInner": {
      "description": "ContentOneOfInner",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageTextBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageAnyBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "MessageTextBlock",
            "MessageAnyBlock"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ContentOneOfInner",
      "type": "object"
    },
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    }
  },
  "description": "Message",
  "properties": {
    "role": {
      "description": "The role of the message.",
      "title": "Role",
      "type": "string"
    },
    "content": {
      "$ref": "#/$defs/Content"
    },
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the message.",
      "title": "Id"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The metadata of the message.",
      "title": "Metadata"
    }
  },
  "required": [
    "role",
    "content"
  ],
  "title": "Message",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class Message(BaseModel):
    """
    Message
    """ # noqa: E501
    role: StrictStr = Field(description="The role of the message.")
    content: Content
    id: Optional[StrictStr] = Field(default=None, description="The ID of the message.")
    metadata: Optional[Dict[str, Any]] = Field(default=None, description="The metadata of the message.")
    __properties: ClassVar[List[str]] = ["role", "content", "id", "metadata"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of Message from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of content
        if self.content:
            _dict['content'] = self.content.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of Message from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "role": obj.get("role"),
            "content": Content.from_dict(obj["content"]) if obj.get("content") is not None else None,
            "id": obj.get("id"),
            "metadata": obj.get("metadata")
        })
        return _obj

id = None pydantic-field

The ID of the message.

metadata = None pydantic-field

The metadata of the message.

role pydantic-field

The role of the message.

from_dict(obj) classmethod

Create an instance of Message from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message.py
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of Message from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "role": obj.get("role"),
        "content": Content.from_dict(obj["content"]) if obj.get("content") is not None else None,
        "id": obj.get("id"),
        "metadata": obj.get("metadata")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of Message from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message.py
54
55
56
57
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of Message from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message.py
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of content
    if self.content:
        _dict['content'] = self.content.to_dict()
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message.py
49
50
51
52
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message.py
45
46
47
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

MessageAnyBlock

Bases: BaseModel

MessageAnyBlock

Show JSON schema:
{
  "description": "MessageAnyBlock",
  "properties": {
    "type": {
      "title": "Type",
      "type": "string"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Metadata"
    }
  },
  "required": [
    "type"
  ],
  "title": "MessageAnyBlock",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

  • type (StrictStr)
  • metadata (Optional[Dict[str, Any]])
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message_any_block.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
class MessageAnyBlock(BaseModel):
    """
    MessageAnyBlock
    """ # noqa: E501
    type: StrictStr
    metadata: Optional[Dict[str, Any]] = None
    __properties: ClassVar[List[str]] = ["type", "metadata"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of MessageAnyBlock from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of MessageAnyBlock from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "type": obj.get("type"),
            "metadata": obj.get("metadata")
        })
        return _obj

from_dict(obj) classmethod

Create an instance of MessageAnyBlock from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message_any_block.py
76
77
78
79
80
81
82
83
84
85
86
87
88
89
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of MessageAnyBlock from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "type": obj.get("type"),
        "metadata": obj.get("metadata")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of MessageAnyBlock from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message_any_block.py
51
52
53
54
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of MessageAnyBlock from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message_any_block.py
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message_any_block.py
46
47
48
49
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message_any_block.py
42
43
44
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

MessageTextBlock

Bases: BaseModel

MessageTextBlock

Show JSON schema:
{
  "description": "MessageTextBlock",
  "properties": {
    "text": {
      "title": "Text",
      "type": "string"
    },
    "type": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "title": "Type"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Metadata"
    }
  },
  "required": [
    "text",
    "type"
  ],
  "title": "MessageTextBlock",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

  • text (StrictStr)
  • type (Optional[Any])
  • metadata (Optional[Dict[str, Any]])
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message_text_block.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
class MessageTextBlock(BaseModel):
    """
    MessageTextBlock
    """ # noqa: E501
    text: StrictStr
    type: Optional[Any]
    metadata: Optional[Dict[str, Any]] = None
    __properties: ClassVar[List[str]] = ["text", "type", "metadata"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of MessageTextBlock from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # set to None if type (nullable) is None
        # and model_fields_set contains the field
        if self.type is None and "type" in self.model_fields_set:
            _dict['type'] = None

        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of MessageTextBlock from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "text": obj.get("text"),
            "type": obj.get("type"),
            "metadata": obj.get("metadata")
        })
        return _obj

from_dict(obj) classmethod

Create an instance of MessageTextBlock from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message_text_block.py
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of MessageTextBlock from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "text": obj.get("text"),
        "type": obj.get("type"),
        "metadata": obj.get("metadata")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of MessageTextBlock from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message_text_block.py
52
53
54
55
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of MessageTextBlock from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message_text_block.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # set to None if type (nullable) is None
    # and model_fields_set contains the field
    if self.type is None and "type" in self.model_fields_set:
        _dict['type'] = None

    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message_text_block.py
47
48
49
50
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/message_text_block.py
43
44
45
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

Run

Bases: BaseModel

Holds common information of a run

Show JSON schema:
{
  "$defs": {
    "RunStatus": {
      "description": "RunStatus",
      "enum": [
        "pending",
        "error",
        "success",
        "timeout",
        "interrupted"
      ],
      "title": "RunStatus",
      "type": "string"
    }
  },
  "description": "Holds common information of a run",
  "properties": {
    "run_id": {
      "description": "The ID of the run.",
      "title": "Run Id",
      "type": "string"
    },
    "thread_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Thread ID wher the Run belongs to. This is populated only for runs on agents agents supporting Threads.",
      "title": "Thread Id"
    },
    "agent_id": {
      "description": "The agent that was used for this run.",
      "title": "Agent Id",
      "type": "string"
    },
    "created_at": {
      "description": "The time the run was created.",
      "format": "date-time",
      "title": "Created At",
      "type": "string"
    },
    "updated_at": {
      "description": "The last time the run was updated.",
      "format": "date-time",
      "title": "Updated At",
      "type": "string"
    },
    "status": {
      "$ref": "#/$defs/RunStatus",
      "description": "The status of the run. One of 'pending', 'error', 'success', 'timeout', 'interrupted'."
    }
  },
  "required": [
    "run_id",
    "agent_id",
    "created_at",
    "updated_at",
    "status"
  ],
  "title": "Run",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class Run(BaseModel):
    """
    Holds common information of a run
    """ # noqa: E501
    run_id: StrictStr = Field(description="The ID of the run.")
    thread_id: Optional[StrictStr] = Field(default=None, description="Optional Thread ID wher the Run belongs to. This is populated only for runs on agents agents supporting Threads.")
    agent_id: StrictStr = Field(description="The agent that was used for this run.")
    created_at: datetime = Field(description="The time the run was created.")
    updated_at: datetime = Field(description="The last time the run was updated.")
    status: RunStatus = Field(description="The status of the run. One of 'pending', 'error', 'success', 'timeout', 'interrupted'.")
    __properties: ClassVar[List[str]] = ["run_id", "thread_id", "agent_id", "created_at", "updated_at", "status"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of Run from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of Run from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "run_id": obj.get("run_id"),
            "thread_id": obj.get("thread_id"),
            "agent_id": obj.get("agent_id"),
            "created_at": obj.get("created_at"),
            "updated_at": obj.get("updated_at"),
            "status": obj.get("status")
        })
        return _obj

agent_id pydantic-field

The agent that was used for this run.

created_at pydantic-field

The time the run was created.

run_id pydantic-field

The ID of the run.

status pydantic-field

The status of the run. One of 'pending', 'error', 'success', 'timeout', 'interrupted'.

thread_id = None pydantic-field

Optional Thread ID wher the Run belongs to. This is populated only for runs on agents agents supporting Threads.

updated_at pydantic-field

The last time the run was updated.

from_dict(obj) classmethod

Create an instance of Run from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run.py
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of Run from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "run_id": obj.get("run_id"),
        "thread_id": obj.get("thread_id"),
        "agent_id": obj.get("agent_id"),
        "created_at": obj.get("created_at"),
        "updated_at": obj.get("updated_at"),
        "status": obj.get("status")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of Run from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run.py
57
58
59
60
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of Run from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run.py
52
53
54
55
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run.py
48
49
50
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

RunCreate

Bases: BaseModel

Payload for creating a run.

Show JSON schema:
{
  "$defs": {
    "Config": {
      "description": "The configuration for the agent.",
      "properties": {
        "tags": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Tags"
        },
        "recursion_limit": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Recursion Limit"
        },
        "configurable": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The configuration for this agent. The schema is described in agent ACP descriptor under 'spec.config'. If missing, default values are used.",
          "title": "Configurable"
        }
      },
      "title": "Config",
      "type": "object"
    },
    "StreamMode": {
      "description": "If populated, indicates that the client requests to stream results with the specified streaming mode(s). The requested streaming mode(s) must be one or more of those supported by the agent as declared in agent ACP descriptor  under `specs.capabilities`",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/StreamingMode"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Anyof Schema 1 Validator"
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamingMode"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "StreamingMode",
            "List[StreamingMode]"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "StreamMode",
      "type": "object"
    },
    "StreamingMode": {
      "description": "StreamingMode",
      "enum": [
        "values",
        "custom"
      ],
      "title": "StreamingMode",
      "type": "string"
    }
  },
  "description": "Payload for creating a run.",
  "properties": {
    "agent_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The agent ID to run. If not provided will use the default agent for this service.",
      "title": "Agent Id"
    },
    "input": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.",
      "title": "Input"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Metadata to assign to the run.",
      "title": "Metadata"
    },
    "config": {
      "anyOf": [
        {
          "$ref": "#/$defs/Config"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "webhook": {
      "anyOf": [
        {
          "maxLength": 65536,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Webhook to call upon change of run status. This is a url that accepts a POST containing the `Run` object as body. See Callbacks definition.",
      "title": "Webhook"
    },
    "stream_mode": {
      "anyOf": [
        {
          "$ref": "#/$defs/StreamMode"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "on_disconnect": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "cancel",
      "description": "The disconnect mode to use. Must be one of 'cancel' or 'continue'.",
      "title": "On Disconnect"
    },
    "multitask_strategy": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "reject",
      "description": "Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.",
      "title": "Multitask Strategy"
    },
    "after_seconds": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The number of seconds to wait before starting the run. Use to schedule future runs.",
      "title": "After Seconds"
    }
  },
  "title": "RunCreate",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Validators:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create.py
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
class RunCreate(BaseModel):
    """
    Payload for creating a run.
    """ # noqa: E501
    agent_id: Optional[StrictStr] = Field(default=None, description="The agent ID to run. If not provided will use the default agent for this service.")
    input: Optional[Dict[str, Any]] = Field(default=None, description="The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.")
    metadata: Optional[Dict[str, Any]] = Field(default=None, description="Metadata to assign to the run.")
    config: Optional[Config] = None
    webhook: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=65536)]] = Field(default=None, description="Webhook to call upon change of run status. This is a url that accepts a POST containing the `Run` object as body. See Callbacks definition.")
    stream_mode: Optional[StreamMode] = None
    on_disconnect: Optional[StrictStr] = Field(default='cancel', description="The disconnect mode to use. Must be one of 'cancel' or 'continue'.")
    multitask_strategy: Optional[StrictStr] = Field(default='reject', description="Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.")
    after_seconds: Optional[StrictInt] = Field(default=None, description="The number of seconds to wait before starting the run. Use to schedule future runs.")
    __properties: ClassVar[List[str]] = ["agent_id", "input", "metadata", "config", "webhook", "stream_mode", "on_disconnect", "multitask_strategy", "after_seconds"]

    @field_validator('on_disconnect')
    def on_disconnect_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['cancel', 'continue']):
            raise ValueError("must be one of enum values ('cancel', 'continue')")
        return value

    @field_validator('multitask_strategy')
    def multitask_strategy_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['reject', 'rollback', 'interrupt', 'enqueue']):
            raise ValueError("must be one of enum values ('reject', 'rollback', 'interrupt', 'enqueue')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RunCreate from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of config
        if self.config:
            _dict['config'] = self.config.to_dict()
        # override the default output from pydantic by calling `to_dict()` of stream_mode
        if self.stream_mode:
            _dict['stream_mode'] = self.stream_mode.to_dict()
        # set to None if stream_mode (nullable) is None
        # and model_fields_set contains the field
        if self.stream_mode is None and "stream_mode" in self.model_fields_set:
            _dict['stream_mode'] = None

        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of RunCreate from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "agent_id": obj.get("agent_id"),
            "input": obj.get("input"),
            "metadata": obj.get("metadata"),
            "config": Config.from_dict(obj["config"]) if obj.get("config") is not None else None,
            "webhook": obj.get("webhook"),
            "stream_mode": StreamMode.from_dict(obj["stream_mode"]) if obj.get("stream_mode") is not None else None,
            "on_disconnect": obj.get("on_disconnect") if obj.get("on_disconnect") is not None else 'cancel',
            "multitask_strategy": obj.get("multitask_strategy") if obj.get("multitask_strategy") is not None else 'reject',
            "after_seconds": obj.get("after_seconds")
        })
        return _obj

after_seconds = None pydantic-field

The number of seconds to wait before starting the run. Use to schedule future runs.

agent_id = None pydantic-field

The agent ID to run. If not provided will use the default agent for this service.

input = None pydantic-field

The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.

metadata = None pydantic-field

Metadata to assign to the run.

multitask_strategy = 'reject' pydantic-field

Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.

on_disconnect = 'cancel' pydantic-field

The disconnect mode to use. Must be one of 'cancel' or 'continue'.

webhook = None pydantic-field

Webhook to call upon change of run status. This is a url that accepts a POST containing the Run object as body. See Callbacks definition.

from_dict(obj) classmethod

Create an instance of RunCreate from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create.py
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of RunCreate from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "agent_id": obj.get("agent_id"),
        "input": obj.get("input"),
        "metadata": obj.get("metadata"),
        "config": Config.from_dict(obj["config"]) if obj.get("config") is not None else None,
        "webhook": obj.get("webhook"),
        "stream_mode": StreamMode.from_dict(obj["stream_mode"]) if obj.get("stream_mode") is not None else None,
        "on_disconnect": obj.get("on_disconnect") if obj.get("on_disconnect") is not None else 'cancel',
        "multitask_strategy": obj.get("multitask_strategy") if obj.get("multitask_strategy") is not None else 'reject',
        "after_seconds": obj.get("after_seconds")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of RunCreate from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create.py
81
82
83
84
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of RunCreate from a JSON string"""
    return cls.from_dict(json.loads(json_str))

multitask_strategy_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create.py
55
56
57
58
59
60
61
62
63
@field_validator('multitask_strategy')
def multitask_strategy_validate_enum(cls, value):
    """Validates the enum"""
    if value is None:
        return value

    if value not in set(['reject', 'rollback', 'interrupt', 'enqueue']):
        raise ValueError("must be one of enum values ('reject', 'rollback', 'interrupt', 'enqueue')")
    return value

on_disconnect_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create.py
45
46
47
48
49
50
51
52
53
@field_validator('on_disconnect')
def on_disconnect_validate_enum(cls, value):
    """Validates the enum"""
    if value is None:
        return value

    if value not in set(['cancel', 'continue']):
        raise ValueError("must be one of enum values ('cancel', 'continue')")
    return value

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create.py
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of config
    if self.config:
        _dict['config'] = self.config.to_dict()
    # override the default output from pydantic by calling `to_dict()` of stream_mode
    if self.stream_mode:
        _dict['stream_mode'] = self.stream_mode.to_dict()
    # set to None if stream_mode (nullable) is None
    # and model_fields_set contains the field
    if self.stream_mode is None and "stream_mode" in self.model_fields_set:
        _dict['stream_mode'] = None

    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create.py
76
77
78
79
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create.py
72
73
74
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

RunCreateStateful

Bases: BaseModel

Payload for creating a stateful run.

Show JSON schema:
{
  "$defs": {
    "Config": {
      "description": "The configuration for the agent.",
      "properties": {
        "tags": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Tags"
        },
        "recursion_limit": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Recursion Limit"
        },
        "configurable": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The configuration for this agent. The schema is described in agent ACP descriptor under 'spec.config'. If missing, default values are used.",
          "title": "Configurable"
        }
      },
      "title": "Config",
      "type": "object"
    },
    "StreamMode": {
      "description": "If populated, indicates that the client requests to stream results with the specified streaming mode(s). The requested streaming mode(s) must be one or more of those supported by the agent as declared in agent ACP descriptor  under `specs.capabilities`",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/StreamingMode"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Anyof Schema 1 Validator"
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamingMode"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "StreamingMode",
            "List[StreamingMode]"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "StreamMode",
      "type": "object"
    },
    "StreamingMode": {
      "description": "StreamingMode",
      "enum": [
        "values",
        "custom"
      ],
      "title": "StreamingMode",
      "type": "string"
    }
  },
  "description": "Payload for creating a stateful run.",
  "properties": {
    "agent_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The agent ID to run. If not provided will use the default agent for this service.",
      "title": "Agent Id"
    },
    "input": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.",
      "title": "Input"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Metadata to assign to the run.",
      "title": "Metadata"
    },
    "config": {
      "anyOf": [
        {
          "$ref": "#/$defs/Config"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "webhook": {
      "anyOf": [
        {
          "maxLength": 65536,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Webhook to call upon change of run status. This is a url that accepts a POST containing the `Run` object as body. See Callbacks definition.",
      "title": "Webhook"
    },
    "stream_mode": {
      "anyOf": [
        {
          "$ref": "#/$defs/StreamMode"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "on_disconnect": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "cancel",
      "description": "The disconnect mode to use. Must be one of 'cancel' or 'continue'.",
      "title": "On Disconnect"
    },
    "multitask_strategy": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "reject",
      "description": "Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.",
      "title": "Multitask Strategy"
    },
    "after_seconds": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The number of seconds to wait before starting the run. Use to schedule future runs.",
      "title": "After Seconds"
    },
    "stream_subgraphs": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": false,
      "description": "Whether to stream output from subgraphs.",
      "title": "Stream Subgraphs"
    },
    "if_not_exists": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "reject",
      "description": "How to handle missing thread. Must be either 'reject' (raise error if missing), or 'create' (create new thread).",
      "title": "If Not Exists"
    }
  },
  "title": "RunCreateStateful",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Validators:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateful.py
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
class RunCreateStateful(BaseModel):
    """
    Payload for creating a stateful run.
    """ # noqa: E501
    agent_id: Optional[StrictStr] = Field(default=None, description="The agent ID to run. If not provided will use the default agent for this service.")
    input: Optional[Dict[str, Any]] = Field(default=None, description="The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.")
    metadata: Optional[Dict[str, Any]] = Field(default=None, description="Metadata to assign to the run.")
    config: Optional[Config] = None
    webhook: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=65536)]] = Field(default=None, description="Webhook to call upon change of run status. This is a url that accepts a POST containing the `Run` object as body. See Callbacks definition.")
    stream_mode: Optional[StreamMode] = None
    on_disconnect: Optional[StrictStr] = Field(default='cancel', description="The disconnect mode to use. Must be one of 'cancel' or 'continue'.")
    multitask_strategy: Optional[StrictStr] = Field(default='reject', description="Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.")
    after_seconds: Optional[StrictInt] = Field(default=None, description="The number of seconds to wait before starting the run. Use to schedule future runs.")
    stream_subgraphs: Optional[StrictBool] = Field(default=False, description="Whether to stream output from subgraphs.")
    if_not_exists: Optional[StrictStr] = Field(default='reject', description="How to handle missing thread. Must be either 'reject' (raise error if missing), or 'create' (create new thread).")
    __properties: ClassVar[List[str]] = ["agent_id", "input", "metadata", "config", "webhook", "stream_mode", "on_disconnect", "multitask_strategy", "after_seconds", "stream_subgraphs", "if_not_exists"]

    @field_validator('on_disconnect')
    def on_disconnect_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['cancel', 'continue']):
            raise ValueError("must be one of enum values ('cancel', 'continue')")
        return value

    @field_validator('multitask_strategy')
    def multitask_strategy_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['reject', 'rollback', 'interrupt', 'enqueue']):
            raise ValueError("must be one of enum values ('reject', 'rollback', 'interrupt', 'enqueue')")
        return value

    @field_validator('if_not_exists')
    def if_not_exists_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['create', 'reject']):
            raise ValueError("must be one of enum values ('create', 'reject')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RunCreateStateful from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of config
        if self.config:
            _dict['config'] = self.config.to_dict()
        # override the default output from pydantic by calling `to_dict()` of stream_mode
        if self.stream_mode:
            _dict['stream_mode'] = self.stream_mode.to_dict()
        # set to None if stream_mode (nullable) is None
        # and model_fields_set contains the field
        if self.stream_mode is None and "stream_mode" in self.model_fields_set:
            _dict['stream_mode'] = None

        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of RunCreateStateful from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "agent_id": obj.get("agent_id"),
            "input": obj.get("input"),
            "metadata": obj.get("metadata"),
            "config": Config.from_dict(obj["config"]) if obj.get("config") is not None else None,
            "webhook": obj.get("webhook"),
            "stream_mode": StreamMode.from_dict(obj["stream_mode"]) if obj.get("stream_mode") is not None else None,
            "on_disconnect": obj.get("on_disconnect") if obj.get("on_disconnect") is not None else 'cancel',
            "multitask_strategy": obj.get("multitask_strategy") if obj.get("multitask_strategy") is not None else 'reject',
            "after_seconds": obj.get("after_seconds"),
            "stream_subgraphs": obj.get("stream_subgraphs") if obj.get("stream_subgraphs") is not None else False,
            "if_not_exists": obj.get("if_not_exists") if obj.get("if_not_exists") is not None else 'reject'
        })
        return _obj

after_seconds = None pydantic-field

The number of seconds to wait before starting the run. Use to schedule future runs.

agent_id = None pydantic-field

The agent ID to run. If not provided will use the default agent for this service.

if_not_exists = 'reject' pydantic-field

How to handle missing thread. Must be either 'reject' (raise error if missing), or 'create' (create new thread).

input = None pydantic-field

The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.

metadata = None pydantic-field

Metadata to assign to the run.

multitask_strategy = 'reject' pydantic-field

Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.

on_disconnect = 'cancel' pydantic-field

The disconnect mode to use. Must be one of 'cancel' or 'continue'.

stream_subgraphs = False pydantic-field

Whether to stream output from subgraphs.

webhook = None pydantic-field

Webhook to call upon change of run status. This is a url that accepts a POST containing the Run object as body. See Callbacks definition.

from_dict(obj) classmethod

Create an instance of RunCreateStateful from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateful.py
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of RunCreateStateful from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "agent_id": obj.get("agent_id"),
        "input": obj.get("input"),
        "metadata": obj.get("metadata"),
        "config": Config.from_dict(obj["config"]) if obj.get("config") is not None else None,
        "webhook": obj.get("webhook"),
        "stream_mode": StreamMode.from_dict(obj["stream_mode"]) if obj.get("stream_mode") is not None else None,
        "on_disconnect": obj.get("on_disconnect") if obj.get("on_disconnect") is not None else 'cancel',
        "multitask_strategy": obj.get("multitask_strategy") if obj.get("multitask_strategy") is not None else 'reject',
        "after_seconds": obj.get("after_seconds"),
        "stream_subgraphs": obj.get("stream_subgraphs") if obj.get("stream_subgraphs") is not None else False,
        "if_not_exists": obj.get("if_not_exists") if obj.get("if_not_exists") is not None else 'reject'
    })
    return _obj

from_json(json_str) classmethod

Create an instance of RunCreateStateful from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateful.py
93
94
95
96
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of RunCreateStateful from a JSON string"""
    return cls.from_dict(json.loads(json_str))

if_not_exists_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateful.py
67
68
69
70
71
72
73
74
75
@field_validator('if_not_exists')
def if_not_exists_validate_enum(cls, value):
    """Validates the enum"""
    if value is None:
        return value

    if value not in set(['create', 'reject']):
        raise ValueError("must be one of enum values ('create', 'reject')")
    return value

multitask_strategy_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateful.py
57
58
59
60
61
62
63
64
65
@field_validator('multitask_strategy')
def multitask_strategy_validate_enum(cls, value):
    """Validates the enum"""
    if value is None:
        return value

    if value not in set(['reject', 'rollback', 'interrupt', 'enqueue']):
        raise ValueError("must be one of enum values ('reject', 'rollback', 'interrupt', 'enqueue')")
    return value

on_disconnect_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateful.py
47
48
49
50
51
52
53
54
55
@field_validator('on_disconnect')
def on_disconnect_validate_enum(cls, value):
    """Validates the enum"""
    if value is None:
        return value

    if value not in set(['cancel', 'continue']):
        raise ValueError("must be one of enum values ('cancel', 'continue')")
    return value

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateful.py
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of config
    if self.config:
        _dict['config'] = self.config.to_dict()
    # override the default output from pydantic by calling `to_dict()` of stream_mode
    if self.stream_mode:
        _dict['stream_mode'] = self.stream_mode.to_dict()
    # set to None if stream_mode (nullable) is None
    # and model_fields_set contains the field
    if self.stream_mode is None and "stream_mode" in self.model_fields_set:
        _dict['stream_mode'] = None

    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateful.py
88
89
90
91
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateful.py
84
85
86
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

RunCreateStateless

Bases: BaseModel

Payload for creating a stateless run.

Show JSON schema:
{
  "$defs": {
    "Config": {
      "description": "The configuration for the agent.",
      "properties": {
        "tags": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Tags"
        },
        "recursion_limit": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Recursion Limit"
        },
        "configurable": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The configuration for this agent. The schema is described in agent ACP descriptor under 'spec.config'. If missing, default values are used.",
          "title": "Configurable"
        }
      },
      "title": "Config",
      "type": "object"
    },
    "StreamMode": {
      "description": "If populated, indicates that the client requests to stream results with the specified streaming mode(s). The requested streaming mode(s) must be one or more of those supported by the agent as declared in agent ACP descriptor  under `specs.capabilities`",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/StreamingMode"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Anyof Schema 1 Validator"
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamingMode"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "StreamingMode",
            "List[StreamingMode]"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "StreamMode",
      "type": "object"
    },
    "StreamingMode": {
      "description": "StreamingMode",
      "enum": [
        "values",
        "custom"
      ],
      "title": "StreamingMode",
      "type": "string"
    }
  },
  "description": "Payload for creating a stateless run.",
  "properties": {
    "agent_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The agent ID to run. If not provided will use the default agent for this service.",
      "title": "Agent Id"
    },
    "input": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.",
      "title": "Input"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Metadata to assign to the run.",
      "title": "Metadata"
    },
    "config": {
      "anyOf": [
        {
          "$ref": "#/$defs/Config"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "webhook": {
      "anyOf": [
        {
          "maxLength": 65536,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Webhook to call upon change of run status. This is a url that accepts a POST containing the `Run` object as body. See Callbacks definition.",
      "title": "Webhook"
    },
    "stream_mode": {
      "anyOf": [
        {
          "$ref": "#/$defs/StreamMode"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "on_disconnect": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "cancel",
      "description": "The disconnect mode to use. Must be one of 'cancel' or 'continue'.",
      "title": "On Disconnect"
    },
    "multitask_strategy": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "reject",
      "description": "Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.",
      "title": "Multitask Strategy"
    },
    "after_seconds": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The number of seconds to wait before starting the run. Use to schedule future runs.",
      "title": "After Seconds"
    },
    "on_completion": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "delete",
      "description": "Whether to delete or keep the thread created for a stateless run. Must be one of 'delete' or 'keep'.",
      "title": "On Completion"
    }
  },
  "title": "RunCreateStateless",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Validators:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateless.py
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
class RunCreateStateless(BaseModel):
    """
    Payload for creating a stateless run.
    """ # noqa: E501
    agent_id: Optional[StrictStr] = Field(default=None, description="The agent ID to run. If not provided will use the default agent for this service.")
    input: Optional[Dict[str, Any]] = Field(default=None, description="The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.")
    metadata: Optional[Dict[str, Any]] = Field(default=None, description="Metadata to assign to the run.")
    config: Optional[Config] = None
    webhook: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=65536)]] = Field(default=None, description="Webhook to call upon change of run status. This is a url that accepts a POST containing the `Run` object as body. See Callbacks definition.")
    stream_mode: Optional[StreamMode] = None
    on_disconnect: Optional[StrictStr] = Field(default='cancel', description="The disconnect mode to use. Must be one of 'cancel' or 'continue'.")
    multitask_strategy: Optional[StrictStr] = Field(default='reject', description="Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.")
    after_seconds: Optional[StrictInt] = Field(default=None, description="The number of seconds to wait before starting the run. Use to schedule future runs.")
    on_completion: Optional[StrictStr] = Field(default='delete', description="Whether to delete or keep the thread created for a stateless run. Must be one of 'delete' or 'keep'.")
    __properties: ClassVar[List[str]] = ["agent_id", "input", "metadata", "config", "webhook", "stream_mode", "on_disconnect", "multitask_strategy", "after_seconds", "on_completion"]

    @field_validator('on_disconnect')
    def on_disconnect_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['cancel', 'continue']):
            raise ValueError("must be one of enum values ('cancel', 'continue')")
        return value

    @field_validator('multitask_strategy')
    def multitask_strategy_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['reject', 'rollback', 'interrupt', 'enqueue']):
            raise ValueError("must be one of enum values ('reject', 'rollback', 'interrupt', 'enqueue')")
        return value

    @field_validator('on_completion')
    def on_completion_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['delete', 'keep']):
            raise ValueError("must be one of enum values ('delete', 'keep')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RunCreateStateless from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of config
        if self.config:
            _dict['config'] = self.config.to_dict()
        # override the default output from pydantic by calling `to_dict()` of stream_mode
        if self.stream_mode:
            _dict['stream_mode'] = self.stream_mode.to_dict()
        # set to None if stream_mode (nullable) is None
        # and model_fields_set contains the field
        if self.stream_mode is None and "stream_mode" in self.model_fields_set:
            _dict['stream_mode'] = None

        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of RunCreateStateless from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "agent_id": obj.get("agent_id"),
            "input": obj.get("input"),
            "metadata": obj.get("metadata"),
            "config": Config.from_dict(obj["config"]) if obj.get("config") is not None else None,
            "webhook": obj.get("webhook"),
            "stream_mode": StreamMode.from_dict(obj["stream_mode"]) if obj.get("stream_mode") is not None else None,
            "on_disconnect": obj.get("on_disconnect") if obj.get("on_disconnect") is not None else 'cancel',
            "multitask_strategy": obj.get("multitask_strategy") if obj.get("multitask_strategy") is not None else 'reject',
            "after_seconds": obj.get("after_seconds"),
            "on_completion": obj.get("on_completion") if obj.get("on_completion") is not None else 'delete'
        })
        return _obj

after_seconds = None pydantic-field

The number of seconds to wait before starting the run. Use to schedule future runs.

agent_id = None pydantic-field

The agent ID to run. If not provided will use the default agent for this service.

input = None pydantic-field

The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.

metadata = None pydantic-field

Metadata to assign to the run.

multitask_strategy = 'reject' pydantic-field

Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.

on_completion = 'delete' pydantic-field

Whether to delete or keep the thread created for a stateless run. Must be one of 'delete' or 'keep'.

on_disconnect = 'cancel' pydantic-field

The disconnect mode to use. Must be one of 'cancel' or 'continue'.

webhook = None pydantic-field

Webhook to call upon change of run status. This is a url that accepts a POST containing the Run object as body. See Callbacks definition.

from_dict(obj) classmethod

Create an instance of RunCreateStateless from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateless.py
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of RunCreateStateless from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "agent_id": obj.get("agent_id"),
        "input": obj.get("input"),
        "metadata": obj.get("metadata"),
        "config": Config.from_dict(obj["config"]) if obj.get("config") is not None else None,
        "webhook": obj.get("webhook"),
        "stream_mode": StreamMode.from_dict(obj["stream_mode"]) if obj.get("stream_mode") is not None else None,
        "on_disconnect": obj.get("on_disconnect") if obj.get("on_disconnect") is not None else 'cancel',
        "multitask_strategy": obj.get("multitask_strategy") if obj.get("multitask_strategy") is not None else 'reject',
        "after_seconds": obj.get("after_seconds"),
        "on_completion": obj.get("on_completion") if obj.get("on_completion") is not None else 'delete'
    })
    return _obj

from_json(json_str) classmethod

Create an instance of RunCreateStateless from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateless.py
92
93
94
95
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of RunCreateStateless from a JSON string"""
    return cls.from_dict(json.loads(json_str))

multitask_strategy_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateless.py
56
57
58
59
60
61
62
63
64
@field_validator('multitask_strategy')
def multitask_strategy_validate_enum(cls, value):
    """Validates the enum"""
    if value is None:
        return value

    if value not in set(['reject', 'rollback', 'interrupt', 'enqueue']):
        raise ValueError("must be one of enum values ('reject', 'rollback', 'interrupt', 'enqueue')")
    return value

on_completion_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateless.py
66
67
68
69
70
71
72
73
74
@field_validator('on_completion')
def on_completion_validate_enum(cls, value):
    """Validates the enum"""
    if value is None:
        return value

    if value not in set(['delete', 'keep']):
        raise ValueError("must be one of enum values ('delete', 'keep')")
    return value

on_disconnect_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateless.py
46
47
48
49
50
51
52
53
54
@field_validator('on_disconnect')
def on_disconnect_validate_enum(cls, value):
    """Validates the enum"""
    if value is None:
        return value

    if value not in set(['cancel', 'continue']):
        raise ValueError("must be one of enum values ('cancel', 'continue')")
    return value

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateless.py
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of config
    if self.config:
        _dict['config'] = self.config.to_dict()
    # override the default output from pydantic by calling `to_dict()` of stream_mode
    if self.stream_mode:
        _dict['stream_mode'] = self.stream_mode.to_dict()
    # set to None if stream_mode (nullable) is None
    # and model_fields_set contains the field
    if self.stream_mode is None and "stream_mode" in self.model_fields_set:
        _dict['stream_mode'] = None

    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateless.py
87
88
89
90
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_create_stateless.py
83
84
85
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

RunError

Bases: BaseModel

Run terminated with an error

Show JSON schema:
{
  "description": "Run terminated with an error",
  "properties": {
    "type": {
      "title": "Type",
      "type": "string"
    },
    "run_id": {
      "description": "The ID of the run.",
      "title": "Run Id",
      "type": "string"
    },
    "errcode": {
      "description": "code of the error",
      "title": "Errcode",
      "type": "integer"
    },
    "description": {
      "description": "description of the error",
      "title": "Description",
      "type": "string"
    }
  },
  "required": [
    "type",
    "run_id",
    "errcode",
    "description"
  ],
  "title": "RunError",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Validators:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_error.py
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
class RunError(BaseModel):
    """
    Run terminated with an error
    """ # noqa: E501
    type: StrictStr
    run_id: StrictStr = Field(description="The ID of the run.")
    errcode: StrictInt = Field(description="code of the error")
    description: StrictStr = Field(description="description of the error")
    __properties: ClassVar[List[str]] = ["type", "run_id", "errcode", "description"]

    @field_validator('type')
    def type_validate_enum(cls, value):
        """Validates the enum"""
        if value not in set(['error']):
            raise ValueError("must be one of enum values ('error')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RunError from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of RunError from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "type": obj.get("type"),
            "run_id": obj.get("run_id"),
            "errcode": obj.get("errcode"),
            "description": obj.get("description")
        })
        return _obj

description pydantic-field

description of the error

errcode pydantic-field

code of the error

run_id pydantic-field

The ID of the run.

from_dict(obj) classmethod

Create an instance of RunError from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_error.py
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of RunError from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "type": obj.get("type"),
        "run_id": obj.get("run_id"),
        "errcode": obj.get("errcode"),
        "description": obj.get("description")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of RunError from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_error.py
60
61
62
63
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of RunError from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_error.py
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_error.py
55
56
57
58
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_error.py
51
52
53
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

type_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_error.py
37
38
39
40
41
42
@field_validator('type')
def type_validate_enum(cls, value):
    """Validates the enum"""
    if value not in set(['error']):
        raise ValueError("must be one of enum values ('error')")
    return value

RunInterrupt

Bases: BaseModel

Interrupt occurred during a Run

Show JSON schema:
{
  "description": "Interrupt occurred during a Run",
  "properties": {
    "type": {
      "title": "Type",
      "type": "string"
    },
    "interrupt": {
      "additionalProperties": true,
      "description": "This schema describes the interrupt payload. Actual schema describes a polimorphic object, which means a schema structured with `oneOf` and `discriminator`. The discriminator is the `interrupt_type`, while the schemas will be the ones defined in the agent spec under `interrupts`/`interrupt_payload` For example:          oneOf:   - $ref: '#/components/schemas/ApprovalInterruptPayload'   - $ref: '#/components/schemas/QuestionInterruptPayload' discriminator:   propertyName: interruput_type   mapping:     approval: '#/components/schemas/ApprovalInterruptPayload'     question: '#/components/schemas/QuestionInterruptPayload'",
      "title": "Interrupt",
      "type": "object"
    }
  },
  "required": [
    "type",
    "interrupt"
  ],
  "title": "RunInterrupt",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

  • type (StrictStr)
  • interrupt (Dict[str, Any])

Validators:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_interrupt.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
class RunInterrupt(BaseModel):
    """
    Interrupt occurred during a Run
    """ # noqa: E501
    type: StrictStr
    interrupt: Dict[str, Any] = Field(description="This schema describes the interrupt payload. Actual schema describes a polimorphic object, which means a schema structured with `oneOf` and `discriminator`. The discriminator is the `interrupt_type`, while the schemas will be the ones defined in the agent spec under `interrupts`/`interrupt_payload` For example:          oneOf:   - $ref: '#/components/schemas/ApprovalInterruptPayload'   - $ref: '#/components/schemas/QuestionInterruptPayload' discriminator:   propertyName: interruput_type   mapping:     approval: '#/components/schemas/ApprovalInterruptPayload'     question: '#/components/schemas/QuestionInterruptPayload'")
    __properties: ClassVar[List[str]] = ["type", "interrupt"]

    @field_validator('type')
    def type_validate_enum(cls, value):
        """Validates the enum"""
        if value not in set(['interrupt']):
            raise ValueError("must be one of enum values ('interrupt')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RunInterrupt from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of RunInterrupt from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "type": obj.get("type"),
            "interrupt": obj.get("interrupt")
        })
        return _obj

interrupt pydantic-field

This schema describes the interrupt payload. Actual schema describes a polimorphic object, which means a schema structured with oneOf and discriminator. The discriminator is the interrupt_type, while the schemas will be the ones defined in the agent spec under interrupts/interrupt_payload For example: oneOf: - $ref: '#/components/schemas/ApprovalInterruptPayload' - $ref: '#/components/schemas/QuestionInterruptPayload' discriminator: propertyName: interruput_type mapping: approval: '#/components/schemas/ApprovalInterruptPayload' question: '#/components/schemas/QuestionInterruptPayload'

from_dict(obj) classmethod

Create an instance of RunInterrupt from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_interrupt.py
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of RunInterrupt from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "type": obj.get("type"),
        "interrupt": obj.get("interrupt")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of RunInterrupt from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_interrupt.py
58
59
60
61
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of RunInterrupt from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_interrupt.py
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_interrupt.py
53
54
55
56
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_interrupt.py
49
50
51
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

type_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_interrupt.py
35
36
37
38
39
40
@field_validator('type')
def type_validate_enum(cls, value):
    """Validates the enum"""
    if value not in set(['interrupt']):
        raise ValueError("must be one of enum values ('interrupt')")
    return value

RunOutput

Bases: BaseModel

Output of a Run. Can be the final result or an interrupt.

Show JSON schema:
{
  "$defs": {
    "Content": {
      "description": "The content of the message.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 1 Validator"
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 2 Validator"
        },
        "actual_instance": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "List[ContentOneOfInner]",
            "str"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "Content",
      "type": "object"
    },
    "ContentOneOfInner": {
      "description": "ContentOneOfInner",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageTextBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageAnyBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "MessageTextBlock",
            "MessageAnyBlock"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ContentOneOfInner",
      "type": "object"
    },
    "Message": {
      "description": "Message",
      "properties": {
        "role": {
          "description": "The role of the message.",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/Content"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the message.",
          "title": "Id"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The metadata of the message.",
          "title": "Metadata"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "Message",
      "type": "object"
    },
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    },
    "RunError": {
      "description": "Run terminated with an error",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "run_id": {
          "description": "The ID of the run.",
          "title": "Run Id",
          "type": "string"
        },
        "errcode": {
          "description": "code of the error",
          "title": "Errcode",
          "type": "integer"
        },
        "description": {
          "description": "description of the error",
          "title": "Description",
          "type": "string"
        }
      },
      "required": [
        "type",
        "run_id",
        "errcode",
        "description"
      ],
      "title": "RunError",
      "type": "object"
    },
    "RunInterrupt": {
      "description": "Interrupt occurred during a Run",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "interrupt": {
          "additionalProperties": true,
          "description": "This schema describes the interrupt payload. Actual schema describes a polimorphic object, which means a schema structured with `oneOf` and `discriminator`. The discriminator is the `interrupt_type`, while the schemas will be the ones defined in the agent spec under `interrupts`/`interrupt_payload` For example:          oneOf:   - $ref: '#/components/schemas/ApprovalInterruptPayload'   - $ref: '#/components/schemas/QuestionInterruptPayload' discriminator:   propertyName: interruput_type   mapping:     approval: '#/components/schemas/ApprovalInterruptPayload'     question: '#/components/schemas/QuestionInterruptPayload'",
          "title": "Interrupt",
          "type": "object"
        }
      },
      "required": [
        "type",
        "interrupt"
      ],
      "title": "RunInterrupt",
      "type": "object"
    },
    "RunResult": {
      "description": "Final result of a Run.",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "values": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The output of the agent. The schema is described in agent ACP descriptor under 'spec.output'.",
          "title": "Values"
        },
        "messages": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/Message"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The messages returned by the run.",
          "title": "Messages"
        }
      },
      "required": [
        "type"
      ],
      "title": "RunResult",
      "type": "object"
    }
  },
  "description": "Output of a Run. Can be the final result or an interrupt.",
  "properties": {
    "oneof_schema_1_validator": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunResult"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "oneof_schema_2_validator": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunInterrupt"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "oneof_schema_3_validator": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunError"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "actual_instance": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunError"
        },
        {
          "$ref": "#/$defs/RunInterrupt"
        },
        {
          "$ref": "#/$defs/RunResult"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Actual Instance"
    },
    "one_of_schemas": {
      "default": [
        "RunInterrupt",
        "RunResult",
        "RunError"
      ],
      "items": {
        "type": "string"
      },
      "title": "One Of Schemas",
      "type": "array",
      "uniqueItems": true
    },
    "discriminator_value_class_map": {
      "additionalProperties": {
        "type": "string"
      },
      "default": {},
      "title": "Discriminator Value Class Map",
      "type": "object"
    }
  },
  "title": "RunOutput",
  "type": "object"
}

Config:

  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Validators:

  • actual_instance_must_validate_oneofactual_instance
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_output.py
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
class RunOutput(BaseModel):
    """
    Output of a Run. Can be the final result or an interrupt.
    """
    # data type: RunResult
    oneof_schema_1_validator: Optional[RunResult] = None
    # data type: RunInterrupt
    oneof_schema_2_validator: Optional[RunInterrupt] = None
    # data type: RunError
    oneof_schema_3_validator: Optional[RunError] = None
    actual_instance: Optional[Union[RunError, RunInterrupt, RunResult]] = None
    one_of_schemas: Set[str] = { "RunError", "RunInterrupt", "RunResult" }

    model_config = ConfigDict(
        validate_assignment=True,
        protected_namespaces=(),
    )


    discriminator_value_class_map: Dict[str, str] = {
    }

    def __init__(self, *args, **kwargs) -> None:
        if args:
            if len(args) > 1:
                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
            if kwargs:
                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
            super().__init__(actual_instance=args[0])
        else:
            super().__init__(**kwargs)

    @field_validator('actual_instance')
    def actual_instance_must_validate_oneof(cls, v):
        instance = RunOutput.model_construct()
        error_messages = []
        match = 0
        # validate data type: RunResult
        if not isinstance(v, RunResult):
            error_messages.append(f"Error! Input type `{type(v)}` is not `RunResult`")
        else:
            match += 1
        # validate data type: RunInterrupt
        if not isinstance(v, RunInterrupt):
            error_messages.append(f"Error! Input type `{type(v)}` is not `RunInterrupt`")
        else:
            match += 1
        # validate data type: RunError
        if not isinstance(v, RunError):
            error_messages.append(f"Error! Input type `{type(v)}` is not `RunError`")
        else:
            match += 1
        if match > 1:
            # more than 1 match
            raise ValueError("Multiple matches found when setting `actual_instance` in RunOutput with oneOf schemas: RunError, RunInterrupt, RunResult. Details: " + ", ".join(error_messages))
        elif match == 0:
            # no match
            raise ValueError("No match found when setting `actual_instance` in RunOutput with oneOf schemas: RunError, RunInterrupt, RunResult. Details: " + ", ".join(error_messages))
        else:
            return v

    @classmethod
    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
        return cls.from_json(json.dumps(obj))

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Returns the object represented by the json string"""
        instance = cls.model_construct()
        error_messages = []
        match = 0

        # deserialize data into RunResult
        try:
            instance.actual_instance = RunResult.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into RunInterrupt
        try:
            instance.actual_instance = RunInterrupt.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into RunError
        try:
            instance.actual_instance = RunError.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))

        if match > 1:
            # more than 1 match
            raise ValueError("Multiple matches found when deserializing the JSON string into RunOutput with oneOf schemas: RunError, RunInterrupt, RunResult. Details: " + ", ".join(error_messages))
        elif match == 0:
            # no match
            raise ValueError("No match found when deserializing the JSON string into RunOutput with oneOf schemas: RunError, RunInterrupt, RunResult. Details: " + ", ".join(error_messages))
        else:
            return instance

    def to_json(self) -> str:
        """Returns the JSON representation of the actual instance"""
        if self.actual_instance is None:
            return "null"

        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
            return self.actual_instance.to_json()
        else:
            return json.dumps(self.actual_instance)

    def to_dict(self) -> Optional[Union[Dict[str, Any], RunError, RunInterrupt, RunResult]]:
        """Returns the dict representation of the actual instance"""
        if self.actual_instance is None:
            return None

        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
            return self.actual_instance.to_dict()
        else:
            # primitive type
            return self.actual_instance

    def to_str(self) -> str:
        """Returns the string representation of the actual instance"""
        return pprint.pformat(self.model_dump())

from_json(json_str) classmethod

Returns the object represented by the json string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_output.py
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
@classmethod
def from_json(cls, json_str: str) -> Self:
    """Returns the object represented by the json string"""
    instance = cls.model_construct()
    error_messages = []
    match = 0

    # deserialize data into RunResult
    try:
        instance.actual_instance = RunResult.from_json(json_str)
        match += 1
    except (ValidationError, ValueError) as e:
        error_messages.append(str(e))
    # deserialize data into RunInterrupt
    try:
        instance.actual_instance = RunInterrupt.from_json(json_str)
        match += 1
    except (ValidationError, ValueError) as e:
        error_messages.append(str(e))
    # deserialize data into RunError
    try:
        instance.actual_instance = RunError.from_json(json_str)
        match += 1
    except (ValidationError, ValueError) as e:
        error_messages.append(str(e))

    if match > 1:
        # more than 1 match
        raise ValueError("Multiple matches found when deserializing the JSON string into RunOutput with oneOf schemas: RunError, RunInterrupt, RunResult. Details: " + ", ".join(error_messages))
    elif match == 0:
        # no match
        raise ValueError("No match found when deserializing the JSON string into RunOutput with oneOf schemas: RunError, RunInterrupt, RunResult. Details: " + ", ".join(error_messages))
    else:
        return instance

to_dict()

Returns the dict representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_output.py
141
142
143
144
145
146
147
148
149
150
def to_dict(self) -> Optional[Union[Dict[str, Any], RunError, RunInterrupt, RunResult]]:
    """Returns the dict representation of the actual instance"""
    if self.actual_instance is None:
        return None

    if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
        return self.actual_instance.to_dict()
    else:
        # primitive type
        return self.actual_instance

to_json()

Returns the JSON representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_output.py
131
132
133
134
135
136
137
138
139
def to_json(self) -> str:
    """Returns the JSON representation of the actual instance"""
    if self.actual_instance is None:
        return "null"

    if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
        return self.actual_instance.to_json()
    else:
        return json.dumps(self.actual_instance)

to_str()

Returns the string representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_output.py
152
153
154
def to_str(self) -> str:
    """Returns the string representation of the actual instance"""
    return pprint.pformat(self.model_dump())

RunOutputStream

Bases: BaseModel

Server-sent event containing one agent output event. Actual event type is carried inside the data.

Show JSON schema:
{
  "$defs": {
    "Content": {
      "description": "The content of the message.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 1 Validator"
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 2 Validator"
        },
        "actual_instance": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "List[ContentOneOfInner]",
            "str"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "Content",
      "type": "object"
    },
    "ContentOneOfInner": {
      "description": "ContentOneOfInner",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageTextBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageAnyBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "MessageTextBlock",
            "MessageAnyBlock"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ContentOneOfInner",
      "type": "object"
    },
    "CustomRunResultUpdate": {
      "description": "Object holding a custom defined update of the agent result during streaming.",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "run_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the run.",
          "title": "Run Id"
        },
        "status": {
          "$ref": "#/$defs/RunStatus",
          "description": "Status of the Run when this result was generated"
        },
        "update": {
          "additionalProperties": true,
          "description": "An update in the SSE event streaming where streaming mode is set to custom. The schema is described in agent ACP descriptor under 'spec.custom_streaming_update'.",
          "title": "Update",
          "type": "object"
        }
      },
      "required": [
        "type",
        "status",
        "update"
      ],
      "title": "CustomRunResultUpdate",
      "type": "object"
    },
    "Message": {
      "description": "Message",
      "properties": {
        "role": {
          "description": "The role of the message.",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/Content"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the message.",
          "title": "Id"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The metadata of the message.",
          "title": "Metadata"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "Message",
      "type": "object"
    },
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    },
    "RunStatus": {
      "description": "RunStatus",
      "enum": [
        "pending",
        "error",
        "success",
        "timeout",
        "interrupted"
      ],
      "title": "RunStatus",
      "type": "string"
    },
    "StreamEventPayload": {
      "description": "A serialized JSON data structure carried in the SSE event data field. The event can carry either a full `ValueRunResultUpdate`, if streaming mode is `values` or an `CustomRunResultUpdate` if streaming mode is `custom`",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/ValueRunResultUpdate"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/CustomRunResultUpdate"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "anyOf": [
            {
              "$ref": "#/$defs/CustomRunResultUpdate"
            },
            {
              "$ref": "#/$defs/ValueRunResultUpdate"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "ValueRunResultUpdate",
            "CustomRunResultUpdate"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        },
        "discriminator_value_class_map": {
          "additionalProperties": {
            "type": "string"
          },
          "default": {},
          "title": "Discriminator Value Class Map",
          "type": "object"
        }
      },
      "title": "StreamEventPayload",
      "type": "object"
    },
    "ValueRunResultUpdate": {
      "description": "Partial result provided as value through streaming.",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "run_id": {
          "description": "The ID of the run.",
          "title": "Run Id",
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/RunStatus",
          "description": "Status of the Run when this result was generated. This is particurarly useful when this data structure is used for streaming results. As the server can indicate an interrupt or an error condition while streaming the result."
        },
        "values": {
          "additionalProperties": true,
          "description": "The output of the agent. The schema is described in agent ACP descriptor under 'spec.output'.",
          "title": "Values",
          "type": "object"
        },
        "messages": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/Message"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Stream of messages returned by the run.",
          "title": "Messages"
        }
      },
      "required": [
        "type",
        "run_id",
        "status",
        "values"
      ],
      "title": "ValueRunResultUpdate",
      "type": "object"
    }
  },
  "description": "Server-sent event containing one agent output event. Actual event type is carried inside the data.",
  "properties": {
    "id": {
      "description": "Unique identifier of the event",
      "title": "Id",
      "type": "string"
    },
    "event": {
      "description": "Event type. This is the constant string `agent_event` to be compatible with SSE spec. The actual type differentiation is done in the event itself.",
      "title": "Event",
      "type": "string"
    },
    "data": {
      "$ref": "#/$defs/StreamEventPayload"
    }
  },
  "required": [
    "id",
    "event",
    "data"
  ],
  "title": "RunOutputStream",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Validators:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_output_stream.py
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
class RunOutputStream(BaseModel):
    """
    Server-sent event containing one agent output event. Actual event type is carried inside the data.
    """ # noqa: E501
    id: StrictStr = Field(description="Unique identifier of the event")
    event: StrictStr = Field(description="Event type. This is the constant string `agent_event` to be compatible with SSE spec. The actual type differentiation is done in the event itself.")
    data: StreamEventPayload
    __properties: ClassVar[List[str]] = ["id", "event", "data"]

    @field_validator('event')
    def event_validate_enum(cls, value):
        """Validates the enum"""
        if value not in set(['agent_event']):
            raise ValueError("must be one of enum values ('agent_event')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RunOutputStream from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of data
        if self.data:
            _dict['data'] = self.data.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of RunOutputStream from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "id": obj.get("id"),
            "event": obj.get("event"),
            "data": StreamEventPayload.from_dict(obj["data"]) if obj.get("data") is not None else None
        })
        return _obj

event pydantic-field

Event type. This is the constant string agent_event to be compatible with SSE spec. The actual type differentiation is done in the event itself.

id pydantic-field

Unique identifier of the event

event_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_output_stream.py
37
38
39
40
41
42
@field_validator('event')
def event_validate_enum(cls, value):
    """Validates the enum"""
    if value not in set(['agent_event']):
        raise ValueError("must be one of enum values ('agent_event')")
    return value

from_dict(obj) classmethod

Create an instance of RunOutputStream from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_output_stream.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of RunOutputStream from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "id": obj.get("id"),
        "event": obj.get("event"),
        "data": StreamEventPayload.from_dict(obj["data"]) if obj.get("data") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of RunOutputStream from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_output_stream.py
60
61
62
63
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of RunOutputStream from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_output_stream.py
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of data
    if self.data:
        _dict['data'] = self.data.to_dict()
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_output_stream.py
55
56
57
58
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_output_stream.py
51
52
53
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

RunResult

Bases: BaseModel

Final result of a Run.

Show JSON schema:
{
  "$defs": {
    "Content": {
      "description": "The content of the message.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 1 Validator"
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 2 Validator"
        },
        "actual_instance": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "List[ContentOneOfInner]",
            "str"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "Content",
      "type": "object"
    },
    "ContentOneOfInner": {
      "description": "ContentOneOfInner",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageTextBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageAnyBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "MessageTextBlock",
            "MessageAnyBlock"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ContentOneOfInner",
      "type": "object"
    },
    "Message": {
      "description": "Message",
      "properties": {
        "role": {
          "description": "The role of the message.",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/Content"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the message.",
          "title": "Id"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The metadata of the message.",
          "title": "Metadata"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "Message",
      "type": "object"
    },
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    }
  },
  "description": "Final result of a Run.",
  "properties": {
    "type": {
      "title": "Type",
      "type": "string"
    },
    "values": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The output of the agent. The schema is described in agent ACP descriptor under 'spec.output'.",
      "title": "Values"
    },
    "messages": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Message"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The messages returned by the run.",
      "title": "Messages"
    }
  },
  "required": [
    "type"
  ],
  "title": "RunResult",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Validators:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_result.py
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
class RunResult(BaseModel):
    """
    Final result of a Run.
    """ # noqa: E501
    type: StrictStr
    values: Optional[Dict[str, Any]] = Field(default=None, description="The output of the agent. The schema is described in agent ACP descriptor under 'spec.output'.")
    messages: Optional[List[Message]] = Field(default=None, description="The messages returned by the run.")
    __properties: ClassVar[List[str]] = ["type", "values", "messages"]

    @field_validator('type')
    def type_validate_enum(cls, value):
        """Validates the enum"""
        if value not in set(['result']):
            raise ValueError("must be one of enum values ('result')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RunResult from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of each item in messages (list)
        _items = []
        if self.messages:
            for _item_messages in self.messages:
                if _item_messages:
                    _items.append(_item_messages.to_dict())
            _dict['messages'] = _items
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of RunResult from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "type": obj.get("type"),
            "values": obj.get("values"),
            "messages": [Message.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None
        })
        return _obj

messages = None pydantic-field

The messages returned by the run.

values = None pydantic-field

The output of the agent. The schema is described in agent ACP descriptor under 'spec.output'.

from_dict(obj) classmethod

Create an instance of RunResult from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_result.py
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of RunResult from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "type": obj.get("type"),
        "values": obj.get("values"),
        "messages": [Message.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of RunResult from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_result.py
60
61
62
63
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of RunResult from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_result.py
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of each item in messages (list)
    _items = []
    if self.messages:
        for _item_messages in self.messages:
            if _item_messages:
                _items.append(_item_messages.to_dict())
        _dict['messages'] = _items
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_result.py
55
56
57
58
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_result.py
51
52
53
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

type_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_result.py
37
38
39
40
41
42
@field_validator('type')
def type_validate_enum(cls, value):
    """Validates the enum"""
    if value not in set(['result']):
        raise ValueError("must be one of enum values ('result')")
    return value

RunSearchRequest

Bases: BaseModel

Payload for listing runs.

Show JSON schema:
{
  "$defs": {
    "RunStatus": {
      "description": "RunStatus",
      "enum": [
        "pending",
        "error",
        "success",
        "timeout",
        "interrupted"
      ],
      "title": "RunStatus",
      "type": "string"
    }
  },
  "description": "Payload for listing runs.",
  "properties": {
    "agent_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Matches all the Runs associated with the specified Agent ID.",
      "title": "Agent Id"
    },
    "status": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunStatus"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Matches all the Runs associated with the specified status. One of 'pending', 'error', 'success', 'timeout', 'interrupted'."
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Matches all threads for which metadata has  keys and values equal to those specified in this object.",
      "title": "Metadata"
    },
    "limit": {
      "anyOf": [
        {
          "maximum": 1000,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 10,
      "description": "Maximum number to return.",
      "title": "Limit"
    },
    "offset": {
      "anyOf": [
        {
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 0,
      "description": "Offset to start from.",
      "title": "Offset"
    }
  },
  "title": "RunSearchRequest",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

  • agent_id (Optional[StrictStr])
  • status (Optional[RunStatus])
  • metadata (Optional[Dict[str, Any]])
  • limit (Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]])
  • offset (Optional[Annotated[int, Field(strict=True, ge=0)]])
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_search_request.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class RunSearchRequest(BaseModel):
    """
    Payload for listing runs.
    """ # noqa: E501
    agent_id: Optional[StrictStr] = Field(default=None, description="Matches all the Runs associated with the specified Agent ID.")
    status: Optional[RunStatus] = Field(default=None, description="Matches all the Runs associated with the specified status. One of 'pending', 'error', 'success', 'timeout', 'interrupted'.")
    metadata: Optional[Dict[str, Any]] = Field(default=None, description="Matches all threads for which metadata has  keys and values equal to those specified in this object.")
    limit: Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]] = Field(default=10, description="Maximum number to return.")
    offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=0, description="Offset to start from.")
    __properties: ClassVar[List[str]] = ["agent_id", "status", "metadata", "limit", "offset"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RunSearchRequest from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of RunSearchRequest from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "agent_id": obj.get("agent_id"),
            "status": obj.get("status"),
            "metadata": obj.get("metadata"),
            "limit": obj.get("limit") if obj.get("limit") is not None else 10,
            "offset": obj.get("offset") if obj.get("offset") is not None else 0
        })
        return _obj

agent_id = None pydantic-field

Matches all the Runs associated with the specified Agent ID.

limit = 10 pydantic-field

Maximum number to return.

metadata = None pydantic-field

Matches all threads for which metadata has keys and values equal to those specified in this object.

offset = 0 pydantic-field

Offset to start from.

status = None pydantic-field

Matches all the Runs associated with the specified status. One of 'pending', 'error', 'success', 'timeout', 'interrupted'.

from_dict(obj) classmethod

Create an instance of RunSearchRequest from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_search_request.py
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of RunSearchRequest from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "agent_id": obj.get("agent_id"),
        "status": obj.get("status"),
        "metadata": obj.get("metadata"),
        "limit": obj.get("limit") if obj.get("limit") is not None else 10,
        "offset": obj.get("offset") if obj.get("offset") is not None else 0
    })
    return _obj

from_json(json_str) classmethod

Create an instance of RunSearchRequest from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_search_request.py
56
57
58
59
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of RunSearchRequest from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_search_request.py
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_search_request.py
51
52
53
54
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_search_request.py
47
48
49
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

RunStateful

Bases: BaseModel

Holds all the information of a stateful run

Show JSON schema:
{
  "$defs": {
    "Config": {
      "description": "The configuration for the agent.",
      "properties": {
        "tags": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Tags"
        },
        "recursion_limit": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Recursion Limit"
        },
        "configurable": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The configuration for this agent. The schema is described in agent ACP descriptor under 'spec.config'. If missing, default values are used.",
          "title": "Configurable"
        }
      },
      "title": "Config",
      "type": "object"
    },
    "RunCreateStateful": {
      "description": "Payload for creating a stateful run.",
      "properties": {
        "agent_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The agent ID to run. If not provided will use the default agent for this service.",
          "title": "Agent Id"
        },
        "input": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.",
          "title": "Input"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Metadata to assign to the run.",
          "title": "Metadata"
        },
        "config": {
          "anyOf": [
            {
              "$ref": "#/$defs/Config"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "webhook": {
          "anyOf": [
            {
              "maxLength": 65536,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Webhook to call upon change of run status. This is a url that accepts a POST containing the `Run` object as body. See Callbacks definition.",
          "title": "Webhook"
        },
        "stream_mode": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamMode"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "on_disconnect": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "cancel",
          "description": "The disconnect mode to use. Must be one of 'cancel' or 'continue'.",
          "title": "On Disconnect"
        },
        "multitask_strategy": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "reject",
          "description": "Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.",
          "title": "Multitask Strategy"
        },
        "after_seconds": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The number of seconds to wait before starting the run. Use to schedule future runs.",
          "title": "After Seconds"
        },
        "stream_subgraphs": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "description": "Whether to stream output from subgraphs.",
          "title": "Stream Subgraphs"
        },
        "if_not_exists": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "reject",
          "description": "How to handle missing thread. Must be either 'reject' (raise error if missing), or 'create' (create new thread).",
          "title": "If Not Exists"
        }
      },
      "title": "RunCreateStateful",
      "type": "object"
    },
    "RunStatus": {
      "description": "RunStatus",
      "enum": [
        "pending",
        "error",
        "success",
        "timeout",
        "interrupted"
      ],
      "title": "RunStatus",
      "type": "string"
    },
    "StreamMode": {
      "description": "If populated, indicates that the client requests to stream results with the specified streaming mode(s). The requested streaming mode(s) must be one or more of those supported by the agent as declared in agent ACP descriptor  under `specs.capabilities`",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/StreamingMode"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Anyof Schema 1 Validator"
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamingMode"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "StreamingMode",
            "List[StreamingMode]"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "StreamMode",
      "type": "object"
    },
    "StreamingMode": {
      "description": "StreamingMode",
      "enum": [
        "values",
        "custom"
      ],
      "title": "StreamingMode",
      "type": "string"
    }
  },
  "description": "Holds all the information of a stateful run",
  "properties": {
    "run_id": {
      "description": "The ID of the run.",
      "title": "Run Id",
      "type": "string"
    },
    "thread_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Thread ID wher the Run belongs to. This is populated only for runs on agents agents supporting Threads.",
      "title": "Thread Id"
    },
    "agent_id": {
      "description": "The agent that was used for this run.",
      "title": "Agent Id",
      "type": "string"
    },
    "created_at": {
      "description": "The time the run was created.",
      "format": "date-time",
      "title": "Created At",
      "type": "string"
    },
    "updated_at": {
      "description": "The last time the run was updated.",
      "format": "date-time",
      "title": "Updated At",
      "type": "string"
    },
    "status": {
      "$ref": "#/$defs/RunStatus",
      "description": "The status of the run. One of 'pending', 'error', 'success', 'timeout', 'interrupted'."
    },
    "creation": {
      "$ref": "#/$defs/RunCreateStateful"
    }
  },
  "required": [
    "run_id",
    "agent_id",
    "created_at",
    "updated_at",
    "status",
    "creation"
  ],
  "title": "RunStateful",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_stateful.py
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
class RunStateful(BaseModel):
    """
    Holds all the information of a stateful run
    """ # noqa: E501
    run_id: StrictStr = Field(description="The ID of the run.")
    thread_id: Optional[StrictStr] = Field(default=None, description="Optional Thread ID wher the Run belongs to. This is populated only for runs on agents agents supporting Threads.")
    agent_id: StrictStr = Field(description="The agent that was used for this run.")
    created_at: datetime = Field(description="The time the run was created.")
    updated_at: datetime = Field(description="The last time the run was updated.")
    status: RunStatus = Field(description="The status of the run. One of 'pending', 'error', 'success', 'timeout', 'interrupted'.")
    creation: RunCreateStateful
    __properties: ClassVar[List[str]] = ["run_id", "thread_id", "agent_id", "created_at", "updated_at", "status", "creation"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RunStateful from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of creation
        if self.creation:
            _dict['creation'] = self.creation.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of RunStateful from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "run_id": obj.get("run_id"),
            "thread_id": obj.get("thread_id"),
            "agent_id": obj.get("agent_id"),
            "created_at": obj.get("created_at"),
            "updated_at": obj.get("updated_at"),
            "status": obj.get("status"),
            "creation": RunCreateStateful.from_dict(obj["creation"]) if obj.get("creation") is not None else None
        })
        return _obj

agent_id pydantic-field

The agent that was used for this run.

created_at pydantic-field

The time the run was created.

run_id pydantic-field

The ID of the run.

status pydantic-field

The status of the run. One of 'pending', 'error', 'success', 'timeout', 'interrupted'.

thread_id = None pydantic-field

Optional Thread ID wher the Run belongs to. This is populated only for runs on agents agents supporting Threads.

updated_at pydantic-field

The last time the run was updated.

from_dict(obj) classmethod

Create an instance of RunStateful from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_stateful.py
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of RunStateful from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "run_id": obj.get("run_id"),
        "thread_id": obj.get("thread_id"),
        "agent_id": obj.get("agent_id"),
        "created_at": obj.get("created_at"),
        "updated_at": obj.get("updated_at"),
        "status": obj.get("status"),
        "creation": RunCreateStateful.from_dict(obj["creation"]) if obj.get("creation") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of RunStateful from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_stateful.py
59
60
61
62
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of RunStateful from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_stateful.py
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of creation
    if self.creation:
        _dict['creation'] = self.creation.to_dict()
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_stateful.py
54
55
56
57
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_stateful.py
50
51
52
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

RunStateless

Bases: BaseModel

Holds all the information of a stateless run

Show JSON schema:
{
  "$defs": {
    "Config": {
      "description": "The configuration for the agent.",
      "properties": {
        "tags": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Tags"
        },
        "recursion_limit": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Recursion Limit"
        },
        "configurable": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The configuration for this agent. The schema is described in agent ACP descriptor under 'spec.config'. If missing, default values are used.",
          "title": "Configurable"
        }
      },
      "title": "Config",
      "type": "object"
    },
    "RunCreateStateless": {
      "description": "Payload for creating a stateless run.",
      "properties": {
        "agent_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The agent ID to run. If not provided will use the default agent for this service.",
          "title": "Agent Id"
        },
        "input": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.",
          "title": "Input"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Metadata to assign to the run.",
          "title": "Metadata"
        },
        "config": {
          "anyOf": [
            {
              "$ref": "#/$defs/Config"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "webhook": {
          "anyOf": [
            {
              "maxLength": 65536,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Webhook to call upon change of run status. This is a url that accepts a POST containing the `Run` object as body. See Callbacks definition.",
          "title": "Webhook"
        },
        "stream_mode": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamMode"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "on_disconnect": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "cancel",
          "description": "The disconnect mode to use. Must be one of 'cancel' or 'continue'.",
          "title": "On Disconnect"
        },
        "multitask_strategy": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "reject",
          "description": "Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.",
          "title": "Multitask Strategy"
        },
        "after_seconds": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The number of seconds to wait before starting the run. Use to schedule future runs.",
          "title": "After Seconds"
        },
        "on_completion": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "delete",
          "description": "Whether to delete or keep the thread created for a stateless run. Must be one of 'delete' or 'keep'.",
          "title": "On Completion"
        }
      },
      "title": "RunCreateStateless",
      "type": "object"
    },
    "RunStatus": {
      "description": "RunStatus",
      "enum": [
        "pending",
        "error",
        "success",
        "timeout",
        "interrupted"
      ],
      "title": "RunStatus",
      "type": "string"
    },
    "StreamMode": {
      "description": "If populated, indicates that the client requests to stream results with the specified streaming mode(s). The requested streaming mode(s) must be one or more of those supported by the agent as declared in agent ACP descriptor  under `specs.capabilities`",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/StreamingMode"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Anyof Schema 1 Validator"
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamingMode"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "StreamingMode",
            "List[StreamingMode]"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "StreamMode",
      "type": "object"
    },
    "StreamingMode": {
      "description": "StreamingMode",
      "enum": [
        "values",
        "custom"
      ],
      "title": "StreamingMode",
      "type": "string"
    }
  },
  "description": "Holds all the information of a stateless run",
  "properties": {
    "run_id": {
      "description": "The ID of the run.",
      "title": "Run Id",
      "type": "string"
    },
    "thread_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Thread ID wher the Run belongs to. This is populated only for runs on agents agents supporting Threads.",
      "title": "Thread Id"
    },
    "agent_id": {
      "description": "The agent that was used for this run.",
      "title": "Agent Id",
      "type": "string"
    },
    "created_at": {
      "description": "The time the run was created.",
      "format": "date-time",
      "title": "Created At",
      "type": "string"
    },
    "updated_at": {
      "description": "The last time the run was updated.",
      "format": "date-time",
      "title": "Updated At",
      "type": "string"
    },
    "status": {
      "$ref": "#/$defs/RunStatus",
      "description": "The status of the run. One of 'pending', 'error', 'success', 'timeout', 'interrupted'."
    },
    "creation": {
      "$ref": "#/$defs/RunCreateStateless"
    }
  },
  "required": [
    "run_id",
    "agent_id",
    "created_at",
    "updated_at",
    "status",
    "creation"
  ],
  "title": "RunStateless",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_stateless.py
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
class RunStateless(BaseModel):
    """
    Holds all the information of a stateless run
    """ # noqa: E501
    run_id: StrictStr = Field(description="The ID of the run.")
    thread_id: Optional[StrictStr] = Field(default=None, description="Optional Thread ID wher the Run belongs to. This is populated only for runs on agents agents supporting Threads.")
    agent_id: StrictStr = Field(description="The agent that was used for this run.")
    created_at: datetime = Field(description="The time the run was created.")
    updated_at: datetime = Field(description="The last time the run was updated.")
    status: RunStatus = Field(description="The status of the run. One of 'pending', 'error', 'success', 'timeout', 'interrupted'.")
    creation: RunCreateStateless
    __properties: ClassVar[List[str]] = ["run_id", "thread_id", "agent_id", "created_at", "updated_at", "status", "creation"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RunStateless from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of creation
        if self.creation:
            _dict['creation'] = self.creation.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of RunStateless from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "run_id": obj.get("run_id"),
            "thread_id": obj.get("thread_id"),
            "agent_id": obj.get("agent_id"),
            "created_at": obj.get("created_at"),
            "updated_at": obj.get("updated_at"),
            "status": obj.get("status"),
            "creation": RunCreateStateless.from_dict(obj["creation"]) if obj.get("creation") is not None else None
        })
        return _obj

agent_id pydantic-field

The agent that was used for this run.

created_at pydantic-field

The time the run was created.

run_id pydantic-field

The ID of the run.

status pydantic-field

The status of the run. One of 'pending', 'error', 'success', 'timeout', 'interrupted'.

thread_id = None pydantic-field

Optional Thread ID wher the Run belongs to. This is populated only for runs on agents agents supporting Threads.

updated_at pydantic-field

The last time the run was updated.

from_dict(obj) classmethod

Create an instance of RunStateless from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_stateless.py
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of RunStateless from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "run_id": obj.get("run_id"),
        "thread_id": obj.get("thread_id"),
        "agent_id": obj.get("agent_id"),
        "created_at": obj.get("created_at"),
        "updated_at": obj.get("updated_at"),
        "status": obj.get("status"),
        "creation": RunCreateStateless.from_dict(obj["creation"]) if obj.get("creation") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of RunStateless from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_stateless.py
59
60
61
62
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of RunStateless from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_stateless.py
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of creation
    if self.creation:
        _dict['creation'] = self.creation.to_dict()
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_stateless.py
54
55
56
57
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_stateless.py
50
51
52
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

RunStatus

Bases: str, Enum

RunStatus

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_status.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class RunStatus(str, Enum):
    """
    RunStatus
    """

    """
    allowed enum values
    """
    PENDING = 'pending'
    ERROR = 'error'
    SUCCESS = 'success'
    TIMEOUT = 'timeout'
    INTERRUPTED = 'interrupted'

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Create an instance of RunStatus from a JSON string"""
        return cls(json.loads(json_str))

from_json(json_str) classmethod

Create an instance of RunStatus from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_status.py
37
38
39
40
@classmethod
def from_json(cls, json_str: str) -> Self:
    """Create an instance of RunStatus from a JSON string"""
    return cls(json.loads(json_str))

RunWaitResponseStateful

Bases: BaseModel

RunWaitResponseStateful

Show JSON schema:
{
  "$defs": {
    "Config": {
      "description": "The configuration for the agent.",
      "properties": {
        "tags": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Tags"
        },
        "recursion_limit": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Recursion Limit"
        },
        "configurable": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The configuration for this agent. The schema is described in agent ACP descriptor under 'spec.config'. If missing, default values are used.",
          "title": "Configurable"
        }
      },
      "title": "Config",
      "type": "object"
    },
    "Content": {
      "description": "The content of the message.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 1 Validator"
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 2 Validator"
        },
        "actual_instance": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "List[ContentOneOfInner]",
            "str"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "Content",
      "type": "object"
    },
    "ContentOneOfInner": {
      "description": "ContentOneOfInner",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageTextBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageAnyBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "MessageTextBlock",
            "MessageAnyBlock"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ContentOneOfInner",
      "type": "object"
    },
    "Message": {
      "description": "Message",
      "properties": {
        "role": {
          "description": "The role of the message.",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/Content"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the message.",
          "title": "Id"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The metadata of the message.",
          "title": "Metadata"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "Message",
      "type": "object"
    },
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    },
    "RunCreateStateful": {
      "description": "Payload for creating a stateful run.",
      "properties": {
        "agent_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The agent ID to run. If not provided will use the default agent for this service.",
          "title": "Agent Id"
        },
        "input": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.",
          "title": "Input"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Metadata to assign to the run.",
          "title": "Metadata"
        },
        "config": {
          "anyOf": [
            {
              "$ref": "#/$defs/Config"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "webhook": {
          "anyOf": [
            {
              "maxLength": 65536,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Webhook to call upon change of run status. This is a url that accepts a POST containing the `Run` object as body. See Callbacks definition.",
          "title": "Webhook"
        },
        "stream_mode": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamMode"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "on_disconnect": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "cancel",
          "description": "The disconnect mode to use. Must be one of 'cancel' or 'continue'.",
          "title": "On Disconnect"
        },
        "multitask_strategy": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "reject",
          "description": "Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.",
          "title": "Multitask Strategy"
        },
        "after_seconds": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The number of seconds to wait before starting the run. Use to schedule future runs.",
          "title": "After Seconds"
        },
        "stream_subgraphs": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "description": "Whether to stream output from subgraphs.",
          "title": "Stream Subgraphs"
        },
        "if_not_exists": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "reject",
          "description": "How to handle missing thread. Must be either 'reject' (raise error if missing), or 'create' (create new thread).",
          "title": "If Not Exists"
        }
      },
      "title": "RunCreateStateful",
      "type": "object"
    },
    "RunError": {
      "description": "Run terminated with an error",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "run_id": {
          "description": "The ID of the run.",
          "title": "Run Id",
          "type": "string"
        },
        "errcode": {
          "description": "code of the error",
          "title": "Errcode",
          "type": "integer"
        },
        "description": {
          "description": "description of the error",
          "title": "Description",
          "type": "string"
        }
      },
      "required": [
        "type",
        "run_id",
        "errcode",
        "description"
      ],
      "title": "RunError",
      "type": "object"
    },
    "RunInterrupt": {
      "description": "Interrupt occurred during a Run",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "interrupt": {
          "additionalProperties": true,
          "description": "This schema describes the interrupt payload. Actual schema describes a polimorphic object, which means a schema structured with `oneOf` and `discriminator`. The discriminator is the `interrupt_type`, while the schemas will be the ones defined in the agent spec under `interrupts`/`interrupt_payload` For example:          oneOf:   - $ref: '#/components/schemas/ApprovalInterruptPayload'   - $ref: '#/components/schemas/QuestionInterruptPayload' discriminator:   propertyName: interruput_type   mapping:     approval: '#/components/schemas/ApprovalInterruptPayload'     question: '#/components/schemas/QuestionInterruptPayload'",
          "title": "Interrupt",
          "type": "object"
        }
      },
      "required": [
        "type",
        "interrupt"
      ],
      "title": "RunInterrupt",
      "type": "object"
    },
    "RunOutput": {
      "description": "Output of a Run. Can be the final result or an interrupt.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/RunResult"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/RunInterrupt"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "oneof_schema_3_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/RunError"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "anyOf": [
            {
              "$ref": "#/$defs/RunError"
            },
            {
              "$ref": "#/$defs/RunInterrupt"
            },
            {
              "$ref": "#/$defs/RunResult"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "RunInterrupt",
            "RunResult",
            "RunError"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        },
        "discriminator_value_class_map": {
          "additionalProperties": {
            "type": "string"
          },
          "default": {},
          "title": "Discriminator Value Class Map",
          "type": "object"
        }
      },
      "title": "RunOutput",
      "type": "object"
    },
    "RunResult": {
      "description": "Final result of a Run.",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "values": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The output of the agent. The schema is described in agent ACP descriptor under 'spec.output'.",
          "title": "Values"
        },
        "messages": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/Message"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The messages returned by the run.",
          "title": "Messages"
        }
      },
      "required": [
        "type"
      ],
      "title": "RunResult",
      "type": "object"
    },
    "RunStateful": {
      "description": "Holds all the information of a stateful run",
      "properties": {
        "run_id": {
          "description": "The ID of the run.",
          "title": "Run Id",
          "type": "string"
        },
        "thread_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional Thread ID wher the Run belongs to. This is populated only for runs on agents agents supporting Threads.",
          "title": "Thread Id"
        },
        "agent_id": {
          "description": "The agent that was used for this run.",
          "title": "Agent Id",
          "type": "string"
        },
        "created_at": {
          "description": "The time the run was created.",
          "format": "date-time",
          "title": "Created At",
          "type": "string"
        },
        "updated_at": {
          "description": "The last time the run was updated.",
          "format": "date-time",
          "title": "Updated At",
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/RunStatus",
          "description": "The status of the run. One of 'pending', 'error', 'success', 'timeout', 'interrupted'."
        },
        "creation": {
          "$ref": "#/$defs/RunCreateStateful"
        }
      },
      "required": [
        "run_id",
        "agent_id",
        "created_at",
        "updated_at",
        "status",
        "creation"
      ],
      "title": "RunStateful",
      "type": "object"
    },
    "RunStatus": {
      "description": "RunStatus",
      "enum": [
        "pending",
        "error",
        "success",
        "timeout",
        "interrupted"
      ],
      "title": "RunStatus",
      "type": "string"
    },
    "StreamMode": {
      "description": "If populated, indicates that the client requests to stream results with the specified streaming mode(s). The requested streaming mode(s) must be one or more of those supported by the agent as declared in agent ACP descriptor  under `specs.capabilities`",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/StreamingMode"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Anyof Schema 1 Validator"
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamingMode"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "StreamingMode",
            "List[StreamingMode]"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "StreamMode",
      "type": "object"
    },
    "StreamingMode": {
      "description": "StreamingMode",
      "enum": [
        "values",
        "custom"
      ],
      "title": "StreamingMode",
      "type": "string"
    }
  },
  "description": "RunWaitResponseStateful",
  "properties": {
    "run": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunStateful"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The run information."
    },
    "output": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunOutput"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "title": "RunWaitResponseStateful",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_wait_response_stateful.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class RunWaitResponseStateful(BaseModel):
    """
    RunWaitResponseStateful
    """ # noqa: E501
    run: Optional[RunStateful] = Field(default=None, description="The run information.")
    output: Optional[RunOutput] = None
    __properties: ClassVar[List[str]] = ["run", "output"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RunWaitResponseStateful from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of run
        if self.run:
            _dict['run'] = self.run.to_dict()
        # override the default output from pydantic by calling `to_dict()` of output
        if self.output:
            _dict['output'] = self.output.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of RunWaitResponseStateful from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "run": RunStateful.from_dict(obj["run"]) if obj.get("run") is not None else None,
            "output": RunOutput.from_dict(obj["output"]) if obj.get("output") is not None else None
        })
        return _obj

run = None pydantic-field

The run information.

from_dict(obj) classmethod

Create an instance of RunWaitResponseStateful from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_wait_response_stateful.py
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of RunWaitResponseStateful from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "run": RunStateful.from_dict(obj["run"]) if obj.get("run") is not None else None,
        "output": RunOutput.from_dict(obj["output"]) if obj.get("output") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of RunWaitResponseStateful from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_wait_response_stateful.py
53
54
55
56
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of RunWaitResponseStateful from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_wait_response_stateful.py
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of run
    if self.run:
        _dict['run'] = self.run.to_dict()
    # override the default output from pydantic by calling `to_dict()` of output
    if self.output:
        _dict['output'] = self.output.to_dict()
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_wait_response_stateful.py
48
49
50
51
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_wait_response_stateful.py
44
45
46
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

RunWaitResponseStateless

Bases: BaseModel

RunWaitResponseStateless

Show JSON schema:
{
  "$defs": {
    "Config": {
      "description": "The configuration for the agent.",
      "properties": {
        "tags": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Tags"
        },
        "recursion_limit": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Recursion Limit"
        },
        "configurable": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The configuration for this agent. The schema is described in agent ACP descriptor under 'spec.config'. If missing, default values are used.",
          "title": "Configurable"
        }
      },
      "title": "Config",
      "type": "object"
    },
    "Content": {
      "description": "The content of the message.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 1 Validator"
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 2 Validator"
        },
        "actual_instance": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "List[ContentOneOfInner]",
            "str"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "Content",
      "type": "object"
    },
    "ContentOneOfInner": {
      "description": "ContentOneOfInner",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageTextBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageAnyBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "MessageTextBlock",
            "MessageAnyBlock"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ContentOneOfInner",
      "type": "object"
    },
    "Message": {
      "description": "Message",
      "properties": {
        "role": {
          "description": "The role of the message.",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/Content"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the message.",
          "title": "Id"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The metadata of the message.",
          "title": "Metadata"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "Message",
      "type": "object"
    },
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    },
    "RunCreateStateless": {
      "description": "Payload for creating a stateless run.",
      "properties": {
        "agent_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The agent ID to run. If not provided will use the default agent for this service.",
          "title": "Agent Id"
        },
        "input": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The input to the agent. The schema is described in agent ACP descriptor under 'spec.thread_state'.'input'.",
          "title": "Input"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Metadata to assign to the run.",
          "title": "Metadata"
        },
        "config": {
          "anyOf": [
            {
              "$ref": "#/$defs/Config"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "webhook": {
          "anyOf": [
            {
              "maxLength": 65536,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Webhook to call upon change of run status. This is a url that accepts a POST containing the `Run` object as body. See Callbacks definition.",
          "title": "Webhook"
        },
        "stream_mode": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamMode"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "on_disconnect": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "cancel",
          "description": "The disconnect mode to use. Must be one of 'cancel' or 'continue'.",
          "title": "On Disconnect"
        },
        "multitask_strategy": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "reject",
          "description": "Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.",
          "title": "Multitask Strategy"
        },
        "after_seconds": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The number of seconds to wait before starting the run. Use to schedule future runs.",
          "title": "After Seconds"
        },
        "on_completion": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "delete",
          "description": "Whether to delete or keep the thread created for a stateless run. Must be one of 'delete' or 'keep'.",
          "title": "On Completion"
        }
      },
      "title": "RunCreateStateless",
      "type": "object"
    },
    "RunError": {
      "description": "Run terminated with an error",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "run_id": {
          "description": "The ID of the run.",
          "title": "Run Id",
          "type": "string"
        },
        "errcode": {
          "description": "code of the error",
          "title": "Errcode",
          "type": "integer"
        },
        "description": {
          "description": "description of the error",
          "title": "Description",
          "type": "string"
        }
      },
      "required": [
        "type",
        "run_id",
        "errcode",
        "description"
      ],
      "title": "RunError",
      "type": "object"
    },
    "RunInterrupt": {
      "description": "Interrupt occurred during a Run",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "interrupt": {
          "additionalProperties": true,
          "description": "This schema describes the interrupt payload. Actual schema describes a polimorphic object, which means a schema structured with `oneOf` and `discriminator`. The discriminator is the `interrupt_type`, while the schemas will be the ones defined in the agent spec under `interrupts`/`interrupt_payload` For example:          oneOf:   - $ref: '#/components/schemas/ApprovalInterruptPayload'   - $ref: '#/components/schemas/QuestionInterruptPayload' discriminator:   propertyName: interruput_type   mapping:     approval: '#/components/schemas/ApprovalInterruptPayload'     question: '#/components/schemas/QuestionInterruptPayload'",
          "title": "Interrupt",
          "type": "object"
        }
      },
      "required": [
        "type",
        "interrupt"
      ],
      "title": "RunInterrupt",
      "type": "object"
    },
    "RunOutput": {
      "description": "Output of a Run. Can be the final result or an interrupt.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/RunResult"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/RunInterrupt"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "oneof_schema_3_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/RunError"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "anyOf": [
            {
              "$ref": "#/$defs/RunError"
            },
            {
              "$ref": "#/$defs/RunInterrupt"
            },
            {
              "$ref": "#/$defs/RunResult"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "RunInterrupt",
            "RunResult",
            "RunError"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        },
        "discriminator_value_class_map": {
          "additionalProperties": {
            "type": "string"
          },
          "default": {},
          "title": "Discriminator Value Class Map",
          "type": "object"
        }
      },
      "title": "RunOutput",
      "type": "object"
    },
    "RunResult": {
      "description": "Final result of a Run.",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "values": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The output of the agent. The schema is described in agent ACP descriptor under 'spec.output'.",
          "title": "Values"
        },
        "messages": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/Message"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The messages returned by the run.",
          "title": "Messages"
        }
      },
      "required": [
        "type"
      ],
      "title": "RunResult",
      "type": "object"
    },
    "RunStateless": {
      "description": "Holds all the information of a stateless run",
      "properties": {
        "run_id": {
          "description": "The ID of the run.",
          "title": "Run Id",
          "type": "string"
        },
        "thread_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional Thread ID wher the Run belongs to. This is populated only for runs on agents agents supporting Threads.",
          "title": "Thread Id"
        },
        "agent_id": {
          "description": "The agent that was used for this run.",
          "title": "Agent Id",
          "type": "string"
        },
        "created_at": {
          "description": "The time the run was created.",
          "format": "date-time",
          "title": "Created At",
          "type": "string"
        },
        "updated_at": {
          "description": "The last time the run was updated.",
          "format": "date-time",
          "title": "Updated At",
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/RunStatus",
          "description": "The status of the run. One of 'pending', 'error', 'success', 'timeout', 'interrupted'."
        },
        "creation": {
          "$ref": "#/$defs/RunCreateStateless"
        }
      },
      "required": [
        "run_id",
        "agent_id",
        "created_at",
        "updated_at",
        "status",
        "creation"
      ],
      "title": "RunStateless",
      "type": "object"
    },
    "RunStatus": {
      "description": "RunStatus",
      "enum": [
        "pending",
        "error",
        "success",
        "timeout",
        "interrupted"
      ],
      "title": "RunStatus",
      "type": "string"
    },
    "StreamMode": {
      "description": "If populated, indicates that the client requests to stream results with the specified streaming mode(s). The requested streaming mode(s) must be one or more of those supported by the agent as declared in agent ACP descriptor  under `specs.capabilities`",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/StreamingMode"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Anyof Schema 1 Validator"
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/StreamingMode"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "StreamingMode",
            "List[StreamingMode]"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "StreamMode",
      "type": "object"
    },
    "StreamingMode": {
      "description": "StreamingMode",
      "enum": [
        "values",
        "custom"
      ],
      "title": "StreamingMode",
      "type": "string"
    }
  },
  "description": "RunWaitResponseStateless",
  "properties": {
    "run": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunStateless"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The run information."
    },
    "output": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunOutput"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "title": "RunWaitResponseStateless",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_wait_response_stateless.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class RunWaitResponseStateless(BaseModel):
    """
    RunWaitResponseStateless
    """ # noqa: E501
    run: Optional[RunStateless] = Field(default=None, description="The run information.")
    output: Optional[RunOutput] = None
    __properties: ClassVar[List[str]] = ["run", "output"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RunWaitResponseStateless from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of run
        if self.run:
            _dict['run'] = self.run.to_dict()
        # override the default output from pydantic by calling `to_dict()` of output
        if self.output:
            _dict['output'] = self.output.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of RunWaitResponseStateless from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "run": RunStateless.from_dict(obj["run"]) if obj.get("run") is not None else None,
            "output": RunOutput.from_dict(obj["output"]) if obj.get("output") is not None else None
        })
        return _obj

run = None pydantic-field

The run information.

from_dict(obj) classmethod

Create an instance of RunWaitResponseStateless from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_wait_response_stateless.py
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of RunWaitResponseStateless from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "run": RunStateless.from_dict(obj["run"]) if obj.get("run") is not None else None,
        "output": RunOutput.from_dict(obj["output"]) if obj.get("output") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of RunWaitResponseStateless from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_wait_response_stateless.py
53
54
55
56
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of RunWaitResponseStateless from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_wait_response_stateless.py
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of run
    if self.run:
        _dict['run'] = self.run.to_dict()
    # override the default output from pydantic by calling `to_dict()` of output
    if self.output:
        _dict['output'] = self.output.to_dict()
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_wait_response_stateless.py
48
49
50
51
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/run_wait_response_stateless.py
44
45
46
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

StreamEventPayload

Bases: BaseModel

A serialized JSON data structure carried in the SSE event data field. The event can carry either a full ValueRunResultUpdate, if streaming mode is values or an CustomRunResultUpdate if streaming mode is custom

Show JSON schema:
{
  "$defs": {
    "Content": {
      "description": "The content of the message.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 1 Validator"
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 2 Validator"
        },
        "actual_instance": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "List[ContentOneOfInner]",
            "str"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "Content",
      "type": "object"
    },
    "ContentOneOfInner": {
      "description": "ContentOneOfInner",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageTextBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageAnyBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "MessageTextBlock",
            "MessageAnyBlock"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ContentOneOfInner",
      "type": "object"
    },
    "CustomRunResultUpdate": {
      "description": "Object holding a custom defined update of the agent result during streaming.",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "run_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the run.",
          "title": "Run Id"
        },
        "status": {
          "$ref": "#/$defs/RunStatus",
          "description": "Status of the Run when this result was generated"
        },
        "update": {
          "additionalProperties": true,
          "description": "An update in the SSE event streaming where streaming mode is set to custom. The schema is described in agent ACP descriptor under 'spec.custom_streaming_update'.",
          "title": "Update",
          "type": "object"
        }
      },
      "required": [
        "type",
        "status",
        "update"
      ],
      "title": "CustomRunResultUpdate",
      "type": "object"
    },
    "Message": {
      "description": "Message",
      "properties": {
        "role": {
          "description": "The role of the message.",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/Content"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the message.",
          "title": "Id"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The metadata of the message.",
          "title": "Metadata"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "Message",
      "type": "object"
    },
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    },
    "RunStatus": {
      "description": "RunStatus",
      "enum": [
        "pending",
        "error",
        "success",
        "timeout",
        "interrupted"
      ],
      "title": "RunStatus",
      "type": "string"
    },
    "ValueRunResultUpdate": {
      "description": "Partial result provided as value through streaming.",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "run_id": {
          "description": "The ID of the run.",
          "title": "Run Id",
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/RunStatus",
          "description": "Status of the Run when this result was generated. This is particurarly useful when this data structure is used for streaming results. As the server can indicate an interrupt or an error condition while streaming the result."
        },
        "values": {
          "additionalProperties": true,
          "description": "The output of the agent. The schema is described in agent ACP descriptor under 'spec.output'.",
          "title": "Values",
          "type": "object"
        },
        "messages": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/Message"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Stream of messages returned by the run.",
          "title": "Messages"
        }
      },
      "required": [
        "type",
        "run_id",
        "status",
        "values"
      ],
      "title": "ValueRunResultUpdate",
      "type": "object"
    }
  },
  "description": "A serialized JSON data structure carried in the SSE event data field. The event can carry either a full `ValueRunResultUpdate`, if streaming mode is `values` or an `CustomRunResultUpdate` if streaming mode is `custom`",
  "properties": {
    "oneof_schema_1_validator": {
      "anyOf": [
        {
          "$ref": "#/$defs/ValueRunResultUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "oneof_schema_2_validator": {
      "anyOf": [
        {
          "$ref": "#/$defs/CustomRunResultUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "actual_instance": {
      "anyOf": [
        {
          "$ref": "#/$defs/CustomRunResultUpdate"
        },
        {
          "$ref": "#/$defs/ValueRunResultUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Actual Instance"
    },
    "one_of_schemas": {
      "default": [
        "ValueRunResultUpdate",
        "CustomRunResultUpdate"
      ],
      "items": {
        "type": "string"
      },
      "title": "One Of Schemas",
      "type": "array",
      "uniqueItems": true
    },
    "discriminator_value_class_map": {
      "additionalProperties": {
        "type": "string"
      },
      "default": {},
      "title": "Discriminator Value Class Map",
      "type": "object"
    }
  },
  "title": "StreamEventPayload",
  "type": "object"
}

Config:

  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Validators:

  • actual_instance_must_validate_oneofactual_instance
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/stream_event_payload.py
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
class StreamEventPayload(BaseModel):
    """
    A serialized JSON data structure carried in the SSE event data field. The event can carry either a full `ValueRunResultUpdate`, if streaming mode is `values` or an `CustomRunResultUpdate` if streaming mode is `custom`
    """
    # data type: ValueRunResultUpdate
    oneof_schema_1_validator: Optional[ValueRunResultUpdate] = None
    # data type: CustomRunResultUpdate
    oneof_schema_2_validator: Optional[CustomRunResultUpdate] = None
    actual_instance: Optional[Union[CustomRunResultUpdate, ValueRunResultUpdate]] = None
    one_of_schemas: Set[str] = { "CustomRunResultUpdate", "ValueRunResultUpdate" }

    model_config = ConfigDict(
        validate_assignment=True,
        protected_namespaces=(),
    )


    discriminator_value_class_map: Dict[str, str] = {
    }

    def __init__(self, *args, **kwargs) -> None:
        if args:
            if len(args) > 1:
                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
            if kwargs:
                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
            super().__init__(actual_instance=args[0])
        else:
            super().__init__(**kwargs)

    @field_validator('actual_instance')
    def actual_instance_must_validate_oneof(cls, v):
        instance = StreamEventPayload.model_construct()
        error_messages = []
        match = 0
        # validate data type: ValueRunResultUpdate
        if not isinstance(v, ValueRunResultUpdate):
            error_messages.append(f"Error! Input type `{type(v)}` is not `ValueRunResultUpdate`")
        else:
            match += 1
        # validate data type: CustomRunResultUpdate
        if not isinstance(v, CustomRunResultUpdate):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomRunResultUpdate`")
        else:
            match += 1
        if match > 1:
            # more than 1 match
            raise ValueError("Multiple matches found when setting `actual_instance` in StreamEventPayload with oneOf schemas: CustomRunResultUpdate, ValueRunResultUpdate. Details: " + ", ".join(error_messages))
        elif match == 0:
            # no match
            raise ValueError("No match found when setting `actual_instance` in StreamEventPayload with oneOf schemas: CustomRunResultUpdate, ValueRunResultUpdate. Details: " + ", ".join(error_messages))
        else:
            return v

    @classmethod
    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
        return cls.from_json(json.dumps(obj))

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Returns the object represented by the json string"""
        instance = cls.model_construct()
        error_messages = []
        match = 0

        # deserialize data into ValueRunResultUpdate
        try:
            instance.actual_instance = ValueRunResultUpdate.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomRunResultUpdate
        try:
            instance.actual_instance = CustomRunResultUpdate.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))

        if match > 1:
            # more than 1 match
            raise ValueError("Multiple matches found when deserializing the JSON string into StreamEventPayload with oneOf schemas: CustomRunResultUpdate, ValueRunResultUpdate. Details: " + ", ".join(error_messages))
        elif match == 0:
            # no match
            raise ValueError("No match found when deserializing the JSON string into StreamEventPayload with oneOf schemas: CustomRunResultUpdate, ValueRunResultUpdate. Details: " + ", ".join(error_messages))
        else:
            return instance

    def to_json(self) -> str:
        """Returns the JSON representation of the actual instance"""
        if self.actual_instance is None:
            return "null"

        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
            return self.actual_instance.to_json()
        else:
            return json.dumps(self.actual_instance)

    def to_dict(self) -> Optional[Union[Dict[str, Any], CustomRunResultUpdate, ValueRunResultUpdate]]:
        """Returns the dict representation of the actual instance"""
        if self.actual_instance is None:
            return None

        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
            return self.actual_instance.to_dict()
        else:
            # primitive type
            return self.actual_instance

    def to_str(self) -> str:
        """Returns the string representation of the actual instance"""
        return pprint.pformat(self.model_dump())

from_json(json_str) classmethod

Returns the object represented by the json string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/stream_event_payload.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
@classmethod
def from_json(cls, json_str: str) -> Self:
    """Returns the object represented by the json string"""
    instance = cls.model_construct()
    error_messages = []
    match = 0

    # deserialize data into ValueRunResultUpdate
    try:
        instance.actual_instance = ValueRunResultUpdate.from_json(json_str)
        match += 1
    except (ValidationError, ValueError) as e:
        error_messages.append(str(e))
    # deserialize data into CustomRunResultUpdate
    try:
        instance.actual_instance = CustomRunResultUpdate.from_json(json_str)
        match += 1
    except (ValidationError, ValueError) as e:
        error_messages.append(str(e))

    if match > 1:
        # more than 1 match
        raise ValueError("Multiple matches found when deserializing the JSON string into StreamEventPayload with oneOf schemas: CustomRunResultUpdate, ValueRunResultUpdate. Details: " + ", ".join(error_messages))
    elif match == 0:
        # no match
        raise ValueError("No match found when deserializing the JSON string into StreamEventPayload with oneOf schemas: CustomRunResultUpdate, ValueRunResultUpdate. Details: " + ", ".join(error_messages))
    else:
        return instance

to_dict()

Returns the dict representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/stream_event_payload.py
127
128
129
130
131
132
133
134
135
136
def to_dict(self) -> Optional[Union[Dict[str, Any], CustomRunResultUpdate, ValueRunResultUpdate]]:
    """Returns the dict representation of the actual instance"""
    if self.actual_instance is None:
        return None

    if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
        return self.actual_instance.to_dict()
    else:
        # primitive type
        return self.actual_instance

to_json()

Returns the JSON representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/stream_event_payload.py
117
118
119
120
121
122
123
124
125
def to_json(self) -> str:
    """Returns the JSON representation of the actual instance"""
    if self.actual_instance is None:
        return "null"

    if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
        return self.actual_instance.to_json()
    else:
        return json.dumps(self.actual_instance)

to_str()

Returns the string representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/stream_event_payload.py
138
139
140
def to_str(self) -> str:
    """Returns the string representation of the actual instance"""
    return pprint.pformat(self.model_dump())

StreamMode

Bases: BaseModel

If populated, indicates that the client requests to stream results with the specified streaming mode(s). The requested streaming mode(s) must be one or more of those supported by the agent as declared in agent ACP descriptor under specs.capabilities

Show JSON schema:
{
  "$defs": {
    "StreamingMode": {
      "description": "StreamingMode",
      "enum": [
        "values",
        "custom"
      ],
      "title": "StreamingMode",
      "type": "string"
    }
  },
  "description": "If populated, indicates that the client requests to stream results with the specified streaming mode(s). The requested streaming mode(s) must be one or more of those supported by the agent as declared in agent ACP descriptor  under `specs.capabilities`",
  "properties": {
    "anyof_schema_1_validator": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/StreamingMode"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Anyof Schema 1 Validator"
    },
    "anyof_schema_2_validator": {
      "anyOf": [
        {
          "$ref": "#/$defs/StreamingMode"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "actual_instance": {
      "default": null,
      "title": "Actual Instance"
    },
    "any_of_schemas": {
      "default": [
        "StreamingMode",
        "List[StreamingMode]"
      ],
      "items": {
        "type": "string"
      },
      "title": "Any Of Schemas",
      "type": "array",
      "uniqueItems": true
    }
  },
  "title": "StreamMode",
  "type": "object"
}

Config:

  • default: {'validate_assignment': True, 'protected_namespaces': ()}

Fields:

Validators:

  • actual_instance_must_validate_anyofactual_instance
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/stream_mode.py
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
class StreamMode(BaseModel):
    """
    If populated, indicates that the client requests to stream results with the specified streaming mode(s). The requested streaming mode(s) must be one or more of those supported by the agent as declared in agent ACP descriptor  under `specs.capabilities`
    """

    # data type: List[StreamingMode]
    anyof_schema_1_validator: Optional[List[StreamingMode]] = None
    # data type: StreamingMode
    anyof_schema_2_validator: Optional[StreamingMode] = None
    if TYPE_CHECKING:
        actual_instance: Optional[Union[List[StreamingMode], StreamingMode]] = None
    else:
        actual_instance: Any = None
    any_of_schemas: Set[str] = { "List[StreamingMode]", "StreamingMode" }

    model_config = {
        "validate_assignment": True,
        "protected_namespaces": (),
    }

    def __init__(self, *args, **kwargs) -> None:
        if args:
            if len(args) > 1:
                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
            if kwargs:
                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
            super().__init__(actual_instance=args[0])
        else:
            super().__init__(**kwargs)

    @field_validator('actual_instance')
    def actual_instance_must_validate_anyof(cls, v):
        if v is None:
            return v

        instance = StreamMode.model_construct()
        error_messages = []
        # validate data type: List[StreamingMode]
        try:
            instance.anyof_schema_1_validator = v
            return v
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # validate data type: StreamingMode
        if not isinstance(v, StreamingMode):
            error_messages.append(f"Error! Input type `{type(v)}` is not `StreamingMode`")
        else:
            return v

        if error_messages:
            # no match
            raise ValueError("No match found when setting the actual_instance in StreamMode with anyOf schemas: List[StreamingMode], StreamingMode. Details: " + ", ".join(error_messages))
        else:
            return v

    @classmethod
    def from_dict(cls, obj: Dict[str, Any]) -> Self:
        return cls.from_json(json.dumps(obj))

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Returns the object represented by the json string"""
        instance = cls.model_construct()
        if json_str is None:
            return instance

        error_messages = []
        # deserialize data into List[StreamingMode]
        try:
            # validation
            instance.anyof_schema_1_validator = json.loads(json_str)
            # assign value to actual_instance
            instance.actual_instance = instance.anyof_schema_1_validator
            return instance
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # anyof_schema_2_validator: Optional[StreamingMode] = None
        try:
            instance.actual_instance = StreamingMode.from_json(json_str)
            return instance
        except (ValidationError, ValueError) as e:
             error_messages.append(str(e))

        if error_messages:
            # no match
            raise ValueError("No match found when deserializing the JSON string into StreamMode with anyOf schemas: List[StreamingMode], StreamingMode. Details: " + ", ".join(error_messages))
        else:
            return instance

    def to_json(self) -> str:
        """Returns the JSON representation of the actual instance"""
        if self.actual_instance is None:
            return "null"

        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
            return self.actual_instance.to_json()
        else:
            return json.dumps(self.actual_instance)

    def to_dict(self) -> Optional[Union[Dict[str, Any], List[StreamingMode], StreamingMode]]:
        """Returns the dict representation of the actual instance"""
        if self.actual_instance is None:
            return None

        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
            return self.actual_instance.to_dict()
        else:
            return self.actual_instance

    def to_str(self) -> str:
        """Returns the string representation of the actual instance"""
        return pprint.pformat(self.model_dump())

from_json(json_str) classmethod

Returns the object represented by the json string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/stream_mode.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
@classmethod
def from_json(cls, json_str: str) -> Self:
    """Returns the object represented by the json string"""
    instance = cls.model_construct()
    if json_str is None:
        return instance

    error_messages = []
    # deserialize data into List[StreamingMode]
    try:
        # validation
        instance.anyof_schema_1_validator = json.loads(json_str)
        # assign value to actual_instance
        instance.actual_instance = instance.anyof_schema_1_validator
        return instance
    except (ValidationError, ValueError) as e:
        error_messages.append(str(e))
    # anyof_schema_2_validator: Optional[StreamingMode] = None
    try:
        instance.actual_instance = StreamingMode.from_json(json_str)
        return instance
    except (ValidationError, ValueError) as e:
         error_messages.append(str(e))

    if error_messages:
        # no match
        raise ValueError("No match found when deserializing the JSON string into StreamMode with anyOf schemas: List[StreamingMode], StreamingMode. Details: " + ", ".join(error_messages))
    else:
        return instance

to_dict()

Returns the dict representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/stream_mode.py
130
131
132
133
134
135
136
137
138
def to_dict(self) -> Optional[Union[Dict[str, Any], List[StreamingMode], StreamingMode]]:
    """Returns the dict representation of the actual instance"""
    if self.actual_instance is None:
        return None

    if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
        return self.actual_instance.to_dict()
    else:
        return self.actual_instance

to_json()

Returns the JSON representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/stream_mode.py
120
121
122
123
124
125
126
127
128
def to_json(self) -> str:
    """Returns the JSON representation of the actual instance"""
    if self.actual_instance is None:
        return "null"

    if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
        return self.actual_instance.to_json()
    else:
        return json.dumps(self.actual_instance)

to_str()

Returns the string representation of the actual instance

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/stream_mode.py
140
141
142
def to_str(self) -> str:
    """Returns the string representation of the actual instance"""
    return pprint.pformat(self.model_dump())

StreamingMode

Bases: str, Enum

StreamingMode

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/streaming_mode.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class StreamingMode(str, Enum):
    """
    StreamingMode
    """

    """
    allowed enum values
    """
    VALUES = 'values'
    CUSTOM = 'custom'

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Create an instance of StreamingMode from a JSON string"""
        return cls(json.loads(json_str))

from_json(json_str) classmethod

Create an instance of StreamingMode from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/streaming_mode.py
34
35
36
37
@classmethod
def from_json(cls, json_str: str) -> Self:
    """Create an instance of StreamingMode from a JSON string"""
    return cls(json.loads(json_str))

StreamingModes

Bases: BaseModel

Supported streaming modes. If missing, streaming is not supported. If no mode is supported attempts to stream output will result in an error.

Show JSON schema:
{
  "description": "Supported streaming modes. If missing, streaming is not supported.  If no mode is supported attempts to stream output will result in an error.",
  "properties": {
    "values": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "This is `true` if the agent supports values streaming. If `false` or missing, values streaming is not supported. Values streaming consists of a stream of objects of type `ValueRunResultUpdate`, where each one sent over the stream fully replace the previous one.",
      "title": "Values"
    },
    "custom": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "This is `true` if the agent supports custom objects streaming. If `false` or missing, custom streaming is not supported. Custom Objects streaming consists of a stream of object whose schema is specified by the agent ACP descriptor under `specs.custom_streaming_update`.",
      "title": "Custom"
    }
  },
  "title": "StreamingModes",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

  • values (Optional[StrictBool])
  • custom (Optional[StrictBool])
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/streaming_modes.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
class StreamingModes(BaseModel):
    """
    Supported streaming modes. If missing, streaming is not supported.  If no mode is supported attempts to stream output will result in an error.
    """ # noqa: E501
    values: Optional[StrictBool] = Field(default=None, description="This is `true` if the agent supports values streaming. If `false` or missing, values streaming is not supported. Values streaming consists of a stream of objects of type `ValueRunResultUpdate`, where each one sent over the stream fully replace the previous one.")
    custom: Optional[StrictBool] = Field(default=None, description="This is `true` if the agent supports custom objects streaming. If `false` or missing, custom streaming is not supported. Custom Objects streaming consists of a stream of object whose schema is specified by the agent ACP descriptor under `specs.custom_streaming_update`.")
    __properties: ClassVar[List[str]] = ["values", "custom"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of StreamingModes from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of StreamingModes from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "values": obj.get("values"),
            "custom": obj.get("custom")
        })
        return _obj

custom = None pydantic-field

This is true if the agent supports custom objects streaming. If false or missing, custom streaming is not supported. Custom Objects streaming consists of a stream of object whose schema is specified by the agent ACP descriptor under specs.custom_streaming_update.

values = None pydantic-field

This is true if the agent supports values streaming. If false or missing, values streaming is not supported. Values streaming consists of a stream of objects of type ValueRunResultUpdate, where each one sent over the stream fully replace the previous one.

from_dict(obj) classmethod

Create an instance of StreamingModes from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/streaming_modes.py
76
77
78
79
80
81
82
83
84
85
86
87
88
89
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of StreamingModes from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "values": obj.get("values"),
        "custom": obj.get("custom")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of StreamingModes from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/streaming_modes.py
51
52
53
54
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of StreamingModes from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/streaming_modes.py
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/streaming_modes.py
46
47
48
49
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/streaming_modes.py
42
43
44
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

Thread

Bases: BaseModel

Represents a collection of consecutive runs over a thread. Thread is associated with a state. Runs for a thread can potentially happen across different agents, if the state format is compatible.

Show JSON schema:
{
  "$defs": {
    "Content": {
      "description": "The content of the message.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 1 Validator"
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 2 Validator"
        },
        "actual_instance": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "List[ContentOneOfInner]",
            "str"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "Content",
      "type": "object"
    },
    "ContentOneOfInner": {
      "description": "ContentOneOfInner",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageTextBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageAnyBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "MessageTextBlock",
            "MessageAnyBlock"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ContentOneOfInner",
      "type": "object"
    },
    "Message": {
      "description": "Message",
      "properties": {
        "role": {
          "description": "The role of the message.",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/Content"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the message.",
          "title": "Id"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The metadata of the message.",
          "title": "Metadata"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "Message",
      "type": "object"
    },
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    }
  },
  "description": "Represents a collection of consecutive runs over a thread.  Thread is associated with a state. Runs for a thread can potentially happen across different agents, if the state format is compatible.",
  "properties": {
    "thread_id": {
      "description": "unique identifier of a thread",
      "title": "Thread Id",
      "type": "string"
    },
    "created_at": {
      "description": "The time the thread was created.",
      "format": "date-time",
      "title": "Created At",
      "type": "string"
    },
    "updated_at": {
      "description": "The last time the thread was updated.",
      "format": "date-time",
      "title": "Updated At",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Free form metadata for this thread",
      "title": "Metadata",
      "type": "object"
    },
    "status": {
      "description": "The status of the thread.",
      "title": "Status",
      "type": "string"
    },
    "values": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The thread state. The schema is described in agent ACP descriptor under 'spec.thread_state'.",
      "title": "Values"
    },
    "messages": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Message"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The current Messages of the thread. If messages are contained in Thread.values, implementations should remove them from values when returning messages. When this key isn't present it means the thread/agent doesn't support messages.",
      "title": "Messages"
    }
  },
  "required": [
    "thread_id",
    "created_at",
    "updated_at",
    "metadata",
    "status"
  ],
  "title": "Thread",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Validators:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread.py
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
class Thread(BaseModel):
    """
    Represents a collection of consecutive runs over a thread.  Thread is associated with a state. Runs for a thread can potentially happen across different agents, if the state format is compatible.
    """ # noqa: E501
    thread_id: StrictStr = Field(description="unique identifier of a thread")
    created_at: datetime = Field(description="The time the thread was created.")
    updated_at: datetime = Field(description="The last time the thread was updated.")
    metadata: Dict[str, Any] = Field(description="Free form metadata for this thread")
    status: StrictStr = Field(description="The status of the thread.")
    values: Optional[Dict[str, Any]] = Field(default=None, description="The thread state. The schema is described in agent ACP descriptor under 'spec.thread_state'.")
    messages: Optional[List[Message]] = Field(default=None, description="The current Messages of the thread. If messages are contained in Thread.values, implementations should remove them from values when returning messages. When this key isn't present it means the thread/agent doesn't support messages.")
    __properties: ClassVar[List[str]] = ["thread_id", "created_at", "updated_at", "metadata", "status", "values", "messages"]

    @field_validator('status')
    def status_validate_enum(cls, value):
        """Validates the enum"""
        if value not in set(['idle', 'busy', 'interrupted', 'error']):
            raise ValueError("must be one of enum values ('idle', 'busy', 'interrupted', 'error')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of Thread from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of each item in messages (list)
        _items = []
        if self.messages:
            for _item_messages in self.messages:
                if _item_messages:
                    _items.append(_item_messages.to_dict())
            _dict['messages'] = _items
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of Thread from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "thread_id": obj.get("thread_id"),
            "created_at": obj.get("created_at"),
            "updated_at": obj.get("updated_at"),
            "metadata": obj.get("metadata"),
            "status": obj.get("status"),
            "values": obj.get("values"),
            "messages": [Message.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None
        })
        return _obj

created_at pydantic-field

The time the thread was created.

messages = None pydantic-field

The current Messages of the thread. If messages are contained in Thread.values, implementations should remove them from values when returning messages. When this key isn't present it means the thread/agent doesn't support messages.

metadata pydantic-field

Free form metadata for this thread

status pydantic-field

The status of the thread.

thread_id pydantic-field

unique identifier of a thread

updated_at pydantic-field

The last time the thread was updated.

values = None pydantic-field

The thread state. The schema is described in agent ACP descriptor under 'spec.thread_state'.

from_dict(obj) classmethod

Create an instance of Thread from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread.py
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of Thread from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "thread_id": obj.get("thread_id"),
        "created_at": obj.get("created_at"),
        "updated_at": obj.get("updated_at"),
        "metadata": obj.get("metadata"),
        "status": obj.get("status"),
        "values": obj.get("values"),
        "messages": [Message.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of Thread from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread.py
65
66
67
68
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of Thread from a JSON string"""
    return cls.from_dict(json.loads(json_str))

status_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread.py
42
43
44
45
46
47
@field_validator('status')
def status_validate_enum(cls, value):
    """Validates the enum"""
    if value not in set(['idle', 'busy', 'interrupted', 'error']):
        raise ValueError("must be one of enum values ('idle', 'busy', 'interrupted', 'error')")
    return value

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread.py
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of each item in messages (list)
    _items = []
    if self.messages:
        for _item_messages in self.messages:
            if _item_messages:
                _items.append(_item_messages.to_dict())
        _dict['messages'] = _items
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread.py
60
61
62
63
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread.py
56
57
58
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

ThreadCheckpoint

Bases: BaseModel

Structured identifier for a thread checkpoint, ie. an entry in the thread's history.

Show JSON schema:
{
  "description": "Structured identifier for a thread checkpoint, ie. an entry in the thread's history.",
  "properties": {
    "checkpoint_id": {
      "description": "The ID of the checkpoint.",
      "title": "Checkpoint Id",
      "type": "string"
    }
  },
  "required": [
    "checkpoint_id"
  ],
  "title": "ThreadCheckpoint",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_checkpoint.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
class ThreadCheckpoint(BaseModel):
    """
    Structured identifier for a thread checkpoint, ie. an entry in the thread's history.
    """ # noqa: E501
    checkpoint_id: StrictStr = Field(description="The ID of the checkpoint.")
    __properties: ClassVar[List[str]] = ["checkpoint_id"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of ThreadCheckpoint from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of ThreadCheckpoint from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "checkpoint_id": obj.get("checkpoint_id")
        })
        return _obj

checkpoint_id pydantic-field

The ID of the checkpoint.

from_dict(obj) classmethod

Create an instance of ThreadCheckpoint from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_checkpoint.py
75
76
77
78
79
80
81
82
83
84
85
86
87
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of ThreadCheckpoint from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "checkpoint_id": obj.get("checkpoint_id")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of ThreadCheckpoint from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_checkpoint.py
50
51
52
53
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of ThreadCheckpoint from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_checkpoint.py
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_checkpoint.py
45
46
47
48
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_checkpoint.py
41
42
43
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

ThreadCreate

Bases: BaseModel

Detail of an empty thread to be created.

Show JSON schema:
{
  "description": "Detail of an empty thread to be created.",
  "properties": {
    "thread_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the thread. If not provided, a random UUID will be generated.",
      "title": "Thread Id"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Free form metadata for this thread",
      "title": "Metadata"
    },
    "if_exists": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "raise",
      "description": "How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread).",
      "title": "If Exists"
    }
  },
  "title": "ThreadCreate",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Validators:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_create.py
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
class ThreadCreate(BaseModel):
    """
    Detail of an empty thread to be created.
    """ # noqa: E501
    thread_id: Optional[StrictStr] = Field(default=None, description="The ID of the thread. If not provided, a random UUID will be generated.")
    metadata: Optional[Dict[str, Any]] = Field(default=None, description="Free form metadata for this thread")
    if_exists: Optional[StrictStr] = Field(default='raise', description="How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread).")
    __properties: ClassVar[List[str]] = ["thread_id", "metadata", "if_exists"]

    @field_validator('if_exists')
    def if_exists_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['raise', 'do_nothing']):
            raise ValueError("must be one of enum values ('raise', 'do_nothing')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of ThreadCreate from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of ThreadCreate from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "thread_id": obj.get("thread_id"),
            "metadata": obj.get("metadata"),
            "if_exists": obj.get("if_exists") if obj.get("if_exists") is not None else 'raise'
        })
        return _obj

if_exists = 'raise' pydantic-field

How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread).

metadata = None pydantic-field

Free form metadata for this thread

thread_id = None pydantic-field

The ID of the thread. If not provided, a random UUID will be generated.

from_dict(obj) classmethod

Create an instance of ThreadCreate from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_create.py
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of ThreadCreate from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "thread_id": obj.get("thread_id"),
        "metadata": obj.get("metadata"),
        "if_exists": obj.get("if_exists") if obj.get("if_exists") is not None else 'raise'
    })
    return _obj

from_json(json_str) classmethod

Create an instance of ThreadCreate from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_create.py
62
63
64
65
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of ThreadCreate from a JSON string"""
    return cls.from_dict(json.loads(json_str))

if_exists_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_create.py
36
37
38
39
40
41
42
43
44
@field_validator('if_exists')
def if_exists_validate_enum(cls, value):
    """Validates the enum"""
    if value is None:
        return value

    if value not in set(['raise', 'do_nothing']):
        raise ValueError("must be one of enum values ('raise', 'do_nothing')")
    return value

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_create.py
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_create.py
57
58
59
60
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_create.py
53
54
55
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

ThreadPatch

Bases: BaseModel

Payload for updating a thread.

Show JSON schema:
{
  "$defs": {
    "Content": {
      "description": "The content of the message.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 1 Validator"
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 2 Validator"
        },
        "actual_instance": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "List[ContentOneOfInner]",
            "str"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "Content",
      "type": "object"
    },
    "ContentOneOfInner": {
      "description": "ContentOneOfInner",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageTextBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageAnyBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "MessageTextBlock",
            "MessageAnyBlock"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ContentOneOfInner",
      "type": "object"
    },
    "Message": {
      "description": "Message",
      "properties": {
        "role": {
          "description": "The role of the message.",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/Content"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the message.",
          "title": "Id"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The metadata of the message.",
          "title": "Metadata"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "Message",
      "type": "object"
    },
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    },
    "ThreadCheckpoint": {
      "description": "Structured identifier for a thread checkpoint, ie. an entry in the thread's history.",
      "properties": {
        "checkpoint_id": {
          "description": "The ID of the checkpoint.",
          "title": "Checkpoint Id",
          "type": "string"
        }
      },
      "required": [
        "checkpoint_id"
      ],
      "title": "ThreadCheckpoint",
      "type": "object"
    }
  },
  "description": "Payload for updating a thread.",
  "properties": {
    "checkpoint": {
      "anyOf": [
        {
          "$ref": "#/$defs/ThreadCheckpoint"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The identifier of the checkpoint to branch from. Ignored for metadata-only patches. If not provided, defaults to the latest checkpoint."
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Metadata to merge with existing thread metadata.",
      "title": "Metadata"
    },
    "values": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The thread state. The schema is described in agent ACP descriptor under 'spec.thread_state'.",
      "title": "Values"
    },
    "messages": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Message"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The current Messages of the thread. If messages are contained in Thread.values, implementations should remove them from values when returning messages. When this key isn't present it means the thread/agent doesn't support messages.",
      "title": "Messages"
    }
  },
  "title": "ThreadPatch",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_patch.py
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
class ThreadPatch(BaseModel):
    """
    Payload for updating a thread.
    """ # noqa: E501
    checkpoint: Optional[ThreadCheckpoint] = Field(default=None, description="The identifier of the checkpoint to branch from. Ignored for metadata-only patches. If not provided, defaults to the latest checkpoint.")
    metadata: Optional[Dict[str, Any]] = Field(default=None, description="Metadata to merge with existing thread metadata.")
    values: Optional[Dict[str, Any]] = Field(default=None, description="The thread state. The schema is described in agent ACP descriptor under 'spec.thread_state'.")
    messages: Optional[List[Message]] = Field(default=None, description="The current Messages of the thread. If messages are contained in Thread.values, implementations should remove them from values when returning messages. When this key isn't present it means the thread/agent doesn't support messages.")
    __properties: ClassVar[List[str]] = ["checkpoint", "metadata", "values", "messages"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of ThreadPatch from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of checkpoint
        if self.checkpoint:
            _dict['checkpoint'] = self.checkpoint.to_dict()
        # override the default output from pydantic by calling `to_dict()` of each item in messages (list)
        _items = []
        if self.messages:
            for _item_messages in self.messages:
                if _item_messages:
                    _items.append(_item_messages.to_dict())
            _dict['messages'] = _items
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of ThreadPatch from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "checkpoint": ThreadCheckpoint.from_dict(obj["checkpoint"]) if obj.get("checkpoint") is not None else None,
            "metadata": obj.get("metadata"),
            "values": obj.get("values"),
            "messages": [Message.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None
        })
        return _obj

checkpoint = None pydantic-field

The identifier of the checkpoint to branch from. Ignored for metadata-only patches. If not provided, defaults to the latest checkpoint.

messages = None pydantic-field

The current Messages of the thread. If messages are contained in Thread.values, implementations should remove them from values when returning messages. When this key isn't present it means the thread/agent doesn't support messages.

metadata = None pydantic-field

Metadata to merge with existing thread metadata.

values = None pydantic-field

The thread state. The schema is described in agent ACP descriptor under 'spec.thread_state'.

from_dict(obj) classmethod

Create an instance of ThreadPatch from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_patch.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of ThreadPatch from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "checkpoint": ThreadCheckpoint.from_dict(obj["checkpoint"]) if obj.get("checkpoint") is not None else None,
        "metadata": obj.get("metadata"),
        "values": obj.get("values"),
        "messages": [Message.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of ThreadPatch from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_patch.py
55
56
57
58
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of ThreadPatch from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_patch.py
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of checkpoint
    if self.checkpoint:
        _dict['checkpoint'] = self.checkpoint.to_dict()
    # override the default output from pydantic by calling `to_dict()` of each item in messages (list)
    _items = []
    if self.messages:
        for _item_messages in self.messages:
            if _item_messages:
                _items.append(_item_messages.to_dict())
        _dict['messages'] = _items
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_patch.py
50
51
52
53
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_patch.py
46
47
48
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

ThreadSearchRequest

Bases: BaseModel

Payload for listing threads.

Show JSON schema:
{
  "$defs": {
    "ThreadStatus": {
      "description": "ThreadStatus",
      "enum": [
        "idle",
        "busy",
        "interrupted",
        "error"
      ],
      "title": "ThreadStatus",
      "type": "string"
    }
  },
  "description": "Payload for listing threads.",
  "properties": {
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Matches all threads for which metadata has  keys and values equal to those specified in this object.",
      "title": "Metadata"
    },
    "values": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "State values to filter on.",
      "title": "Values"
    },
    "status": {
      "anyOf": [
        {
          "$ref": "#/$defs/ThreadStatus"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "limit": {
      "anyOf": [
        {
          "maximum": 1000,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 10,
      "description": "Maximum number to return.",
      "title": "Limit"
    },
    "offset": {
      "anyOf": [
        {
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 0,
      "description": "Offset to start from.",
      "title": "Offset"
    }
  },
  "title": "ThreadSearchRequest",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

  • metadata (Optional[Dict[str, Any]])
  • values (Optional[Dict[str, Any]])
  • status (Optional[ThreadStatus])
  • limit (Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]])
  • offset (Optional[Annotated[int, Field(strict=True, ge=0)]])
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_search_request.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class ThreadSearchRequest(BaseModel):
    """
    Payload for listing threads.
    """ # noqa: E501
    metadata: Optional[Dict[str, Any]] = Field(default=None, description="Matches all threads for which metadata has  keys and values equal to those specified in this object.")
    values: Optional[Dict[str, Any]] = Field(default=None, description="State values to filter on.")
    status: Optional[ThreadStatus] = None
    limit: Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]] = Field(default=10, description="Maximum number to return.")
    offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=0, description="Offset to start from.")
    __properties: ClassVar[List[str]] = ["metadata", "values", "status", "limit", "offset"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of ThreadSearchRequest from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of ThreadSearchRequest from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "metadata": obj.get("metadata"),
            "values": obj.get("values"),
            "status": obj.get("status"),
            "limit": obj.get("limit") if obj.get("limit") is not None else 10,
            "offset": obj.get("offset") if obj.get("offset") is not None else 0
        })
        return _obj

limit = 10 pydantic-field

Maximum number to return.

metadata = None pydantic-field

Matches all threads for which metadata has keys and values equal to those specified in this object.

offset = 0 pydantic-field

Offset to start from.

values = None pydantic-field

State values to filter on.

from_dict(obj) classmethod

Create an instance of ThreadSearchRequest from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_search_request.py
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of ThreadSearchRequest from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "metadata": obj.get("metadata"),
        "values": obj.get("values"),
        "status": obj.get("status"),
        "limit": obj.get("limit") if obj.get("limit") is not None else 10,
        "offset": obj.get("offset") if obj.get("offset") is not None else 0
    })
    return _obj

from_json(json_str) classmethod

Create an instance of ThreadSearchRequest from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_search_request.py
56
57
58
59
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of ThreadSearchRequest from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_search_request.py
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_search_request.py
51
52
53
54
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_search_request.py
47
48
49
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

ThreadState

Bases: BaseModel

ThreadState

Show JSON schema:
{
  "$defs": {
    "Content": {
      "description": "The content of the message.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 1 Validator"
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 2 Validator"
        },
        "actual_instance": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "List[ContentOneOfInner]",
            "str"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "Content",
      "type": "object"
    },
    "ContentOneOfInner": {
      "description": "ContentOneOfInner",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageTextBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageAnyBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "MessageTextBlock",
            "MessageAnyBlock"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ContentOneOfInner",
      "type": "object"
    },
    "Message": {
      "description": "Message",
      "properties": {
        "role": {
          "description": "The role of the message.",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/Content"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the message.",
          "title": "Id"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The metadata of the message.",
          "title": "Metadata"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "Message",
      "type": "object"
    },
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    },
    "ThreadCheckpoint": {
      "description": "Structured identifier for a thread checkpoint, ie. an entry in the thread's history.",
      "properties": {
        "checkpoint_id": {
          "description": "The ID of the checkpoint.",
          "title": "Checkpoint Id",
          "type": "string"
        }
      },
      "required": [
        "checkpoint_id"
      ],
      "title": "ThreadCheckpoint",
      "type": "object"
    }
  },
  "description": "ThreadState",
  "properties": {
    "checkpoint": {
      "$ref": "#/$defs/ThreadCheckpoint",
      "description": "The identifier for this checkpoint."
    },
    "values": {
      "additionalProperties": true,
      "description": "The thread state. The schema is described in agent ACP descriptor under 'spec.thread_state'.",
      "title": "Values",
      "type": "object"
    },
    "messages": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Message"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The current messages of the thread. If messages are contained in Thread.values, implementations should remove them from values when returning messages. When this key isn't present it means the thread/agent doesn't support messages.",
      "title": "Messages"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The checkpoint metadata.",
      "title": "Metadata"
    }
  },
  "required": [
    "checkpoint",
    "values"
  ],
  "title": "ThreadState",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_state.py
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
class ThreadState(BaseModel):
    """
    ThreadState
    """ # noqa: E501
    checkpoint: ThreadCheckpoint = Field(description="The identifier for this checkpoint.")
    values: Dict[str, Any] = Field(description="The thread state. The schema is described in agent ACP descriptor under 'spec.thread_state'.")
    messages: Optional[List[Message]] = Field(default=None, description="The current messages of the thread. If messages are contained in Thread.values, implementations should remove them from values when returning messages. When this key isn't present it means the thread/agent doesn't support messages.")
    metadata: Optional[Dict[str, Any]] = Field(default=None, description="The checkpoint metadata.")
    __properties: ClassVar[List[str]] = ["checkpoint", "values", "messages", "metadata"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of ThreadState from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of checkpoint
        if self.checkpoint:
            _dict['checkpoint'] = self.checkpoint.to_dict()
        # override the default output from pydantic by calling `to_dict()` of each item in messages (list)
        _items = []
        if self.messages:
            for _item_messages in self.messages:
                if _item_messages:
                    _items.append(_item_messages.to_dict())
            _dict['messages'] = _items
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of ThreadState from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "checkpoint": ThreadCheckpoint.from_dict(obj["checkpoint"]) if obj.get("checkpoint") is not None else None,
            "values": obj.get("values"),
            "messages": [Message.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None,
            "metadata": obj.get("metadata")
        })
        return _obj

checkpoint pydantic-field

The identifier for this checkpoint.

messages = None pydantic-field

The current messages of the thread. If messages are contained in Thread.values, implementations should remove them from values when returning messages. When this key isn't present it means the thread/agent doesn't support messages.

metadata = None pydantic-field

The checkpoint metadata.

values pydantic-field

The thread state. The schema is described in agent ACP descriptor under 'spec.thread_state'.

from_dict(obj) classmethod

Create an instance of ThreadState from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_state.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of ThreadState from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "checkpoint": ThreadCheckpoint.from_dict(obj["checkpoint"]) if obj.get("checkpoint") is not None else None,
        "values": obj.get("values"),
        "messages": [Message.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None,
        "metadata": obj.get("metadata")
    })
    return _obj

from_json(json_str) classmethod

Create an instance of ThreadState from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_state.py
55
56
57
58
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of ThreadState from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_state.py
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of checkpoint
    if self.checkpoint:
        _dict['checkpoint'] = self.checkpoint.to_dict()
    # override the default output from pydantic by calling `to_dict()` of each item in messages (list)
    _items = []
    if self.messages:
        for _item_messages in self.messages:
            if _item_messages:
                _items.append(_item_messages.to_dict())
        _dict['messages'] = _items
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_state.py
50
51
52
53
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_state.py
46
47
48
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

ThreadStatus

Bases: str, Enum

ThreadStatus

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_status.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
class ThreadStatus(str, Enum):
    """
    ThreadStatus
    """

    """
    allowed enum values
    """
    IDLE = 'idle'
    BUSY = 'busy'
    INTERRUPTED = 'interrupted'
    ERROR = 'error'

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Create an instance of ThreadStatus from a JSON string"""
        return cls(json.loads(json_str))

from_json(json_str) classmethod

Create an instance of ThreadStatus from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/thread_status.py
36
37
38
39
@classmethod
def from_json(cls, json_str: str) -> Self:
    """Create an instance of ThreadStatus from a JSON string"""
    return cls(json.loads(json_str))

ValueRunResultUpdate

Bases: BaseModel

Partial result provided as value through streaming.

Show JSON schema:
{
  "$defs": {
    "Content": {
      "description": "The content of the message.",
      "properties": {
        "oneof_schema_1_validator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 1 Validator"
        },
        "oneof_schema_2_validator": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oneof Schema 2 Validator"
        },
        "actual_instance": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContentOneOfInner"
              },
              "type": "array"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actual Instance"
        },
        "one_of_schemas": {
          "default": [
            "List[ContentOneOfInner]",
            "str"
          ],
          "items": {
            "type": "string"
          },
          "title": "One Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "Content",
      "type": "object"
    },
    "ContentOneOfInner": {
      "description": "ContentOneOfInner",
      "properties": {
        "anyof_schema_1_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageTextBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "anyof_schema_2_validator": {
          "anyOf": [
            {
              "$ref": "#/$defs/MessageAnyBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "actual_instance": {
          "default": null,
          "title": "Actual Instance"
        },
        "any_of_schemas": {
          "default": [
            "MessageTextBlock",
            "MessageAnyBlock"
          ],
          "items": {
            "type": "string"
          },
          "title": "Any Of Schemas",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ContentOneOfInner",
      "type": "object"
    },
    "Message": {
      "description": "Message",
      "properties": {
        "role": {
          "description": "The role of the message.",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/Content"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the message.",
          "title": "Id"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The metadata of the message.",
          "title": "Metadata"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "Message",
      "type": "object"
    },
    "MessageAnyBlock": {
      "description": "MessageAnyBlock",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "type"
      ],
      "title": "MessageAnyBlock",
      "type": "object"
    },
    "MessageTextBlock": {
      "description": "MessageTextBlock",
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Metadata"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "MessageTextBlock",
      "type": "object"
    },
    "RunStatus": {
      "description": "RunStatus",
      "enum": [
        "pending",
        "error",
        "success",
        "timeout",
        "interrupted"
      ],
      "title": "RunStatus",
      "type": "string"
    }
  },
  "description": "Partial result provided as value through streaming.",
  "properties": {
    "type": {
      "title": "Type",
      "type": "string"
    },
    "run_id": {
      "description": "The ID of the run.",
      "title": "Run Id",
      "type": "string"
    },
    "status": {
      "$ref": "#/$defs/RunStatus",
      "description": "Status of the Run when this result was generated. This is particurarly useful when this data structure is used for streaming results. As the server can indicate an interrupt or an error condition while streaming the result."
    },
    "values": {
      "additionalProperties": true,
      "description": "The output of the agent. The schema is described in agent ACP descriptor under 'spec.output'.",
      "title": "Values",
      "type": "object"
    },
    "messages": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Message"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Stream of messages returned by the run.",
      "title": "Messages"
    }
  },
  "required": [
    "type",
    "run_id",
    "status",
    "values"
  ],
  "title": "ValueRunResultUpdate",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

Validators:

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/value_run_result_update.py
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class ValueRunResultUpdate(BaseModel):
    """
    Partial result provided as value through streaming.
    """ # noqa: E501
    type: StrictStr
    run_id: StrictStr = Field(description="The ID of the run.")
    status: RunStatus = Field(description="Status of the Run when this result was generated. This is particurarly useful when this data structure is used for streaming results. As the server can indicate an interrupt or an error condition while streaming the result.")
    values: Dict[str, Any] = Field(description="The output of the agent. The schema is described in agent ACP descriptor under 'spec.output'.")
    messages: Optional[List[Message]] = Field(default=None, description="Stream of messages returned by the run.")
    __properties: ClassVar[List[str]] = ["type", "run_id", "status", "values", "messages"]

    @field_validator('type')
    def type_validate_enum(cls, value):
        """Validates the enum"""
        if value not in set(['values']):
            raise ValueError("must be one of enum values ('values')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of ValueRunResultUpdate from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of each item in messages (list)
        _items = []
        if self.messages:
            for _item_messages in self.messages:
                if _item_messages:
                    _items.append(_item_messages.to_dict())
            _dict['messages'] = _items
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of ValueRunResultUpdate from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "type": obj.get("type"),
            "run_id": obj.get("run_id"),
            "status": obj.get("status"),
            "values": obj.get("values"),
            "messages": [Message.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None
        })
        return _obj

messages = None pydantic-field

Stream of messages returned by the run.

run_id pydantic-field

The ID of the run.

status pydantic-field

Status of the Run when this result was generated. This is particurarly useful when this data structure is used for streaming results. As the server can indicate an interrupt or an error condition while streaming the result.

values pydantic-field

The output of the agent. The schema is described in agent ACP descriptor under 'spec.output'.

from_dict(obj) classmethod

Create an instance of ValueRunResultUpdate from a dict

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/value_run_result_update.py
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of ValueRunResultUpdate from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate({
        "type": obj.get("type"),
        "run_id": obj.get("run_id"),
        "status": obj.get("status"),
        "values": obj.get("values"),
        "messages": [Message.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None
    })
    return _obj

from_json(json_str) classmethod

Create an instance of ValueRunResultUpdate from a JSON string

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/value_run_result_update.py
63
64
65
66
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of ValueRunResultUpdate from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/value_run_result_update.py
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([
    ])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of each item in messages (list)
    _items = []
    if self.messages:
        for _item_messages in self.messages:
            if _item_messages:
                _items.append(_item_messages.to_dict())
        _dict['messages'] = _items
    return _dict

to_json()

Returns the JSON representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/value_run_result_update.py
58
59
60
61
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str()

Returns the string representation of the model using alias

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/value_run_result_update.py
54
55
56
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

type_validate_enum(value) pydantic-validator

Validates the enum

Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/models/value_run_result_update.py
40
41
42
43
44
45
@field_validator('type')
def type_validate_enum(cls, value):
    """Validates the enum"""
    if value not in set(['values']):
        raise ValueError("must be one of enum values ('values')")
    return value