Upgrading openai 0.25 to 0.26
Breaking0.25.0 → 0.26.5Breaking4Platform1New7Changed6Fixed12Other13
BreakingUpgrade verdict
3 breaking changes and a platform requirement change.
In plain terms
- The default install is much smaller, but if you use tools or embeddings you need to install an extra package set.
- Three deprecated API features are removed.
- The library no longer pulls in numpy and pandas by default, making installs much smaller.
- Stops requiring typing_extensions on Python 3.8 and newer.
Must act 4 items need code or config changes
What you must change
Breaking3
Makes numpy and pandas optional, shrinking default install; users of tools or embeddings should install openai[datalib].
openai[datalib]Removes search, answers, and classifications endpoints.
searchanswersclassificationsAnswersSearchClassificationsMakes numpy and pandas optional, reducing dependency size about 7 times.
numpypandasPlatform1
Stops requiring typing_extensions on Python 3.8 and newer.
typing_extensionsAPI changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- removed:
export Answer - removed:
export Classification - removed:
export Search
- changed:
function parse_stream(rbody) → function parse_stream(rbody: Iterator[bytes]) -> Iterator[str] - changed:
method APIRequestor.request_raw(method, url, *, params=…, supplied_headers: Dict[str, str]=…, files=…, stream: bool=…, request_id: Optional[str]=…, request_timeout: Optional[Union[float, Tuple[float, float]]]=…) -> requests.Response → method APIRequestor.request_raw(method, url, *, params=…, supplied_headers: Optional[Dict[str, str]]=…, files=…, stream: bool=…, request_id: Optional[str]=…, request_timeout: Optional[Union[float, Tuple[float, float]]]=…) -> requests.Response - added:
async function aiohttp_session() -> AsyncIterator[aiohttp.ClientSession] - added:
async function parse_stream_async(rbody: aiohttp.StreamReader) - added:
async method APIRequestor.arequest(method, url, params, headers, files, stream: Literal[True], request_id: Optional[str]=…, request_timeout: Optional[Union[float, Tuple[float, float]]]=…) -> Tuple[AsyncGenerator[OpenAIResponse, None], bool, str] | (method, url, params=…, headers=…, files=…, *, stream: Literal[True], request_id: Optional[str]=…, request_timeout: Optional[Union[float, Tuple[float,… - added:
async method APIRequestor.arequest_raw(method, url, session, *, params=…, supplied_headers: Optional[Dict[str, str]]=…, files=…, request_id: Optional[str]=…, request_timeout: Optional[Union[float, Tuple[float, float]]]=…) -> aiohttp.ClientResponse - added:
function parse_stream_helper(line: bytes) -> Optional[str]
- removed:
export Answer - removed:
export Classification - removed:
export Search
- added:
async method APIResource.arefresh(request_id=…, request_timeout=…) - added:
static method APIResource.aretrieve(id, api_key=…, request_id=…, request_timeout=…, **params)
- added:
async static method CreateableAPIResource.acreate(api_key=…, api_base=…, api_type=…, request_id=…, api_version=…, organization=…, **params)
- added:
static method DeletableAPIResource.adelete(sid, api_type=…, api_version=…, **params) -> Awaitable
- added:
async method EngineAPIResource.await_(timeout=…) - added:
async static method EngineAPIResource.acreate(api_key=…, api_base=…, api_type=…, request_id=…, api_version=…, organization=…, **params)
- added:
async static method ListableAPIResource.alist(api_key=…, request_id=…, api_version=…, organization=…, api_base=…, api_type=…, **params)
- added:
function anested_resource_class_methods(resource, path=…, operations=…, resource_plural=…)
- added:
static method UpdateableAPIResource.amodify(sid, **params) -> Awaitable
- removed:
class Answer(OpenAIObject) - removed:
static method Answer.create(**params) - removed:
static method Answer.get_url()
- removed:
class Classification(OpenAIObject) - removed:
static method Classification.create(**params) - removed:
static method Classification.get_url()
- added:
async static method Completion.acreate(*args, **kwargs)
- added:
static method Customer.acreate(customer, endpoint, **params)
- added:
static method Deployment.acreate(*args, **kwargs) - added:
static method Deployment.adelete(*args, **kwargs) - added:
static method Deployment.alist(*args, **kwargs) - added:
static method Deployment.aretrieve(*args, **kwargs)
- added:
async static method Edit.acreate(*args, **kwargs)
- added:
async static method Embedding.acreate(*args, **kwargs)
- removed:
method Engine.search(**params) - added:
async method Engine.agenerate(timeout=…, **params)
- added:
async static method File.acreate(file, purpose, model=…, api_key=…, api_base=…, api_type=…, api_version=…, organization=…, user_provided_filename=…) - added:
async static method File.adownload(id, api_key=…, api_base=…, api_type=…, api_version=…, organization=…) - added:
async static method File.afind_matching_files(name, bytes, purpose, api_key=…, api_base=…, api_type=…, api_version=…, organization=…)
- added:
async static method FineTune.astream_events(id, api_key=…, api_base=…, api_type=…, request_id=…, api_version=…, organization=…, **params) - added:
static method FineTune.acancel(id, api_key=…, api_type=…, request_id=…, api_version=…, **params)
- changed:
static method Image.create(**params) → static method Image.create(api_key=…, api_base=…, api_type=…, api_version=…, organization=…, **params) - changed:
static method Image.create_edit(image, mask, api_key=…, api_base=…, api_type=…, api_version=…, organization=…, **params) → static method Image.create_edit(image, mask=…, api_key=…, api_base=…, api_type=…, api_version=…, organization=…, **params) - added:
async static method Image.acreate(api_key=…, api_base=…, api_type=…, api_version=…, organization=…, **params) - added:
async static method Image.acreate_edit(image, mask=…, api_key=…, api_base=…, api_type=…, api_version=…, organization=…, **params) - added:
async static method Image.acreate_variation(image, api_key=…, api_base=…, api_type=…, api_version=…, organization=…, **params)
- added:
static method Moderation.acreate(input: Union[str, List[str]], model: Optional[str]=…, api_key: Optional[str]=…)
- removed:
class Search(EngineAPIResource) - removed:
field Search.OBJECT_NAME - removed:
static method Search.create(*args, **kwargs)
- removed:
class Search - removed:
static method Engine.search(args) - removed:
static method Search.create(args) - removed:
static method Search.prepare_data(args, purpose) - added:
class Deployment - added:
static method Deployment.create(args) - added:
static method Deployment.delete(args) - added:
static method Deployment.get(args) - added:
static method Deployment.list(args) - added:
static method FineTune.delete(args)
- added:
class MissingDependencyError(Exception) - added:
function assert_has_numpy() - added:
function assert_has_pandas() - added:
variable HAS_NUMPY - added:
variable HAS_PANDAS - added:
variable INSTRUCTIONS - added:
variable NUMPY_INSTRUCTIONS - added:
variable PANDAS_INSTRUCTIONS - added:
variable numpy - added:
variable pandas
- added:
async function aget_embedding(text: str, engine=…) -> List[float] - added:
async function aget_embeddings(list_of_text: List[str], engine=…) -> List[List[float]]
- added:
async method OpenAIObject.arequest(method, url, params=…, headers=…, stream=…, plain_old_data=…, request_id: Optional[str]=…, request_timeout: Optional[Union[float, Tuple[float, float]]]=…)
- removed:
function get_search_validators(required_fields, optional_fields) - removed:
function write_out_search_file(df, fname, any_remediations, auto_accept, fields, purpose)