Skip to main content

A minimalist client for OpenAI APIs.

Project description

oaix

A minimalist OpenAI API client.

Installation

pip install oaix

Usage

import oaix

oaix.Api().post('chat/completions', json={
    'model': 'gpt-3.5-turbo',
    'messages': [
        {
            'role': 'system',
            'content': "You will introduce yourself as Batman. Then I will ask you a question which you will answer as Batman."
        },
        {
            'role': 'assistant',
            'content': "Hello, I'm Batman."
        },
        {
            'role': 'user',
            'content': 'Tell me exactly who you are and what you do using only four words.'
        }
    ]
})

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

oaix-0.1.0.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

oaix-0.1.0-py2.py3-none-any.whl (2.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page