MCPcopy Create free account
hub / github.com/Rfym21/Qwen2API / buildNormalizedMediaItem

Function buildNormalizedMediaItem

src/utils/chat-helpers.js:117–129  ·  view source on GitHub ↗
(mediaType, url)

Source from the content-addressed store, hash-verified

115/**
116 * 构造规范化媒体内容项
117 * @param {string} mediaType - 媒体类型
118 * @param {string} url - 媒体链接
119 * @returns {object} 规范化后的内容项
120 */
121const buildNormalizedMediaItem = (mediaType, url) => {
122 if (mediaType === 'video') {
123 return {
124 type: 'video',
125 video: url
126 }
127 }
128
129 return {
130 type: 'image',
131 image: url
132 }

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected