Skip to main content

Offical Python SDK for AgentX (https://www.agentx.so/)

Project description

AgentX Python SDK API library

PyPI version

The AgentX Python SDK provides a convenient way to access to your Agent programmatically. This is a python SDK for AgentX (https://www.agentx.so/)

Installation

pip install --upgrade agentx-python

Usage

Provide an api_key inline or set AGENTX_API_KEY as an environment variable. You can get an API key from https://app.agentx.so

Agent

from agentx_python import AgentX

client = AgentX(api_key="<your api key here>")

# Get the list of agents you have
print(client.list_agents())

Conversation

Each Conversation has agents and users tied to it.

# get agent
my_agent = client.get_agent(id="<agent id here>")

# Get the list of conversation from this agent
print(my_agent.list_conversations())

Chat

A chat needs to happen in the conversation. You can do stream response too, default False.

a_conversation = my_agent.get_conversation(id="<conversation id here>")

response = a_conversation.chat("Hello, what is your name?", stream=True)
for chunk in response:
    print(chunk, end="")

# output:
# My name is Rosita. I'm an AI assistant created by AgentX. It's nice to meet you! How can I help you today?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentx-python-0.2.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

agentx_python-0.2.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file agentx-python-0.2.1.tar.gz.

File metadata

  • Download URL: agentx-python-0.2.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for agentx-python-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ad52746ef639da5e3f0e0ba00d6d272b1fa7881bcbc9e2a7a8031bb992ea040b
MD5 c30e054cddecfcca6032e65f12918c8a
BLAKE2b-256 bc849d7a140d618fb9601e83432e5bd891e64f2bdb1bb3ef7ea288dd9c82e214

See more details on using hashes here.

File details

Details for the file agentx_python-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for agentx_python-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 25721649385032d1982a07c901f12cdc68d3cf92457c36a7e59bfe08f978cc35
MD5 1f63448e8647d1c4de2fe0160e22e8a8
BLAKE2b-256 e2ad0c1a51f0158b13ce120a25f00e5c545e3446187369906f3fc42ef01bdb2d

See more details on using hashes here.

Supported by

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