image.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package llm
  2. import (
  3. "yunion.io/x/jsonutils"
  4. "yunion.io/x/onecloud/pkg/apis"
  5. "yunion.io/x/onecloud/pkg/mcclient/options"
  6. )
  7. type LLMImageShowOptions struct {
  8. options.BaseShowOptions
  9. }
  10. func (o *LLMImageShowOptions) Params() (jsonutils.JSONObject, error) {
  11. return options.ListStructToParams(o)
  12. }
  13. type LLMImageListOptions struct {
  14. options.BaseListOptions
  15. LLMType string `json:"llm_type" choices:"ollama|dify|comfyui|vllm" help:"filter by llm type"`
  16. }
  17. func (o *LLMImageListOptions) Params() (jsonutils.JSONObject, error) {
  18. return options.ListStructToParams(o)
  19. }
  20. type LLMImageCreateOptions struct {
  21. apis.SharableVirtualResourceCreateInput
  22. IMAGE_NAME string `json:"image_name"`
  23. IMAGE_LABEL string `json:"image_label"`
  24. CredentialId string `json:"credential_id"`
  25. LLM_TYPE string `json:"llm_type" choices:"ollama|dify|comfyui|vllm" help:"llm type: ollama, comfyui or dify"`
  26. }
  27. func (o *LLMImageCreateOptions) Params() (jsonutils.JSONObject, error) {
  28. return jsonutils.Marshal(o), nil
  29. }
  30. type LLMImageUpdateOptions struct {
  31. apis.SharableVirtualResourceBaseUpdateInput
  32. ID string
  33. ImageName string `json:"image_name"`
  34. ImageLabel string `json:"image_label"`
  35. CredentialId string `json:"credential_id"`
  36. LlmType string `json:"llm_type" choices:"ollama|dify|vllm|comfyui" help:"llm type: ollama, comfyui, vllm or dify"`
  37. }
  38. func (o *LLMImageUpdateOptions) GetId() string {
  39. return o.ID
  40. }
  41. func (o *LLMImageUpdateOptions) Params() (jsonutils.JSONObject, error) {
  42. return jsonutils.Marshal(o), nil
  43. }
  44. type LLMImageDeleteOptions struct {
  45. options.BaseIdOptions
  46. }
  47. func (o *LLMImageDeleteOptions) GetId() string {
  48. return o.ID
  49. }