Skip to content

Commit 3894da7

Browse files
authored
feat: Add Verbosity support in openai_dart (#759)
1 parent f92c94e commit 3894da7

File tree

7 files changed

+123
-12
lines changed

7 files changed

+123
-12
lines changed

packages/openai_dart/lib/src/generated/schema/create_chat_completion_request.dart

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openai_dart/lib/src/generated/schema/schema.dart

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openai_dart/lib/src/generated/schema/schema.freezed.dart

Lines changed: 59 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openai_dart/lib/src/generated/schema/schema.g.dart

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openai_dart/lib/src/generated/schema/verbosity.dart

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openai_dart/oas/openapi_curated.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2297,6 +2297,8 @@ components:
22972297
maxItems: 128
22982298
items:
22992299
$ref: "#/components/schemas/FunctionObject"
2300+
verbosity:
2301+
$ref: "#/components/schemas/Verbosity"
23002302
required:
23012303
- model
23022304
- messages
@@ -2662,6 +2664,18 @@ components:
26622664
Currently supported values are `low`, `medium`, and `high`. Reducing
26632665
reasoning effort can result in faster responses and fewer tokens used
26642666
on reasoning in a response.
2667+
Verbosity:
2668+
type: string
2669+
enum:
2670+
- low
2671+
- medium
2672+
- high
2673+
default: medium
2674+
nullable: true
2675+
description: |
2676+
Constrains the verbosity of the model's response. Lower values will result in
2677+
more concise responses, while higher values will result in more verbose responses.
2678+
Currently supported values are `low`, `medium`, and `high`.
26652679
ResponseFormat:
26662680
type: object
26672681
description: |

packages/openai_dart/test/openai_client_chat_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,10 @@ void main() {
656656
expect(choice1.message.audio, isNotNull);
657657
expect(choice1.message.audio!.id, isNotEmpty);
658658
expect(choice1.message.audio!.expiresAt, greaterThan(0));
659-
expect(choice1.message.audio!.transcript,
660-
anyOf(contains('two'), contains('2')));
659+
expect(
660+
choice1.message.audio!.transcript,
661+
anyOf(contains('two'), contains('2')),
662+
);
661663
expect(choice1.message.audio!.data, isNotEmpty);
662664
});
663665

0 commit comments

Comments
 (0)