agentconnect.core.types module¶
Core type definitions for the AgentConnect framework.
This module provides the fundamental types, enumerations, and data structures used throughout the framework, including agent identities, capabilities, and message types.
- class ModelProvider(value)¶
-
Supported AI model providers.
This enum defines the supported model providers for AI agents.
- OPENAI = 'openai'¶
- ANTHROPIC = 'anthropic'¶
- GROQ = 'groq'¶
- GOOGLE = 'google'¶
- class ModelName(value)¶
-
Supported model names for each provider.
This enum defines the specific model names available for each provider.
- GPT4_5_PREVIEW = 'gpt-4.5-preview-2025-02-27'¶
- GPT4_1 = 'gpt-4.1'¶
- GPT4_1_MINI = 'gpt-4.1-mini'¶
- GPT4O = 'gpt-4o'¶
- GPT4O_MINI = 'gpt-4o-mini'¶
- O1 = 'o1'¶
- O1_MINI = 'o1-mini'¶
- O3 = 'o3'¶
- O3_MINI = 'o3-mini'¶
- O4_MINI = 'o4-mini'¶
- CLAUDE_3_7_SONNET = 'claude-3-7-sonnet-latest'¶
- CLAUDE_3_5_SONNET = 'claude-3-5-sonnet-latest'¶
- CLAUDE_3_5_HAIKU = 'claude-3-5-haiku-latest'¶
- CLAUDE_3_OPUS = 'claude-3-opus-latest'¶
- CLAUDE_3_SONNET = 'claude-3-sonnet-20240229'¶
- CLAUDE_3_HAIKU = 'claude-3-haiku-20240307'¶
- LLAMA33_70B_VTL = 'llama-3.3-70b-versatile'¶
- LLAMA3_1_8B_INSTANT = 'llama-3.1-8b-instant'¶
- LLAMA_GUARD3_8B = 'llama-guard-3-8b'¶
- LLAMA3_70B = 'llama3-70b-8192'¶
- LLAMA3_8B = 'llama3-8b-8192'¶
- MIXTRAL = 'mixtral-8x7b-32768'¶
- GEMMA2_90B = 'gemma2-9b-it'¶
- GEMINI2_5_PRO = 'gemini-2.5-pro'¶
- GEMINI2_5_FLASH = 'gemini-2.5-flash'¶
- GEMINI2_5_FLASH_LITE = 'gemini-2.5-flash-lite'¶
- GEMINI2_FLASH = 'gemini-2.0-flash'¶
- GEMINI2_FLASH_LITE = 'gemini-2.0-flash-lite'¶
- GEMINI2_PRO_EXP = 'gemini-2.0-pro-exp-02-05'¶
- GEMINI2_FLASH_THINKING_EXP = 'gemini-2.0-flash-thinking-exp-01-21'¶
- classmethod get_default_for_provider(provider)¶
Get the default model for a given provider.
- Parameters:
provider (
ModelProvider) – The model provider to get the default model for- Return type:
- Returns:
The default model name for the provider
- Raises:
ValueError – If no default model is defined for the provider
- class AgentType(value)¶
-
Types of agents in the system.
This enum defines the different types of agents that can exist in the system.
- HUMAN = 'human'¶
- AI = 'ai'¶
- class InteractionMode(value)¶
-
Supported interaction modes between agents.
This enum defines the different ways agents can interact with each other.
- HUMAN_TO_AGENT = 'human_to_agent'¶
- AGENT_TO_AGENT = 'agent_to_agent'¶
- class ProtocolVersion(value)¶
-
Supported protocol versions for agent communication.
This enum defines the different protocol versions that can be used for communication between agents.
- V1_0 = '1.0'¶
- V1_1 = '1.1'¶
- class VerificationStatus(value)¶
-
Status of agent identity verification.
This enum defines the different states of agent identity verification.
- PENDING = 'pending'¶
- VERIFIED = 'verified'¶
- FAILED = 'failed'¶
- class Capability(name, description, input_schema=None, output_schema=None, version='1.0')¶
Bases:
objectCapability definition for agents.
This class defines a capability that an agent can provide, including its name, description, and input/output schemas.
- Parameters:
- name¶
Name of the capability
- description¶
Description of what the capability does
- input_schema¶
Schema for the input data
- output_schema¶
Schema for the output data
- version¶
Version of the capability
- class AgentIdentity(did, public_key, private_key=None, verification_status=VerificationStatus.PENDING, created_at=<factory>, metadata=<factory>)¶
Bases:
objectDecentralized Identity for Agents.
This class provides identity management for agents, including cryptographic keys for signing and verification.
- Parameters:
- did¶
Decentralized Identifier
- public_key¶
Public key for verification
- private_key¶
Private key for signing (optional)
- verification_status¶
Status of identity verification
- created_at¶
When the identity was created
- metadata¶
Additional information about the identity
-
verification_status:
VerificationStatus= 'pending'¶
- classmethod create_key_based()¶
Create a new key-based identity for an agent.
This method generates a new RSA key pair and creates a key-based decentralized identifier (DID) for the agent.
- Return type:
- Returns:
A new AgentIdentity with generated keys and DID
- sign_message(message)¶
Sign a message using the private key.
- Parameters:
message (
str) – The message to sign- Return type:
- Returns:
Base64-encoded signature
- Raises:
ValueError – If the private key is not available
- verify_signature(message, signature)¶
Verify a message signature using the public key.
- to_dict()¶
Convert identity to dictionary format.
- Return type:
- Returns:
Dictionary representation of the identity
- class AgentMetadata(agent_id, agent_type, identity, organization_id=None, capabilities=<factory>, interaction_modes=<factory>, payment_address=None, metadata=<factory>)¶
Bases:
objectMetadata for an agent.
This class contains metadata about an agent, including its ID, type, capabilities, and interaction modes.
- Parameters:
agent_id (str)
agent_type (AgentType)
identity (AgentIdentity)
organization_id (str | None)
interaction_modes (List[InteractionMode])
payment_address (str | None)
metadata (Dict)
- agent_id¶
Unique identifier for the agent
- agent_type¶
Type of agent (human, AI)
- identity¶
Agent’s decentralized identity
- organization_id¶
ID of the organization the agent belongs to
- capabilities¶
List of capability names the agent provides
- interaction_modes¶
Supported interaction modes
- payment_address¶
Agent’s primary wallet address for receiving payments
- metadata¶
Additional information about the agent
-
identity:
AgentIdentity¶
-
interaction_modes:
List[InteractionMode]¶
- class Skill(**data)¶
Bases:
BaseModelSkill model for agents.
This class defines a skill that an agent can possess, including its name and description.
- name¶
Name of the skill
- description¶
Optional description of what the skill entails
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class AgentProfile(**data)¶
Bases:
BaseModelComprehensive profile for an agent.
This class provides a complete profile of an agent, including its capabilities, skills, and other metadata needed for discovery and interaction.
- Parameters:
agent_id (str)
agent_type (AgentType)
name (str | None)
summary (str | None)
description (str | None)
version (str | None)
documentation_url (str | None)
organization (str | None)
developer (str | None)
url (str | None)
capabilities (List[Capability])
payment_address (str | None)
reputation_score (float | None)
- agent_id¶
Unique identifier for the agent
- agent_type¶
Type of agent (human, AI)
- name¶
Name of the agent
- summary¶
Brief summary of the agent’s purpose
- description¶
Detailed description of the agent
- version¶
Version of the agent
- documentation_url¶
URL to the agent’s documentation
- organization¶
Organization or entity providing the agent (e.g., ‘Acme Corp’, ‘did:org:123’). Using a verifiable ID is recommended for robustness.
- developer¶
Individual or team that developed the agent (e.g., ‘Alice’, ‘did:person:abc’). Using a verifiable ID is recommended.
- url¶
Endpoint URL for the agent
- auth_schemes¶
List of supported authentication schemes
- default_input_modes¶
List of supported input modes
- default_output_modes¶
List of supported output modes
- capabilities¶
List of capabilities the agent provides
- skills¶
List of skills the agent possesses
- examples¶
Example inputs/outputs or use cases
- tags¶
Keywords for filtering
- payment_address¶
Agent’s primary wallet address for receiving payments
- custom_metadata¶
Additional custom metadata about the agent
- reputation_score¶
Optional reputation score (excluded from serialization)
-
capabilities:
List[Capability]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class MessageType(value)¶
-
Types of messages that can be exchanged between agents.
This enum defines the different types of messages that can be sent between agents in the system.
- TEXT = 'text'¶
- COMMAND = 'command'¶
- RESPONSE = 'response'¶
- ERROR = 'error'¶
- VERIFICATION = 'verification'¶
- CAPABILITY = 'capability'¶
- PROTOCOL = 'protocol'¶
- STOP = 'stop'¶
- SYSTEM = 'system'¶
- COOLDOWN = 'cooldown'¶
- IGNORE = 'ignore'¶
- REQUEST_COLLABORATION = 'request_collaboration'¶
- COLLABORATION_RESPONSE = 'collaboration_response'¶
- COLLABORATION_ERROR = 'collaboration_error'¶