Skip to content

Commit

Permalink
Merge pull request #365 from deepgram/revert/keyterms
Browse files Browse the repository at this point in the history
revert: keyterm -> keyterms
  • Loading branch information
naomi-lgbt authored Mar 3, 2025
2 parents 138ce74 + 4996358 commit 86c1716
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Deepgram/Clients/Agent/v2/Websocket/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public Client(string? apiKey = null, IDeepgramClientOptions? options = null) : b
public async Task<bool> Connect(SettingsConfigurationSchema options, CancellationTokenSource? cancelToken = null, Dictionary<string, string>? addons = null,
Dictionary<string, string>? 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.");
}
Expand Down
8 changes: 6 additions & 2 deletions Deepgram/Models/Agent/v2/WebSocket/Listen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ public record Listen
[JsonPropertyName("model")]
public string Model { get; set; }

/// <summary>
/// Keyterm Prompting allows you improve Keyword Recall Rate (KRR) for important keyterms or phrases up to 90%.
/// <see href="https://developers.deepgram.com/docs/keyterm">
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("keyterm")]
public List<string>? Keyterm { get; set; }
[JsonPropertyName("keyterms")]
public List<string>? Keyterms { get; set; }

/// <summary>
/// Override ToString method to serialize the object
Expand Down
2 changes: 1 addition & 1 deletion examples/agent/websocket/simple/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ await agentClient.Subscribe(new EventHandler<ErrorResponse>((sender, e) =>
settingsConfiguration.Context.Messages = new List<object> {};
settingsConfiguration.Context.Replay = false;
settingsConfiguration.Agent.Listen.Model = "nova-3";
settingsConfiguration.Agent.Listen.Keyterm = new List<string> { "Deepgram" };
settingsConfiguration.Agent.Listen.Keyterms = new List<string> { "Deepgram" };

bool bConnected = await agentClient.Connect(settingsConfiguration);
if (!bConnected)
Expand Down

0 comments on commit 86c1716

Please sign in to comment.