Skip to main content

Aleph Alpha Client

License PyPI version Documentation Status

Python client for the Aleph Alpha API.

Usage

Synchronous Client

import os
from aleph_alpha_client import Client, CompletionRequest, Prompt

client = Client(token=os.getenv("AA_TOKEN"))
request = CompletionRequest(
    prompt=Prompt.from_text("Provide a short description of AI:"),
    maximum_tokens=64,
)
response = client.complete(request, model="luminous-extended")

print(response.completions[0].completion)

Asynchronous Client

import os
from aleph_alpha_client import AsyncClient, CompletionRequest, Prompt

# Can enter context manager within an async function
async with AsyncClient(token=os.environ["AA_TOKEN"]) as client:
    request = CompletionRequest(
        prompt=Prompt.from_text("Provide a short description of AI:"),
        maximum_tokens=64,
    )
    response = await client.complete(request, model="luminous-base") 
    print(response.completions[0].completion)

Interactive Examples

This table contains interactive code examples, further exercises can be found in the examples repository.

Template Description Internal Link Colab Link
1 Calling the API Template 1 Open In Colab
2 Simple completion Template 2 Open In Colab
3 Simple search Template 3 Open In Colab
4 Symmetric and Asymmetric Search Template 4 Open In Colab
5 Hidden Embeddings Template 5 Open In Colab
6 Task-specific Endpoints Template 6 Open In Colab

Installation

The latest stable version is deployed to PyPi so you can install this package via pip.

pip install aleph-alpha-client

Get started using the client by first creating an account. Afterwards head over to your profile to create an API token. Read more about how you can manage your API tokens here.

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aleph-alpha-client-2.16.1.tar.gz (39.8 kB view details)

Uploaded Source

Built Distribution

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

aleph_alpha_client-2.16.1-py3-none-any.whl (38.3 kB view details)

Uploaded Python 3

File details

Details for the file aleph-alpha-client-2.16.1.tar.gz.

File metadata

  • Download URL: aleph-alpha-client-2.16.1.tar.gz
  • Upload date:
  • Size: 39.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for aleph-alpha-client-2.16.1.tar.gz
Algorithm Hash digest
SHA256 5e83a84326da1f32adb32702d9d0e3993e7d79b8aad8dc2301d1dd1866fcf6ed
MD5 659c3284ba1818f27b22de9804b899fd
BLAKE2b-256 8c69f05403845981ca1fde4ea3d26beb52f6b684f20383447dfc4d94f26708a3

See more details on using hashes here.

File details

Details for the file aleph_alpha_client-2.16.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aleph_alpha_client-2.16.1-py3-none-any.whl
Algorithm Hash digest
SHA256 59120218b695bb73dd9f2bda6630740808ad4d10bea82b1b988856d487b1f192
MD5 b81cf919fad3b003a38e43221b11c631
BLAKE2b-256 44d3b8c878777e3420f0e94b247665fc97a4198c33cf7db2c14b3fa9a57e2c4d

See more details on using hashes here.

Release history Release notifications | RSS feed

11.5.1

2 files

11.5.0

2 files

11.4.0

2 files

11.2.0

2 files

11.1.0

2 files

11.0.0

2 files

10.6.2

2 files

10.6.1

2 files

10.6.0

2 files

10.5.1

2 files

10.5.0

2 files

10.4.0

2 files

10.2.2

2 files

10.2.1

2 files

10.1.0

2 files

10.0.1

2 files

10.0.0

2 files

9.1.0

2 files

9.0.0

2 files

8.1.0

2 files

8.0.0

2 files

7.6.0

2 files

7.5.1

2 files

7.5.0

2 files

7.4.0

2 files

7.3.0

2 files

7.1.0

2 files

7.0.1

2 files

7.0.0

2 files

6.0.0

2 files

5.0.0

2 files

4.1.0

2 files

4.0.0

2 files

3.5.1

2 files

3.5.0

2 files

3.4.1

2 files

3.4.0

2 files

3.3.0

2 files

3.2.4

2 files

3.2.3

2 files

3.2.2

2 files

3.2.0

2 files

3.1.5

2 files

3.1.4

2 files

3.1.3

2 files

3.1.2

2 files

3.1.1

2 files

3.1.0

2 files

3.0.0

2 files

2.17.0

2 files

This release

2.16.1 This release

2 files

2.16.0

2 files

2.15.0

2 files

2.14.0

2 files

2.13.0

2 files

2.12.0

2 files

2.11.1

2 files

2.11.0

2 files

2.10.0

2 files

2.9.2

2 files

2.9.1

2 files

2.9.0

2 files

2.8.1

2 files

2.8.0

2 files

2.7.1

2 files

2.7.0

2 files

2.6.1

2 files

2.6.0

2 files

2.5.0

2 files

2.4.4

2 files

2.4.3

2 files

2.4.2

2 files

2.4.1

2 files

2.4.0

2 files

2.3.0

2 files

2.2.3

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.7.1

2 files

1.7.0

2 files

1.6.0

2 files

1.5.0

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

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