Skip to main content

Python SDK for the AgentField control plane

Project description

AgentField Python SDK

The AgentField SDK provides a production-ready Python interface for registering agents, executing workflows, and integrating with the AgentField control plane.

Installation

pip install agentfield

To work on the SDK locally:

git clone https://github.com/Agent-Field/agentfield.git
cd agentfield/sdk/python
python -m pip install -e .[dev]

Quick Start

from agentfield import Agent

agent = Agent(
    node_id="example-agent",
    agentfield_server="http://localhost:8080",
    dev_mode=True,
)

@agent.reasoner()
async def summarize(text: str) -> dict:
    result = await agent.ai(
        prompt=f"Summarize: {text}",
        response_model={"summary": "string", "tone": "string"},
    )
    return result

if __name__ == "__main__":
    agent.serve(port=8001)

See docs/DEVELOPMENT.md for instructions on wiring agents to the control plane.

Testing

pytest

To run coverage locally:

pytest --cov=agentfield --cov-report=term-missing

License

Distributed under the Apache 2.0 License. See the project root LICENSE for details.

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

agentfield-0.1.39rc1.tar.gz (162.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentfield-0.1.39rc1-py3-none-any.whl (180.0 kB view details)

Uploaded Python 3

File details

Details for the file agentfield-0.1.39rc1.tar.gz.

File metadata

  • Download URL: agentfield-0.1.39rc1.tar.gz
  • Upload date:
  • Size: 162.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for agentfield-0.1.39rc1.tar.gz
Algorithm Hash digest
SHA256 0bad939f96a83fe36e69c8120249fe1c6c6d823bbe856439e4106468f9625092
MD5 2884eba460db7e70e501e3ae8bdfb0c1
BLAKE2b-256 ea0fa77cfb093485047e11ebeba10c502d448aa1999351546a4a72cefcf636aa

See more details on using hashes here.

File details

Details for the file agentfield-0.1.39rc1-py3-none-any.whl.

File metadata

  • Download URL: agentfield-0.1.39rc1-py3-none-any.whl
  • Upload date:
  • Size: 180.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for agentfield-0.1.39rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe95e7bb4329ea17c6e58f90a7a4a929a8fba1aa4a09ee35533999346793650b
MD5 9bd4a459ebd0c128450d4735c460ed7a
BLAKE2b-256 5ab46b92de719146a014c9b3bfbe6fd67fda3a7be3782b52ec2e8a81a64ec94a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page