Skip to content
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
9 changes: 9 additions & 0 deletions src/GenerativeAI.Live/Models/MultiModalLiveClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ private async Task<ClientWebSocket> GetClient()
/// </summary>
public bool UseCodeExecutor { get; set; } = false;

public bool InputAudioTranscriptionEnabled { get; set; } = false;

public bool OutputAudioTranscriptionEnabled { get; set; } = false;

Comment on lines +108 to +111
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add XML documentation comments for consistency.

The new properties lack XML documentation comments, which breaks consistency with other properties in the class. Please add documentation similar to other boolean properties in the class.

+    /// <summary>
+    /// Gets or sets a value indicating whether input audio transcription is enabled for the session.
+    /// </summary>
     public bool InputAudioTranscriptionEnabled { get; set; } = false;

+    /// <summary>
+    /// Gets or sets a value indicating whether output audio transcription is enabled for the session.
+    /// </summary>
     public bool OutputAudioTranscriptionEnabled { get; set; } = false;
🤖 Prompt for AI Agents
In src/GenerativeAI.Live/Models/MultiModalLiveClient.cs around lines 108 to 111,
the new boolean properties InputAudioTranscriptionEnabled and
OutputAudioTranscriptionEnabled lack XML documentation comments. Add XML
documentation comments above each property, following the style and format used
for other boolean properties in the class, to maintain consistency and clarity.

🛠️ Refactor suggestion

Add XML documentation for consistency.

The new properties lack XML documentation comments, which is inconsistent with the established pattern in this class. All other public properties have comprehensive documentation.

Add XML documentation for these properties:

+    /// <summary>
+    /// Gets or sets a value indicating whether input audio transcription is enabled for the session.
+    /// </summary>
     public bool InputAudioTranscriptionEnabled { get; set; } = false;

+    /// <summary>
+    /// Gets or sets a value indicating whether output audio transcription is enabled for the session.
+    /// </summary>
     public bool OutputAudioTranscriptionEnabled { get; set; } = false;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public bool InputAudioTranscriptionEnabled { get; set; } = false;
public bool OutputAudioTranscriptionEnabled { get; set; } = false;
/// <summary>
/// Gets or sets a value indicating whether input audio transcription is enabled for the session.
/// </summary>
public bool InputAudioTranscriptionEnabled { get; set; } = false;
/// <summary>
/// Gets or sets a value indicating whether output audio transcription is enabled for the session.
/// </summary>
public bool OutputAudioTranscriptionEnabled { get; set; } = false;
🤖 Prompt for AI Agents
In src/GenerativeAI.Live/Models/MultiModalLiveClient.cs around lines 108 to 111,
the new public properties InputAudioTranscriptionEnabled and
OutputAudioTranscriptionEnabled lack XML documentation comments. Add XML
documentation comments above each property describing their purpose and usage,
following the style and detail level of the existing documented properties in
the class to maintain consistency.

#endregion

#region Constructors
Expand All @@ -115,6 +119,7 @@ private async Task<ClientWebSocket> GetClient()
public MultiModalLiveClient(IPlatformAdapter platformAdapter, string modelName, GenerationConfig? config = null,
ICollection<SafetySetting>? safetySettings = null,
string? systemInstruction = null,
bool inputAudioTranscriptionEnabled = false, bool outputAudioTranscriptionEnabled = false,
ILogger? logger = null)
{
_platformAdapter = platformAdapter ?? throw new ArgumentNullException(nameof(platformAdapter));
Expand All @@ -123,6 +128,8 @@ public MultiModalLiveClient(IPlatformAdapter platformAdapter, string modelName,
{
ResponseModalities = new List<Modality> { Modality.TEXT }
};
InputAudioTranscriptionEnabled = inputAudioTranscriptionEnabled;
OutputAudioTranscriptionEnabled = outputAudioTranscriptionEnabled;
SafetySettings = safetySettings;
SystemInstruction = systemInstruction;
_connectionId = Guid.NewGuid();
Expand Down Expand Up @@ -550,6 +557,8 @@ public async Task SendSetupAsync(CancellationToken cancellationToken = default)
? new Content(this.SystemInstruction, Roles.System)
: null,
Tools = tools.Count > 0 ? tools.ToArray() : null,
InputAudioTranscription = InputAudioTranscriptionEnabled ? new AudioTranscriptionConfig(): null,
OutputAudioTranscription = OutputAudioTranscriptionEnabled ? new AudioTranscriptionConfig() : null,
};
await SendSetupAsync(setup, cancellationToken).ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ public class BidiGenerateContentSetup
[JsonPropertyName("tools")]
public Tool[]? Tools { get; set; }

/// <summary>
/// Configures output audio transcription settings.
/// </summary>
[JsonPropertyName("outputAudioTranscription")]
public AudioTranscriptionConfig? OutputAudioTranscription { get; set; }
public AudioTranscriptionConfig? OutputAudioTranscription { get; set; }

/// <summary>
/// Configures input audio transcription settings.
/// </summary>
[JsonPropertyName("inputAudioTranscription")]
public AudioTranscriptionConfig? InputAudioTranscription { get; set; }
/// <summary>
Expand Down
Loading