Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add provider metadata #205

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/MindWork AI Studio/Chat/ContentText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task CreateFromProviderAsync(IProvider provider, SettingsManager se
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.
Expand Down
29 changes: 29 additions & 0 deletions app/MindWork AI Studio/Provider/LLMProvidersExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions app/MindWork AI Studio/wwwroot/changelog/v0.9.19.md
Original file line number Diff line number Diff line change
@@ -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.