python client to interact with Aleph Alpha api endpoints
Project description
Aleph Alpha Client
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 | |
| 2 | Simple completion | Template 2 | |
| 3 | Simple search | Template 3 | |
| 4 | Symmetric and Asymmetric Search | Template 4 | |
| 5 | Hidden Embeddings | Template 5 | |
| 6 | Combining functionalities | Template 6 |
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b2a3491f6c9832b30f4109685743f2e8d71ec4b91763c5b7cbf45c5b865e003
|
|
| MD5 |
fd8c2a30fc3d05a0e9b263e835baaad4
|
|
| BLAKE2b-256 |
0c392c630bbc181f301cfb126c7ea9ce47252460091c245ff6b4511d2412ac33
|
File details
Details for the file aleph_alpha_client-2.6.0-py3-none-any.whl.
File metadata
- Download URL: aleph_alpha_client-2.6.0-py3-none-any.whl
- Upload date:
- Size: 30.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6d169f57d842053fc614224c7ac29b734dfbf8111afe707cf4d2ca9845b9b29
|
|
| MD5 |
31bd9e8a8882f396a4221e343ff4cd5c
|
|
| BLAKE2b-256 |
8fd8fc427d5b64d939104fce7073a1f9c831ab3e9847cd0d217553e89020d9c2
|