Skip to content

Commit

Permalink
Initial AgentAPI for EA
Browse files Browse the repository at this point in the history
  • Loading branch information
dvonthenen committed Nov 4, 2024
1 parent 86b27b7 commit 67a7e48
Show file tree
Hide file tree
Showing 46 changed files with 2,106 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Deepgram.Dev.sln
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Streaming", "tests\edge_cas
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speak", "tests\edge_cases\tts_v1_client_example\Speak.csproj", "{AB053DDA-2487-476C-9793-A50C37F10CCA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "agent", "agent", "{B7C828E2-1CDB-4F78-9AB7-CA2180795DF4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "websocket", "websocket", "{B254E451-B210-4A01-8854-DA03AC2A1065}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "simple", "simple", "{FB6A2238-DD9A-4A47-B723-C173F2D2E31C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Agent", "examples\agent\websocket\simple\Agent.csproj", "{332347AC-E1D8-4B5D-A26F-50975AEF1F4F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -327,6 +335,10 @@ Global
{AB053DDA-2487-476C-9793-A50C37F10CCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB053DDA-2487-476C-9793-A50C37F10CCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB053DDA-2487-476C-9793-A50C37F10CCA}.Release|Any CPU.Build.0 = Release|Any CPU
{332347AC-E1D8-4B5D-A26F-50975AEF1F4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{332347AC-E1D8-4B5D-A26F-50975AEF1F4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{332347AC-E1D8-4B5D-A26F-50975AEF1F4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{332347AC-E1D8-4B5D-A26F-50975AEF1F4F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -412,6 +424,10 @@ Global
{5CEEB2F0-F284-4BB3-8999-6E91151C0C06} = {1280E66D-A375-422A-ACB4-48F17E9C190E}
{964A87B4-31F8-4D68-AE64-64E66C9959FD} = {0BF29CA2-1CD6-4FF0-BC7B-B33C6B41E9A1}
{AB053DDA-2487-476C-9793-A50C37F10CCA} = {5CEEB2F0-F284-4BB3-8999-6E91151C0C06}
{B7C828E2-1CDB-4F78-9AB7-CA2180795DF4} = {C673DFD1-528A-4BAE-94E6-02EF058AC363}
{B254E451-B210-4A01-8854-DA03AC2A1065} = {B7C828E2-1CDB-4F78-9AB7-CA2180795DF4}
{FB6A2238-DD9A-4A47-B723-C173F2D2E31C} = {B254E451-B210-4A01-8854-DA03AC2A1065}
{332347AC-E1D8-4B5D-A26F-50975AEF1F4F} = {FB6A2238-DD9A-4A47-B723-C173F2D2E31C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8D4ABC6D-7126-4EE2-9303-43A954616B2A}
Expand Down
18 changes: 18 additions & 0 deletions Deepgram/AgentWebSocketClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2021-2024 Deepgram .NET SDK contributors. All Rights Reserved.
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

using Deepgram.Clients.Agent.v2.WebSocket;
using Deepgram.Models.Authenticate.v1;

namespace Deepgram;

/// <summary>
/// Implements the latest supported version of the Agent Client.
/// </summary>
public class AgentWebSocketClient : Client
{
public AgentWebSocketClient(string apiKey = "", DeepgramWsClientOptions? deepgramClientOptions = null) : base(apiKey, deepgramClientOptions)
{
}
}
20 changes: 20 additions & 0 deletions Deepgram/ClientFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ namespace Deepgram;

public static class ClientFactory
{
/// <summary>
/// Create a new AgentWebSocketClient using the latest version
/// </summary>
/// <param name="apiKey"></param>
/// <param name="options"></param>
/// <returns></returns>
public static V2.IAgentWebSocketClient CreateAgentWebSocketClient(string apiKey = "", DeepgramWsClientOptions? options = null)
{
return new AgentWebSocketClient(apiKey, options);
}

/// <summary>
/// Create a new AnalyzeClient
/// </summary>
Expand Down Expand Up @@ -108,6 +119,15 @@ public static V2.ISpeakWebSocketClient CreateSpeakWebSocketClient(string apiKey
/// and the latest version will be renamed to v1.
///

/// <summary>
/// This method allows you to create an AgentClient with a specific version of the client.
/// TODO: this should be revisited at a later time. Opportunity to use reflection to get the type of the client
/// </summary>
public static object CreateAgentWebSocketClient(int version, string apiKey = "", DeepgramWsClientOptions? options = null)
{
return new AgentWebSocketClient(apiKey, options);
}

/// <summary>
/// This method allows you to create an AnalyzeClient with a specific version of the client.
/// TODO: this should be revisited at a later time. Opportunity to use reflection to get the type of the client
Expand Down
Loading

0 comments on commit 67a7e48

Please sign in to comment.