Skip to main content

Python client library for the Martian API

Project description

Martian Python API library

The Martin Python library is a drop in replacement for OpenAI package

Documentation

The API documentation can be found here.

Installation

pip install martian-python

Usage

from martian import OpenAI

client = OpenAI(
    api_key="My MARTIAN Key",  # defaults to os.environ.get("MARTIAN_API_KEY")
)

chat_completion = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": "Say this is a test",
        }
    ],
    model="router",
    # If more than one model is specified, the router chooses the best among them
    # model=["gpt-3.5-turbo", "claude-v1"]  
)

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

martian_python-1.5.3.tar.gz (116.2 kB view hashes)

Uploaded Source

Built Distribution

martian_python-1.5.3-py3-none-any.whl (215.9 kB view hashes)

Uploaded 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