-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix deserialization of run steps when using file search and mitigate …
….NET runtime issue when serializing `ChatResponseFormat` (#206) * Fixed the deserialization of run steps when using file search. The internal representation of File Search as an `IReadOnlyDictionary<string, string>` is incorrect and causing issues during deserialization after the latest service. This fix changes this internal representation to `IReadOnlyDictionary<string, BinaryData>` instead. * Mitigated a .NET runtime issue that prevented `ChatResponseFormat` from serializing correct on targets including Unity. * Renamed `SpeechGenerationOptions`'s `Speed` property to `SpeedRatio`. * Changed `GeneratedSpeechFormat` from an enum to an extensible enum.
- Loading branch information
1 parent
78f3f96
commit cc9169a
Showing
54 changed files
with
647 additions
and
387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,7 @@ | ||
namespace OpenAI.Audio; | ||
|
||
/// <summary> | ||
/// Represents an audio data format available as either input or output into an audio operation. | ||
/// </summary> | ||
/// <summary> The audio format in which to generate the speech. </summary> | ||
[CodeGenModel("CreateSpeechRequestResponseFormat")] | ||
public enum GeneratedSpeechFormat | ||
public readonly partial struct GeneratedSpeechFormat | ||
{ | ||
/// <summary> MP3. /// </summary> | ||
[CodeGenMember("Mp3")] | ||
Mp3, | ||
|
||
/// <summary> Opus. /// </summary> | ||
[CodeGenMember("Opus")] | ||
Opus, | ||
|
||
/// <summary> AAC (advanced audio coding). /// </summary> | ||
[CodeGenMember("Aac")] | ||
Aac, | ||
|
||
/// <summary> FLAC (free lossless audio codec). /// </summary> | ||
[CodeGenMember("Flac")] | ||
Flac, | ||
|
||
/// <summary> WAV. /// </summary> | ||
[CodeGenMember("Wav")] | ||
Wav, | ||
|
||
/// <summary> PCM (pulse-code modulation). /// </summary> | ||
[CodeGenMember("Pcm")] | ||
Pcm, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
namespace OpenAI.Audio; | ||
|
||
/// <summary> | ||
/// A representation of additional options available to control the behavior of a text-to-speech audio generation | ||
/// operation. | ||
/// </summary> | ||
/// <summary> The options to configure text-to-speech audio generation. </summary> | ||
[CodeGenModel("CreateSpeechRequest")] | ||
[CodeGenSuppress("SpeechGenerationOptions", typeof(InternalCreateSpeechRequestModel), typeof(string), typeof(GeneratedSpeechVoice))] | ||
public partial class SpeechGenerationOptions | ||
{ | ||
// CUSTOM: | ||
// - Made internal. The model is specified by the client. | ||
// - Added setter. | ||
/// <summary> One of the available [TTS models](/docs/models/tts): `tts-1` or `tts-1-hd`. </summary> | ||
[CodeGenMember("Model")] | ||
internal InternalCreateSpeechRequestModel Model { get; set; } | ||
|
||
// CUSTOM: | ||
// - Made internal. This value comes from a parameter on the client method. | ||
// - Added setter. | ||
/// <summary> The text to generate audio for. The maximum length is 4096 characters. </summary> | ||
[CodeGenMember("Input")] | ||
internal string Input { get; set; } | ||
|
||
// CUSTOM: | ||
// - Made internal. This value comes from a parameter on the client method. | ||
// - Added setter. | ||
/// <summary> | ||
/// The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, | ||
/// `onyx`, `nova`, and `shimmer`. Previews of the voices are available in the | ||
/// [Text to speech guide](/docs/guides/text-to-speech/voice-options). | ||
/// </summary> | ||
[CodeGenMember("Voice")] | ||
internal GeneratedSpeechVoice Voice { get; set; } | ||
|
||
// CUSTOM: Made public now that there are no required properties. | ||
/// <summary> Initializes a new instance of <see cref="SpeechGenerationOptions"/>. </summary> | ||
public SpeechGenerationOptions() | ||
{ | ||
} | ||
|
||
// CUSTOM: Renamed. | ||
/// <summary> | ||
/// The speed of the generated audio expressed as a ratio between 0.5 and 2.0. The default is 1.0. | ||
/// </summary> | ||
[CodeGenMember("Speed")] | ||
|
||
public float? SpeedRatio { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.