12345678910111213141516171819202122232425262728293031323334353637 |
- using UnityEngine;
- using LLM.Editor.Data;
- using LLM.Editor.Helper;
- using JetBrains.Annotations;
- namespace LLM.Editor.Commands
- {
- // Parameters for this command
- [System.Serializable]
- public class DisplayMessageParams
- {
- public string message;
- }
- [UsedImplicitly]
- public class DisplayMessageCommand : ICommand
- {
- private readonly DisplayMessageParams _params;
- public DisplayMessageCommand(string jsonParams)
- {
- _params = jsonParams?.FromJson<DisplayMessageParams>();
- }
- public void Execute(CommandContext context)
- {
- if (_params == null || string.IsNullOrEmpty(_params.message))
- {
- Debug.LogError("[DisplayMessageCommand] Parameters are invalid or message is empty.");
- return;
- }
- // In a real UI, this would render to the chat window.
- // For now, we just log it.
- Debug.Log($"[LLM RESPONSE]: {_params.message}");
- }
- }
- }
|