Skip to main content

An agent that uses XAI to achieve goals by executing tools

Project description

agentxai

A powerful autonomous agent framework powered by X.AI's Grok model.

Features

  • AgentX: An autonomous agent that can execute complex missions using provided tools
    • tools: List of callable functions the agent can use to complete its mission
      • can be another agent, assuming the agent lives in a funciton
    • mission: String describing the goal or task to accomplish
    • exit_function: Optional callback function executed upon mission completion
      • default is a success bool
    • system_prompt: Customizable prompt to guide agent behavior (default: autonomous goal-focused agent)
    • model: AI model selection (default: "grok-beta")
    • enable_logging: Toggle detailed logging (default: False)
    • max_steps: Maximum execution steps before termination (default: 10)
  • XAI: A robust client for interacting with X.AI's Grok model
  • Cost tracking and token usage monitoring
  • Automatic retries and error handling
  • JSON response validation
  • Configurable logging

example agent:

def my_function(input: str) -> str:
    """
    A simple example function that can be passed to AgentX as a tool.

    Args:
        input (str): The input string to process

    Returns:
        str: The unmodified input string
    """
    # do something with input
    return input

def exit_function(message: str) -> int:
    """
    A simple example exit function that can be passed to AgentX.

    Args:
        message (str): A string containing a number to convert

    Returns:
        int: The string converted to an integer
    """
    try:
        return int(message)
    except ValueError:
        return -1

agent = AgentX(
    tools=[my_function],
    mission="""
    Do something with

    #1 setup
     - some useful details
    #2 do something
    - some details
    #3 last thing to do
    - some details

    success criteria:
      -  that something is done
      -  it is done well
    """,
    exit_function=exit_function,
)

ENV

XAI_API_KEY=

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

agentxai-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

agentxai-0.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file agentxai-0.1.0.tar.gz.

File metadata

  • Download URL: agentxai-0.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for agentxai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4a44d3da488e7bdc825712a5a7c5a4cf07500dd69d81a690bffbebf349b57a7b
MD5 06ceb7b95d8c5b7ffe2b3164867cb83d
BLAKE2b-256 b8432eb304f4b1b79bd6bfa2d9a66408b3874d4fe125076e3b1a1e09801d2f04

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentxai-0.1.0.tar.gz:

Publisher: publish.yml on wickthumb/agentX

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentxai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agentxai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for agentxai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7edb8187a2ed494024a87fe69ce62a0619d398753706c933f528c3f190df8c5a
MD5 1b8b48261d5b86b2c09797dad01ec7a4
BLAKE2b-256 7d711aa28612c36094dc51ec495cf417cfb27edf4e9cc0aa27197e659706e7bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentxai-0.1.0-py3-none-any.whl:

Publisher: publish.yml on wickthumb/agentX

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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