Added provider metadata regarding embeddings (#205)

This commit is contained in:
Thorsten Sommer 2024-11-13 20:33:52 +01:00 committed by GitHub
parent 9fa2a1a135
commit f9245d52c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 32 additions and 1 deletions

View File

@ -40,7 +40,7 @@ public sealed class ContentText : IContent
if(chatThread is null)
return;
// Store the last time we got a response. We use this ater
// Store the last time we got a response. We use this later
// to determine whether we should notify the UI about the
// new content or not. Depends on the energy saving mode
// the user chose.

View File

@ -65,6 +65,35 @@ public static class LLMProvidersExtensions
_ => Confidence.UNKNOWN.WithLevel(settingsManager.GetConfiguredConfidenceLevel(llmProvider)),
};
/// <summary>
/// Determines if the specified provider supports embeddings.
/// </summary>
/// <param name="llmProvider">The provider to check.</param>
/// <returns>True if the provider supports embeddings; otherwise, false.</returns>
public static bool ProvideEmbeddings(this LLMProviders llmProvider) => llmProvider switch
{
//
// Providers that support embeddings:
//
LLMProviders.OPEN_AI => true,
LLMProviders.MISTRAL => true,
LLMProviders.GOOGLE => true,
//
// Providers that do not support embeddings:
//
LLMProviders.GROQ => false,
LLMProviders.ANTHROPIC => false,
LLMProviders.FIREWORKS => false,
//
// Self-hosted providers are treated as a special case anyway.
//
LLMProviders.SELF_HOSTED => false,
_ => false,
};
/// <summary>
/// Creates a new provider instance based on the provider value.
/// </summary>

View File

@ -0,0 +1,2 @@
# v0.9.19, build 194 (2024-11-xx xx:xx UTC)
- Added provider's metadata: which providers offer embeddings for RAG? This is in preparation for integrating your data and files.