From 49963581111cd543b28c6a2b7a142c6985190642 Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Fri, 28 Feb 2025 14:17:31 -0800 Subject: [PATCH] revert: keyterm -> keyterms --- Deepgram/Clients/Agent/v2/Websocket/Client.cs | 2 +- Deepgram/Models/Agent/v2/WebSocket/Listen.cs | 8 ++++++-- examples/agent/websocket/simple/Program.cs | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Deepgram/Clients/Agent/v2/Websocket/Client.cs b/Deepgram/Clients/Agent/v2/Websocket/Client.cs index 035600d..49aa71e 100644 --- a/Deepgram/Clients/Agent/v2/Websocket/Client.cs +++ b/Deepgram/Clients/Agent/v2/Websocket/Client.cs @@ -52,7 +52,7 @@ public Client(string? apiKey = null, IDeepgramClientOptions? options = null) : b public async Task Connect(SettingsConfigurationSchema options, CancellationTokenSource? cancelToken = null, Dictionary? addons = null, Dictionary? headers = null) { - if (!options.Agent.Listen.Model.StartsWith("nova-3") && options.Agent.Listen.Keyterm?.Count > 0) + if (!options.Agent.Listen.Model.StartsWith("nova-3") && options.Agent.Listen.Keyterms?.Count > 0) { throw new DeepgramException("Keyterm is only supported in Nova 3 models."); } diff --git a/Deepgram/Models/Agent/v2/WebSocket/Listen.cs b/Deepgram/Models/Agent/v2/WebSocket/Listen.cs index 811d48d..6278a91 100644 --- a/Deepgram/Models/Agent/v2/WebSocket/Listen.cs +++ b/Deepgram/Models/Agent/v2/WebSocket/Listen.cs @@ -10,9 +10,13 @@ public record Listen [JsonPropertyName("model")] public string Model { get; set; } + /// + /// Keyterm Prompting allows you improve Keyword Recall Rate (KRR) for important keyterms or phrases up to 90%. + /// + /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - [JsonPropertyName("keyterm")] - public List? Keyterm { get; set; } + [JsonPropertyName("keyterms")] + public List? Keyterms { get; set; } /// /// Override ToString method to serialize the object diff --git a/examples/agent/websocket/simple/Program.cs b/examples/agent/websocket/simple/Program.cs index 9ca0a64..823e9e6 100644 --- a/examples/agent/websocket/simple/Program.cs +++ b/examples/agent/websocket/simple/Program.cs @@ -196,7 +196,7 @@ await agentClient.Subscribe(new EventHandler((sender, e) => settingsConfiguration.Context.Messages = new List {}; settingsConfiguration.Context.Replay = false; settingsConfiguration.Agent.Listen.Model = "nova-3"; - settingsConfiguration.Agent.Listen.Keyterm = new List { "Deepgram" }; + settingsConfiguration.Agent.Listen.Keyterms = new List { "Deepgram" }; bool bConnected = await agentClient.Connect(settingsConfiguration); if (!bConnected)