9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
35 lines
1.4 KiB
JavaScript
35 lines
1.4 KiB
JavaScript
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
import { IMAGE_MODELS, VIDEO_MODELS, TOOL_MODELS } from './utils.js';
|
|
cli({
|
|
site: 'yollomi',
|
|
name: 'models',
|
|
access: 'read',
|
|
description: 'List available Yollomi AI models (image, video, tools)',
|
|
strategy: Strategy.PUBLIC,
|
|
browser: false,
|
|
args: [
|
|
{ name: 'type', default: 'all', choices: ['all', 'image', 'video', 'tool'], help: 'Filter by model type' },
|
|
],
|
|
columns: ['type', 'model', 'credits', 'description'],
|
|
func: async (kwargs) => {
|
|
const filter = kwargs.type;
|
|
const rows = [];
|
|
if (filter === 'all' || filter === 'image') {
|
|
for (const [id, info] of Object.entries(IMAGE_MODELS)) {
|
|
rows.push({ type: 'image', model: id, credits: info.credits, description: info.description });
|
|
}
|
|
}
|
|
if (filter === 'all' || filter === 'video') {
|
|
for (const [id, info] of Object.entries(VIDEO_MODELS)) {
|
|
rows.push({ type: 'video', model: id, credits: info.credits, description: info.description });
|
|
}
|
|
}
|
|
if (filter === 'all' || filter === 'tool') {
|
|
for (const [id, info] of Object.entries(TOOL_MODELS)) {
|
|
rows.push({ type: 'tool', model: id, credits: info.credits, description: info.description });
|
|
}
|
|
}
|
|
return rows;
|
|
},
|
|
});
|