Changelog#

v2.1.0 (2024-01-30)#

Schema Import (deprecation warning)

Schemas are now exported from genai.schema (the old way of importing remains to work, but you will receive a warning)

πŸš€ Features / Enhancements#

πŸ› Bug Fixes#

πŸ“– Docs#

βš™οΈ Other#

Full Changelog: v2.0.0…v2.1.0

πŸ”— API Endpoint Versions#

API Endpoint Versions

Method

Path

Version (YYYY-MM-DD)

GET

/v2/api_key

2023-11-22

POST

/v2/api_key/regenerate

2023-11-22

GET

/v2/files

2023-12-15

POST

/v2/files

2023-12-15

DELETE

/v2/files/{id}

2023-11-22

GET

/v2/files/{id}

2023-12-15

GET

/v2/files/{id}/content

2023-11-22

GET

/v2/models

2023-11-22

GET

/v2/models/{id}

2024-01-30

GET

/v2/prompts

2024-01-10

POST

/v2/prompts

2024-01-10

DELETE

/v2/prompts/{id}

2023-11-22

GET

/v2/prompts/{id}

2024-01-10

PATCH

/v2/prompts/{id}

2024-01-10

PUT

/v2/prompts/{id}

2024-01-10

GET

/v2/requests

2023-11-22

DELETE

/v2/requests/chat/{conversationId}

2023-11-22

GET

/v2/requests/chat/{conversationId}

2023-11-22

DELETE

/v2/requests/{id}

2023-11-22

GET

/v2/system_prompts

2023-11-22

POST

/v2/system_prompts

2023-11-22

DELETE

/v2/system_prompts/{id}

2023-11-22

GET

/v2/system_prompts/{id}

2023-11-22

PUT

/v2/system_prompts/{id}

2023-11-22

GET

/v2/tasks

2023-11-22

POST

/v2/text/chat

2024-01-10

POST

/v2/text/chat/output

2024-01-10

POST

/v2/text/chat_stream

2024-01-10

POST

/v2/text/embeddings

2023-11-22

GET

/v2/text/embeddings/limits

2023-11-22

GET

/v2/text/extraction/limits

2023-11-22

POST

/v2/text/generation

2024-01-10

POST

/v2/text/generation/comparison

2023-11-22

GET

/v2/text/generation/limits

2023-11-22

POST

/v2/text/generation/output

2023-11-22

GET

/v2/text/generation/{id}/feedback

2023-11-22

POST

/v2/text/generation/{id}/feedback

2023-11-22

PUT

/v2/text/generation/{id}/feedback

2023-11-22

POST

/v2/text/generation_stream

2024-01-10

POST

/v2/text/moderations

2023-11-22

POST

/v2/text/tokenization

2024-01-10

GET

/v2/tunes

2023-11-22

POST

/v2/tunes

2023-11-22

POST

/v2/tunes/import

2023-11-22

DELETE

/v2/tunes/{id}

2023-11-22

GET

/v2/tunes/{id}

2023-11-22

PATCH

/v2/tunes/{id}

2023-11-22

GET

/v2/tunes/{id}/content/{type}

2023-12-15

GET

/v2/tuning_types

2024-01-30

DELETE

/v2/user

2023-11-22

GET

/v2/user

2023-11-22

PATCH

/v2/user

2023-11-22

POST

/v2/user

2023-11-22

v2.0.0 (2024-01-15)#

On November 22nd, 2023, the API (v2) was announced. We reflected this change on the Python SDK by rewriting its core to be faster, more reliable and mainly in sync with the API. The new SDK brings the concept of the central client, which gives you access to the API very straightforward. This concept was recently integrated into OpenAI SDK / Cohere SDK, and more are joining.

To seamlessly migrate from V0.X versions to 2.0, we have prepared the Migration Guide. The reborn documentation with a lot of examples will help you get started.

Here is a little sneak peek.

  • Very Performant.

  • Generated Typings directly from the API.

  • Smart Requests Concurrency Handling.

  • Retry Mechanism in case of network or API failure.

  • Batching Large Requests automatically.

  • Easy to extend.

Full Changelog: v0.6.1…v2.0.0

πŸ”— API Endpoint Versions#

API Endpoint Versions

Method

Path

Version (YYYY-MM-DD)

GET

/v2/api_key

2023-11-22

POST

/v2/api_key/regenerate

2023-11-22

GET

/v2/files

2023-12-15

POST

/v2/files

2023-12-15

DELETE

/v2/files/{id}

2023-11-22

GET

/v2/files/{id}

