chore: debug CI failure
This commit is contained in:
@@ -3,10 +3,8 @@ using Xunit.Sdk;
|
|||||||
|
|
||||||
namespace AnthropicClient.Tests.EndToEnd;
|
namespace AnthropicClient.Tests.EndToEnd;
|
||||||
|
|
||||||
public class ClientTests(ConfigurationFixture configFixture, ITestOutputHelper testOutputHelper) : EndToEndTest(configFixture)
|
public class ClientTests(ConfigurationFixture configFixture) : EndToEndTest(configFixture)
|
||||||
{
|
{
|
||||||
private readonly ITestOutputHelper _testOutputHelper = testOutputHelper;
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task CreateMessageAsync_WhenCalled_ItShouldReturnResponse()
|
public async Task CreateMessageAsync_WhenCalled_ItShouldReturnResponse()
|
||||||
{
|
{
|
||||||
@@ -67,16 +65,18 @@ public class ClientTests(ConfigurationFixture configFixture, ITestOutputHelper t
|
|||||||
{
|
{
|
||||||
var imagePath = Path.Combine(Directory.GetCurrentDirectory(), "Files", "elephant.jpg");
|
var imagePath = Path.Combine(Directory.GetCurrentDirectory(), "Files", "elephant.jpg");
|
||||||
var mediaType = "image/jpeg";
|
var mediaType = "image/jpeg";
|
||||||
var imageBytes = await File.ReadAllBytesAsync(imagePath);
|
var imageStream = File.Open(imagePath, FileMode.Open);
|
||||||
var base64Image = Convert.ToBase64String(imageBytes);
|
|
||||||
|
|
||||||
_testOutputHelper.WriteLine(base64Image);
|
byte[] data;
|
||||||
|
using var ms = new MemoryStream();
|
||||||
|
await imageStream.CopyToAsync(ms);
|
||||||
|
data = ms.ToArray();
|
||||||
|
|
||||||
var request = new MessageRequest(
|
var request = new MessageRequest(
|
||||||
model: AnthropicModels.Claude3Haiku,
|
model: AnthropicModels.Claude3Haiku,
|
||||||
messages: [
|
messages: [
|
||||||
new(MessageRole.User, [
|
new(MessageRole.User, [
|
||||||
new ImageContent(mediaType, base64Image),
|
new ImageContent(mediaType, Convert.ToBase64String(data)),
|
||||||
new TextContent("What is in this image?")
|
new TextContent("What is in this image?")
|
||||||
]),
|
]),
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user