GatherContextParams.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using Newtonsoft.Json.Linq;
  2. using System.Collections.Generic;
  3. namespace LLM.Editor.Commands
  4. {
  5. /// <summary>
  6. /// Defines the parameters for the GatherContextCommand. It contains a list
  7. /// of specific data requests the LLM wants to be fulfilled.
  8. /// </summary>
  9. [System.Serializable]
  10. public class GatherContextParams
  11. {
  12. public List<ContextRequest> requests = new();
  13. }
  14. /// <summary>
  15. /// Represents a single, specific request for a piece of information about the project.
  16. /// </summary>
  17. [System.Serializable]
  18. public class ContextRequest
  19. {
  20. /// <summary>
  21. /// A key provided by the LLM to uniquely identify this piece of data in the final response dictionary.
  22. /// e.g., "launcherRigidbody"
  23. /// </summary>
  24. public string contextKey;
  25. /// <summary>
  26. /// The identifier for the object of interest. This can be an InstanceID, a GUID, an asset path, or a name.
  27. /// e.g., "18354", "a1b2c3d4e5f6", "Assets/Scripts/Player.cs"
  28. /// </summary>
  29. public string subjectIdentifier;
  30. /// <summary>
  31. /// The type of data being requested. This determines which Context Provider will be used.
  32. /// e.g., "ComponentData", "SourceCode", "ProjectSettings"
  33. /// </summary>
  34. public string dataType;
  35. /// <summary>
  36. /// An optional qualifier to provide more specific instructions to the data provider.
  37. /// e.g., "UnityEngine.Rigidbody", "Physics", "t:Prefab player"
  38. /// </summary>
  39. public JToken qualifier;
  40. }
  41. }