Leea agent SDK
Project description
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.
Installation:
For now use git+ssh://git@github.com/Leea-Labs/leea-agent-sdk in requirements.txt or just for pip install
Example agent:
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")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file leea_agent_sdk-0.0.6.tar.gz.
File metadata
- Download URL: leea_agent_sdk-0.0.6.tar.gz
- Upload date:
- Size: 9.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0caa7f6218f7954266beda7eb75eacc5b421158ad6867f4639088f41c1fda3d
|
|
| MD5 |
20b5fd0650d66ce77f5153ff29e9c83f
|
|
| BLAKE2b-256 |
37d6441075ae428a4e8fd25090e9113fad3538e3f739ba043927158ddb0a454c
|
Provenance
The following attestation bundles were made for leea_agent_sdk-0.0.6.tar.gz:
Publisher:
publish.yml on Leea-Labs/leea-agent-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
leea_agent_sdk-0.0.6.tar.gz -
Subject digest:
a0caa7f6218f7954266beda7eb75eacc5b421158ad6867f4639088f41c1fda3d - Sigstore transparency entry: 175690034
- Sigstore integration time:
-
Permalink:
Leea-Labs/leea-agent-sdk-python@adbb67ccf5e84a85203e42aed9fcf85d4921f874 -
Branch / Tag:
refs/tags/0.0.6 - Owner: https://github.com/Leea-Labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@adbb67ccf5e84a85203e42aed9fcf85d4921f874 -
Trigger Event:
push
-
Statement type:
File details
Details for the file leea_agent_sdk-0.0.6-py3-none-any.whl.
File metadata
- Download URL: leea_agent_sdk-0.0.6-py3-none-any.whl
- Upload date:
- Size: 9.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
644f79d186737c78acb9a61af98f31093206ddb95ee286abc452cf550e230a45
|
|
| MD5 |
4699a2bbe3621dd062da3d7e88416902
|
|
| BLAKE2b-256 |
82ff14d552162c9b7f22b4eaa9ed87c27952cb46a0317928b79962229760b620
|
Provenance
The following attestation bundles were made for leea_agent_sdk-0.0.6-py3-none-any.whl:
Publisher:
publish.yml on Leea-Labs/leea-agent-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
leea_agent_sdk-0.0.6-py3-none-any.whl -
Subject digest:
644f79d186737c78acb9a61af98f31093206ddb95ee286abc452cf550e230a45 - Sigstore transparency entry: 175690037
- Sigstore integration time:
-
Permalink:
Leea-Labs/leea-agent-sdk-python@adbb67ccf5e84a85203e42aed9fcf85d4921f874 -
Branch / Tag:
refs/tags/0.0.6 - Owner: https://github.com/Leea-Labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@adbb67ccf5e84a85203e42aed9fcf85d4921f874 -
Trigger Event:
push
-
Statement type: