Async-openai

Latest version: v0.0.52

Safety actively analyzes 682457 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.0.35

**Additions**

- Added `auto_retry` option to `OpenAI` client, which will automatically retry failed requests.
- Added `RotatingClients` class which handles the rotation of multiple clients. This can be enabled by passing `rotating_clients=True` to the `OpenAI` client while configuring.
- Added `OpenAI.chat_create` and `OpenAI.async_chat_create` methods which automatically handles rotating clients and retrying failed requests.
- Added `azure_model_mapping` which allows automatically mapping of Azure models to OpenAI models when passing `openai` models as a parameter, it will automatically convert it to the Azure model. This is only done in `chat` implementation.

**Fixes**

- Fixed `api_version` Configuration handling.
- Fixed parsing of `function_call` in streaming implementation.

0.0.34

**Changes**

- Updated default `api_version` to `2023-07-01-preview`
- Added `__getitem__` attributes to completion and chat objects, allowing them to act like `dict` objects.
- Added `functions` and `function_call` to `Chat` completion routes.
- `function.properties` can pass through a `pydantic` object which will convert it automatically to a `dict` json schema.
- Added `function_call` attribute in `ChatMessage` objects, allowing for easy access to the function call.
- Streaming is not supported for `functions` at this time.

0.0.33

**Changes**

- Updated auto-configuring `httpx`'s logger to be disabled if `debug_enabled` is set to `False`.

0.0.32

**Changes**

- Updated `headers` behavior and parameter, allowing it to be passed to each API call.
- Updated `auth` behavior, which now utilizes `httpx.Auth` rather than injecting into the header directly.
- Added `custom_headers` configuration that can be passed to the `OpenAI` client during initialization.
- Added customization of `connection_pool`, controlling the number of concurrent connections to the API.

- Reworked `streaming` implementations, which previously didn't properly work.
- Added `parse_stream` parameter (default: true) which defers parsing of the stream util it is called with `result.stream` or `result.astream`, rather than parsing the stream as it is received.

0.0.31

**Changes**

- Updated some behaviors of the `OpenAI` Client.
* allow for customization of retry behavior or completely disabling it.

- Routes now take the `is_azure` parameter during init rather than using `property` to determine the route.
- The `_send` method is better optimized for retry behaviors.

**Fixes**

- Resolved `model` endpoint.
- Resolved handling of `Azure` models.



---

0.0.30

_Potentially breaking changes in this version_

**Changes**

- Refactored the architecture of the `OpenAI` Client to accomodate multi-client initialization. i.e. `OpenAI` can now be initialized with multiple API keys and will automatically rotate between them, as well as switch back and forth between Azure and OpenAI.

- Settings are initialized after first call, rather than globally.

- Routes, Clients are configured after first call, rather than during initialization.


**Fixes**

- Resolved `embedding` endpoints.

**Updates**

- Changed default `api-version` to `2023-03-15-preview`

---

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.