constant.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package model
  2. // Common Role constants (used across different API formats)
  3. const (
  4. RoleSystem = "system"
  5. RoleUser = "user"
  6. RoleAssistant = "assistant"
  7. RoleTool = "tool"
  8. )
  9. const (
  10. ContentTypeText = "text"
  11. ContentTypeImageURL = "image_url"
  12. ContentTypeInputAudio = "input_audio"
  13. )
  14. const (
  15. ChatCompletionChunkObject = "chat.completion.chunk"
  16. ChatCompletionObject = "chat.completion"
  17. VideoGenerationJobObject = "video.generation.job"
  18. VideoGenerationObject = "video.generation"
  19. )
  20. type FinishReason = string
  21. const (
  22. FinishReasonStop FinishReason = "stop"
  23. FinishReasonLength FinishReason = "length"
  24. FinishReasonContentFilter FinishReason = "content_filter"
  25. FinishReasonToolCalls FinishReason = "tool_calls"
  26. FinishReasonFunctionCall FinishReason = "function_call"
  27. )
  28. // Tool Choice constants (used in OpenAI API)
  29. const (
  30. ToolChoiceAuto = "auto"
  31. ToolChoiceNone = "none"
  32. ToolChoiceRequired = "required"
  33. ToolChoiceAny = "any"
  34. )
  35. // Tool Choice Type constants
  36. const (
  37. ToolChoiceTypeFunction = "function"
  38. ToolChoiceTypeTool = "tool"
  39. )