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

Function buildPublicModelData

src/controllers/models.js:10–21  ·  view source on GitHub ↗
(model, suffix = '')

Source from the content-addressed store, hash-verified

8 * @returns {object} 对外模型信息
9 */
10const buildPublicModelData = (model, suffix = '') => {
11 const modelData = JSON.parse(JSON.stringify(model))
12 const upstreamModelID = String(model?.id || '')
13 const displayModelID = String(model?.name || model?.id || '')
14
15 modelData.name = `${displayModelID}${suffix}`
16 modelData.id = `${upstreamModelID}${suffix}`
17 modelData.upstream_id = upstreamModelID
18 modelData.display_name = displayModelID
19
20 return modelData
21}
22
23const handleGetModels = async (req, res) => {
24 const models = []

Callers 1

handleGetModelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected