Skip to main content

A Python utils SDK for xpander.ai services.

Project description

Here's a greatly improved version of your README, integrating details from your setup.py (like updated Python version, full dependency list, extras, etc.), formatted clearly and professionally in Markdown:


xpander_utils Package Development Guide

Overview

xpander_utils is a Python utilities SDK for xpander.ai services.
It provides adapters, helpers, and utilities to integrate and enhance the development of AI agents, workflows, and more.


Installation

Install from PyPI

To use the xpander_utils package in your project, install it via pip:

pip install xpander-utils

Install Locally (Development Mode)

If you want to contribute or modify the package, clone the repository and install it locally in editable mode:

pip install -e .

This allows you to make changes to the source code without reinstalling the package after each modification.


Usage Example

Here's a simple example using SmolAgentsAdapter to bridge between xpander.ai and smolagents:

from smolagents import OpenAIServerModel, ToolCallingAgent
from xpander_utils.sdk.adapters import SmolAgentsAdapter

# API keys
llm_api_key = "{YOUR_LLM_KEY}"
xpander_api_key = "{YOUR_API_KEY}"

# Initialize Xpander agent
xpander = SmolAgentsAdapter(agent_id="{YOUR_AGENT_ID}", api_key=xpander_api_key)

# Initialize model
model = OpenAIServerModel(
    model_id="gpt-4o",
    api_key=llm_api_key
)

# Add a task to Xpander
prompt = "get the longest tag"
xpander.add_task(input=prompt)

# Build the agent using Xpander's tools
agent = ToolCallingAgent(
    step_callbacks=[xpander.step_callback()],
    tools=xpander.get_tools(),
    model=model,
    prompt_templates={"system_prompt": xpander.get_system_prompt()}
)

# Initialize memory from Xpander
xpander.init_memory(agent=agent)

# Run the agent
result = agent.run(task=prompt, reset=False)

Dependencies

The package requires the following libraries:

  • pydantic
  • loguru
  • xpander-sdk
  • httpx
  • aiosseclient

Optional / Extras

Additional functionality can be installed with extras:

Extra Libraries Installed
smolagents smolagents
llama-index llama_index
chainlit chainlit

Example to install with extras:

pip install "xpander-utils[smolagents]"

You can combine extras:

pip install "xpander-utils[smolagents,llama-index]"

Supported Python Versions

This package officially supports Python >= 3.12.7.

Ensure you are using a compatible Python version for full functionality.


License

This project is licensed under the MIT License.


Development Notes

  • Source code is located under the src/ directory.
  • Package discovery is handled via find_packages(where="src").
  • long_description for the package is directly pulled from README.md.

Would you also like me to suggest an even more "pypi-publish-ready" version that includes badges (like version, license, Python version, pypi status) at the top? 🚀
It would look very official!
Want me to generate it too? 🎯

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

xpander_utils-0.0.78.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

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

xpander_utils-0.0.78-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file xpander_utils-0.0.78.tar.gz.

File metadata

  • Download URL: xpander_utils-0.0.78.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for xpander_utils-0.0.78.tar.gz
Algorithm Hash digest
SHA256 28503ba128a1e8637417ac41f375890a236a9d051b2bfcd2e8a084d74a2ff461
MD5 e2ee25a32eaf4cf26e25fb23aa7dbab2
BLAKE2b-256 1768cfce71cece9ca2947b7e0326774259537b45a78fe1feb990af299cdb1500

See more details on using hashes here.

File details

Details for the file xpander_utils-0.0.78-py3-none-any.whl.

File metadata

  • Download URL: xpander_utils-0.0.78-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for xpander_utils-0.0.78-py3-none-any.whl
Algorithm Hash digest
SHA256 f4a5417be842390ea0d7d6b23a19480e09f5525ef2c32599f438ac5eab04d132
MD5 c908ddaafd3e5db518fbe765e5a18e0c
BLAKE2b-256 d629b50c3bfc23db8bf3bb8cad9ae5045fb96adbe91d512c1cb41bfce66a2998

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