mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 14:18:00 +00:00
Let direct chat launchers open disappearing chats (#967)
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
65a1683b95
commit
828541ce93
22 files changed
+212
-103
No files matched your search
@@ -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."
|
||||
|
||||
|
||||
Reference in new issue
Block a user