Skip to main content

OpenAI function calling tools for Sardis - Payment OS for AI Agents

Project description

sardis-openai

OpenAI function calling tools for Sardis - Payment OS for AI Agents.

Installation

pip install sardis-openai

Quick Start

from openai import OpenAI
from sardis_openai import get_sardis_tools, SardisToolHandler

client = OpenAI()
handler = SardisToolHandler(api_key="sk_sardis_...")

# Get Sardis tool definitions
tools = get_sardis_tools()

# Use with Chat Completions
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Pay $25 to OpenAI for API credits"}],
    tools=tools,
)

# Handle tool calls
for tool_call in response.choices[0].message.tool_calls:
    result = await handler.handle(tool_call)
    print(result)

Available Tools

Tool Description
sardis_pay Execute payment with policy enforcement
sardis_check_balance Check wallet balance and limits
sardis_check_policy Dry-run policy validation
sardis_issue_card Issue virtual card for agent
sardis_get_spending_summary Get spending analytics

All tools use strict mode to prevent hallucination.

Links

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

sardis_openai-1.0.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

sardis_openai-1.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file sardis_openai-1.0.0.tar.gz.

File metadata

  • Download URL: sardis_openai-1.0.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for sardis_openai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d702260c06cba50e24d87635a33c87e73b4557638fc0ff0f050b8e1ef240c02d
MD5 76bfbfbbae98fdfa27eaedc98ad48a44
BLAKE2b-256 0e4f9e3415f4640ed56c814af5dab94df30d2d1ea2cb523a6b21070efa1f4619

See more details on using hashes here.

File details

Details for the file sardis_openai-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: sardis_openai-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for sardis_openai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1fd8b57caaa732fd0e017be4c180c993fc4c37317a9aaa3fe21cc49ac020221
MD5 4a1d8cb3b05cc81d9768f8e37abcd83b
BLAKE2b-256 92236070b747680976097448e1ffbde3aa324856ee3862d4fc32fc9740e3bcfc

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