-
Added support for new
gpt-4-o
model -
Added support for external providers
-
Update certain validation behavior of Functions
-
TODO: Add batch create support
-
Added support for the following parameters in
model_configurations
inOpenAIManager
:-
ping_timeout
- allows for custom timeouts for each client. -
included_models
- allows for more flexible setting of models in Azure. -
weight
- allows for weighted selection of clients.
-
-
Improved Healthcheck behavior to cache if successful for a period of time, and always recheck if not.
-
Added
dimension
parameter forembedding
models.
-
Modification of
async_openai.types.context.ModelContextHandler
to a proxied object singleton. -
Begin adding support for external providers, such as
together
to allow usage in conjunction withOpenAI
models. WIP. -
Rework of
api_resource
androot_name
inRoute
objects to be settable during initialization. This is to allow for flexibility for external providers. -
Added capability to have multi-api-key support for external providers, allowing for automatic rotation between api keys.
Breaking Changes
-
The
OpenAI
client has been refactored to be a singletonProxyObject
vs aType
object.Currently, this API is accessible with
async_openai.OpenAIManager
, which provides all the existing functionality of theOpenAI
client, with a few additional features.-
OpenAIManager
supports automatic proxy rotation and client selection based on available models. -
OpenAIManager
supports automatic retrying of failed requests, as well as enabling automatic healthchecking prior to each request to ensure the endpoint is available withauto_healthcheck_enabled
, otherwise it will rotate to another endpoint. This is useful for ensuring high availability and reliability of the API.
Future versions will deprecate the
OpenAI
client in favor of theOpenAIManager
object. -
-
Added new
OpenAIFunctions
class which provides a robust interface for creating and running functions. This class is also a singletonProxyObject
.This can be accessed through the
OpenAIManager.functions
object
Update to Latest OpenAI API
This version updates the API to the latest version of OpenAI's API, which includes the following changes:
-
addition of
gpt-4-turbo
models -
Add additional supported parameters to
chat
endpoint. We maintain v1 parameters forazure
endpoints, but will pass through the new parameters foropenai
endpoints. -
Add gradual support for
tools
Updates
-
Rework of validating
models
, which now is no longer done, and expects the user to pass the correct model name. -
No longer supporting
validate_max_tokens
as there are now many different schemas formax_tokens
depending on the model.
Potentially Breaking Changes
This version introduces full compatability with pydantic v1/v2
where previous versions would only work with pydantic v1
. Auto-detection and handling of deprecated methods of pydantic
models are handled by lazyops
, and require lazyops >= 0.2.60
.
With pydantic v2
support, there should be a slight performance increase in parsing pydantic
objects, although the majority of the time is spent waiting for the API to respond.
Additionally, support is added for handling the response like a dict
object, so you can access the response like response['choices']
rather than response.choices
.
Additions
- Added auto-parsing of
pydantic
objects infunction_call
parameters and return the same object schema inchat_response.function_result_objects
.
Additions
- Added
auto_retry
option toOpenAI
client, which will automatically retry failed requests. - Added
RotatingClients
class which handles the rotation of multiple clients. This can be enabled by passingrotating_clients=True
to theOpenAI
client while configuring. - Added
OpenAI.chat_create
andOpenAI.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 passingopenai
models as a parameter, it will automatically convert it to the Azure model. This is only done inchat
implementation.
Fixes
- Fixed
api_version
Configuration handling. - Fixed parsing of
function_call
in streaming implementation.
Changes
- Updated default
api_version
to2023-07-01-preview
- Added
__getitem__
attributes to completion and chat objects, allowing them to act likedict
objects. - Added
functions
andfunction_call
toChat
completion routes.function.properties
can pass through apydantic
object which will convert it automatically to adict
json schema.
- Added
function_call
attribute inChatMessage
objects, allowing for easy access to the function call. - Streaming is not supported for
functions
at this time.
Changes
- Updated auto-configuring
httpx
's logger to be disabled ifdebug_enabled
is set toFalse
.
Changes
-
Updated
headers
behavior and parameter, allowing it to be passed to each API call. -
Updated
auth
behavior, which now utilizeshttpx.Auth
rather than injecting into the header directly. -
Added
custom_headers
configuration that can be passed to theOpenAI
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 withresult.stream
orresult.astream
, rather than parsing the stream as it is received.
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.
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
to2023-03-15-preview
- Update pricing to reflect OpenAI's new pricing model
gpt-3.5-turbo
text-embedding-ada-002
- Bugfix for consumption and usage validation in
chat
models - Added support for
gpt-3.5-turbo-16k
- Modified handling of
gpt-3.5-turbo
's consumption pricing to reflectprompt
andcompletion
usage - Modified default
Embedding
model to beada
- Add better support for chatgpt models and
gpt-4
- Better validation
max_tokens
- Added support for GPT-3.5 Turbo through
async_openai.OpenAI.chat
- Refactored
async_openai.OpenAI
to utilize ametaclass
rather than initalizing directly
- Refactor
async_openai.types.options.OpenAIModel
to handle more robust parsing of model names.
- Fix proper charge for
babbage
andada
models.