Skip to main content

A Python utils SDK for xpander.ai services.

Project description

xpander_utils Package Development Guide

Local Development

To set up the project locally, follow these steps:

Local Build and Link

Install the package in editable mode:

pip install -e .

Usage

To use the xpander-utils package, install it via pip:

pip install xpander-utils

Example Code

Below is an example of how to use the SmolAgentsAdapter for bridging xpander.ai and smolagents:

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


llm_api_key = "{YOUR_LLM_KEY}"

# get xpander agent
xpander = SmolAgentsAdapter(agent_id="{YOUR_AGENT_ID}", api_key="{YOUR_API_KEY}")

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

# init xpander task
prompt = "get the longest tag"
xpander.add_task(input=prompt)

# convert xpander tools to smolagents

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

# init memory from xpander
xpander.init_memory(agent=agent)

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

Package Information

  • Package Name: xpander_utils
  • Version: 0.0.1
  • Author: xpanderAI
  • Email: dev@xpander.ai
  • Description: A Python utilities SDK for xpander.ai services.
  • URL: xpander.ai

Dependencies

The package requires the following dependencies:

  • pydantic
  • loguru
  • smolagents
  • xpander-sdk

Supported Python Versions

This package requires Python >=3.12.17.

License

This project is licensed under the MIT License.

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.18.tar.gz (12.1 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.18-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xpander_utils-0.0.18.tar.gz
Algorithm Hash digest
SHA256 4942e2ac41e588db44945a7e4394f4281c1eee2676139b064aba3388e08c2684
MD5 0329828215a95ff9b2c5bb8ccb5d3745
BLAKE2b-256 dc619dcb9675d37f81f902e945cec621f5268b00fcc91279e2d9c72371d8974f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for xpander_utils-0.0.18-py3-none-any.whl
Algorithm Hash digest
SHA256 1896939053026d20193aeac6e86c85c6383393598bff2412513602b18beaac36
MD5 fe51c7079dd6e57e54767f0774a1c216
BLAKE2b-256 266ce76ffd7faea60c88c308a05d852e265a240e38b1542177e704185ec8c6bc

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