2024-05-24 12:37:16 -04:00
|
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
// AnthropicTestUtils.cs
|
|
|
|
|
|
2024-06-10 13:32:33 -04:00
|
|
|
|
namespace AutoGen.Anthropic.Tests;
|
2024-05-24 12:37:16 -04:00
|
|
|
|
|
|
|
|
|
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)));
|
|
|
|
|
}
|
2024-05-24 12:37:16 -04:00
|
|
|
|
}
|