mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-07-07 11:06:28 +00:00
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 / 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
39 lines
2.1 KiB
C#
39 lines
2.1 KiB
C#
namespace AIStudio.Assistants.Builder;
|
|
|
|
public enum LuaResponseParseError
|
|
{
|
|
NONE,
|
|
MISSING_JSON_OBJECT,
|
|
INVALID_JSON,
|
|
EMPTY_JSON_OBJECT,
|
|
UNSUPPORTED_SCHEMA_VERSION,
|
|
MISSING_PLUGIN_METADATA,
|
|
MISSING_ASSISTANT_METADATA,
|
|
INCOMPLETE_PLUGIN_METADATA,
|
|
INCOMPLETE_ASSISTANT_METADATA,
|
|
MISSING_LUA,
|
|
LUA_MISSING_ID,
|
|
}
|
|
|
|
public static class LuaResponseParseErrorExtension
|
|
{
|
|
private static string TB(string fallbackEN) => Tools.PluginSystem.I18N.I.T(fallbackEN, typeof(LuaResponseParseErrorExtension).Namespace, nameof(LuaResponseParseErrorExtension));
|
|
|
|
public static string GetMessage(this LuaResponseParseError parseError, string technicalDetails) => parseError switch
|
|
{
|
|
LuaResponseParseError.MISSING_JSON_OBJECT => TB("The model response is missing or unreadable."),
|
|
LuaResponseParseError.INVALID_JSON => string.IsNullOrWhiteSpace(technicalDetails)
|
|
? TB("The model returned an invalid response.")
|
|
: string.Format(TB("The model returned an invalid response: {0}"), technicalDetails),
|
|
LuaResponseParseError.EMPTY_JSON_OBJECT => TB("The model returned an empty JSON object."),
|
|
LuaResponseParseError.UNSUPPORTED_SCHEMA_VERSION => TB("The model responded with an unsupported or deprecated JSON schema."),
|
|
LuaResponseParseError.MISSING_PLUGIN_METADATA => TB("The model's answer is missing the plugin metadata."),
|
|
LuaResponseParseError.MISSING_ASSISTANT_METADATA => TB("The model's answer is missing the assistant metadata."),
|
|
LuaResponseParseError.INCOMPLETE_PLUGIN_METADATA => TB("The model's answer contains incomplete plugin metadata."),
|
|
LuaResponseParseError.INCOMPLETE_ASSISTANT_METADATA => TB("The model's answer contains incomplete assistant metadata."),
|
|
LuaResponseParseError.MISSING_LUA => TB("The model response does not contain the generated Lua plugin code."),
|
|
LuaResponseParseError.LUA_MISSING_ID => TB("The generated Lua plugin code does not contain a readable plugin ID."),
|
|
_ => TB("The model returned an unusable JSON response."),
|
|
};
|
|
}
|