Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 1.65.4 #2165

Merged
merged 2 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.65.3"
".": "1.65.4"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 74
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-5d30684c3118d049682ea30cdb4dbef39b97d51667da484689193dc40162af32.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-b524aed1c2c5c928aa4e2c546f5dbb364e7b4d5027daf05e42e210b05a97c3c6.yml
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.65.4 (2025-03-05)

Full Changelog: [v1.65.3...v1.65.4](https://github.com/openai/openai-python/compare/v1.65.3...v1.65.4)

### Bug Fixes

* **api:** add missing file rank enum + more metadata ([#2164](https://github.com/openai/openai-python/issues/2164)) ([0387e48](https://github.com/openai/openai-python/commit/0387e48e0880e496eb74b60eec9ed76a3171f14d))

## 1.65.3 (2025-03-04)

Full Changelog: [v1.65.2...v1.65.3](https://github.com/openai/openai-python/compare/v1.65.2...v1.65.3)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openai"
version = "1.65.3"
version = "1.65.4"
description = "The official Python library for the openai API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/openai/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "openai"
__version__ = "1.65.3" # x-release-please-version
__version__ = "1.65.4" # x-release-please-version
31 changes: 30 additions & 1 deletion src/openai/resources/fine_tuning/jobs/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Union, Iterable, Optional
from typing import Dict, Union, Iterable, Optional
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -30,6 +30,7 @@
make_request_options,
)
from ....types.fine_tuning import job_list_params, job_create_params, job_list_events_params
from ....types.shared_params.metadata import Metadata
from ....types.fine_tuning.fine_tuning_job import FineTuningJob
from ....types.fine_tuning.fine_tuning_job_event import FineTuningJobEvent

Expand Down Expand Up @@ -67,6 +68,7 @@ def create(
training_file: str,
hyperparameters: job_create_params.Hyperparameters | NotGiven = NOT_GIVEN,
integrations: Optional[Iterable[job_create_params.Integration]] | NotGiven = NOT_GIVEN,
metadata: Optional[Metadata] | NotGiven = NOT_GIVEN,
method: job_create_params.Method | NotGiven = NOT_GIVEN,
seed: Optional[int] | NotGiven = NOT_GIVEN,
suffix: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -114,6 +116,13 @@ def create(

integrations: A list of integrations to enable for your fine-tuning job.

metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
for storing additional information about the object in a structured format, and
querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with
a maximum length of 512 characters.

method: The method used for fine-tuning.

seed: The seed controls the reproducibility of the job. Passing in the same seed and
Expand Down Expand Up @@ -155,6 +164,7 @@ def create(
"training_file": training_file,
"hyperparameters": hyperparameters,
"integrations": integrations,
"metadata": metadata,
"method": method,
"seed": seed,
"suffix": suffix,
Expand Down Expand Up @@ -208,6 +218,7 @@ def list(
*,
after: str | NotGiven = NOT_GIVEN,
limit: int | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -223,6 +234,9 @@ def list(

limit: Number of fine-tuning jobs to retrieve.

metadata: Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
Alternatively, set `metadata=null` to indicate no metadata.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -243,6 +257,7 @@ def list(
{
"after": after,
"limit": limit,
"metadata": metadata,
},
job_list_params.JobListParams,
),
Expand Down Expand Up @@ -365,6 +380,7 @@ async def create(
training_file: str,
hyperparameters: job_create_params.Hyperparameters | NotGiven = NOT_GIVEN,
integrations: Optional[Iterable[job_create_params.Integration]] | NotGiven = NOT_GIVEN,
metadata: Optional[Metadata] | NotGiven = NOT_GIVEN,
method: job_create_params.Method | NotGiven = NOT_GIVEN,
seed: Optional[int] | NotGiven = NOT_GIVEN,
suffix: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -412,6 +428,13 @@ async def create(

integrations: A list of integrations to enable for your fine-tuning job.

metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
for storing additional information about the object in a structured format, and
querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with
a maximum length of 512 characters.

method: The method used for fine-tuning.

seed: The seed controls the reproducibility of the job. Passing in the same seed and
Expand Down Expand Up @@ -453,6 +476,7 @@ async def create(
"training_file": training_file,
"hyperparameters": hyperparameters,
"integrations": integrations,
"metadata": metadata,
"method": method,
"seed": seed,
"suffix": suffix,
Expand Down Expand Up @@ -506,6 +530,7 @@ def list(
*,
after: str | NotGiven = NOT_GIVEN,
limit: int | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -521,6 +546,9 @@ def list(

limit: Number of fine-tuning jobs to retrieve.

metadata: Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
Alternatively, set `metadata=null` to indicate no metadata.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -541,6 +569,7 @@ def list(
{
"after": after,
"limit": limit,
"metadata": metadata,
},
job_list_params.JobListParams,
),
Expand Down
7 changes: 5 additions & 2 deletions src/openai/types/beta/threads/runs/file_search_tool_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@


class FileSearchRankingOptions(BaseModel):
ranker: Literal["default_2024_08_21"]
"""The ranker used for the file search."""
ranker: Literal["auto", "default_2024_08_21"]
"""The ranker to use for the file search.

If not specified will use the `auto` ranker.
"""

score_threshold: float
"""The score threshold for the file search.
Expand Down
11 changes: 11 additions & 0 deletions src/openai/types/fine_tuning/fine_tuning_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing_extensions import Literal

from ..._models import BaseModel
from ..shared.metadata import Metadata
from .fine_tuning_job_wandb_integration_object import FineTuningJobWandbIntegrationObject

__all__ = [
Expand Down Expand Up @@ -208,5 +209,15 @@ class FineTuningJob(BaseModel):
integrations: Optional[List[FineTuningJobWandbIntegrationObject]] = None
"""A list of integrations to enable for this fine-tuning job."""

metadata: Optional[Metadata] = None
"""Set of 16 key-value pairs that can be attached to an object.

This can be useful for storing additional information about the object in a
structured format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with
a maximum length of 512 characters.
"""

method: Optional[Method] = None
"""The method used for fine-tuning."""
12 changes: 12 additions & 0 deletions src/openai/types/fine_tuning/job_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from typing import List, Union, Iterable, Optional
from typing_extensions import Literal, Required, TypedDict

from ..shared_params.metadata import Metadata

__all__ = [
"JobCreateParams",
"Hyperparameters",
Expand Down Expand Up @@ -55,6 +57,16 @@ class JobCreateParams(TypedDict, total=False):
integrations: Optional[Iterable[Integration]]
"""A list of integrations to enable for your fine-tuning job."""

metadata: Optional[Metadata]
"""Set of 16 key-value pairs that can be attached to an object.

This can be useful for storing additional information about the object in a
structured format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with
a maximum length of 512 characters.
"""

method: Method
"""The method used for fine-tuning."""

Expand Down
8 changes: 8 additions & 0 deletions src/openai/types/fine_tuning/job_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from typing import Dict, Optional
from typing_extensions import TypedDict

__all__ = ["JobListParams"]
Expand All @@ -13,3 +14,10 @@ class JobListParams(TypedDict, total=False):

limit: int
"""Number of fine-tuning jobs to retrieve."""

metadata: Optional[Dict[str, str]]
"""Optional metadata filter.

To filter, use the syntax `metadata[k]=v`. Alternatively, set `metadata=null` to
indicate no metadata.
"""
4 changes: 4 additions & 0 deletions tests/api_resources/fine_tuning/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None:
},
}
],
metadata={"foo": "string"},
method={
"dpo": {
"hyperparameters": {
Expand Down Expand Up @@ -148,6 +149,7 @@ def test_method_list_with_all_params(self, client: OpenAI) -> None:
job = client.fine_tuning.jobs.list(
after="string",
limit=0,
metadata={"foo": "string"},
)
assert_matches_type(SyncCursorPage[FineTuningJob], job, path=["response"])

Expand Down Expand Up @@ -289,6 +291,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) ->
},
}
],
metadata={"foo": "string"},
method={
"dpo": {
"hyperparameters": {
Expand Down Expand Up @@ -387,6 +390,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> N
job = await async_client.fine_tuning.jobs.list(
after="string",
limit=0,
metadata={"foo": "string"},
)
assert_matches_type(AsyncCursorPage[FineTuningJob], job, path=["response"])

Expand Down