From 21332960c2c9928873b5b2948b86af31245f9312 Mon Sep 17 00:00:00 2001 From: David Miguel Lozano Date: Fri, 29 Nov 2024 23:39:56 +0100 Subject: [PATCH] fix: Default store field to null in openai_dart to support Azure and Groq APIs (#608) --- .../src/generated/schema/create_chat_completion_request.dart | 2 +- .../openai_dart/lib/src/generated/schema/schema.freezed.dart | 2 +- packages/openai_dart/lib/src/generated/schema/schema.g.dart | 2 +- packages/openai_dart/oas/openapi_curated.yaml | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/openai_dart/lib/src/generated/schema/create_chat_completion_request.dart b/packages/openai_dart/lib/src/generated/schema/create_chat_completion_request.dart index 347185e7..ea7f0656 100644 --- a/packages/openai_dart/lib/src/generated/schema/create_chat_completion_request.dart +++ b/packages/openai_dart/lib/src/generated/schema/create_chat_completion_request.dart @@ -29,7 +29,7 @@ class CreateChatCompletionRequest with _$CreateChatCompletionRequest { /// Whether or not to store the output of this chat completion request for use in our /// [model distillation](https://platform.openai.com/docs/guides/distillation) /// or [evals](https://platform.openai.com/docs/guides/evals) products. - @JsonKey(includeIfNull: false) @Default(false) bool? store, + @JsonKey(includeIfNull: false) bool? store, /// Developer-defined tags and values used for filtering completions /// in the [dashboard](https://platform.openai.com/chat-completions). diff --git a/packages/openai_dart/lib/src/generated/schema/schema.freezed.dart b/packages/openai_dart/lib/src/generated/schema/schema.freezed.dart index 2910b66e..8b8c28cb 100644 --- a/packages/openai_dart/lib/src/generated/schema/schema.freezed.dart +++ b/packages/openai_dart/lib/src/generated/schema/schema.freezed.dart @@ -4313,7 +4313,7 @@ class _$CreateChatCompletionRequestImpl extends _CreateChatCompletionRequest { const _$CreateChatCompletionRequestImpl( {@_ChatCompletionModelConverter() required this.model, required final List messages, - @JsonKey(includeIfNull: false) this.store = false, + @JsonKey(includeIfNull: false) this.store, @JsonKey(includeIfNull: false) final Map? metadata, @JsonKey(name: 'frequency_penalty', includeIfNull: false) this.frequencyPenalty = 0.0, diff --git a/packages/openai_dart/lib/src/generated/schema/schema.g.dart b/packages/openai_dart/lib/src/generated/schema/schema.g.dart index b4e1cb16..5ff8a67b 100644 --- a/packages/openai_dart/lib/src/generated/schema/schema.g.dart +++ b/packages/openai_dart/lib/src/generated/schema/schema.g.dart @@ -309,7 +309,7 @@ _$CreateChatCompletionRequestImpl _$$CreateChatCompletionRequestImplFromJson( messages: (json['messages'] as List) .map((e) => ChatCompletionMessage.fromJson(e as Map)) .toList(), - store: json['store'] as bool? ?? false, + store: json['store'] as bool?, metadata: (json['metadata'] as Map?)?.map( (k, e) => MapEntry(k, e as String), ), diff --git a/packages/openai_dart/oas/openapi_curated.yaml b/packages/openai_dart/oas/openapi_curated.yaml index 35d260ca..dbfa3b16 100644 --- a/packages/openai_dart/oas/openapi_curated.yaml +++ b/packages/openai_dart/oas/openapi_curated.yaml @@ -1874,7 +1874,6 @@ components: $ref: "#/components/schemas/ChatCompletionMessage" store: type: boolean - default: false nullable: true description: | Whether or not to store the output of this chat completion request for use in our