Skip to content

Commit f9d339f

Browse files
docs(api): update top_logprobs parameter description across chat and responses
1 parent 72bf67a commit f9d339f

20 files changed

Lines changed: 110 additions & 40 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 233
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-5002c7ce1688cf372f6c268507494c5e6396f38db8d85d79029d949b7bb06fe3.yml
3-
openapi_spec_hash: 92713b0825f6b8760836778e6d27e837
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-578515408e7ee6ac115f3768b358ff2cd4f5699cbfb527fe58b19806e7d1f713.yml
3+
openapi_spec_hash: b2df68d6233a18b475590978f5682c04
44
config_hash: c6cf65d9b19a16ce4313602a2204d48f

src/openai/resources/chat/completions/completions.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,9 @@ def create(
516516
[custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
517517
or [function tools](https://platform.openai.com/docs/guides/function-calling).
518518
519-
top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
520-
return at each token position, each with an associated log probability.
519+
top_logprobs: An integer between 0 and 20 specifying the maximum number of most likely tokens
520+
to return at each token position, each with an associated log probability. In
521+
some cases, the number of returned tokens may be fewer than requested.
521522
`logprobs` must be set to `true` if this parameter is used.
522523
523524
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
@@ -822,8 +823,9 @@ def create(
822823
[custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
823824
or [function tools](https://platform.openai.com/docs/guides/function-calling).
824825
825-
top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
826-
return at each token position, each with an associated log probability.
826+
top_logprobs: An integer between 0 and 20 specifying the maximum number of most likely tokens
827+
to return at each token position, each with an associated log probability. In
828+
some cases, the number of returned tokens may be fewer than requested.
827829
`logprobs` must be set to `true` if this parameter is used.
828830
829831
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
@@ -1128,8 +1130,9 @@ def create(
11281130
[custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
11291131
or [function tools](https://platform.openai.com/docs/guides/function-calling).
11301132
1131-
top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
1132-
return at each token position, each with an associated log probability.
1133+
top_logprobs: An integer between 0 and 20 specifying the maximum number of most likely tokens
1134+
to return at each token position, each with an associated log probability. In
1135+
some cases, the number of returned tokens may be fewer than requested.
11331136
`logprobs` must be set to `true` if this parameter is used.
11341137
11351138
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
@@ -2037,8 +2040,9 @@ async def create(
20372040
[custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
20382041
or [function tools](https://platform.openai.com/docs/guides/function-calling).
20392042
2040-
top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
2041-
return at each token position, each with an associated log probability.
2043+
top_logprobs: An integer between 0 and 20 specifying the maximum number of most likely tokens
2044+
to return at each token position, each with an associated log probability. In
2045+
some cases, the number of returned tokens may be fewer than requested.
20422046
`logprobs` must be set to `true` if this parameter is used.
20432047
20442048
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
@@ -2343,8 +2347,9 @@ async def create(
23432347
[custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
23442348
or [function tools](https://platform.openai.com/docs/guides/function-calling).
23452349
2346-
top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
2347-
return at each token position, each with an associated log probability.
2350+
top_logprobs: An integer between 0 and 20 specifying the maximum number of most likely tokens
2351+
to return at each token position, each with an associated log probability. In
2352+
some cases, the number of returned tokens may be fewer than requested.
23482353
`logprobs` must be set to `true` if this parameter is used.
23492354
23502355
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
@@ -2649,8 +2654,9 @@ async def create(
26492654
[custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
26502655
or [function tools](https://platform.openai.com/docs/guides/function-calling).
26512656
2652-
top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
2653-
return at each token position, each with an associated log probability.
2657+
top_logprobs: An integer between 0 and 20 specifying the maximum number of most likely tokens
2658+
to return at each token position, each with an associated log probability. In
2659+
some cases, the number of returned tokens may be fewer than requested.
26542660
`logprobs` must be set to `true` if this parameter is used.
26552661
26562662
top_p: An alternative to sampling with temperature, called nucleus sampling, where the

src/openai/resources/responses/responses.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,9 @@ def create(
344344
[function calling](https://platform.openai.com/docs/guides/function-calling).
345345
You can also use custom tools to call your own code.
346346
347-
top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
348-
return at each token position, each with an associated log probability.
347+
top_logprobs: An integer between 0 and 20 specifying the maximum number of most likely tokens
348+
to return at each token position, each with an associated log probability. In
349+
some cases, the number of returned tokens may be fewer than requested.
349350
350351
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
351352
model considers the results of the tokens with top_p probability mass. So 0.1
@@ -593,8 +594,9 @@ def create(
593594
[function calling](https://platform.openai.com/docs/guides/function-calling).
594595
You can also use custom tools to call your own code.
595596
596-
top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
597-
return at each token position, each with an associated log probability.
597+
top_logprobs: An integer between 0 and 20 specifying the maximum number of most likely tokens
598+
to return at each token position, each with an associated log probability. In
599+
some cases, the number of returned tokens may be fewer than requested.
598600
599601
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
600602
model considers the results of the tokens with top_p probability mass. So 0.1
@@ -842,8 +844,9 @@ def create(
842844
[function calling](https://platform.openai.com/docs/guides/function-calling).
843845
You can also use custom tools to call your own code.
844846
845-
top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
846-
return at each token position, each with an associated log probability.
847+
top_logprobs: An integer between 0 and 20 specifying the maximum number of most likely tokens
848+
to return at each token position, each with an associated log probability. In
849+
some cases, the number of returned tokens may be fewer than requested.
847850
848851
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
849852
model considers the results of the tokens with top_p probability mass. So 0.1
@@ -2043,8 +2046,9 @@ async def create(
20432046
[function calling](https://platform.openai.com/docs/guides/function-calling).
20442047
You can also use custom tools to call your own code.
20452048
2046-
top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
2047-
return at each token position, each with an associated log probability.
2049+
top_logprobs: An integer between 0 and 20 specifying the maximum number of most likely tokens
2050+
to return at each token position, each with an associated log probability. In
2051+
some cases, the number of returned tokens may be fewer than requested.
20482052
20492053
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
20502054
model considers the results of the tokens with top_p probability mass. So 0.1
@@ -2292,8 +2296,9 @@ async def create(
22922296
[function calling](https://platform.openai.com/docs/guides/function-calling).
22932297
You can also use custom tools to call your own code.
22942298
2295-
top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
2296-
return at each token position, each with an associated log probability.
2299+
top_logprobs: An integer between 0 and 20 specifying the maximum number of most likely tokens
2300+
to return at each token position, each with an associated log probability. In
2301+
some cases, the number of returned tokens may be fewer than requested.
22972302
22982303
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
22992304
model considers the results of the tokens with top_p probability mass. So 0.1
@@ -2541,8 +2546,9 @@ async def create(
25412546
[function calling](https://platform.openai.com/docs/guides/function-calling).
25422547
You can also use custom tools to call your own code.
25432548
2544-
top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
2545-
return at each token position, each with an associated log probability.
2549+
top_logprobs: An integer between 0 and 20 specifying the maximum number of most likely tokens
2550+
to return at each token position, each with an associated log probability. In
2551+
some cases, the number of returned tokens may be fewer than requested.
25462552
25472553
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
25482554
model considers the results of the tokens with top_p probability mass. So 0.1

src/openai/types/admin/organization/usage_audio_speeches_response.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ class DataResultOrganizationCostsResult(BaseModel):
353353
costs result.
354354
"""
355355

356+
quantity: Optional[float] = None
357+
"""
358+
When `group_by=line_item`, this field provides the quantity of the grouped costs
359+
result.
360+
"""
361+
356362

357363
DataResult: TypeAlias = Annotated[
358364
Union[

src/openai/types/admin/organization/usage_audio_transcriptions_response.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ class DataResultOrganizationCostsResult(BaseModel):
353353
costs result.
354354
"""
355355

356+
quantity: Optional[float] = None
357+
"""
358+
When `group_by=line_item`, this field provides the quantity of the grouped costs
359+
result.
360+
"""
361+
356362

357363
DataResult: TypeAlias = Annotated[
358364
Union[

src/openai/types/admin/organization/usage_code_interpreter_sessions_response.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ class DataResultOrganizationCostsResult(BaseModel):
353353
costs result.
354354
"""
355355

356+
quantity: Optional[float] = None
357+
"""
358+
When `group_by=line_item`, this field provides the quantity of the grouped costs
359+
result.
360+
"""
361+
356362

357363
DataResult: TypeAlias = Annotated[
358364
Union[

src/openai/types/admin/organization/usage_completions_response.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ class DataResultOrganizationCostsResult(BaseModel):
353353
costs result.
354354
"""
355355

356+
quantity: Optional[float] = None
357+
"""
358+
When `group_by=line_item`, this field provides the quantity of the grouped costs
359+
result.
360+
"""
361+
356362

357363
DataResult: TypeAlias = Annotated[
358364
Union[

src/openai/types/admin/organization/usage_costs_response.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ class DataResultOrganizationCostsResult(BaseModel):
353353
costs result.
354354
"""
355355

356+
quantity: Optional[float] = None
357+
"""
358+
When `group_by=line_item`, this field provides the quantity of the grouped costs
359+
result.
360+
"""
361+
356362

357363
DataResult: TypeAlias = Annotated[
358364
Union[

src/openai/types/admin/organization/usage_embeddings_response.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ class DataResultOrganizationCostsResult(BaseModel):
353353
costs result.
354354
"""
355355

356+
quantity: Optional[float] = None
357+
"""
358+
When `group_by=line_item`, this field provides the quantity of the grouped costs
359+
result.
360+
"""
361+
356362

357363
DataResult: TypeAlias = Annotated[
358364
Union[

src/openai/types/admin/organization/usage_images_response.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ class DataResultOrganizationCostsResult(BaseModel):
353353
costs result.
354354
"""
355355

356+
quantity: Optional[float] = None
357+
"""
358+
When `group_by=line_item`, this field provides the quantity of the grouped costs
359+
result.
360+
"""
361+
356362

357363
DataResult: TypeAlias = Annotated[
358364
Union[

0 commit comments

Comments
 (0)