Releases: Aleph-Alpha/aleph-alpha-client
Releases · Aleph-Alpha/aleph-alpha-client
Version 2.5.0 - Introduce AsyncClient
What's Changed
- Introduce AsyncClient (see blog post)
- Reworked Readme.md to link to extended examples and Google Colab Notebooks
Full Changelog: v2.4.4...v2.5.0
Fix bug in ImagePrompt.from_url
Version 2.4.3
- Minimum version for
urllib3
- Add constructor
AlephAlphaModel.from_model_name
Version 2.4.2
What's Changed
Fix: Specify minimum version number for requests
dependency.
Full Changelog: v2.4.1...v2.4.2
2.4.1 - Support Python 3.7
What's Changed
Python support
- Minimal supported Python version is now 3.7
- Previously we only supported version 3.8
Full Changelog: v2.4.0...v2.4.1
2.4.0 - Experimental checkpoints
2.4.0
New feature
- Internal users can now select experimental checkpoints directly instead of a model to process their requests
- Replaced fields normalize, square_outputs and prompt_explain_indices with directional in experimental explain endpoint
Full Changelog: v2.3.0...v2.4.0
v2.3.0 - Summarization
What's Changed
- Summarization requests added to the client
Summary with a Docx Document
from aleph_alpha_client import Document, AlephAlphaClient, AlephAlphaModel, SummarizationRequest
import os
model = AlephAlphaModel(
AlephAlphaClient(host="https://api.aleph-alpha.com", token=os.getenv("AA_TOKEN")),
# You need to choose a model with qa support for this example.
model_name = "luminous-extended"
)
docx_file = "./tests/sample.docx"
document = Document.from_docx_file(docx_file)
request = SummarizationRequest(document)
result = model.summarize(request)
print(result)
Summary with a Text
from aleph_alpha_client import AlephAlphaClient, AlephAlphaModel, SummarizationRequest
import os
model = AlephAlphaModel(
AlephAlphaClient(host="https://api.aleph-alpha.com", token=os.getenv("AA_TOKEN")),
# You need to choose a model with qa support for this example.
model_name = "luminous-extended"
)
prompt = "In imperative programming, a computer program is a sequence of instructions in a programming language that a computer can execute or interpret."
document = Document.from_text(prompt)
request = SummarizationRequest(document)
result = model.summarize(request)
print(result)
Summary with a multimodal prompt
from aleph_alpha_client import Document, ImagePrompt, AlephAlphaClient, AlephAlphaModel, SummarizationRequest
import os
model = AlephAlphaModel(
AlephAlphaClient(host="https://api.aleph-alpha.com", token=os.getenv("AA_TOKEN")),
# You need to choose a model with qa support for this example.
model_name = "luminous-extended"
)
url = "https://upload.wikimedia.org/wikipedia/commons/thumb/7/74/2008-09-24_Blockbuster_in_Durham.jpg/330px-2008-09-24_Blockbuster_in_Durham.jpg"
image = ImagePrompt.from_url(url)
prompt = [image]
document = Document.from_prompt(prompt)
request = SummarizationRequest(document)
result = model.summarize(request)
print(result)
Full Changelog: v2.2.3...v2.3.0
2.2.3
What's Changed
2.2.3
Bugfix:
- Remove message field from CompletionResult
Full Changelog: v2.2.2...v2.2.3
2.2.2
What's Changed
2.2.2
- Document hosting parameter.
- The hosting parameter determines in which datacenters the request may be processed.
- Currently, we only support setting it to "aleph-alpha", which allows us to only process the request in our own datacenters.
- Not setting this value, or setting it to null, allows us to process the request in both our own as well as external datacenters.
Full Changelog: v2.2.1...v2.2.2
2.2.1
What's Changed
Bugfix
- Restore original error handling of HTTP status codes to before 2.2.0
- Add dedicated exception BusyError for status code 503
Full Changelog: v2.2.0...v2.2.1