mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 01:07:21 +00:00
Scaled down and converted images before sending them to AI models (#1101)
This commit is contained in:
1 parent
1c8632bbe0
commit
ba99bf6fae
33 files changed
+1550
-264
No files matched your search
@@ -59,18 +59,16 @@ public sealed class ProviderAnthropic() : BaseProvider(LLMProviders.ANTHROPIC, n
|
||||
Text = text,
|
||||
},
|
||||
|
||||
// Anthropic-specific image sub-content:
|
||||
async attachment => new SubContentImage
|
||||
// Anthropic-specific image sub-content, which takes the base64 and its type apart:
|
||||
image => new SubContentImage
|
||||
{
|
||||
Source = new SubContentBase64Image
|
||||
{
|
||||
Data = await attachment.TryAsBase64(token: token) is (true, var base64Content)
|
||||
? base64Content
|
||||
: string.Empty,
|
||||
|
||||
MediaType = attachment.DetermineMimeType(),
|
||||
Data = image.Base64,
|
||||
MediaType = image.MimeType,
|
||||
}
|
||||
}
|
||||
},
|
||||
token
|
||||
);
|
||||
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user