mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 23:07:23 +00:00
Allowed the Batch Processing assistant to process images (#1087)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
5d6e48ef93
commit
e019c24ea2
19 files changed
+429
-31
No files matched your search
@@ -288,6 +288,27 @@ public static class LLMProvidersExtensions
|
||||
_ => false,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The largest image file, in bytes, which the provider accepts in a request, where it states one.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The limit belongs to the API of the provider, not to the model: the same model may accept
|
||||
/// larger images through another provider. What we actually send is asked through
|
||||
/// IImageSourceExtensions.MaxImageSizeBytesFor, which also applies our own limit.
|
||||
/// </remarks>
|
||||
/// <param name="llmProvider">The provider to check.</param>
|
||||
/// <returns>The size limit of one image file, or null when the provider states none we know of.</returns>
|
||||
public static long? GetMaxImageSizeBytes(this LLMProviders llmProvider) => llmProvider switch
|
||||
{
|
||||
//
|
||||
// Anthropic accepts at most 5 MiB (5,242,880 bytes) of base64 per image. Base64 needs four
|
||||
// characters for every three bytes, which leaves 3,932,160 bytes for the image file itself:
|
||||
//
|
||||
LLMProviders.ANTHROPIC => 3_932_160,
|
||||
|
||||
_ => null,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new provider instance based on the provider value.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user