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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

Details for the file martian_python-1.5.3.tar.gz.

File metadata

  • Download URL: martian_python-1.5.3.tar.gz
  • Upload date:
  • Size: 116.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for martian_python-1.5.3.tar.gz
Algorithm Hash digest
SHA256 6e69a978b88a445c74dfbb39efa390fdc5b000cd6ba56a22a1223e5d458cafff
MD5 c6d8e5fcf18062b67106e34e909bde34
BLAKE2b-256 8456487da534947bfa4bcbdef544d5c7b2d639e0984207be5209684ddaf1ee76

See more details on using hashes here.

File details

Details for the file martian_python-1.5.3-py3-none-any.whl.

File metadata

  • Download URL: martian_python-1.5.3-py3-none-any.whl
  • Upload date:
  • Size: 215.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for martian_python-1.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d7dc046cc7d541d69a05407821971ab16549d3d650674c89b438e0b715018fee
MD5 0017e92e865709e5db9e13555e7b32f2
BLAKE2b-256 13aaa8e7e1c4dd8a2ca70de78bb51374a38563a3d10fe90d2d5cca909ee302da

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