mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 11:18:00 +00:00
Let the Assistant Builder generate launchers without a workspace
This commit is contained in:
5 files changed
+22
-9
No files matched your search
@@ -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) ||
|
||||
|
||||
Reference in new issue
Block a user