Skip to main content

A Python SDK for document, image, and audio AI actions powered by OpenAI.

Project description

OpenAI AI Actions SDK

openai-ai-actions-sdk is a Python SDK for common AI tasks across documents, images, and audio.

It provides simple actions like summarization, keyword extraction, image understanding, question answering, transcription, and transcript summarization, while hiding the lower-level OpenAI API request handling from application code.

What The SDK Can Do

  • Document actions: generate text, summarize, extract keywords, analyze sentiment, answer questions from context
  • Image actions: describe images, analyze images, answer questions about an image
  • Audio actions: transcribe audio and summarize transcripts

Package Structure

The main SDK entry point is AIActions.

from mysdk import AIActions

sdk = AIActions()

After creating the SDK, the advanced modules are available as:

  • sdk.documents
  • sdk.images
  • sdk.audio

The package also keeps backward-compatible shortcuts like:

  • sdk.generate_text(...)
  • sdk.summarize(...)
  • sdk.extract_keywords(...)
  • sdk.analyze_sentiment(...)
  • sdk.answer_question(...)

Install

Install the package normally:

pip install openai-ai-actions-sdk

If you are working from the source repo locally:

pip install .

For development with tests:

pip install -e .[dev]

Environment Setup

Set your OpenAI API key before running live SDK calls.

PowerShell:

$env:OPENAI_API_KEY="your_api_key"

Command Prompt:

set OPENAI_API_KEY=your_api_key

Quick Start

from mysdk import AIActions

sdk = AIActions()

print(sdk.documents.summarize_short("Long document text"))
print(sdk.documents.extract_keywords_detailed("Python SDKs simplify AI integration."))
print(sdk.documents.answer_question(
    context="Paris is the capital of France.",
    question="What is the capital of France?",
))
print(sdk.images.describe("sample.png"))
print(sdk.audio.transcribe("meeting.wav"))

Main Modules

Documents

Use sdk.documents for text and document-style operations.

Examples:

sdk.documents.summarize("Long text")
sdk.documents.summarize_short("Long text")
sdk.documents.extract_keywords_detailed("Some content")
sdk.documents.analyze_sentiment_detailed("The SDK is practical and clear.")
sdk.documents.answer_question(
    context="The company is based in Austin.",
    question="Where is the company based?",
)

Images

Use sdk.images for image understanding.

Examples:

sdk.images.describe("photo.jpg")
sdk.images.analyze("chart.png")
sdk.images.answer_question("screenshot.png", "What does this image show?")

Audio

Use sdk.audio for audio transcription and transcript summarization.

Examples:

sdk.audio.transcribe("meeting.wav")
sdk.audio.transcribe_detailed("meeting.wav")
sdk.audio.summarize("meeting.wav")

Test The Installed Package

After installing the package on any machine, you can test document, image, and audio support with this script.

Replace the image and audio paths with real files on that machine.

from mysdk import AIActions, AIActionError

DOCUMENT_TEXT = """
OpenAI provides APIs that help developers build AI-powered applications.
Python SDKs make integration cleaner, faster, and easier to maintain.
"""

IMAGE_PATH = r"C:\path\to\your\image.jpg"
AUDIO_PATH = r"C:\path\to\your\audio.mp4"

try:
    sdk = AIActions()

    print("DOCUMENT RESULT:")
    print(sdk.documents.summarize_short(DOCUMENT_TEXT))

    print("\nIMAGE RESULT:")
    print(sdk.images.analyze(IMAGE_PATH))

    print("\nAUDIO RESULT:")
    print(sdk.audio.summarize(AUDIO_PATH))

except AIActionError as exc:
    print(f"SDK error: {exc}")

Run it with:

PowerShell:

$env:OPENAI_API_KEY="your_api_key"
python test_sdk.py

Command Prompt:

set OPENAI_API_KEY=your_api_key
python test_sdk.py

Verify The Installed Version

To confirm that the installed package includes the advanced API:

python -c "from mysdk import AIActions; sdk=AIActions(); print(hasattr(sdk, 'documents'), hasattr(sdk, 'images'), hasattr(sdk, 'audio'))"

Expected output:

True True True

Run Unit Tests

The test suite uses mocked OpenAI behavior, so it does not require a live API key.

pytest

Notes

  • Internally, the SDK uses the official OpenAI Python library.
  • The package is modular, but the top-level compatibility methods are still available for simpler usage.
  • Image and audio actions require real local file paths.
  • Current document methods operate on text content, not document file paths like PDF or DOCX.

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

openai_ai_actions_sdk-0.3.2.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

openai_ai_actions_sdk-0.3.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file openai_ai_actions_sdk-0.3.2.tar.gz.

File metadata

  • Download URL: openai_ai_actions_sdk-0.3.2.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for openai_ai_actions_sdk-0.3.2.tar.gz
Algorithm Hash digest
SHA256 25baea077199c92e326e3ac222def68e9fa218aedf6c3697736091e0f331d8dd
MD5 7c5c9f911954a785f1a8640bbc8b536e
BLAKE2b-256 d63b2d02b92196702adf598134765daa07ab10c9a470c27af59f52294b787b5f

See more details on using hashes here.

File details

Details for the file openai_ai_actions_sdk-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for openai_ai_actions_sdk-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 faaf51285c35fbee86aefb6781f3f9bfef63b7b7450bd3733c4b692805f68f1e
MD5 5c466e0808b8bd3fc195c438f6706275
BLAKE2b-256 9135df1a5e8e5ee64bb6cbe946e73bae8fa977c5b0bf003e63d895e9dd7c8fd1

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