2023-12-15

GET

/v2/files/{id}/content

2023-11-22

GET

/v2/models

2023-11-22

GET

/v2/models/{id}

2024-01-10

GET

/v2/prompts

2024-01-10

POST

/v2/prompts

2024-01-10

DELETE

/v2/prompts/{id}

2023-11-22

GET

/v2/prompts/{id}

2024-01-10

PATCH

/v2/prompts/{id}

2024-01-10

PUT

/v2/prompts/{id}

2024-01-10

GET

/v2/requests

2023-11-22

DELETE

/v2/requests/chat/{conversationId}

2023-11-22

GET

/v2/requests/chat/{conversationId}

2023-11-22

DELETE

/v2/requests/{id}

2023-11-22

GET

/v2/tasks

2023-11-22

POST

/v2/text/chat

2024-01-10

POST

/v2/text/chat/output

2024-01-10

POST

/v2/text/chat_stream

2024-01-10

POST

/v2/text/embeddings

2023-11-22

GET

/v2/text/embeddings/limits

2023-11-22

GET

/v2/text/extraction/limits

2023-11-22

POST

/v2/text/generation

2024-01-10

POST

/v2/text/generation/comparison

2023-11-22

GET

/v2/text/generation/limits

2023-11-22

POST

/v2/text/generation/output

2023-11-22

GET

/v2/text/generation/{id}/feedback

2023-11-22

POST

/v2/text/generation/{id}/feedback

2023-11-22

PUT

/v2/text/generation/{id}/feedback

2023-11-22

POST

/v2/text/generation_stream

2024-01-10

POST

/v2/text/moderations

2023-11-22

POST

/v2/text/tokenization

2024-01-10

GET

/v2/tunes

2023-11-22

POST

/v2/tunes

2023-11-22

POST

/v2/tunes/import

2023-11-22

DELETE

/v2/tunes/{id}

2023-11-22

GET

/v2/tunes/{id}

2023-11-22

PATCH

/v2/tunes/{id}

2023-11-22

GET

/v2/tunes/{id}/content/{type}

2023-12-15

GET

/v2/tuning_types

2023-11-22

DELETE

/v2/user

2023-11-22

GET

/v2/user

2023-11-22

PATCH

/v2/user

2023-11-22

POST

/v2/user

2023-11-22

v0.6.1 (2023-12-20)#

Full Changelog: v0.6.0…v0.6.1

v0.6.0 (2023-12-08)#

New Contributors#

Full Changelog: v0.5.1…v0.5.2

v0.5.1 (2023-11-17)#

πŸ› Bug fixes#

  • Add missing rate-limit check for tokenize methods

  • Unify error messages between sync and async methods

Full Changelog: v0.5.0…v0.5.1

v0.5.0 (2023-11-13)#

πŸš€ Features / Enhancements#

  • Added integration for LangChain Chat Models; see an example of generation and streaming.

  • Added support for LangChain Model Serialization (saving and loading models); see an example.

  • Added support for the Chat endpoint in Model class; see an example.

  • Added support for new moderation models (HAP, STIGMA, Implicit Hate) - not released on API yet but will be available soon.

  • Added type validation for input_tokens property in generate response.

  • Extend LangChain generation information / LLM Output (token_usage structure, generated tokens, stop_reason, conversation_id, created_at, …).

  • Add optional raw_response=True/False parameter to generate_stream / generate_as_complete and generate methods to receive a raw response instead of unwrapped results.

πŸ› Bug fixes#

  • LangChain extension now correctly tokenizes the inputs (previously, the GPT2 tokenizer had been used).

  • Improve general error handling.

Full Changelog: v0.4.1…v0.5.0

v0.4.1 (2023-10-27)#

πŸ› Bug fixes#

  • Correctly handle file responses

  • Use tqdm.auto instead of tqdm.tqdm to improve display in Jupyter Notebooks

Full Changelog: v0.4.0…v0.4.1

v0.4.0 (2023-10-24)#

⚠️ Switch to Pydantic V2#

  • In case your application is dependent on Pydantic V1, refer to the migration guide.

  • If you cannot upgrade, stick to the previous version 0.3.2.

Full Changelog: v0.3.2…v0.4.0

v0.3.2 (2023-10-23)#

πŸ› Bug fixes#

  • Correctly handle async errors and process abortion

πŸ”§ Configuration Changes#

  • Increase async generate/tokenize retry limits from 3 to 5

Full Changelog: v0.3.1…v0.3.2

v0.3.1 (2023-10-20)#

