Upgrading openai 0.10 to 0.11
Breaking0.10.5 → 0.11.6Breaking2Deprecated1New1Changed4Fixed4Other3
BreakingUpgrade verdict
2 breaking changes.
In plain terms
- The fine-tuning create call no longer accepts the packing options.
- The default API prefix is now empty and the prefix logic moved into the package init, so if you set OPENAI_API_BASE locally you may need to change it.
- The old way of creating embeddings through an engine is deprecated; use the Embedding.create method instead.
Must act 3 items need code or config changes
Python requirement changed in 0.11.0: >=3.6 → >=3.7.1.
What you must change
Breaking2
Removes packing flags from fine_tunes.create.
fine_tunes.createChanges the default api_prefix to "" and moves that logic into init.py; local OPENAI_API_BASE settings may need updating.
api_prefixOPENAI_API_BASEDeprecations to plan for
Deprecated1
Deprecates openai.Engine.embeddings in favor of openai.Embedding.create.
openai.Engine.embeddingsopenai.Embedding.createAPI changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- removed:
variable client_id - removed:
variable default_http_client - removed:
variable enable_telemetry - removed:
variable file_api_base - removed:
variable max_network_retries - added:
export Embedding - added:
variable api_key_path: Optional[str]
- removed:
function url_encode_params(params) - removed:
method APIRequestor.interpret_response(rbody, rcode, rheaders, stream=…) - removed:
method APIRequestor.interpret_response_line(rbody, rcode, rheaders, stream=…) - changed:
constructor APIRequestor(key=…, client=…, api_base=…, api_version=…, organization=…) → constructor APIRequestor(key=…, api_base=…, api_version=…, organization=…) - changed:
method APIRequestor.request(method, url, params=…, headers=…, stream=…) → method APIRequestor.request(method, url, params=…, headers=…, files=…, stream=…, request_id: Optional[str]=…) -> Tuple[Union[OpenAIResponse, Iterator[OpenAIResponse]], bool, str] - changed:
method APIRequestor.request_headers(api_key, method, extra) → method APIRequestor.request_headers(method: str, extra, request_id: Optional[str]) -> Dict[str, str] - changed:
method APIRequestor.request_raw(method, url, params=…, supplied_headers=…, stream=…) → method APIRequestor.request_raw(method, url, params=…, supplied_headers=…, files=…, stream=…, request_id: Optional[str]=…) -> requests.Response - added:
variable MAX_CONNECTION_RETRIES - added:
variable TIMEOUT_SECS
- added:
export Embedding
- removed:
export SingletonAPIResource - removed:
export custom_method
- changed:
static method CreateableAPIResource.create(api_key=…, api_base=…, idempotency_key=…, request_id=…, api_version=…, organization=…, **params) → static method CreateableAPIResource.create(api_key=…, api_base=…, request_id=…, api_version=…, organization=…, **params)
- removed:
function custom_method(name, http_verb, http_path=…)
- changed:
method DeletableAPIResource.delete(**params) → static method DeletableAPIResource.delete(sid, **params)
- changed:
static method EngineAPIResource.create(api_key=…, api_base=…, idempotency_key=…, request_id=…, api_version=…, organization=…, **params) → static method EngineAPIResource.create(api_key=…, api_base=…, request_id=…, api_version=…, organization=…, **params)
- removed:
class SingletonAPIResource(APIResource) - removed:
method SingletonAPIResource.instance_url() - removed:
static method SingletonAPIResource.class_url() - removed:
static method SingletonAPIResource.retrieve(**params)
- removed:
method UpdateableAPIResource.save(idempotency_key=…, request_id=…)
- removed:
field Answer.api_prefix - changed:
static method Answer.get_url(base) → static method Answer.get_url()
- removed:
field Classification.api_prefix - changed:
static method Classification.get_url(base) → static method Classification.get_url()
- added:
class Embedding(EngineAPIResource, ListableAPIResource, DeletableAPIResource) - added:
field Embedding.OBJECT_NAME - added:
field Embedding.engine_required - added:
static method Embedding.create(*args, **kwargs)
- changed:
method ErrorObject.refresh_from(values, api_key=…, partial=…, api_version=…, organization=…, last_response=…) → method ErrorObject.refresh_from(values, api_key=…, api_version=…, organization=…, response_ms: Optional[int]=…)
- changed:
static method File.create(api_key=…, api_base=…, api_version=…, organization=…, **params) → static method File.create(file, purpose, model=…, api_key=…, api_base=…, api_version=…, organization=…, user_provided_filename=…) - changed:
static method File.find_matching_files(api_key=…, api_base=…, api_version=…, organization=…, file=…, purpose=…) → static method File.find_matching_files(name, bytes, purpose, api_key=…, api_base=…, api_version=…, organization=…)
- removed:
field Search.OBJECT_NAME - removed:
field Search.api_prefix
- added:
static method Search.prepare_data(args, purpose)
- added:
function cosine_similarity(a, b) - added:
function get_embedding(text: str, engine=…) -> List[float] - added:
function get_embeddings(list_of_text: List[str], engine=…) -> List[List[float]] - added:
function plot_multiclass_precision_recall(y_score, y_true_untransformed, class_list, classifier_name)
- removed:
class IdempotencyError(OpenAIError) - added:
class ServiceUnavailableError(OpenAIError)
- removed:
class GZIPCompressedStream(io.RawIOBase) - removed:
constructor GZIPCompressedStream(stream, compression_level) - removed:
method GZIPCompressedStream.readable() - removed:
method GZIPCompressedStream.readinto(b) - removed:
property GZIPCompressedStream.compression_level - removed:
property GZIPCompressedStream.stream
- removed:
class HTTPClient(abc.ABC) - removed:
class RequestsClient(HTTPClient) - removed:
constructor HTTPClient(verify_ssl_certs=…, proxy=…) - removed:
constructor RequestsClient(timeout=…, session=…, **kwargs) - removed:
field HTTPClient.INITIAL_DELAY - removed:
field HTTPClient.MAX_DELAY - removed:
field HTTPClient.MAX_RETRY_AFTER - removed:
field RequestsClient.name - removed:
function new_default_http_client(*args, **kwargs) - removed:
method HTTPClient.close() - removed:
method HTTPClient.request(method, url, headers, post_data=…, stream=…) - removed:
method HTTPClient.request_with_retries(method, url, headers, post_data=…, stream=…) - removed:
method RequestsClient.close() - removed:
method RequestsClient.request(method, url, headers, post_data=…, stream=…)
- removed:
class MultipartDataGenerator(object) - removed:
constructor MultipartDataGenerator(chunk_size=…) - removed:
method MultipartDataGenerator.add_params(params) - removed:
method MultipartDataGenerator.get_post_data() - removed:
method MultipartDataGenerator.param_header()
- removed:
class OpenAIObject.ReprJSONEncoder(json.JSONEncoder) - removed:
method OpenAIObject.ReprJSONEncoder.default(obj) - removed:
method OpenAIObject.serialize(previous) - removed:
method OpenAIObject.update(update_dict) - removed:
property OpenAIObject.last_response - changed:
constructor OpenAIObject(id=…, api_key=…, api_version=…, organization=…, last_response=…, api_base=…, engine=…, **params) → constructor OpenAIObject(id=…, api_key=…, api_version=…, organization=…, response_ms: Optional[int]=…, api_base=…, engine=…, **params) - changed:
method OpenAIObject.refresh_from(values, api_key=…, partial=…, api_version=…, organization=…, last_response=…) → method OpenAIObject.refresh_from(values, api_key=…, api_version=…, organization=…, response_ms: Optional[int]=…) - changed:
method OpenAIObject.request(method, url, params=…, headers=…, stream=…, plain_old_data=…) → method OpenAIObject.request(method, url, params=…, headers=…, stream=…, plain_old_data=…, request_id: Optional[str]=…) - changed:
static method OpenAIObject.construct_from(values, key, api_version=…, organization=…, engine=…, last_response=…) → static method OpenAIObject.construct_from(values, api_key: Optional[str]=…, api_version=…, organization=…, engine=…, response_ms: Optional[int]=…) - added:
property OpenAIObject.response_ms -> Optional[int]
- removed:
property OpenAIResponse.idempotency_key - removed:
property OpenAIResponse.request_id - changed:
class OpenAIResponse(object) → class OpenAIResponse - changed:
constructor OpenAIResponse(body, code, headers) → constructor OpenAIResponse(data, headers) - added:
property OpenAIResponse.organization -> Optional[str] - added:
property OpenAIResponse.request_id -> Optional[str] - added:
property OpenAIResponse.response_ms -> Optional[int]
- removed:
class RequestMetrics(object) - removed:
constructor RequestMetrics(request_id, request_duration_ms) - removed:
method RequestMetrics.payload()
- removed:
export io - removed:
export parse_qsl - removed:
function dashboard_link(request_id)
- removed:
function get_batch_size_suggestion(df, no_packing) - removed:
function non_empty_completion_validator(df) - changed:
function additional_column_validator(df) → function additional_column_validator(df, fields=…) - changed:
function duplicated_rows_validator(df) → function duplicated_rows_validator(df, fields=…) - changed:
function read_any_format(fname) → function read_any_format(fname, fields=…) - added:
function apply_validators(df, fname, remediation, validators, auto_accept, write_out_file_func) - added:
function get_search_validators(required_fields, optional_fields) - added:
function non_empty_field_validator(df, field=…) - added:
function write_out_search_file(df, fname, any_remediations, auto_accept, fields, purpose)