- Allow steering capabilities for client-submitted chat completion requests
- Remove deprecated QA and Summarization functionality
- Remove references to luminous-extended model
- Minimal supported Python version is now 3.9
- Remove default value for
host
parameter inClient
andAsyncClient
. Passing a value for thehost
is now required.
- Add
instructable_embed
toClient
andAsyncClient
- Add fallback mechanism for figuring out the version locally.
- Add support for chat endpoint to
Client
andAsyncClient
- Add
complete_with_streaming
toAsyncClient
to support completion endpoint with streaming
- Maximum token attribute of
CompletionRequest
defaults to None
- Minimal supported Python version is now 3.8
- Dependency
aiohttp
is specified to be at least of version3.10
.
- Introduce support for internal feature 'tags'
- Export BusyError
- Fixed a bug in pydoc for Prompt and Token
- Added
num_tokens_prompt_total
toEvaluationResponse
- HTTP API version 1.16.0 or higher is required.
- Added
num_tokens_prompt_total
to the types below. This is a breaking change sincenum_tokens_prompt_total
is mandatory.EmbeddingResponse
SemanticEmbeddingResponse
BatchSemanticEmbeddingResponse
- HTTP API version 1.15.0 or higher is required.
- Added
num_tokens_prompt_total
andnum_tokens_generated
toCompletionResponse
. This is a breaking change as these were introduced as mandatory parameters rather than optional ones. - HTTP API version 1.14.0 or higher is required.
- Added
verify_ssl
flag, so you can disable SSL checking for your sessions.
- Turned all NamedTuples into Dataclasses. Even if this is technically a breaking change probably not much source code is actually affected as constructing instances still behaves the same.
- Fix failing serialization of Prompt-based Documents in QA requests. Documents should also be constructible from actual Prompts and not only from sequences
- Deprecation of
qa
andsummarization
methods onClient
andAsyncClient
. New methods of processing these tasks will be released before they are removed in the next major version.
- Full release for exporting type hints
- Alpha release for exporting type hints
PromptTemplate
now resets cached non-text items after generating prompt
PromptTemplate
now supports embedding full prompts and tokens
- Mismatched tag for release
- Add
PromptTemplate
to support easy creation of multi-modal prompts
- Fix parsing of optimized prompt returned in a
CompletionResponse
- Make sure
control_factor
gets passed along withExplanationRequest
- Make sure model name gets passed along for async batch semnatic embed
- Re-relase 3.2.1 again because of deployment issue
- Add progress_bar option to batch semantic embedding API
- Add batch_size option to batch semantic embedding API
- Add batch_semantic_embed method for processing batches of semantic embeddings
- Remove internal search endpoint again (was only accessible for internal users).
- Do not send max_answers for QA by default, use API's default instead.
- Add missing import of PromptGranularity in init.py.
- AsyncClient: Retry on ClientConnectionErrors as well.
PromptGranularity
for ExplanationRequest
s is now an enum. This was previously just a type alias
for a union of literals but we felt that it would be more natural to have a dedicated enum.
Better understand the source of a completion, specifically on how much each section of a prompt impacts the completion.
To get started, you can simply pass in a prompt you used with a model and the completion the model gave and generate an explanation:
from aleph_alpha_client import Client, CompletionRequest, ExplanationRequest, Prompt
client = Client(token=os.environ["AA_TOKEN"])
prompt = Prompt.from_text("An apple a day, ")
model_name = "luminous-extended"
# create a completion request
request = CompletionRequest(prompt=prompt, maximum_tokens=32)
response = client.complete(request, model=model_name)
# generate an explanation
request = ExplanationRequest(prompt=prompt, target=response.completions[0].completion)
response = client.explain(request, model=model_name)
To visually see the results, you can also use this in our Playground.
We also have more documentation and examples available for you to read.
Under the hood, we are leveraging the method from our AtMan paper to help generate these explanations. And we've also exposed these controls anywhere you can submit us a prompt!
So if you have other use cases for attention manipulation, you can pass these AtMan controls as part of your prompt items.
from aleph_alpha_client import Prompt, Text, TextControl
Prompt([
Text("Hello, World!", controls=[TextControl(start=0, length=5, factor=0.5)]),
Image.from_url(
"https://cdn-images-1.medium.com/max/1200/1*HunNdlTmoPj8EKpl-jqvBA.png",
controls=[ImageControl(top=0.25, left=0.25, height=0.5, width=0.5, factor=2.0)]
)
])
For more information, check out our documentation and examples.
- Removed deprecated
AlephAlphaClient
andAlephAlphaModel
. UseClient
orAsyncClient
instead. - Removed deprecated
ImagePrompt
. ImportImage
instead for image prompt items. - New Q&A interface. We've improved the Q&A implementation, and most parameters are no longer needed.
- You only need to specify your documents, a query, and (optional) the max number of answers you want to receive.
- You no longer specify a model.
- Removed "model" parameter from summarize method
- Removed "model_version" from
SummarizationResponse
- Allow specifying token overlap behavior in AtMan by @benbrandt in #106
- Better handle case when Prompt is supplied a string instead of a list by @benbrandt in #107
- New Explain interface for internal testing by @ahartel and @benbrandt in #97 #98 #99 #100 #101 #102 #103 #104
- AsyncClient now respects http proxy env variables, as Client did all the time
- Update examples links in Readme.md
- Add Image.from_image_source
- Add completion parameter: repetition_penalties_include_completion, raw_completion
- Fix json deserialization bug: Ignore additional unknown fields in json
- Add attention manipulation parameters for images in multimodal prompts
- Add attention manipulation parameters on character level
- Introduce offline tokenizer
- Add method
models
to Client and AsyncClient to list available models - Fix docstrings for
complete
methods with respect to Prompt construction - Minor docstring fix for
evaulate
methods
- fix complete in deprecated client: pass None-lists as empty list
- add completion parameters: completion_bias_inclusion, completion_bias_inclusion_first_token_only completion_bias_exclusion, completion_bias_exclusion_first_token_only
- add completion parameters: minimum_tokens, echo, use_multiplicative_frequency_penalty, sequence_penalty, sequence_penalty_min_length, use_multiplicative_sequence_penalty
- fix type hint in DetokenizationResponse
Rerelease to fix tag issue
- Adjust default request timeouts
- Fix QA Beta bug in AsyncClient
- Remove experimental checkpoint features
- Fix documentation for Client and AsyncClient for readthedocs.io
- Add nice flag to clients to indicate lower priority
- Add beta flag for QA requests
- Add manual on readthedocs
- Increase number of retries and expose parameters
- Introduce search endpoint for internal users
- Introduce Client
- Add DeprecationWarning for AlephAlphaClient and AlephAlphaModel (to be removed in 3.0.0)
- Introduce AsyncClient
- Reworked Readme.md to link to extended examples and Google Colab Notebooks
- Fix: ImagePrompt.from_url raises if status-code not OK
- Fix: Dependency
urllib
is specified to be at least of version1.26
. - Add constructor
AlephAlphaModel::from_model_name
.
- Fix: Dependency
requests
is specified to be at least of version2.28
.
- Minimal supported Python version is now 3.7
- Previously we only supported version 3.8
- Internal clients can now select a checkpoints directly and don't have to select a model that processes their requests
- Replaced fields
normalize
,square_outputs
andprompt_explain_indices
withdirectional
in hidden explain endpoint
- Summarization of Documents
- Update documentation for
hosting
parameter
- Remove
message
field from CompletionResult
- 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.
- Restore original error handling of HTTP status codes to before 2.2.0
- Add dedicated exception BusyError for status code 503
- Retry failed HTTP requests via urllib for status codes 408, 429, 500, 502, 503, 504
- Add new parameters to control how repetition penalties are applied for completion requests (see docs for more information):
penalty_bias
penalty_exceptions
penalty_exceptions_include_stop_sequences
- Make hosting parameter optional in semantic_embed on client. Changed order of parameters
hosting
andrequest
. Should not be an issue if you're not using semantic_embed from the client directly or if you're using keyword args.
- Add experimental penalty parameters for completion
- Improved handling of text-based Documents in Q&A
- Introduce
semantic_embed
endpoint on client and model. - Introduce timeout on client
- Introduce AlephAlphaModel as a more convenient alternative to direct usage of AlephAlphaClient
- Support for sending images to multimodal Models.
- Initial Release