Skip to main content

python client to interact with Aleph Alpha api endpoints

Project description

Aleph Alpha Client

License PyPI version

Python client for the Aleph Alpha API.

Usage

Text Completion

from aleph_alpha_client import Client, CompletionRequest, Prompt
import os

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

print(result.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 Combining functionalities 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

Project details


Release history Release notifications | RSS feed

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.6.0.tar.gz (25.0 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.6.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aleph-alpha-client-2.6.0.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for aleph-alpha-client-2.6.0.tar.gz
Algorithm Hash digest
SHA256 4b2a3491f6c9832b30f4109685743f2e8d71ec4b91763c5b7cbf45c5b865e003
MD5 fd8c2a30fc3d05a0e9b263e835baaad4
BLAKE2b-256 0c392c630bbc181f301cfb126c7ea9ce47252460091c245ff6b4511d2412ac33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aleph_alpha_client-2.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6d169f57d842053fc614224c7ac29b734dfbf8111afe707cf4d2ca9845b9b29
MD5 31bd9e8a8882f396a4221e343ff4cd5c
BLAKE2b-256 8fd8fc427d5b64d939104fce7073a1f9c831ab3e9847cd0d217553e89020d9c2

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