Skip to main content

Python client for AI Support API integration

Project description

AI Support Client

A Python client library for integrating AI-powered customer support into your applications.

Installation

pip install ai-support-client

Quick Start

from ai_support_client import AISupport

# Initialize the client
client = AISupport(
    api_key="your_api_key",
    project_id="your_project_id"
)

# Handle a customer inquiry
response = client.handle_inquiry(
    message="How do I reset my password?",
    inquiry_type="chat",
    context={
        "customer_id": "12345",
        "previous_interactions": []
    }
)

print(response.message)

Features

  • Easy integration with AI Support API
  • Support for chat, voice, and email inquiries
  • Customizable context for better AI responses
  • Rate limiting and error handling
  • Type hints for better IDE support

Documentation

Initialization

client = AISupport(
    api_key="your_api_key",
    project_id="your_project_id",
    base_url="https://api.aisupport.com/v1"  # Optional
)

Methods

handle_inquiry

Handle a customer inquiry and get an AI-generated response.

response = client.handle_inquiry(
    message="How do I reset my password?",
    inquiry_type="chat",  # "chat", "voice", or "email"
    context={
        "customer_id": "12345",
        "previous_interactions": []
    }
)

get_usage

Get current API usage statistics.

usage = client.get_usage()
print(f"API calls this month: {usage.total_calls}")

Error Handling

The library raises specific exceptions for different error cases:

  • AISupportAuthError: Authentication errors
  • AISupportRateLimitError: Rate limit exceeded
  • AISupportAPIError: General API errors

Example:

from ai_support_client.exceptions import AISupportAuthError

try:
    response = client.handle_inquiry(message="Hello")
except AISupportAuthError:
    print("Invalid API key")

License

MIT License

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

ai_support_client-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

ai_support_client-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ai_support_client-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ai_support_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1be87c6a55d4d7b9e360ae3d0e2eca1777b0577e6093851e9d6c1643df39af03
MD5 93ae99f6ef027f6a94be6e6dc07e152b
BLAKE2b-256 753809d56f90349ad7209be5548639eae40f8b92bb2f38924e53378acf700203

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ai_support_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d7ec68747def1c9babe5093279f036f0cadf1e2e187a6fa80d4794c45316532
MD5 1f65f0533e2d9da84dece8350a85809b
BLAKE2b-256 460aefca444223d2c99578b7ba74247bdb99d44582ff2c79995f83ee9f44fb25

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