Releases: Aleph-Alpha/aleph-alpha-client
Releases · Aleph-Alpha/aleph-alpha-client
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
v2.2.0
What's Changed
New feature
- Retry failed HTTP requests via urllib for status codes 408, 429, 500, 502, 503, 504
Full Changelog: v2.1.0...v2.2.0
2.1.0
2.0.0
What's Changed
Breaking change
- Make hosting parameter optional in semantic_embed on client. Changed order of parameters hosting and request. Should not be an issue if you're not using semantic_embed from the client directly or if you're using keyword args.
Experimental feature
- Add experimental penalty parameters for completion
Full Changelog: v1.7.1...2.0.0