-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #259 from dvonthenen/live-client-helper-funcs
Add Subscribe Interface to Live Client
- Loading branch information
Showing
10 changed files
with
273 additions
and
116 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\Deepgram\Deepgram.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Using Include="Deepgram" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// Copyright 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 System.Text.Json; | ||
|
||
using Deepgram.Logger; | ||
using Deepgram.Models.Manage.v1; | ||
|
||
namespace SampleApp | ||
{ | ||
class Program | ||
{ | ||
static async Task Main(string[] args) | ||
{ | ||
// Initialize Library with default logging | ||
// Normal logging is "Info" level | ||
Library.Initialize(); | ||
// OR very chatty logging | ||
//Library.Initialize(LogLevel.Debug); // LogLevel.Default, LogLevel.Debug, LogLevel.Verbose | ||
|
||
// Set "DEEPGRAM_API_KEY" environment variable to your Deepgram API Key | ||
var deepgramClient = new ManageClient(); | ||
|
||
var response = await deepgramClient.GetProjects(); | ||
if (response == null) | ||
{ | ||
Console.WriteLine("No projects found."); | ||
return; | ||
} | ||
|
||
Console.WriteLine(JsonSerializer.Serialize(response)); | ||
|
||
//var projectId = ""; | ||
//foreach (var project in response.Projects) | ||
//{ | ||
// Console.WriteLine($"Project ID: {project.ProjectId}"); | ||
// projectId = project.ProjectId; | ||
// break; | ||
//} | ||
|
||
//var balanacesResponse = deepgramClient.GetBalances(projectId); | ||
//if (balanacesResponse == null || balanacesResponse.Balances == null) | ||
//{ | ||
// Console.WriteLine("No balance found."); | ||
// return; | ||
//} | ||
|
||
//Console.WriteLine("\n\nBalances:"); | ||
//Console.WriteLine(JsonSerializer.Serialize(balanacesResponse)); | ||
//Console.WriteLine("\n\n"); | ||
|
||
//string balanceId = ""; | ||
//foreach (var balance in balanacesResponse.Balances) | ||
//{ | ||
// Console.WriteLine($"Balance ID: {balance.BalanceId}"); | ||
// balanceId = balance.BalanceId; | ||
// break; | ||
//} | ||
|
||
//var balanaceResponse = deepgramClient.GetBalance(projectId, balanceId); | ||
//if (balanaceResponse == null) | ||
//{ | ||
// Console.WriteLine("No balance found."); | ||
// return; | ||
//} | ||
|
||
//Console.WriteLine("\n\nBalances:"); | ||
//Console.WriteLine(JsonSerializer.Serialize(balanacesResponse)); | ||
//Console.WriteLine("\n\n"); | ||
|
||
Console.WriteLine("Press any key to exit."); | ||
Console.ReadKey(); | ||
|
||
// Teardown Library | ||
Library.Terminate(); | ||
} | ||
} | ||
} |
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.