openai_request.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. package dto
  2. import (
  3. "encoding/json"
  4. "one-api/common"
  5. "strings"
  6. )
  7. type ResponseFormat struct {
  8. Type string `json:"type,omitempty"`
  9. JsonSchema json.RawMessage `json:"json_schema,omitempty"`
  10. }
  11. type FormatJsonSchema struct {
  12. Description string `json:"description,omitempty"`
  13. Name string `json:"name"`
  14. Schema any `json:"schema,omitempty"`
  15. Strict json.RawMessage `json:"strict,omitempty"`
  16. }
  17. type GeneralOpenAIRequest struct {
  18. Model string `json:"model,omitempty"`
  19. Messages []Message `json:"messages,omitempty"`
  20. Prompt any `json:"prompt,omitempty"`
  21. Prefix any `json:"prefix,omitempty"`
  22. Suffix any `json:"suffix,omitempty"`
  23. Stream bool `json:"stream,omitempty"`
  24. StreamOptions *StreamOptions `json:"stream_options,omitempty"`
  25. MaxTokens uint `json:"max_tokens,omitempty"`
  26. MaxCompletionTokens uint `json:"max_completion_tokens,omitempty"`
  27. ReasoningEffort string `json:"reasoning_effort,omitempty"`
  28. Temperature *float64 `json:"temperature,omitempty"`
  29. TopP float64 `json:"top_p,omitempty"`
  30. TopK int `json:"top_k,omitempty"`
  31. Stop any `json:"stop,omitempty"`
  32. N int `json:"n,omitempty"`
  33. Input any `json:"input,omitempty"`
  34. Instruction string `json:"instruction,omitempty"`
  35. Size string `json:"size,omitempty"`
  36. Functions json.RawMessage `json:"functions,omitempty"`
  37. FrequencyPenalty float64 `json:"frequency_penalty,omitempty"`
  38. PresencePenalty float64 `json:"presence_penalty,omitempty"`
  39. ResponseFormat *ResponseFormat `json:"response_format,omitempty"`
  40. EncodingFormat json.RawMessage `json:"encoding_format,omitempty"`
  41. Seed float64 `json:"seed,omitempty"`
  42. ParallelTooCalls *bool `json:"parallel_tool_calls,omitempty"`
  43. Tools []ToolCallRequest `json:"tools,omitempty"`
  44. ToolChoice any `json:"tool_choice,omitempty"`
  45. User string `json:"user,omitempty"`
  46. LogProbs bool `json:"logprobs,omitempty"`
  47. TopLogProbs int `json:"top_logprobs,omitempty"`
  48. Dimensions int `json:"dimensions,omitempty"`
  49. Modalities json.RawMessage `json:"modalities,omitempty"`
  50. Audio json.RawMessage `json:"audio,omitempty"`
  51. EnableThinking any `json:"enable_thinking,omitempty"` // ali
  52. THINKING json.RawMessage `json:"thinking,omitempty"` // doubao
  53. ExtraBody json.RawMessage `json:"extra_body,omitempty"`
  54. SearchParameters any `json:"search_parameters,omitempty"` //xai
  55. WebSearchOptions *WebSearchOptions `json:"web_search_options,omitempty"`
  56. // OpenRouter Params
  57. Usage json.RawMessage `json:"usage,omitempty"`
  58. Reasoning json.RawMessage `json:"reasoning,omitempty"`
  59. // Ali Qwen Params
  60. VlHighResolutionImages json.RawMessage `json:"vl_high_resolution_images,omitempty"`
  61. // 用匿名参数接收额外参数,例如ollama的think参数在此接收
  62. Extra map[string]json.RawMessage `json:"-"`
  63. }
  64. func (r *GeneralOpenAIRequest) ToMap() map[string]any {
  65. result := make(map[string]any)
  66. data, _ := common.Marshal(r)
  67. _ = common.Unmarshal(data, &result)
  68. return result
  69. }
  70. func (r *GeneralOpenAIRequest) GetSystemRoleName() string {
  71. if strings.HasPrefix(r.Model, "o") {
  72. if !strings.HasPrefix(r.Model, "o1-mini") && !strings.HasPrefix(r.Model, "o1-preview") {
  73. return "developer"
  74. }
  75. } else if strings.HasPrefix(r.Model, "gpt-5") {
  76. return "developer"
  77. }
  78. return "system"
  79. }
  80. type ToolCallRequest struct {
  81. ID string `json:"id,omitempty"`
  82. Type string `json:"type"`
  83. Function FunctionRequest `json:"function"`
  84. }
  85. type FunctionRequest struct {
  86. Description string `json:"description,omitempty"`
  87. Name string `json:"name"`
  88. Parameters any `json:"parameters,omitempty"`
  89. Arguments string `json:"arguments,omitempty"`
  90. }
  91. type StreamOptions struct {
  92. IncludeUsage bool `json:"include_usage,omitempty"`
  93. }
  94. func (r *GeneralOpenAIRequest) GetMaxTokens() uint {
  95. if r.MaxCompletionTokens != 0 {
  96. return r.MaxCompletionTokens
  97. }
  98. return r.MaxTokens
  99. }
  100. func (r *GeneralOpenAIRequest) ParseInput() []string {
  101. if r.Input == nil {
  102. return nil
  103. }
  104. var input []string
  105. switch r.Input.(type) {
  106. case string:
  107. input = []string{r.Input.(string)}
  108. case []any:
  109. input = make([]string, 0, len(r.Input.([]any)))
  110. for _, item := range r.Input.([]any) {
  111. if str, ok := item.(string); ok {
  112. input = append(input, str)
  113. }
  114. }
  115. }
  116. return input
  117. }
  118. type Message struct {
  119. Role string `json:"role"`
  120. Content any `json:"content"`
  121. Name *string `json:"name,omitempty"`
  122. Prefix *bool `json:"prefix,omitempty"`
  123. ReasoningContent string `json:"reasoning_content,omitempty"`
  124. Reasoning string `json:"reasoning,omitempty"`
  125. ToolCalls json.RawMessage `json:"tool_calls,omitempty"`
  126. ToolCallId string `json:"tool_call_id,omitempty"`
  127. parsedContent []MediaContent
  128. //parsedStringContent *string
  129. }
  130. func (m *Message) MarshalJSON() ([]byte, error) {
  131. if m.Content == nil {
  132. m.Content = ""
  133. }
  134. type Alias Message
  135. return json.Marshal((*Alias)(m))
  136. }
  137. type MediaContent struct {
  138. Type string `json:"type"`
  139. Text string `json:"text,omitempty"`
  140. ImageUrl any `json:"image_url,omitempty"`
  141. InputAudio any `json:"input_audio,omitempty"`
  142. File any `json:"file,omitempty"`
  143. VideoUrl any `json:"video_url,omitempty"`
  144. // OpenRouter Params
  145. CacheControl json.RawMessage `json:"cache_control,omitempty"`
  146. }
  147. func (m *MediaContent) GetImageMedia() *MessageImageUrl {
  148. if m.ImageUrl != nil {
  149. if _, ok := m.ImageUrl.(*MessageImageUrl); ok {
  150. return m.ImageUrl.(*MessageImageUrl)
  151. }
  152. if itemMap, ok := m.ImageUrl.(map[string]any); ok {
  153. out := &MessageImageUrl{
  154. Url: common.Interface2String(itemMap["url"]),
  155. Detail: common.Interface2String(itemMap["detail"]),
  156. MimeType: common.Interface2String(itemMap["mime_type"]),
  157. }
  158. return out
  159. }
  160. }
  161. return nil
  162. }
  163. func (m *MediaContent) GetInputAudio() *MessageInputAudio {
  164. if m.InputAudio != nil {
  165. if _, ok := m.InputAudio.(*MessageInputAudio); ok {
  166. return m.InputAudio.(*MessageInputAudio)
  167. }
  168. if itemMap, ok := m.InputAudio.(map[string]any); ok {
  169. out := &MessageInputAudio{
  170. Data: common.Interface2String(itemMap["data"]),
  171. Format: common.Interface2String(itemMap["format"]),
  172. }
  173. return out
  174. }
  175. }
  176. return nil
  177. }
  178. func (m *MediaContent) GetFile() *MessageFile {
  179. if m.File != nil {
  180. if _, ok := m.File.(*MessageFile); ok {
  181. return m.File.(*MessageFile)
  182. }
  183. if itemMap, ok := m.File.(map[string]any); ok {
  184. out := &MessageFile{
  185. FileName: common.Interface2String(itemMap["file_name"]),
  186. FileData: common.Interface2String(itemMap["file_data"]),
  187. FileId: common.Interface2String(itemMap["file_id"]),
  188. }
  189. return out
  190. }
  191. }
  192. return nil
  193. }
  194. type MessageImageUrl struct {
  195. Url string `json:"url"`
  196. Detail string `json:"detail"`
  197. MimeType string
  198. }
  199. func (m *MessageImageUrl) IsRemoteImage() bool {
  200. return strings.HasPrefix(m.Url, "http")
  201. }
  202. type MessageInputAudio struct {
  203. Data string `json:"data"` //base64
  204. Format string `json:"format"`
  205. }
  206. type MessageFile struct {
  207. FileName string `json:"filename,omitempty"`
  208. FileData string `json:"file_data,omitempty"`
  209. FileId string `json:"file_id,omitempty"`
  210. }
  211. type MessageVideoUrl struct {
  212. Url string `json:"url"`
  213. }
  214. const (
  215. ContentTypeText = "text"
  216. ContentTypeImageURL = "image_url"
  217. ContentTypeInputAudio = "input_audio"
  218. ContentTypeFile = "file"
  219. ContentTypeVideoUrl = "video_url" // 阿里百炼视频识别
  220. )
  221. func (m *Message) GetPrefix() bool {
  222. if m.Prefix == nil {
  223. return false
  224. }
  225. return *m.Prefix
  226. }
  227. func (m *Message) SetPrefix(prefix bool) {
  228. m.Prefix = &prefix
  229. }
  230. func (m *Message) ParseToolCalls() []ToolCallRequest {
  231. if m.ToolCalls == nil {
  232. return nil
  233. }
  234. var toolCalls []ToolCallRequest
  235. if err := json.Unmarshal(m.ToolCalls, &toolCalls); err == nil {
  236. return toolCalls
  237. }
  238. return toolCalls
  239. }
  240. func (m *Message) SetToolCalls(toolCalls any) {
  241. toolCallsJson, _ := json.Marshal(toolCalls)
  242. m.ToolCalls = toolCallsJson
  243. }
  244. func (m *Message) StringContent() string {
  245. switch m.Content.(type) {
  246. case string:
  247. return m.Content.(string)
  248. case []any:
  249. var contentStr string
  250. for _, contentItem := range m.Content.([]any) {
  251. contentMap, ok := contentItem.(map[string]any)
  252. if !ok {
  253. continue
  254. }
  255. if contentMap["type"] == ContentTypeText {
  256. if subStr, ok := contentMap["text"].(string); ok {
  257. contentStr += subStr
  258. }
  259. }
  260. }
  261. return contentStr
  262. }
  263. return ""
  264. }
  265. func (m *Message) SetNullContent() {
  266. m.Content = nil
  267. m.parsedContent = nil
  268. }
  269. func (m *Message) SetStringContent(content string) {
  270. m.Content = content
  271. m.parsedContent = nil
  272. }
  273. func (m *Message) SetMediaContent(content []MediaContent) {
  274. m.Content = content
  275. m.parsedContent = content
  276. }
  277. func (m *Message) IsStringContent() bool {
  278. _, ok := m.Content.(string)
  279. if ok {
  280. return true
  281. }
  282. return false
  283. }
  284. func (m *Message) ParseContent() []MediaContent {
  285. if m.Content == nil {
  286. return nil
  287. }
  288. if len(m.parsedContent) > 0 {
  289. return m.parsedContent
  290. }
  291. var contentList []MediaContent
  292. // 先尝试解析为字符串
  293. content, ok := m.Content.(string)
  294. if ok {
  295. contentList = []MediaContent{{
  296. Type: ContentTypeText,
  297. Text: content,
  298. }}
  299. m.parsedContent = contentList
  300. return contentList
  301. }
  302. // 尝试解析为数组
  303. //var arrayContent []map[string]interface{}
  304. arrayContent, ok := m.Content.([]any)
  305. if !ok {
  306. return contentList
  307. }
  308. for _, contentItemAny := range arrayContent {
  309. mediaItem, ok := contentItemAny.(MediaContent)
  310. if ok {
  311. contentList = append(contentList, mediaItem)
  312. continue
  313. }
  314. contentItem, ok := contentItemAny.(map[string]any)
  315. if !ok {
  316. continue
  317. }
  318. contentType, ok := contentItem["type"].(string)
  319. if !ok {
  320. continue
  321. }
  322. switch contentType {
  323. case ContentTypeText:
  324. if text, ok := contentItem["text"].(string); ok {
  325. contentList = append(contentList, MediaContent{
  326. Type: ContentTypeText,
  327. Text: text,
  328. })
  329. }
  330. case ContentTypeImageURL:
  331. imageUrl := contentItem["image_url"]
  332. temp := &MessageImageUrl{
  333. Detail: "high",
  334. }
  335. switch v := imageUrl.(type) {
  336. case string:
  337. temp.Url = v
  338. case map[string]interface{}:
  339. url, ok1 := v["url"].(string)
  340. detail, ok2 := v["detail"].(string)
  341. if ok2 {
  342. temp.Detail = detail
  343. }
  344. if ok1 {
  345. temp.Url = url
  346. }
  347. }
  348. contentList = append(contentList, MediaContent{
  349. Type: ContentTypeImageURL,
  350. ImageUrl: temp,
  351. })
  352. case ContentTypeInputAudio:
  353. if audioData, ok := contentItem["input_audio"].(map[string]interface{}); ok {
  354. data, ok1 := audioData["data"].(string)
  355. format, ok2 := audioData["format"].(string)
  356. if ok1 && ok2 {
  357. temp := &MessageInputAudio{
  358. Data: data,
  359. Format: format,
  360. }
  361. contentList = append(contentList, MediaContent{
  362. Type: ContentTypeInputAudio,
  363. InputAudio: temp,
  364. })
  365. }
  366. }
  367. case ContentTypeFile:
  368. if fileData, ok := contentItem["file"].(map[string]interface{}); ok {
  369. fileId, ok3 := fileData["file_id"].(string)
  370. if ok3 {
  371. contentList = append(contentList, MediaContent{
  372. Type: ContentTypeFile,
  373. File: &MessageFile{
  374. FileId: fileId,
  375. },
  376. })
  377. } else {
  378. fileName, ok1 := fileData["filename"].(string)
  379. fileDataStr, ok2 := fileData["file_data"].(string)
  380. if ok1 && ok2 {
  381. contentList = append(contentList, MediaContent{
  382. Type: ContentTypeFile,
  383. File: &MessageFile{
  384. FileName: fileName,
  385. FileData: fileDataStr,
  386. },
  387. })
  388. }
  389. }
  390. }
  391. case ContentTypeVideoUrl:
  392. if videoUrl, ok := contentItem["video_url"].(string); ok {
  393. contentList = append(contentList, MediaContent{
  394. Type: ContentTypeVideoUrl,
  395. VideoUrl: &MessageVideoUrl{
  396. Url: videoUrl,
  397. },
  398. })
  399. }
  400. }
  401. }
  402. if len(contentList) > 0 {
  403. m.parsedContent = contentList
  404. }
  405. return contentList
  406. }
  407. // old code
  408. /*func (m *Message) StringContent() string {
  409. if m.parsedStringContent != nil {
  410. return *m.parsedStringContent
  411. }
  412. var stringContent string
  413. if err := json.Unmarshal(m.Content, &stringContent); err == nil {
  414. m.parsedStringContent = &stringContent
  415. return stringContent
  416. }
  417. contentStr := new(strings.Builder)
  418. arrayContent := m.ParseContent()
  419. for _, content := range arrayContent {
  420. if content.Type == ContentTypeText {
  421. contentStr.WriteString(content.Text)
  422. }
  423. }
  424. stringContent = contentStr.String()
  425. m.parsedStringContent = &stringContent
  426. return stringContent
  427. }
  428. func (m *Message) SetNullContent() {
  429. m.Content = nil
  430. m.parsedStringContent = nil
  431. m.parsedContent = nil
  432. }
  433. func (m *Message) SetStringContent(content string) {
  434. jsonContent, _ := json.Marshal(content)
  435. m.Content = jsonContent
  436. m.parsedStringContent = &content
  437. m.parsedContent = nil
  438. }
  439. func (m *Message) SetMediaContent(content []MediaContent) {
  440. jsonContent, _ := json.Marshal(content)
  441. m.Content = jsonContent
  442. m.parsedContent = nil
  443. m.parsedStringContent = nil
  444. }
  445. func (m *Message) IsStringContent() bool {
  446. if m.parsedStringContent != nil {
  447. return true
  448. }
  449. var stringContent string
  450. if err := json.Unmarshal(m.Content, &stringContent); err == nil {
  451. m.parsedStringContent = &stringContent
  452. return true
  453. }
  454. return false
  455. }
  456. func (m *Message) ParseContent() []MediaContent {
  457. if m.parsedContent != nil {
  458. return m.parsedContent
  459. }
  460. var contentList []MediaContent
  461. // 先尝试解析为字符串
  462. var stringContent string
  463. if err := json.Unmarshal(m.Content, &stringContent); err == nil {
  464. contentList = []MediaContent{{
  465. Type: ContentTypeText,
  466. Text: stringContent,
  467. }}
  468. m.parsedContent = contentList
  469. return contentList
  470. }
  471. // 尝试解析为数组
  472. var arrayContent []map[string]interface{}
  473. if err := json.Unmarshal(m.Content, &arrayContent); err == nil {
  474. for _, contentItem := range arrayContent {
  475. contentType, ok := contentItem["type"].(string)
  476. if !ok {
  477. continue
  478. }
  479. switch contentType {
  480. case ContentTypeText:
  481. if text, ok := contentItem["text"].(string); ok {
  482. contentList = append(contentList, MediaContent{
  483. Type: ContentTypeText,
  484. Text: text,
  485. })
  486. }
  487. case ContentTypeImageURL:
  488. imageUrl := contentItem["image_url"]
  489. temp := &MessageImageUrl{
  490. Detail: "high",
  491. }
  492. switch v := imageUrl.(type) {
  493. case string:
  494. temp.Url = v
  495. case map[string]interface{}:
  496. url, ok1 := v["url"].(string)
  497. detail, ok2 := v["detail"].(string)
  498. if ok2 {
  499. temp.Detail = detail
  500. }
  501. if ok1 {
  502. temp.Url = url
  503. }
  504. }
  505. contentList = append(contentList, MediaContent{
  506. Type: ContentTypeImageURL,
  507. ImageUrl: temp,
  508. })
  509. case ContentTypeInputAudio:
  510. if audioData, ok := contentItem["input_audio"].(map[string]interface{}); ok {
  511. data, ok1 := audioData["data"].(string)
  512. format, ok2 := audioData["format"].(string)
  513. if ok1 && ok2 {
  514. temp := &MessageInputAudio{
  515. Data: data,
  516. Format: format,
  517. }
  518. contentList = append(contentList, MediaContent{
  519. Type: ContentTypeInputAudio,
  520. InputAudio: temp,
  521. })
  522. }
  523. }
  524. case ContentTypeFile:
  525. if fileData, ok := contentItem["file"].(map[string]interface{}); ok {
  526. fileId, ok3 := fileData["file_id"].(string)
  527. if ok3 {
  528. contentList = append(contentList, MediaContent{
  529. Type: ContentTypeFile,
  530. File: &MessageFile{
  531. FileId: fileId,
  532. },
  533. })
  534. } else {
  535. fileName, ok1 := fileData["filename"].(string)
  536. fileDataStr, ok2 := fileData["file_data"].(string)
  537. if ok1 && ok2 {
  538. contentList = append(contentList, MediaContent{
  539. Type: ContentTypeFile,
  540. File: &MessageFile{
  541. FileName: fileName,
  542. FileData: fileDataStr,
  543. },
  544. })
  545. }
  546. }
  547. }
  548. case ContentTypeVideoUrl:
  549. if videoUrl, ok := contentItem["video_url"].(string); ok {
  550. contentList = append(contentList, MediaContent{
  551. Type: ContentTypeVideoUrl,
  552. VideoUrl: &MessageVideoUrl{
  553. Url: videoUrl,
  554. },
  555. })
  556. }
  557. }
  558. }
  559. }
  560. if len(contentList) > 0 {
  561. m.parsedContent = contentList
  562. }
  563. return contentList
  564. }*/
  565. type WebSearchOptions struct {
  566. SearchContextSize string `json:"search_context_size,omitempty"`
  567. UserLocation json.RawMessage `json:"user_location,omitempty"`
  568. }
  569. // https://platform.openai.com/docs/api-reference/responses/create
  570. type OpenAIResponsesRequest struct {
  571. Model string `json:"model"`
  572. Input json.RawMessage `json:"input,omitempty"`
  573. Include json.RawMessage `json:"include,omitempty"`
  574. Instructions json.RawMessage `json:"instructions,omitempty"`
  575. MaxOutputTokens uint `json:"max_output_tokens,omitempty"`
  576. Metadata json.RawMessage `json:"metadata,omitempty"`
  577. ParallelToolCalls bool `json:"parallel_tool_calls,omitempty"`
  578. PreviousResponseID string `json:"previous_response_id,omitempty"`
  579. Reasoning *Reasoning `json:"reasoning,omitempty"`
  580. ServiceTier string `json:"service_tier,omitempty"`
  581. Store bool `json:"store,omitempty"`
  582. Stream bool `json:"stream,omitempty"`
  583. Temperature float64 `json:"temperature,omitempty"`
  584. Text json.RawMessage `json:"text,omitempty"`
  585. ToolChoice json.RawMessage `json:"tool_choice,omitempty"`
  586. Tools []map[string]any `json:"tools,omitempty"` // 需要处理的参数很少,MCP 参数太多不确定,所以用 map
  587. TopP float64 `json:"top_p,omitempty"`
  588. Truncation string `json:"truncation,omitempty"`
  589. User string `json:"user,omitempty"`
  590. MaxToolCalls uint `json:"max_tool_calls,omitempty"`
  591. Prompt json.RawMessage `json:"prompt,omitempty"`
  592. }
  593. type Reasoning struct {
  594. Effort string `json:"effort,omitempty"`
  595. Summary string `json:"summary,omitempty"`
  596. }
  597. //type ResponsesToolsCall struct {
  598. // Type string `json:"type"`
  599. // // Web Search
  600. // UserLocation json.RawMessage `json:"user_location,omitempty"`
  601. // SearchContextSize string `json:"search_context_size,omitempty"`
  602. // // File Search
  603. // VectorStoreIds []string `json:"vector_store_ids,omitempty"`
  604. // MaxNumResults uint `json:"max_num_results,omitempty"`
  605. // Filters json.RawMessage `json:"filters,omitempty"`
  606. // // Computer Use
  607. // DisplayWidth uint `json:"display_width,omitempty"`
  608. // DisplayHeight uint `json:"display_height,omitempty"`
  609. // Environment string `json:"environment,omitempty"`
  610. // // Function
  611. // Name string `json:"name,omitempty"`
  612. // Description string `json:"description,omitempty"`
  613. // Parameters json.RawMessage `json:"parameters,omitempty"`
  614. // Function json.RawMessage `json:"function,omitempty"`
  615. // Container json.RawMessage `json:"container,omitempty"`
  616. //}