feat: 开发采集、采集箱和商品编辑功能
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { api } from './api';
|
||||
|
||||
export interface AiModelOption {
|
||||
id: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface ModelsResponse {
|
||||
default: string;
|
||||
models: AiModelOption[];
|
||||
}
|
||||
|
||||
export interface CopyRequest {
|
||||
source_text: string;
|
||||
model_code?: string;
|
||||
model?: string;
|
||||
}
|
||||
|
||||
export interface CopyResponse {
|
||||
titles_ru: string[];
|
||||
titles_zh: string[];
|
||||
description_ru: string;
|
||||
description_zh: string;
|
||||
tags_ru: string[];
|
||||
tags_zh: string[];
|
||||
model: string;
|
||||
usage: { prompt_tokens: number; completion_tokens: number };
|
||||
}
|
||||
|
||||
export function getAiModels() {
|
||||
return api.get<ModelsResponse>('/ai/models');
|
||||
}
|
||||
|
||||
export function generateCopy(payload: CopyRequest) {
|
||||
return api.post<CopyResponse>('/ai/copy', payload);
|
||||
}
|
||||
Reference in New Issue
Block a user