image.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package llm
  2. import (
  3. "yunion.io/x/pkg/util/sets"
  4. "yunion.io/x/onecloud/pkg/apis"
  5. )
  6. type LLMImageType string
  7. const (
  8. LLM_IMAGE_TYPE_OLLAMA LLMImageType = "ollama"
  9. LLM_IMAGE_TYPE_VLLM LLMImageType = "vllm"
  10. LLM_IMAGE_TYPE_DIFY LLMImageType = "dify"
  11. LLM_IMAGE_TYPE_COMFYUI LLMImageType = "comfyui"
  12. LLM_IMAGE_TYPE_OPENCLAW LLMImageType = "openclaw"
  13. )
  14. var (
  15. LLM_IMAGE_TYPES = sets.NewString(
  16. string(LLM_IMAGE_TYPE_OLLAMA),
  17. string(LLM_IMAGE_TYPE_VLLM),
  18. string(LLM_IMAGE_TYPE_DIFY),
  19. string(LLM_IMAGE_TYPE_COMFYUI),
  20. string(LLM_IMAGE_TYPE_OPENCLAW),
  21. )
  22. )
  23. func IsLLMImageType(t string) bool {
  24. return LLM_IMAGE_TYPES.Has(t)
  25. }
  26. type LLMImageListInput struct {
  27. apis.SharableVirtualResourceListInput
  28. ImageLabel string `json:"image_label"`
  29. ImageName string `json:"image_name"`
  30. LLMType string `json:"llm_type"`
  31. }
  32. type LLMImageCreateInput struct {
  33. apis.SharableVirtualResourceCreateInput
  34. ImageName string `json:"image_name"`
  35. ImageLabel string `json:"image_label"`
  36. CredentialId string `json:"credential_id"`
  37. LLMType string `json:"llm_type"`
  38. }
  39. type LLMImageUpdateInput struct {
  40. apis.SharableVirtualResourceCreateInput
  41. ImageName *string `json:"image_name,omitempty"`
  42. ImageLabel *string `json:"image_label,omitempty"`
  43. CredentialId *string `json:"credential_id,omitempty"`
  44. LLMType *string `json:"llm_type,omitempty"`
  45. }