ApiPayloads.cs 837 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections.Generic;
  2. namespace LLM.Editor.Api
  3. {
  4. // C# classes that map directly to the JSON structure required by the Gemini API.
  5. [System.Serializable]
  6. public class SystemInstruction
  7. {
  8. public List<Part> parts;
  9. }
  10. [System.Serializable]
  11. public class ApiRequest
  12. {
  13. public List<Content> contents;
  14. public SystemInstruction system_instruction;
  15. }
  16. [System.Serializable]
  17. public class Content
  18. {
  19. public string role;
  20. public List<Part> parts;
  21. }
  22. [System.Serializable]
  23. public class Part
  24. {
  25. public string text;
  26. }
  27. [System.Serializable]
  28. public class ApiResponse
  29. {
  30. public List<Candidate> candidates;
  31. }
  32. [System.Serializable]
  33. public class Candidate
  34. {
  35. public Content content;
  36. }
  37. }