Backend (app/imitate.py):
- GET /api/imitate/products — reads imitate: config, checks online status
- GET /api/imitate/products/{id}/sample — fetches real item from product API
- GET /api/imitate/run (SSE) — streams ollama responses for selected models
- POST /api/imitate/push-corrections — queues results in SFT corrections JSONL
Frontend (ImitateView.vue):
- Step 1: product picker grid (online/offline status, icon from config)
- Step 2: raw sample preview + editable prompt textarea
- Step 3: ollama model multi-select, temperature slider, SSE run with live log
- Step 4: response cards side by side, push to Corrections button
Wiring:
- app/api.py: include imitate_router at /api/imitate
- web/src/router: /imitate route + lazy import
- AppSidebar: Imitate nav entry (mirror icon)
- config/label_tool.yaml.example: imitate: section with peregrine example
- 16 unit tests (100% passing)
Also: BenchmarkView.vue Compare panel — side-by-side run diff for bench results
25 lines
1.4 KiB
TypeScript
25 lines
1.4 KiB
TypeScript
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
import LabelView from '../views/LabelView.vue'
|
|
|
|
// Views are lazy-loaded to keep initial bundle small
|
|
const FetchView = () => import('../views/FetchView.vue')
|
|
const StatsView = () => import('../views/StatsView.vue')
|
|
const BenchmarkView = () => import('../views/BenchmarkView.vue')
|
|
const SettingsView = () => import('../views/SettingsView.vue')
|
|
const CorrectionsView = () => import('../views/CorrectionsView.vue')
|
|
const ModelsView = () => import('../views/ModelsView.vue')
|
|
const ImitateView = () => import('../views/ImitateView.vue')
|
|
|
|
export const router = createRouter({
|
|
history: createWebHashHistory(),
|
|
routes: [
|
|
{ path: '/', component: LabelView, meta: { title: 'Label' } },
|
|
{ path: '/fetch', component: FetchView, meta: { title: 'Fetch' } },
|
|
{ path: '/stats', component: StatsView, meta: { title: 'Stats' } },
|
|
{ path: '/benchmark', component: BenchmarkView, meta: { title: 'Benchmark' } },
|
|
{ path: '/models', component: ModelsView, meta: { title: 'Models' } },
|
|
{ path: '/imitate', component: ImitateView, meta: { title: 'Imitate' } },
|
|
{ path: '/corrections', component: CorrectionsView, meta: { title: 'Corrections' } },
|
|
{ path: '/settings', component: SettingsView, meta: { title: 'Settings' } },
|
|
],
|
|
})
|