Metadata-Version: 2.1
Name: agentxai
Version: 0.1.0
Summary: An agent that uses XAI to achieve goals by executing tools
Home-page: https://github.com/wickthumb/agentX
Author: wickthumb
Author-email: steven@wick3d.llc
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: build==1.2.2.post1
Requires-Dist: certifi==2024.8.30
Requires-Dist: charset-normalizer==3.4.0
Requires-Dist: docutils==0.21.2
Requires-Dist: idna==3.10
Requires-Dist: importlib_metadata==8.5.0
Requires-Dist: jaraco.classes==3.4.0
Requires-Dist: jaraco.context==6.0.1
Requires-Dist: jaraco.functools==4.1.0
Requires-Dist: keyring==25.5.0
Requires-Dist: markdown-it-py==3.0.0
Requires-Dist: mdurl==0.1.2
Requires-Dist: more-itertools==10.5.0
Requires-Dist: nh3==0.2.18
Requires-Dist: packaging==24.2
Requires-Dist: pkginfo==1.10.0
Requires-Dist: Pygments==2.18.0
Requires-Dist: pyproject_hooks==1.2.0
Requires-Dist: python-dotenv==1.0.1
Requires-Dist: readme_renderer==44.0
Requires-Dist: requests==2.32.3
Requires-Dist: requests-toolbelt==1.0.0
Requires-Dist: rfc3986==2.0.0
Requires-Dist: rich==13.9.4
Requires-Dist: setuptools==75.6.0
Requires-Dist: tenacity==9.0.0
Requires-Dist: twine==5.1.1
Requires-Dist: urllib3==2.2.3
Requires-Dist: zipp==3.21.0

# 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:

```python

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=
```