πŸš€ Features / Enhancements#

  • Handle concurrency limits for generate and generate_as_completed methods.

  • Add automatic handling of rate limits for the tokenize endpoint (tokenize_async method).

  • Added stop_sequence parameter for generated output (non-empty token which caused the generation to stop) + added - include_stop_sequence parameter for the GenerateParams (it indicates whether the stop sequence (which caused the generation to stop) is part of the generated text. The default value depends on the model in use).

  • Removed hidden stop_sequences removal inside the LangChainInterface, which can now be controlled via the include_stop_sequence parameter.

  • Improve general error handling + method signatures (improve Python typings).

πŸ› Bug fixes#

  • Fix stacked progress bar (generate_async method)

  • Handle cases when the package is used inside the asyncio environment

  • Hide warning when an unknown field is retrieved in the generated response

Full Changelog: v0.3.0…v0.3.1

v0.3.0 (2023-10-12)#

πŸš€ Features / Enhancements#

  • Added Hugging Face Agent support; see an example.

  • Drastically improve the speed of generate_async method - the concurrency limit is now automatically inferred from the API. (custom setting of ConnectionManager.MAX_CONCURRENT_GENERATE will be ignored). In case you want to slow down the speed of generating, just pass the following parameter to the method: max_concurrency_limit=1 or any other value.

  • Increase the default tokenize processing limits from 5 requests per second to 10 requests per second (this will be increased in the future).

πŸ› Bug fixes#

  • Throws on unhandled exceptions during the generate_async calls. Correctly cleanups the async HTTP clients when the task/calculation is being cancelled (for instance, you call generate_async in Jupyter - Notebook and then click the stop button). This should prevent receiving the Can't have two active async_generate_clients error.

  • Fix async support for newer LangChain versions (>=0.0.300)

  • Fix LangChain PromptTemplate import warning in newer versions of LangChain

  • Correctly handle server errors when streaming

  • Fix tune_methods method

v0.2.8 (2023-09-25)#

πŸš€ Features / Enhancements#

  • Added moderation support; now you can retrieve HAP for generated requests (example)

  • Internally improve streaming processing (poor or unstable internet connection)

  • Internally improve server response parsing and error handling

  • Add a user-agent header to distinguish Python SDK on the API

πŸ› Bug fixes#

  • LangChain - correct handling of stop_sequences

  • Correctly set versions of used dependencies (httpx / pyyaml)

  • Prevents unexpected modifications to user’s GenerateParams passed to the Model class

  • Prevents unexpected errors when GenerateParams contains stream=True and generate (non-stream) version is called

πŸ”§ Configuration changes#

  • Remove API version from the API endpoint string

Full Changelog: v0.2.7…v0.2.8

v0.2.7 (2023-09-15)#

Full Changelog: v0.2.6…v0.2.7

v0.2.6 (2023-09-11)#

New Contributors#

Full Changelog: v0.2.5…v0.2.6

v0.2.5 (2023-08-21)#

  • TOUs handling

  • Update Pydantic version

  • Update examples

Full Changelog: v0.2.4…v0.2.5

v0.2.4 (2023-08-01)#

Updated the documentation (imports of credentials) Updated schemas for config Added params in GeneratedParams Updated examples Updated tests

v0.2.3 (2023-07-24)#

  • Remove ModelType enum

  • Add utils for Model class: listing, info, available, etc.

  • Pydantic model allows extra params

  • Tests

v0.2.2 (2023-07-11)#

Documentation Updates.

v0.2.1 (2023-07-10)#

Documentation update Example update

v0.2.0 (2023-07-10)#

Model Tuning File manager Tuning Manager ModelType deprecation warning Open Source documentation update

v0.1.19 (2023-06-30)#

Fixed pydantic version issue

v0.1.18 (2023-06-30)#

Watsonx Templating support Documentation and examples’ update Parameters updated for upstream compatibility with sampling method Retry mechanism update

v0.1.17 (2023-06-23)#

  • Modifications to examples/tests to avoid sampling-related parameters with greedy decoding

  • Updates to build process

  • Modifications to error messages

v0.1.16 (2023-06-21)#

  • Documentation update

  • Local server example

  • Open source contributions information

  • Example endpoints updated

v0.1.15 (2023-06-08)#

  • πŸ”¨ GitHub Workflows

  • ✨ Progress bar in async_generate function

  • πŸ› Updating Terms of Use to use PATCH

  • 🎨 Adding accessors attribute to model class

  • ✨Search Space example and utils

  • ✨ Localserver Extension