mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 08:57:59 +00:00
Added a semantic search tool (#1005)
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
This commit is contained in:
1 parent
4baf21656a
commit
1eaca9b12f
91 files changed
+4248
-487
No files matched your search
@@ -86,8 +86,13 @@ public sealed class ProviderAnthropic() : BaseProvider(LLMProviders.ANTHROPIC, n
|
||||
var providerSettings = this.CreateSettingsProvider(chatModel);
|
||||
var runnableTools = toolRegistry is null
|
||||
? []
|
||||
: await toolRegistry.GetRunnableToolsAsync(providerSettings, chatThread.RuntimeComponent, chatThread.RuntimeSelectedToolIds,
|
||||
this.Provider.GetConfidence(settingsManager).Level, chatThread.MayRunTools(settingsManager));
|
||||
: await toolRegistry.GetRunnableToolsAsync(new ToolResolutionContext
|
||||
{
|
||||
Provider = providerSettings,
|
||||
Component = chatThread.RuntimeComponent,
|
||||
ProviderConfidence = this.Provider.GetConfidence(settingsManager).Level,
|
||||
ChatThread = chatThread,
|
||||
}, chatThread.RuntimeSelectedToolIds, chatThread.MayRunTools(settingsManager), token);
|
||||
|
||||
var systemPrompt = chatThread.PrepareSystemPrompt(settingsManager, runnableTools.Select(x => x.Definition));
|
||||
if (toolExecutor is not null && runnableTools.Count > 0)
|
||||
|
||||
@@ -1314,11 +1314,16 @@ public abstract class BaseProvider : IProvider, ISecretId
|
||||
{
|
||||
var providerSettings = this.CreateSettingsProvider(chatModel);
|
||||
var runnableTools = await toolRegistry.GetRunnableToolsAsync(
|
||||
providerSettings,
|
||||
chatThread.RuntimeComponent,
|
||||
new ToolResolutionContext
|
||||
{
|
||||
Provider = providerSettings,
|
||||
Component = chatThread.RuntimeComponent,
|
||||
ProviderConfidence = this.Provider.GetConfidence(settingsManager).Level,
|
||||
ChatThread = chatThread,
|
||||
},
|
||||
chatThread.RuntimeSelectedToolIds,
|
||||
this.Provider.GetConfidence(settingsManager).Level,
|
||||
chatThread.MayRunTools(settingsManager));
|
||||
chatThread.MayRunTools(settingsManager),
|
||||
token);
|
||||
|
||||
systemPrompt = new TextMessage
|
||||
{
|
||||
@@ -1387,15 +1392,8 @@ public abstract class BaseProvider : IProvider, ISecretId
|
||||
yield return content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes this provider instance with the given model as configured provider settings.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Anything asking about model capabilities must go through this, because the expert
|
||||
/// capability overrides live on the settings object: a provider that builds its own settings
|
||||
/// instance without them silently ignores what the user configured.
|
||||
/// </remarks>
|
||||
protected AIStudio.Settings.Provider CreateSettingsProvider(Model chatModel) => new()
|
||||
/// <inheritdoc />
|
||||
public AIStudio.Settings.Provider CreateSettingsProvider(Model chatModel) => new()
|
||||
{
|
||||
UsedLLMProvider = this.Provider,
|
||||
Model = chatModel,
|
||||
|
||||
@@ -44,7 +44,22 @@ public interface IProvider
|
||||
/// This capability may differ by provider type, host, or modality.
|
||||
/// </summary>
|
||||
public bool HasModelLoadingCapability { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Describes this provider instance with the given model as configured provider settings.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Anything asking about model capabilities must go through this, because the expert
|
||||
/// capability overrides live on the settings object: a provider that builds its own settings
|
||||
/// instance without them silently ignores what the user configured.<br/><br/>
|
||||
/// Whoever decides something on behalf of a request asks with these as well, so that both come
|
||||
/// to the same answer. The RAG process, for instance, leaves the searching of the data sources
|
||||
/// to Semantic Search only when the request is going to offer that tool.
|
||||
/// </remarks>
|
||||
/// <param name="chatModel">The model to describe the provider with.</param>
|
||||
/// <returns>The settings of this provider instance with that model.</returns>
|
||||
public AIStudio.Settings.Provider CreateSettingsProvider(Model chatModel);
|
||||
|
||||
/// <summary>
|
||||
/// Starts a chat completion stream.
|
||||
/// </summary>
|
||||
|
||||
@@ -25,6 +25,9 @@ public class NoProvider : IProvider
|
||||
|
||||
public bool HasModelLoadingCapability => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public AIStudio.Settings.Provider CreateSettingsProvider(Model chatModel) => AIStudio.Settings.Provider.NONE;
|
||||
|
||||
public Task<ModelLoadResult> GetTextModels(string? apiKeyProvisional = null, CancellationToken token = default) => Task.FromResult(ModelLoadResult.FromModels([]));
|
||||
|
||||
public Task<ModelLoadResult> GetImageModels(string? apiKeyProvisional = null, CancellationToken token = default) => Task.FromResult(ModelLoadResult.FromModels([]));
|
||||
|
||||
@@ -191,11 +191,16 @@ public sealed class ProviderOpenAI() : BaseProvider(LLMProviders.OPEN_AI, new Ur
|
||||
IReadOnlyList<(ToolDefinition Definition, IToolImplementation Implementation)> runnableTools = toolRegistry is null
|
||||
? []
|
||||
: await toolRegistry.GetRunnableToolsAsync(
|
||||
providerSettings,
|
||||
chatThread.RuntimeComponent,
|
||||
new ToolResolutionContext
|
||||
{
|
||||
Provider = providerSettings,
|
||||
Component = chatThread.RuntimeComponent,
|
||||
ProviderConfidence = providerConfidence,
|
||||
ChatThread = chatThread,
|
||||
},
|
||||
chatThread.RuntimeSelectedToolIds,
|
||||
providerConfidence,
|
||||
chatThread.MayRunTools(settingsManager));
|
||||
chatThread.MayRunTools(settingsManager),
|
||||
token);
|
||||
|
||||
var toolAwareDefinitions = toolExecutor is null
|
||||
? Enumerable.Empty<ToolDefinition>()
|
||||
|
||||
Reference in new issue
Block a user