feat: 新增数据库
This commit is contained in:
+10
-2
@@ -16,6 +16,13 @@ interface IImageGenerationResponse {
|
||||
/** 生成图片地址 */
|
||||
url?: string;
|
||||
}>;
|
||||
/** 上游 token 用量 */
|
||||
usage?: unknown;
|
||||
}
|
||||
|
||||
export interface IAskImageResult extends IImageGenerateData {
|
||||
/** 完整上游生图接口返回结果,仅服务端内部保存 */
|
||||
upstreamResponse: IImageGenerationResponse;
|
||||
}
|
||||
|
||||
/** 通用 AI 调用函数(支持文本 / 图文 / 多模态) */
|
||||
@@ -107,7 +114,7 @@ export const askImg = async ({
|
||||
}: {
|
||||
apiKey: string;
|
||||
prompt: string;
|
||||
}): Promise<IImageGenerateData> => {
|
||||
}): Promise<IAskImageResult> => {
|
||||
const result = await $fetch<IImageGenerationResponse>(IMAGE_GENERATION_URL, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
@@ -128,7 +135,8 @@ export const askImg = async ({
|
||||
|
||||
return {
|
||||
imageUrl: image.url,
|
||||
revisedPrompt: image.revised_prompt
|
||||
revisedPrompt: image.revised_prompt,
|
||||
upstreamResponse: result
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user