Skip to main content

OpenAIWrapper

A wrapper class for openai client.
Initialize the OpenAIWrapper.
Parameters:

Class Attributes

actual_usage_summary



extra_kwargs



total_usage_summary



Static Methods

extract_text_or_completion_object

Extract the text or ChatCompletion objects from a completion or chat response.
Parameters: Returns:

instantiate

Parameters:

Instance Attributes

openai_kwargs



Instance Methods

clear_usage_summary

Clear the usage summary.

create

Make a completion for a given config using available clients.
Besides the kwargs allowed in openai’s [or other] client, we allow the following additional kwargs.
The config in each client will be overridden by the config.
Parameters:
Print the usage summary. Parameters:

register_model_client

Register a model client.
Parameters: