Metadata-Version: 2.4
Name: leea_agent_sdk
Version: 0.0.3
Summary: Leea agent SDK
Project-URL: Homepage, https://github.com/Leea-Labs/leea-agent-sdk-python
Project-URL: Documentation, https://github.com/Leea-Labs/leea-agent-sdk-python/blob/main/README.md
Project-URL: Repository, https://github.com/Leea-Labs/leea-agent-sdk-python
License-Expression: MIT
Keywords: agents,leea,sdk
Requires-Python: >=3.9
Requires-Dist: base58==2.1.1
Requires-Dist: certifi~=2023.5.7
Requires-Dist: eth-account~=0.13.4
Requires-Dist: eth-utils~=5.2.0
Requires-Dist: jsonschema~=4.23.0
Requires-Dist: protobuf~=5.29.3
Requires-Dist: pydantic~=2.9.2
Requires-Dist: solana~=0.36.2
Requires-Dist: solders~=0.23.0
Requires-Dist: urllib3~=2.2.3
Requires-Dist: web3[tester]~=7.7.0
Requires-Dist: websockets~=13.1
Description-Content-Type: text/markdown

# SDK for Leea Agent Protocol
Project is in active development stage, so don't judge us harshly!

This is framework-agnostic SDK that needed to connect any agent/service into [Leea Agent Protocol](https://docs.leealabs.com/leea-labs/multi-agents-systems/leea-multi-agent-ecosystem-and-tools). 

### Installation:
For now use `git+ssh://git@github.com/Leea-Labs/leea-agent-sdk` in requirements.txt or just for pip install

### Example agent:

```python
import os
from typing import Type, Literal

from pydantic import BaseModel, Field

from leea_agent_sdk.agent import Agent
from leea_agent_sdk.runtime import start
from leea_agent_sdk.context import ExecutionContext


class DividerAgentInput(BaseModel):
    a: int = Field(description="A")
    b: int = Field(description="B")


class DividerAgentOutput(BaseModel):
    value: float = Field(description="data field")


class DividerAgent(Agent):
    name: str = "Divider"
    description: str = "Agent that can calculate a / b"
    
    visibility: Literal["public", "private", "hidden"] = "public"

    input_schema: Type[BaseModel] = DividerAgentInput
    output_schema: Type[BaseModel] = DividerAgentOutput

    async def ready(self):
        print("Agent is ready to serve!")
    
    async def run(self, context: ExecutionContext, input: DividerAgentInput) -> DividerAgentOutput:
        if input.b == 0:
            raise ValueError("Can't divide by zero") # this will send failed execution result 
        
        # Pushing log to increase observability
        await self.push_log(context, "Calculating!")
        
        # Calling other agent
        cool_agent = await self.get_agent("leea/cool-agent")
        await cool_agent.call(context, {"some": "data"})
        
        # Returning result
        return DividerAgentOutput(value=input.a / input.b)


if __name__ == '__main__':
    os.environ['LEEA_API_KEY'] = "..."
    start(DividerAgent(), wallet_path="./wallet.json")
```


