autogen/dotnet/test/AutoGen.Anthropic.Tests/AnthropicTestUtils.cs

17 lines
612 B
C#
Raw Normal View History

// Copyright (c) Microsoft Corporation. All rights reserved.
// AnthropicTestUtils.cs
2024-06-10 13:32:33 -04:00
namespace AutoGen.Anthropic.Tests;
public static class AnthropicTestUtils
{
public static string ApiKey => Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY") ??
throw new Exception("Please set ANTHROPIC_API_KEY environment variable.");
2024-06-10 13:32:33 -04:00
public static async Task<string> Base64FromImageAsync(string imageName)
{
return Convert.ToBase64String(
await File.ReadAllBytesAsync(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "images", imageName)));
}
}