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(*values)¶
-
Supported AI model providers.
This enum defines the supported model providers for AI agents.
- OPENAI = 'openai'¶
- ANTHROPIC = 'anthropic'¶
- GROQ = 'groq'¶
- GOOGLE = 'google'¶
- class ModelName(*values)¶
-
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'¶
- GPT4O = 'gpt-4o'¶
- GPT4O_MINI = 'gpt-4o-mini'¶
- O1 = 'o1'¶
- O1_MINI = 'o1-mini'¶
- O3_MINI = 'o3-mini-2025-01-31'¶
- 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_EXP = 'gemini-2.5-pro-exp-03-25 '¶
- 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'¶
- GEMINI1_5_FLASH = 'gemini-1.5-flash'¶
- GEMINI1_5_PRO = 'gemini-1.5-pro'¶
- 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(*values)¶
-
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(*values)¶
-
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(*values)¶
-
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(*values)¶
-
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, output_schema, version='1.0')¶
Bases:
object
Capability 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:
object
Decentralized 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>, verification_status=False, metadata=<factory>)¶
Bases:
object
Metadata 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])
verification_status (bool)
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
- verification_status¶
Whether the agent’s identity is verified
- metadata¶
Additional information about the agent
-
identity:
AgentIdentity
¶
-
interaction_modes:
List
[InteractionMode
]¶
- class MessageType(*values)¶
-
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'¶