mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-09 18:59:50 +08:00
feat(embedding): 接入阿里云多模态向量端点
This commit is contained in:
+15
@@ -34,6 +34,21 @@ describe('buildDefaultModelTestRequestBody', () => {
|
||||
expect(body.stream).toBeUndefined()
|
||||
})
|
||||
|
||||
it('uses multimodal input and qwen3-vl defaults for Aliyun embedding tests', () => {
|
||||
const body = JSON.parse(buildDefaultModelTestRequestBody('qwen3-vl-embedding', 'aliyun:multimodal_embedding'))
|
||||
|
||||
expect(body).toEqual({
|
||||
model: 'qwen3-vl-embedding',
|
||||
input: [
|
||||
{ text: 'White running shoes, lightweight and breathable.' },
|
||||
{ image: 'https://dashscope.oss-cn-beijing.aliyuncs.com/images/256_1.png' },
|
||||
],
|
||||
parameters: {
|
||||
enable_fusion: true,
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it.each([
|
||||
'openai:rerank',
|
||||
'jina:rerank',
|
||||
|
||||
@@ -151,6 +151,19 @@ export function buildDefaultModelTestRequestBody(
|
||||
): string {
|
||||
const normalizedApiFormat = normalizeApiFormatAlias(apiFormat ?? '')
|
||||
|
||||
if (normalizedApiFormat === 'aliyun:multimodal_embedding') {
|
||||
return JSON.stringify({
|
||||
model: modelName,
|
||||
input: [
|
||||
{ text: 'White running shoes, lightweight and breathable.' },
|
||||
{ image: 'https://dashscope.oss-cn-beijing.aliyuncs.com/images/256_1.png' },
|
||||
],
|
||||
parameters: {
|
||||
enable_fusion: true,
|
||||
},
|
||||
}, null, 2)
|
||||
}
|
||||
|
||||
if (normalizedApiFormat.endsWith(':embedding')) {
|
||||
return JSON.stringify({
|
||||
model: modelName,
|
||||
@@ -273,4 +286,4 @@ export function parseModelTestRequestHeadersDraft(
|
||||
emptyError: null,
|
||||
invalidTypeError: '测试请求头必须是 JSON 对象',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user