mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-15 03:03:38 +00:00
Let direct chat launchers open disappearing chats (#967)
Some checks are pending
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
Some checks are pending
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:
parent
65a1683b95
commit
828541ce93
@ -23,7 +23,7 @@
|
||||
</MudField>
|
||||
<MudJustifiedText Typo="Typo.body2" Class="mb-3">
|
||||
@(this.createChatLauncher
|
||||
? T("The direct chat launcher tile has no input form of its own. It opens a new chat right away, in the workspace you name below and with the provider, profile, chat template, and data sources you select there.")
|
||||
? T("The direct chat launcher tile has no input form of its own. It opens a new chat right away, with the provider, profile, chat template, and data sources you select below. Name a workspace for that chat, or leave the workspace empty to open a disappearing chat.")
|
||||
: T("The assistant asks users for input through a form and builds its own prompt from it."))
|
||||
</MudJustifiedText>
|
||||
@if (this.createChatLauncher)
|
||||
@ -39,8 +39,7 @@
|
||||
@bind-ProfileId="@this.launcherProfileId"
|
||||
@bind-ChatTemplateId="@this.launcherChatTemplateId"
|
||||
@bind-DataSourceIds="@this.launcherDataSourceIds"
|
||||
@bind-ToolIds="@this.launcherToolIds"
|
||||
ValidateWorkspaceName="@this.ValidateLauncherWorkspaceName"/>
|
||||
@bind-ToolIds="@this.launcherToolIds"/>
|
||||
</MudPaper>
|
||||
}
|
||||
|
||||
|
||||
@ -375,14 +375,6 @@ public partial class AssistantBuilder : AssistantBaseCore<NoSettingsPanel>
|
||||
return null;
|
||||
}
|
||||
|
||||
private string? ValidateLauncherWorkspaceName(string workspaceName)
|
||||
{
|
||||
if (this.createChatLauncher && string.IsNullOrWhiteSpace(workspaceName))
|
||||
return T("Please select or enter a workspace name for the chat launcher.");
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private async Task GenerateAssistantSpec()
|
||||
{
|
||||
await this.Form!.Validate();
|
||||
@ -589,7 +581,8 @@ public partial class AssistantBuilder : AssistantBaseCore<NoSettingsPanel>
|
||||
// The description stays required for both kinds of assistant. Users who only want a tile
|
||||
// usually flip the switch before typing anything, so the Builder offers a starting point they
|
||||
// can edit or replace. The workspace is picked after that, hence the suggestion is refreshed
|
||||
// whenever the workspace changes:
|
||||
// whenever the workspace changes — including when it is cleared again, which turns the tile
|
||||
// into one that opens a disappearing chat:
|
||||
//
|
||||
private void SuggestLauncherDescription()
|
||||
{
|
||||
@ -597,8 +590,9 @@ public partial class AssistantBuilder : AssistantBaseCore<NoSettingsPanel>
|
||||
return;
|
||||
|
||||
var suggestion = T("Create a tile that opens a preconfigured chat directly, without an input form of its own.");
|
||||
if (!string.IsNullOrWhiteSpace(this.launcherWorkspaceName))
|
||||
suggestion = $"{suggestion} {string.Format(T("Workspace: {0}"), this.launcherWorkspaceName.Trim())}";
|
||||
suggestion = string.IsNullOrWhiteSpace(this.launcherWorkspaceName)
|
||||
? $"{suggestion} {T("The chat opens as a disappearing chat, without a workspace.")}"
|
||||
: $"{suggestion} {string.Format(T("Workspace: {0}"), this.launcherWorkspaceName.Trim())}";
|
||||
|
||||
this.assistantDescription = suggestion;
|
||||
this.descriptionSuggestion = suggestion;
|
||||
|
||||
@ -2,6 +2,10 @@ namespace AIStudio.Assistants.Builder;
|
||||
|
||||
internal sealed class AssistantBuilderChatLaunchMetadata
|
||||
{
|
||||
/// <summary>
|
||||
/// The workspace the chat is created in. A model leaves this field out for a launcher that
|
||||
/// opens a chat without a workspace, which is why it stays empty rather than null.
|
||||
/// </summary>
|
||||
public string WorkspaceName { get; init; } = string.Empty;
|
||||
public string? ProviderId { get; init; }
|
||||
public string? ProfileId { get; init; }
|
||||
|
||||
@ -131,11 +131,9 @@
|
||||
"chatLaunch": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"workspace_name"
|
||||
],
|
||||
"properties": {
|
||||
"workspace_name": {
|
||||
"description": "Omit this field for a launcher that opens a chat without a workspace.",
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
|
||||
@ -124,7 +124,12 @@ internal sealed partial class LuaResponse
|
||||
|
||||
private static bool IsValidChatLaunchMetadata(AssistantBuilderChatLaunchMetadata? launch)
|
||||
{
|
||||
if (launch is null || string.IsNullOrWhiteSpace(launch.WorkspaceName))
|
||||
//
|
||||
// A missing workspace name describes a launcher that opens a chat without a workspace, so
|
||||
// only the launch block itself is mandatory here. Whether the name matches the plugin the
|
||||
// model wrote is decided later, by comparing both.
|
||||
//
|
||||
if (launch is null)
|
||||
return false;
|
||||
|
||||
if (!IsOptionalGuid(launch.ProviderId, allowEmpty: false) ||
|
||||
|
||||
@ -751,6 +751,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1428868592"]
|
||||
-- Tile title (optional)
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T145442870"] = "Tile title (optional)"
|
||||
|
||||
-- The direct chat launcher tile has no input form of its own. It opens a new chat right away, with the provider, profile, chat template, and data sources you select below. Name a workspace for that chat, or leave the workspace empty to open a disappearing chat.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1455505413"] = "The direct chat launcher tile has no input form of its own. It opens a new chat right away, with the provider, profile, chat template, and data sources you select below. Name a workspace for that chat, or leave the workspace empty to open a disappearing chat."
|
||||
|
||||
-- Additional changes (Optional)
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1502888752"] = "Additional changes (Optional)"
|
||||
|
||||
@ -763,6 +766,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1517869254"]
|
||||
-- An expected user prompt, e.g. summarize this document
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1565792607"] = "An expected user prompt, e.g. summarize this document"
|
||||
|
||||
-- The chat opens as a disappearing chat, without a workspace.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1621773509"] = "The chat opens as a disappearing chat, without a workspace."
|
||||
|
||||
-- Return to the original assistant description. The current draft and the plugin preview will be discarded.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1622920412"] = "Return to the original assistant description. The current draft and the plugin preview will be discarded."
|
||||
|
||||
@ -919,9 +925,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T3843866124"]
|
||||
-- Install assistant
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T3863433088"] = "Install assistant"
|
||||
|
||||
-- The direct chat launcher tile has no input form of its own. It opens a new chat right away, in the workspace you name below and with the provider, profile, chat template, and data sources you select there.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T395398616"] = "The direct chat launcher tile has no input form of its own. It opens a new chat right away, in the workspace you name below and with the provider, profile, chat template, and data sources you select there."
|
||||
|
||||
-- Assistant draft
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T3957423852"] = "Assistant draft"
|
||||
|
||||
@ -943,9 +946,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T4217647404"]
|
||||
-- Please create an assistant draft first.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T4269176489"] = "Please create an assistant draft first."
|
||||
|
||||
-- Please select or enter a workspace name for the chat launcher.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T4396903"] = "Please select or enter a workspace name for the chat launcher."
|
||||
|
||||
-- The assistant asks users for input through a form and builds its own prompt from it.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T451049798"] = "The assistant asks users for input through a form and builds its own prompt from it."
|
||||
|
||||
@ -3955,6 +3955,12 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T1286170698"] = "
|
||||
-- Chat provider
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T1648955896"] = "Chat provider"
|
||||
|
||||
-- The tile opens its chat in this workspace and creates the workspace when it does not exist yet.
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T1797236585"] = "The tile opens its chat in this workspace and creates the workspace when it does not exist yet."
|
||||
|
||||
-- Workspace name (Optional)
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T1873204484"] = "Workspace name (Optional)"
|
||||
|
||||
-- Use no profile
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T2205839602"] = "Use no profile"
|
||||
|
||||
@ -3973,12 +3979,12 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T2886517443"] = "
|
||||
-- Choose an existing workspace or enter a name that should be created when the launcher is opened.
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T2901190527"] = "Choose an existing workspace or enter a name that should be created when the launcher is opened."
|
||||
|
||||
-- Workspace name
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T295876489"] = "Workspace name"
|
||||
|
||||
-- Data sources (Optional)
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T3259309302"] = "Data sources (Optional)"
|
||||
|
||||
-- Without a workspace, the tile opens a disappearing chat: it belongs to no workspace and is deleted according to your workspace maintenance settings.
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T3611496116"] = "Without a workspace, the tile opens a disappearing chat: it belongs to no workspace and is deleted according to your workspace maintenance settings."
|
||||
|
||||
-- Use the normal chat data source defaults
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T3898572329"] = "Use the normal chat data source defaults"
|
||||
|
||||
@ -6319,9 +6325,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T3688254408"]
|
||||
-- the required provider confidence level
|
||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T818422588"] = "the required provider confidence level"
|
||||
|
||||
-- Please select or enter a workspace name for this tile.
|
||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DIRECTCHATLAUNCHERSETTINGSDIALOG::T1505747232"] = "Please select or enter a workspace name for this tile."
|
||||
|
||||
-- Resulting Lua plugin
|
||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DIRECTCHATLAUNCHERSETTINGSDIALOG::T1671332249"] = "Resulting Lua plugin"
|
||||
|
||||
@ -11179,6 +11182,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T1
|
||||
-- Failed to parse the UI render tree from the ASSISTANT lua table.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T1318499252"] = "Failed to parse the UI render tree from the ASSISTANT lua table."
|
||||
|
||||
-- The ASSISTANT table contains a WorkspaceName for LaunchBehavior 'OPEN_TEMPORARY_CHAT'. A chat without a workspace cannot have one.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T1331424201"] = "The ASSISTANT table contains a WorkspaceName for LaunchBehavior 'OPEN_TEMPORARY_CHAT'. A chat without a workspace cannot have one."
|
||||
|
||||
-- The provided ASSISTANT lua table does not contain a valid UI table.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T1841068402"] = "The provided ASSISTANT lua table does not contain a valid UI table."
|
||||
|
||||
|
||||
@ -10,7 +10,15 @@
|
||||
</MudSelect>
|
||||
}
|
||||
|
||||
<MudTextField T="string" Text="@this.WorkspaceName" TextChanged="@this.SetWorkspaceName" Validation="@this.ValidateWorkspaceName" AdornmentIcon="@Icons.Material.Filled.CreateNewFolder" Adornment="Adornment.Start" IconSize="Size.Small" Label="@T("Workspace name")" HelperText="@T("Choose an existing workspace or enter a name that should be created when the launcher is opened.")" Variant="Variant.Outlined" Margin="Margin.Dense" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
|
||||
<MudTextField T="string" Text="@this.WorkspaceName" TextChanged="@this.SetWorkspaceName" AdornmentIcon="@(this.OpensTemporaryChat ? Icons.Material.Filled.Timer : Icons.Material.Filled.CreateNewFolder)" Adornment="Adornment.Start" IconSize="Size.Small" Label="@T("Workspace name (Optional)")" HelperText="@T("Choose an existing workspace or enter a name that should be created when the launcher is opened.")" Variant="Variant.Outlined" Margin="Margin.Dense" Class="mb-1" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
|
||||
|
||||
@* The tile behaves differently with and without a workspace, so the form says which of the two is
|
||||
chosen right now instead of only explaining that both are possible. *@
|
||||
<MudText Typo="Typo.body2" Class="mud-text-secondary mb-3">
|
||||
@(this.OpensTemporaryChat
|
||||
? T("Without a workspace, the tile opens a disappearing chat: it belongs to no workspace and is deleted according to your workspace maintenance settings.")
|
||||
: T("The tile opens its chat in this workspace and creates the workspace when it does not exist yet."))
|
||||
</MudText>
|
||||
<MudSelect T="string" Value="@this.ProviderId" ValueChanged="@this.SetProviderId" Label="@T("Chat provider")" Variant="Variant.Outlined" Margin="Margin.Dense" Class="mb-3 rounded-lg" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.SmartToy">
|
||||
<MudSelectItem T="string" Value="@string.Empty">@T("Use chat default")</MudSelectItem>
|
||||
@foreach (var provider in this.SettingsManager.GetConfidentProviders(Components.CHAT))
|
||||
|
||||
@ -3,8 +3,9 @@ using Microsoft.AspNetCore.Components;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
/// <summary>
|
||||
/// The selection a direct chat launcher needs: the workspace its chat is created in, and the
|
||||
/// provider, profile, chat template, and data sources that chat starts with.
|
||||
/// The selection a direct chat launcher needs: the workspace its chat is created in — or no
|
||||
/// workspace, for a disappearing chat — and the provider, profile, chat template, and data sources
|
||||
/// that chat starts with.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The Assistant Builder uses this form to describe a launcher it is about to generate, while the
|
||||
@ -15,7 +16,8 @@ public partial class DirectChatLauncherForm : MSGComponentBase
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the workspace the launcher opens its chat in. The workspace is created when it
|
||||
/// does not exist yet, hence this is a free-text field and not a workspace ID.
|
||||
/// does not exist yet, hence this is a free-text field and not a workspace ID. An empty name is
|
||||
/// a choice of its own: the launcher then opens a disappearing chat.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string WorkspaceName { get; set; } = string.Empty;
|
||||
@ -75,11 +77,9 @@ public partial class DirectChatLauncherForm : MSGComponentBase
|
||||
public EventCallback<HashSet<string>> ToolIdsChanged { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Validates the workspace name. The hosts differ here: the Builder requires a name only while
|
||||
/// its launcher switch is on, whereas the settings dialog always requires one.
|
||||
/// Whether the launcher currently describes a chat without a workspace.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Func<string, string?>? ValidateWorkspaceName { get; set; }
|
||||
private bool OpensTemporaryChat => string.IsNullOrWhiteSpace(this.WorkspaceName);
|
||||
|
||||
private IReadOnlyList<WorkspaceTreeWorkspace> availableWorkspaces = [];
|
||||
|
||||
|
||||
@ -32,8 +32,7 @@
|
||||
@bind-ProfileId="@this.profileId"
|
||||
@bind-ChatTemplateId="@this.chatTemplateId"
|
||||
@bind-DataSourceIds="@this.dataSourceIds"
|
||||
@bind-ToolIds="@this.toolIds"
|
||||
ValidateWorkspaceName="@this.ValidateWorkspaceName"/>
|
||||
@bind-ToolIds="@this.toolIds"/>
|
||||
</MudPaper>
|
||||
</MudForm>
|
||||
|
||||
|
||||
@ -152,7 +152,9 @@ public partial class DirectChatLauncherSettingsDialog : MSGComponentBase
|
||||
|
||||
//
|
||||
// An empty selection means "use the chat defaults" and is left out of the plugin, whereas
|
||||
// the empty GUID explicitly selects no profile or no chat template:
|
||||
// the empty GUID explicitly selects no profile or no chat template. Clearing the workspace
|
||||
// name is a change of its own: the tile then opens a disappearing chat, and the writer
|
||||
// switches the launch behavior accordingly.
|
||||
//
|
||||
return new(
|
||||
this.workspaceName.Trim(),
|
||||
@ -248,8 +250,6 @@ public partial class DirectChatLauncherSettingsDialog : MSGComponentBase
|
||||
|
||||
private string? ValidateDescription(string value) => string.IsNullOrWhiteSpace(value) ? T("Please provide a description for this tile.") : null;
|
||||
|
||||
private string? ValidateWorkspaceName(string value) => string.IsNullOrWhiteSpace(value) ? T("Please select or enter a workspace name for this tile.") : null;
|
||||
|
||||
private void Cancel() => this.MudDialog.Cancel();
|
||||
|
||||
private static Guid? ParseOptionalGuid(string value) => Guid.TryParse(value, out var parsed) ? parsed : null;
|
||||
|
||||
@ -82,7 +82,7 @@ Each assistant plugin lives in its own directory under the assistants plugin roo
|
||||
## Structure
|
||||
- `ASSISTANT` is the root table. Every assistant requires `Title` and `Description`.
|
||||
- Form assistants additionally require `SystemPrompt`, `SubmitText`, `AllowProfiles`, and a nested `UI` definition.
|
||||
- Direct chat launchers instead require `LaunchBehavior = "OPEN_WORKSPACE_CHAT_BY_NAME"` and `WorkspaceName`. AI Studio stops reading the form-only fields as soon as a launch behavior is active, so older launchers that still carry them keep working.
|
||||
- Direct chat launchers instead require a `LaunchBehavior`: either `"OPEN_WORKSPACE_CHAT_BY_NAME"` together with a `WorkspaceName`, or `"OPEN_TEMPORARY_CHAT"` for a chat that belongs to no workspace. AI Studio stops reading the form-only fields as soon as a launch behavior is active, so older launchers that still carry them keep working.
|
||||
- `ToolIds` is optional for both kinds and names the tools the assistant runs with, such as `{"web_search"}`. When present, it must list at least one unique, non-empty tool ID; omit the field instead of writing an empty list. For a form assistant, naming tools takes the choice away from users: the tool selection disappears, and the assistant always runs with exactly these tools. For a launcher, the tools are merely preselected and users may change them once the chat is open. Naming a tool is a wish, not a permission: a tool switched off in the settings stays off, one whose settings are incomplete cannot run, and every tool still has to meet the confidence requirements of the provider in use. A tool ID unknown to the installation is skipped.
|
||||
- `DEPLOYED_USING_CONFIG_SERVER` identifies who manages the assistant plugin. Set it to `false` for locally managed plugins. A missing field is also treated as local for compatibility with existing plugins. Enterprise-distributed plugins must set it to `true` and cannot be revised with AI in AI Studio.
|
||||
- `AI_STUDIO_ASSISTANT_BUILDER = {Generated = true, SchemaVersion = 1}` is reserved for plugins generated by the AI Studio Assistant Builder. It enables Builder-specific actions such as safe deletion and must not be added to manually authored or enterprise-distributed assistants. Newly generated Builder assistants always set `DEPLOYED_USING_CONFIG_SERVER = false` explicitly.
|
||||
@ -108,8 +108,8 @@ ASSISTANT = {
|
||||
}
|
||||
```
|
||||
|
||||
## Direct Launch to Workspace Chat
|
||||
Assistant plugins can optionally skip the normal assistant page and open a chat directly from the tile.
|
||||
## Direct Launch into a Chat
|
||||
Assistant plugins can optionally skip the normal assistant page and open a chat directly from the tile. The chat either lives in a workspace or in none at all; everything else about the two behaviors is the same.
|
||||
|
||||
```lua
|
||||
ASSISTANT = {
|
||||
@ -130,8 +130,21 @@ ASSISTANT = {
|
||||
}
|
||||
```
|
||||
|
||||
A launcher without a workspace uses the other behavior and omits `WorkspaceName`. Every optional chat selection shown above works here as well:
|
||||
|
||||
```lua
|
||||
ASSISTANT = {
|
||||
["Title"] = "Quick Question",
|
||||
["Description"] = "Open a disappearing chat with your research profile.",
|
||||
["LaunchBehavior"] = "OPEN_TEMPORARY_CHAT",
|
||||
["ProfileId"] = "22222222-2222-2222-2222-222222222222", -- optional
|
||||
}
|
||||
```
|
||||
|
||||
- `WorkspaceName` is resolved case-insensitively after trimming.
|
||||
- If the workspace does not exist yet, AI Studio creates it automatically.
|
||||
- Use `OPEN_TEMPORARY_CHAT` when the chat needs no home of its own, for instance, a quick start that only preselects a profile and a few data sources. AI Studio then opens the same disappearing chat the chat page offers: it is kept apart from the workspaces and cleaned up according to the workspace maintenance settings of the installation.
|
||||
- `OPEN_TEMPORARY_CHAT` must not carry a `WorkspaceName`. A name next to it stops the plugin from loading rather than being ignored, so a leftover or mistyped name cannot silently turn a workspace launcher into a disappearing one.
|
||||
- Omitted optional IDs use the chat defaults active when the tile is opened. An explicit empty GUID selects no profile or no chat template; an empty provider or data-source GUID is invalid.
|
||||
- `ProviderId` overrides both the chat-specific and app-wide default provider. It must name a provider that is permitted for chats at the required confidence level.
|
||||
- Explicit data sources are enabled and manually preselected, automatic source selection is disabled, and the normal automatic-validation setting is retained. Every referenced source must currently be available and permitted for the effective provider.
|
||||
|
||||
@ -444,7 +444,8 @@ ASSISTANT = {
|
||||
},
|
||||
}
|
||||
|
||||
-- direct chat launcher example; form-only fields and UI are not used in this mode:
|
||||
-- direct chat launcher example opening the chat in a workspace; form-only fields and UI are not
|
||||
-- used in this mode:
|
||||
ASSISTANT = {
|
||||
["Title"] = "<main title of chat launcher>",
|
||||
["Description"] = "<description of the chat that will be opened>",
|
||||
@ -464,3 +465,15 @@ ASSISTANT = {
|
||||
"<optional tool ID>",
|
||||
},
|
||||
}
|
||||
|
||||
-- direct chat launcher example without a workspace: the tile opens a disappearing chat, which is
|
||||
-- kept apart from the workspaces and cleaned up according to the workspace maintenance settings.
|
||||
-- A WorkspaceName next to this launch behavior is an error instead of being ignored, so a leftover
|
||||
-- name cannot silently change the kind of chat the tile opens. Every optional field of the example
|
||||
-- above works here as well:
|
||||
ASSISTANT = {
|
||||
["Title"] = "<main title of chat launcher>",
|
||||
["Description"] = "<description of the chat that will be opened>",
|
||||
["LaunchBehavior"] = "OPEN_TEMPORARY_CHAT",
|
||||
["ProfileId"] = "<optional profile GUID; use the empty GUID for no profile>",
|
||||
}
|
||||
|
||||
@ -753,6 +753,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1428868592"]
|
||||
-- Tile title (optional)
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T145442870"] = "Kacheltitel (optional)"
|
||||
|
||||
-- The direct chat launcher tile has no input form of its own. It opens a new chat right away, with the provider, profile, chat template, and data sources you select below. Name a workspace for that chat, or leave the workspace empty to open a disappearing chat.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1455505413"] = "Die Kachel für den Chat-Schnellstart verfügt über kein eigenes Eingabeformular. Sie öffnet einen neuen Chat – mit dem Anbieter, Profil, der Chat-Vorlage und den Datenquellen, die Sie unten auswählen. Benennen Sie einen Arbeitsbereich für diesen Chat oder lassen Sie den Arbeitsbereich leer, um einen selbstlöschenden Chat zu öffnen."
|
||||
|
||||
-- Additional changes (Optional)
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1502888752"] = "Zusätzliche Änderungen (optional)"
|
||||
|
||||
@ -765,6 +768,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1517869254"]
|
||||
-- An expected user prompt, e.g. summarize this document
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1565792607"] = "Eine erwartete Nutzereingabe, z. B. „Fasse dieses Dokument zusammen“"
|
||||
|
||||
-- The chat opens as a disappearing chat, without a workspace.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1621773509"] = "Der Chat wird ohne Arbeitsbereich als selbstlöschender Chat geöffnet."
|
||||
|
||||
-- Return to the original assistant description. The current draft and the plugin preview will be discarded.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1622920412"] = "Zur ursprünglichen Beschreibung des Assistenten zurückkehren. Der aktuelle Entwurf und die Plugin-Vorschau werden verworfen."
|
||||
|
||||
@ -921,9 +927,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T3843866124"]
|
||||
-- Install assistant
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T3863433088"] = "Assistent installieren"
|
||||
|
||||
-- The direct chat launcher tile has no input form of its own. It opens a new chat right away, in the workspace you name below and with the provider, profile, chat template, and data sources you select there.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T395398616"] = "Die Kachel für den direkten Chat-Schnellstart hat kein eigenes Eingabeformular. Sie öffnet sofort einen neuen Chat – im unten benannten Arbeitsbereich und mit dem dort ausgewählten Anbieter, Profil, der Chat-Vorlage und den Datenquellen."
|
||||
|
||||
-- Assistant draft
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T3957423852"] = "Assistentenentwurf"
|
||||
|
||||
@ -945,9 +948,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T4217647404"]
|
||||
-- Please create an assistant draft first.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T4269176489"] = "Bitte erstellen Sie zuerst einen Entwurf für einen Assistenten."
|
||||
|
||||
-- Please select or enter a workspace name for the chat launcher.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T4396903"] = "Bitte wählen Sie einen Namen für den Arbeitsbereich des Chat-Schnellstarts aus oder geben Sie einen ein."
|
||||
|
||||
-- The assistant asks users for input through a form and builds its own prompt from it.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T451049798"] = "Der Assistent fragt Nutzer über ein Formular nach Eingaben und erstellt daraus seinen eigenen Prompt."
|
||||
|
||||
@ -3957,6 +3957,12 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T1286170698"] = "
|
||||
-- Chat provider
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T1648955896"] = "Chat-Anbieter"
|
||||
|
||||
-- The tile opens its chat in this workspace and creates the workspace when it does not exist yet.
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T1797236585"] = "Die Kachel öffnet ihren Chat in diesem Arbeitsbereich oder erstellt den Arbeitsbereich, falls er noch nicht existiert."
|
||||
|
||||
-- Workspace name (Optional)
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T1873204484"] = "Name des Arbeitsbereichs (optional)"
|
||||
|
||||
-- Use no profile
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T2205839602"] = "Kein Profil verwenden"
|
||||
|
||||
@ -3975,12 +3981,12 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T2886517443"] = "
|
||||
-- Choose an existing workspace or enter a name that should be created when the launcher is opened.
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T2901190527"] = "Wählen Sie einen vorhandenen Arbeitsbereich aus oder geben Sie einen Namen ein, der beim Verwenden des Chat-Schnellstarts erstellt werden soll."
|
||||
|
||||
-- Workspace name
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T295876489"] = "Name des Arbeitsbereichs"
|
||||
|
||||
-- Data sources (Optional)
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T3259309302"] = "Datenquellen (optional)"
|
||||
|
||||
-- Without a workspace, the tile opens a disappearing chat: it belongs to no workspace and is deleted according to your workspace maintenance settings.
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T3611496116"] = "Ohne Arbeitsbereich öffnet die Kachel einen selbstlöschenden Chat: Er gehört keinem Arbeitsbereich an und wird gemäß den Wartungseinstellungen für Ihre Arbeitsbereiche gelöscht."
|
||||
|
||||
-- Use the normal chat data source defaults
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T3898572329"] = "Die Standardwerte der Datenquelle für den normalen Chat verwenden"
|
||||
|
||||
@ -6321,9 +6327,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T3688254408"]
|
||||
-- the required provider confidence level
|
||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T818422588"] = "das erforderliche Vertrauensniveau des Anbieters"
|
||||
|
||||
-- Please select or enter a workspace name for this tile.
|
||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DIRECTCHATLAUNCHERSETTINGSDIALOG::T1505747232"] = "Bitte wählen Sie einen Namen für den Arbeitsbereich für diese Kachel aus oder geben Sie einen ein."
|
||||
|
||||
-- Resulting Lua plugin
|
||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DIRECTCHATLAUNCHERSETTINGSDIALOG::T1671332249"] = "Resultierendes Lua-Plugin"
|
||||
|
||||
@ -11181,6 +11184,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T1
|
||||
-- Failed to parse the UI render tree from the ASSISTANT lua table.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T1318499252"] = "Der UI-Render-Baum konnte nicht aus der ASSISTANT-Lua-Tabelle geparst werden."
|
||||
|
||||
-- The ASSISTANT table contains a WorkspaceName for LaunchBehavior 'OPEN_TEMPORARY_CHAT'. A chat without a workspace cannot have one.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T1331424201"] = "Die Tabelle ASSISTANT enthält für LaunchBehavior „OPEN_TEMPORARY_CHAT“ einen WorkspaceName. Ein Chat ohne Arbeitsbereich kann keinen haben."
|
||||
|
||||
-- The provided ASSISTANT lua table does not contain a valid UI table.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T1841068402"] = "Die bereitgestellte ASSISTANT-Lua-Tabelle enthält keine gültige UI-Tabelle."
|
||||
|
||||
|
||||
@ -753,6 +753,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1428868592"]
|
||||
-- Tile title (optional)
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T145442870"] = "Tile title (optional)"
|
||||
|
||||
-- The direct chat launcher tile has no input form of its own. It opens a new chat right away, with the provider, profile, chat template, and data sources you select below. Name a workspace for that chat, or leave the workspace empty to open a disappearing chat.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1455505413"] = "The direct chat launcher tile has no input form of its own. It opens a new chat right away, with the provider, profile, chat template, and data sources you select below. Name a workspace for that chat, or leave the workspace empty to open a disappearing chat."
|
||||
|
||||
-- Additional changes (Optional)
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1502888752"] = "Additional changes (Optional)"
|
||||
|
||||
@ -765,6 +768,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1517869254"]
|
||||
-- An expected user prompt, e.g. summarize this document
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1565792607"] = "An expected user prompt, e.g. summarize this document"
|
||||
|
||||
-- The chat opens as a disappearing chat, without a workspace.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1621773509"] = "The chat opens as a disappearing chat, without a workspace."
|
||||
|
||||
-- Return to the original assistant description. The current draft and the plugin preview will be discarded.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T1622920412"] = "Return to the original assistant description. The current draft and the plugin preview will be discarded."
|
||||
|
||||
@ -921,9 +927,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T3843866124"]
|
||||
-- Install assistant
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T3863433088"] = "Install assistant"
|
||||
|
||||
-- The direct chat launcher tile has no input form of its own. It opens a new chat right away, in the workspace you name below and with the provider, profile, chat template, and data sources you select there.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T395398616"] = "The direct chat launcher tile has no input form of its own. It opens a new chat right away, in the workspace you name below and with the provider, profile, chat template, and data sources you select there."
|
||||
|
||||
-- Assistant draft
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T3957423852"] = "Assistant draft"
|
||||
|
||||
@ -945,9 +948,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T4217647404"]
|
||||
-- Please create an assistant draft first.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T4269176489"] = "Please create an assistant draft first."
|
||||
|
||||
-- Please select or enter a workspace name for the chat launcher.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T4396903"] = "Please select or enter a workspace name for the chat launcher."
|
||||
|
||||
-- The assistant asks users for input through a form and builds its own prompt from it.
|
||||
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BUILDER::ASSISTANTBUILDER::T451049798"] = "The assistant asks users for input through a form and builds its own prompt from it."
|
||||
|
||||
@ -3957,6 +3957,12 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T1286170698"] = "
|
||||
-- Chat provider
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T1648955896"] = "Chat provider"
|
||||
|
||||
-- The tile opens its chat in this workspace and creates the workspace when it does not exist yet.
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T1797236585"] = "The tile opens its chat in this workspace and creates the workspace when it does not exist yet."
|
||||
|
||||
-- Workspace name (Optional)
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T1873204484"] = "Workspace name (Optional)"
|
||||
|
||||
-- Use no profile
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T2205839602"] = "Use no profile"
|
||||
|
||||
@ -3975,12 +3981,12 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T2886517443"] = "
|
||||
-- Choose an existing workspace or enter a name that should be created when the launcher is opened.
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T2901190527"] = "Choose an existing workspace or enter a name that should be created when the launcher is opened."
|
||||
|
||||
-- Workspace name
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T295876489"] = "Workspace name"
|
||||
|
||||
-- Data sources (Optional)
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T3259309302"] = "Data sources (Optional)"
|
||||
|
||||
-- Without a workspace, the tile opens a disappearing chat: it belongs to no workspace and is deleted according to your workspace maintenance settings.
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T3611496116"] = "Without a workspace, the tile opens a disappearing chat: it belongs to no workspace and is deleted according to your workspace maintenance settings."
|
||||
|
||||
-- Use the normal chat data source defaults
|
||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DIRECTCHATLAUNCHERFORM::T3898572329"] = "Use the normal chat data source defaults"
|
||||
|
||||
@ -6321,9 +6327,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T3688254408"]
|
||||
-- the required provider confidence level
|
||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T818422588"] = "the required provider confidence level"
|
||||
|
||||
-- Please select or enter a workspace name for this tile.
|
||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DIRECTCHATLAUNCHERSETTINGSDIALOG::T1505747232"] = "Please select or enter a workspace name for this tile."
|
||||
|
||||
-- Resulting Lua plugin
|
||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DIRECTCHATLAUNCHERSETTINGSDIALOG::T1671332249"] = "Resulting Lua plugin"
|
||||
|
||||
@ -11181,6 +11184,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T1
|
||||
-- Failed to parse the UI render tree from the ASSISTANT lua table.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T1318499252"] = "Failed to parse the UI render tree from the ASSISTANT lua table."
|
||||
|
||||
-- The ASSISTANT table contains a WorkspaceName for LaunchBehavior 'OPEN_TEMPORARY_CHAT'. A chat without a workspace cannot have one.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T1331424201"] = "The ASSISTANT table contains a WorkspaceName for LaunchBehavior 'OPEN_TEMPORARY_CHAT'. A chat without a workspace cannot have one."
|
||||
|
||||
-- The provided ASSISTANT lua table does not contain a valid UI table.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T1841068402"] = "The provided ASSISTANT lua table does not contain a valid UI table."
|
||||
|
||||
|
||||
@ -1,4 +1,12 @@
|
||||
namespace AIStudio.Tools.PluginSystem.Assistants;
|
||||
|
||||
/// <param name="WorkspaceName">The workspace the chat is created in. An empty name means the launcher opens a chat without a workspace, which the app shows as a disappearing chat.</param>
|
||||
/// <param name="ToolIds">The tools preselected for the chat, or null when the launcher names none.</param>
|
||||
public sealed record AssistantChatLaunchConfiguration(string WorkspaceName, Guid? ProviderId, Guid? ProfileId, Guid? ChatTemplateId, IReadOnlyList<Guid>? DataSourceIds, IReadOnlyList<string>? ToolIds);
|
||||
public sealed record AssistantChatLaunchConfiguration(string WorkspaceName, Guid? ProviderId, Guid? ProfileId, Guid? ChatTemplateId, IReadOnlyList<Guid>? DataSourceIds, IReadOnlyList<string>? ToolIds)
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether the launcher opens a chat that belongs to no workspace. The missing workspace name is
|
||||
/// the whole condition, so the launch behavior and the written plugin follow from it.
|
||||
/// </summary>
|
||||
public bool OpensTemporaryChat => string.IsNullOrWhiteSpace(this.WorkspaceName);
|
||||
}
|
||||
|
||||
@ -4,4 +4,5 @@ public enum AssistantPluginLaunchBehavior
|
||||
{
|
||||
NONE,
|
||||
OPEN_WORKSPACE_CHAT_BY_NAME,
|
||||
OPEN_TEMPORARY_CHAT,
|
||||
}
|
||||
|
||||
@ -165,8 +165,18 @@ public static class DirectChatLauncherLuaWriter
|
||||
builder.AppendLine("ASSISTANT = {");
|
||||
builder.AppendLine($" [\"Title\"] = \"{Escape(definition.Title)}\",");
|
||||
builder.AppendLine($" [\"Description\"] = \"{Escape(definition.Description)}\",");
|
||||
builder.AppendLine($" [\"LaunchBehavior\"] = \"{nameof(AssistantPluginLaunchBehavior.OPEN_WORKSPACE_CHAT_BY_NAME)}\",");
|
||||
builder.AppendLine($" [\"WorkspaceName\"] = \"{Escape(definition.Launch.WorkspaceName.Trim())}\",");
|
||||
//
|
||||
// The behavior follows from the workspace rather than being tracked next to it. A launcher
|
||||
// without one has no name to write, and the plugin loader rejects a WorkspaceName there, so
|
||||
// the field is left out the same way the optional IDs below are:
|
||||
//
|
||||
if (definition.Launch.OpensTemporaryChat)
|
||||
builder.AppendLine($" [\"LaunchBehavior\"] = \"{nameof(AssistantPluginLaunchBehavior.OPEN_TEMPORARY_CHAT)}\",");
|
||||
else
|
||||
{
|
||||
builder.AppendLine($" [\"LaunchBehavior\"] = \"{nameof(AssistantPluginLaunchBehavior.OPEN_WORKSPACE_CHAT_BY_NAME)}\",");
|
||||
builder.AppendLine($" [\"WorkspaceName\"] = \"{Escape(definition.Launch.WorkspaceName.Trim())}\",");
|
||||
}
|
||||
|
||||
//
|
||||
// Omitted IDs mean "use the chat defaults", while an empty GUID explicitly selects no
|
||||
|
||||
@ -223,38 +223,61 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType
|
||||
if (launchBehavior is AssistantPluginLaunchBehavior.NONE)
|
||||
return true;
|
||||
|
||||
//
|
||||
// Both launch behaviors describe the same chat and differ only in where it is kept, so only
|
||||
// the workspace is read per behavior. Everything else follows below, for both of them:
|
||||
//
|
||||
var workspaceName = string.Empty;
|
||||
switch (launchBehavior)
|
||||
{
|
||||
case AssistantPluginLaunchBehavior.OPEN_WORKSPACE_CHAT_BY_NAME:
|
||||
if (!assistantTable.TryGetValue("WorkspaceName", out var workspaceNameValue) ||
|
||||
!workspaceNameValue.TryRead<string>(out var workspaceName))
|
||||
!workspaceNameValue.TryRead<string>(out var configuredWorkspaceName))
|
||||
{
|
||||
message = TB("The ASSISTANT table contains the LaunchBehavior 'OPEN_WORKSPACE_CHAT_BY_NAME' but no valid WorkspaceName.");
|
||||
return false;
|
||||
}
|
||||
|
||||
workspaceName = workspaceName.Trim();
|
||||
workspaceName = configuredWorkspaceName.Trim();
|
||||
if (string.IsNullOrWhiteSpace(workspaceName))
|
||||
{
|
||||
message = TB("The ASSISTANT table contains an empty WorkspaceName for LaunchBehavior 'OPEN_WORKSPACE_CHAT_BY_NAME'.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!TryReadOptionalGuid(assistantTable, "ProviderId", false, out var providerId, out message) ||
|
||||
!TryReadOptionalGuid(assistantTable, "ProfileId", true, out var profileId, out message) ||
|
||||
!TryReadOptionalGuid(assistantTable, "ChatTemplateId", true, out var chatTemplateId, out message) ||
|
||||
!TryReadOptionalDataSourceIds(assistantTable, out var dataSourceIds, out message) ||
|
||||
!TryReadOptionalToolIds(assistantTable, out var toolIds, out message))
|
||||
break;
|
||||
|
||||
//
|
||||
// A chat without a workspace has no name to carry, so one written here can only be a
|
||||
// mistake. We reject it rather than dropping it silently: a misspelled LaunchBehavior
|
||||
// would otherwise turn a workspace launcher into a disappearing one, and the author
|
||||
// would only notice it by the chats going missing.
|
||||
//
|
||||
case AssistantPluginLaunchBehavior.OPEN_TEMPORARY_CHAT:
|
||||
if (assistantTable.TryGetValue("WorkspaceName", out var unexpectedWorkspaceNameValue) &&
|
||||
unexpectedWorkspaceNameValue.TryRead<string>(out var unexpectedWorkspaceName) &&
|
||||
!string.IsNullOrWhiteSpace(unexpectedWorkspaceName))
|
||||
{
|
||||
message = TB("The ASSISTANT table contains a WorkspaceName for LaunchBehavior 'OPEN_TEMPORARY_CHAT'. A chat without a workspace cannot have one.");
|
||||
return false;
|
||||
}
|
||||
|
||||
this.ChatLaunchConfiguration = new(workspaceName, providerId, profileId, chatTemplateId, dataSourceIds, toolIds);
|
||||
|
||||
return true;
|
||||
break;
|
||||
|
||||
default:
|
||||
message = TB("The ASSISTANT table contains an unsupported LaunchBehavior value.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!TryReadOptionalGuid(assistantTable, "ProviderId", false, out var providerId, out message) ||
|
||||
!TryReadOptionalGuid(assistantTable, "ProfileId", true, out var profileId, out message) ||
|
||||
!TryReadOptionalGuid(assistantTable, "ChatTemplateId", true, out var chatTemplateId, out message) ||
|
||||
!TryReadOptionalDataSourceIds(assistantTable, out var dataSourceIds, out message) ||
|
||||
!TryReadOptionalToolIds(assistantTable, out var toolIds, out message))
|
||||
return false;
|
||||
|
||||
this.ChatLaunchConfiguration = new(workspaceName, providerId, profileId, chatTemplateId, dataSourceIds, toolIds);
|
||||
return true;
|
||||
}
|
||||
|
||||
private static bool TryReadOptionalGuid(LuaTable assistantTable, string fieldName, bool allowEmpty, out Guid? id, out string message)
|
||||
|
||||
@ -3,7 +3,7 @@ namespace AIStudio.Tools.Services;
|
||||
/// <summary>
|
||||
/// The chat a direct chat launcher tile opens, as chosen in the Assistant Builder.
|
||||
/// </summary>
|
||||
/// <param name="WorkspaceName">The workspace the chat is created in.</param>
|
||||
/// <param name="WorkspaceName">The workspace the chat is created in; an empty name opens a chat without a workspace instead.</param>
|
||||
/// <param name="ProviderId">The provider to preselect, or null for the chat default.</param>
|
||||
/// <param name="ProfileId">The profile to preselect; the empty GUID selects no profile.</param>
|
||||
/// <param name="ChatTemplateId">The chat template to preselect; the empty GUID selects none.</param>
|
||||
|
||||
@ -358,6 +358,7 @@ public sealed class AssistantPluginGenerationService(ToolRegistry toolRegistry,
|
||||
- Write description as one sentence that says which chat this tile opens and what it is for. Do not describe an input form, a prompt, or a submit button, because a launcher has none.
|
||||
- Write all three texts in the language of the approved draft.
|
||||
- Do not mention workspace names, provider names, profile names, template names, data source IDs, or tool IDs in any of the three texts.
|
||||
- When the chat launch names no workspace, the tile opens a chat that belongs to no workspace and disappears again. You may say the chat is temporary, but never invent a workspace name.
|
||||
- Do not return Markdown, code fences, explanations, or text outside the JSON object.
|
||||
""";
|
||||
|
||||
@ -512,6 +513,7 @@ public sealed class AssistantPluginGenerationService(ToolRegistry toolRegistry,
|
||||
- Explain omitted provider, profile, template, data-source, or tool values as using the normal chat defaults.
|
||||
- In the {{TB("Tools")}} section, say what the preselected tools let the chat do and that users may change the selection once the chat is open.
|
||||
- Explain the empty profile/template GUID as explicitly selecting no profile/template.
|
||||
- When the ChatLaunch names no workspace, write in the {{TB("Workspace")}} section that the tile opens a chat without a workspace: it is kept among the temporary chats and is deleted by the maintenance the user configured for them. Never invent a workspace name.
|
||||
- Do not propose UI components, submit behavior, BuildPrompt, or a plugin SystemPrompt for a chat launcher.
|
||||
""";
|
||||
|
||||
@ -620,10 +622,11 @@ public sealed class AssistantPluginGenerationService(ToolRegistry toolRegistry,
|
||||
- Keep TYPE = "ASSISTANT".
|
||||
- Keep the assistant locally managed. DEPLOYED_USING_CONFIG_SERVER must not be true.
|
||||
{{builderMetadataRule}}
|
||||
- Set assistant.kind to "CHAT_LAUNCHER" exactly when the revised ASSISTANT table uses LaunchBehavior = "OPEN_WORKSPACE_CHAT_BY_NAME"; otherwise set it to "FORM".
|
||||
- Set assistant.kind to "CHAT_LAUNCHER" exactly when the revised ASSISTANT table uses LaunchBehavior = "OPEN_WORKSPACE_CHAT_BY_NAME" or "OPEN_TEMPORARY_CHAT"; otherwise set it to "FORM".
|
||||
- For a form assistant, include system_prompt, submit_text, and allow_ai_studio_profiles in the JSON assistant object and omit launch. Include tool_ids exactly when the revised ASSISTANT table carries ToolIds.
|
||||
- Change ASSISTANT.ToolIds only when the requested change asks for it. Use only tool IDs from the "Available tools" list in the plugin context for tools you add; never invent an ID. Drop the field entirely rather than writing an empty list.
|
||||
- For a chat launcher, include launch with the exact WorkspaceName and optional ProviderId, ProfileId, ChatTemplateId, DataSourceIds, and ToolIds values from the revised ASSISTANT table; omit system_prompt, submit_text, and allow_ai_studio_profiles.
|
||||
- For a chat launcher, include launch with the optional ProviderId, ProfileId, ChatTemplateId, DataSourceIds, and ToolIds values from the revised ASSISTANT table; omit system_prompt, submit_text, and allow_ai_studio_profiles. Include workspace_name with the exact WorkspaceName exactly when the table uses OPEN_WORKSPACE_CHAT_BY_NAME, and omit it for OPEN_TEMPORARY_CHAT.
|
||||
- Keep the LaunchBehavior a launcher already has unless the requested change asks to add or drop its workspace. OPEN_WORKSPACE_CHAT_BY_NAME requires a WorkspaceName, and OPEN_TEMPORARY_CHAT must not carry one.
|
||||
- A chat launcher must not include SystemPrompt, SubmitText, AllowProfiles, BuildPrompt, or UI in its ASSISTANT table.
|
||||
- Preserve an empty profile or template GUID when it explicitly means no profile or no template. Do not emit empty provider or data-source GUIDs.
|
||||
- Preserve existing behavior unless the requested change explicitly modifies it.
|
||||
@ -757,8 +760,11 @@ public sealed class AssistantPluginGenerationService(ToolRegistry toolRegistry,
|
||||
if (launch is null)
|
||||
return true;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(launch.WorkspaceName) ||
|
||||
!IsOptionalGuid(launch.ProviderId, allowEmpty: false) ||
|
||||
//
|
||||
// No workspace name is a choice rather than a gap: the launcher then opens a chat that
|
||||
// belongs to no workspace. Only the remaining fields have a shape to check.
|
||||
//
|
||||
if (!IsOptionalGuid(launch.ProviderId, allowEmpty: false) ||
|
||||
!IsOptionalGuid(launch.ProfileId, allowEmpty: true) ||
|
||||
!IsOptionalGuid(launch.ChatTemplateId, allowEmpty: true))
|
||||
return false;
|
||||
|
||||
@ -50,21 +50,29 @@ public sealed class DirectChatService(SettingsManager settingsManager, DataSourc
|
||||
if (dataSourceOptions is null)
|
||||
return new(null, dataSourceOptionsResult.ErrorMessage);
|
||||
|
||||
Guid workspaceId;
|
||||
try
|
||||
//
|
||||
// A launcher that names no workspace wants the same chat the chat page starts on its own:
|
||||
// one that belongs nowhere, is kept among the temporary chats, and disappears with them. The
|
||||
// empty workspace ID is what says so, here as everywhere else in the app.
|
||||
//
|
||||
var workspaceId = Guid.Empty;
|
||||
if (!launchConfiguration.OpensTemporaryChat)
|
||||
{
|
||||
workspaceId = await WorkspaceBehaviour.ResolveOrCreateWorkspaceIdByNameAsync(launchConfiguration.WorkspaceName);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
logger.LogError(exception, "Assistant plugin '{PluginName}' could not resolve or create workspace '{WorkspaceName}'.", assistantPlugin.Name, launchConfiguration.WorkspaceName);
|
||||
return new(null, string.Format(TB("The workspace '{0}' could not be opened or created."), launchConfiguration.WorkspaceName));
|
||||
}
|
||||
try
|
||||
{
|
||||
workspaceId = await WorkspaceBehaviour.ResolveOrCreateWorkspaceIdByNameAsync(launchConfiguration.WorkspaceName);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
logger.LogError(exception, "Assistant plugin '{PluginName}' could not resolve or create workspace '{WorkspaceName}'.", assistantPlugin.Name, launchConfiguration.WorkspaceName);
|
||||
return new(null, string.Format(TB("The workspace '{0}' could not be opened or created."), launchConfiguration.WorkspaceName));
|
||||
}
|
||||
|
||||
if (workspaceId == Guid.Empty)
|
||||
{
|
||||
logger.LogWarning("Assistant plugin '{PluginName}' could not resolve or create workspace '{WorkspaceName}'.", assistantPlugin.Name, launchConfiguration.WorkspaceName);
|
||||
return new(null, string.Format(TB("The workspace '{0}' could not be opened or created."), launchConfiguration.WorkspaceName));
|
||||
if (workspaceId == Guid.Empty)
|
||||
{
|
||||
logger.LogWarning("Assistant plugin '{PluginName}' could not resolve or create workspace '{WorkspaceName}'.", assistantPlugin.Name, launchConfiguration.WorkspaceName);
|
||||
return new(null, string.Format(TB("The workspace '{0}' could not be opened or created."), launchConfiguration.WorkspaceName));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@ -36,6 +36,8 @@
|
||||
- Fixed the web address staying in the field when you reset an assistant that loads content from a web page.
|
||||
- Fixed the web address being gone when you leave such an assistant and come back to it later.
|
||||
- Fixed the Visual Briefing Assistant (in preview) not scrolling, which put everything below the window edge out of reach and made the assistant unusable. The briefing preview is now shown at its intended size inside its frame, and switching between the desktop, tablet, and mobile view changes its width as it should.
|
||||
- Fixed exported answers losing their sources. When an answer is based on web pages a tool read or on documents of your own, the exported file now lists those sources, in every format AI Studio writes.
|
||||
- Fixed exported answers losing their sources. When an answer is based on web pages a tool read or on documents of your own, the exported file now lists those sources in every format AI Studio writes.
|
||||
- Fixed the copy button leaving the sources behind. Copy an answer, and its sources come along.
|
||||
- Fixed a tile that opens a chat directly always demanding a workspace. Leave the workspace empty in the Assistant Builder, and the tile opens a disappearing chat instead.
|
||||
- Fixed the same restriction for plugin authors: a direct-chat launcher can now open a chat without naming a workspace. The example assistant plugin shows both ways.
|
||||
- Upgraded the Visual Briefing Assistant (in preview) from the prototype to the beta state. The assistant is now completely implemented and is undergoing a deeper testing phase in preparation for release. To try it, open the app settings, allow preview features down to beta, and then enable the Visual Briefing Assistant there.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user