feat: release OpsXShell 2.1.0 native Tauri edition
This commit is contained in:
1 parent
e9a0d21758
commit
a3dba0c6ed
311 files changed
+31748
-14897
No files matched your search
@@ -0,0 +1,53 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { normalizeModelsDevCatalog } from '../../src/ai/modelCatalog'
|
||||
|
||||
describe('models.dev catalog normalization', () => {
|
||||
it('normalizes the provider keyed api.json shape', () => {
|
||||
const result = normalizeModelsDevCatalog([
|
||||
{
|
||||
source: 'https://models.dev/api.json',
|
||||
data: {
|
||||
deepseek: {
|
||||
id: 'deepseek',
|
||||
name: 'DeepSeek',
|
||||
api: 'https://api.deepseek.com/v1',
|
||||
models: {
|
||||
'deepseek-chat': { id: 'deepseek-chat', name: 'DeepSeek Chat' },
|
||||
'deepseek-reasoner': { id: 'deepseek-reasoner', name: 'DeepSeek Reasoner', reasoning: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
expect(result).toHaveLength(1)
|
||||
expect(result[0].baseUrl).toBe('https://api.deepseek.com/v1')
|
||||
expect(result[0].models).toEqual(
|
||||
expect.arrayContaining([expect.objectContaining({ model: 'deepseek-reasoner', capability: 'reasoning' })])
|
||||
)
|
||||
})
|
||||
|
||||
it('groups a flat models.json shape by provider and tolerates partial documents', () => {
|
||||
const result = normalizeModelsDevCatalog([
|
||||
{ source: 'broken', data: { metadata: { updated: true } } },
|
||||
{
|
||||
source: 'models',
|
||||
data: {
|
||||
models: {
|
||||
'vendor/model-a': { id: 'model-a', name: 'Model A', provider: 'vendor' },
|
||||
'vendor/model-b': { id: 'model-b', name: 'Model B', provider: 'vendor', reasoning: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
])
|
||||
expect(result).toEqual([
|
||||
expect.objectContaining({
|
||||
id: 'vendor',
|
||||
models: expect.arrayContaining([
|
||||
expect.objectContaining({ model: 'model-a' }),
|
||||
expect.objectContaining({ model: 'model-b', capability: 'reasoning' }),
|
||||
]),
|
||||
}),
|
||||
])
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user