Skip to main content

Developers building Python 3.8+ apps can now interact seamlessly with the AI71 API thanks to the ai71 Python library. It includes built-in type checking for both requests and responses, and provides both synchronous and asynchronous HTTP clients powered by httpx.

Documentation

The API documentation can be found here.

Installation

pip install ai71

Usage

Define AI71_API_KEY environment variable or provide api_key in AI71 and AsyncAI71.

import os
from ai71 import AI71

client = AI71()

chat_completion = client.chat.completions.create(
    messages=[{"role": "user", "content": "What is your name?"}],
    model="tiiuae/falcon-180B-chat",
)

# Fetch supported models
model_list = client.models.list()

Async Usage

import asyncio

from ai71 import AsyncAI71

client = AsyncAI71()


async def main():
    stream = await client.chat.completions.create(
        messages=[{"role": "user", "content": "What is your name?"}],
        model="tiiuae/falcon-180B-chat",
        stream=True,
    )
    async for chunk in stream:
        print(chunk.choices[0].delta.content or "", end="")

    # Fetch supported models
    model_list = await client.models.list()


asyncio.run(main())

Metadata

Release files for ai71 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai71 1.0.1
File Size Uploaded Provenance
ai71-1.0.1.tar.gz 7.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ai71 1.0.1
File Interpreter ABI Platform
ai71-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.1 kB

Release files / ai71-1.0.1.tar.gz

Download URL ai71-1.0.1.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5d851ba972e8ee82782df96a103617dd62b2eb3b9e3c26f3fd521969e4dbd1e3
BLAKE2b-256 checksum
How to use checksums
ba127a6cf87cd57e9637c09d0443400d2b937d9746b5c76b95703dd999408547
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.9 Linux/6.8.0-1021-azure

Release files / ai71-1.0.1-py3-none-any.whl

Download URL ai71-1.0.1-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b121b4725732c1798c4d1400435bc08a0f96828613b4c3ffd3dfe8289b546df
BLAKE2b-256 checksum
How to use checksums
d94c81495f2cee3059a4f7fb5740a5e59641a582d4b2315b83d6098cb1b34183
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.9 Linux/6.8.0-1021-azure

Security for ai71 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page