Skip to content

Releases: Aleph-Alpha/aleph-alpha-client

Version 2.5.0 - Introduce AsyncClient

14 Nov 10:31
f42ef1e
Compare
Choose a tag to compare

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

04 Oct 15:23
f391534
Compare
Choose a tag to compare

What's Changed

  • Fix image loading in ImagePrompt.from_url

Full Changelog: v2.4.3...v2.4.4

Version 2.4.3

23 Sep 14:56
Compare
Choose a tag to compare
  • Minimum version for urllib3
  • Add constructor AlephAlphaModel.from_model_name

Version 2.4.2

23 Sep 12:03
Compare
Choose a tag to compare

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

23 Sep 08:33
d866e4c
Compare
Choose a tag to compare

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

07 Sep 09:01
Compare
Choose a tag to compare

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

23 Aug 06:52
5979ff8
Compare
Choose a tag to compare

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

15 Aug 12:48
7824722
Compare
Choose a tag to compare

What's Changed

2.2.3

Bugfix:

  • Remove message field from CompletionResult

Full Changelog: v2.2.2...v2.2.3

2.2.2

15 Aug 11:17
5a26a0a
Compare
Choose a tag to compare

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

11 Aug 09:42
4e04f45
Compare
Choose a tag to compare

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