mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-17 23:12:23 +00:00
refactor(actions): 重构 AI优化代码的逻辑
- 更新 Prisma 客户端的导入路径 - 简化 AI优化代码的输入输出格式 - 移除不必要的测试用例 JSON 化处理
This commit is contained in:
parent
f325e4e9d4
commit
1ca7b547c4
@ -7,7 +7,7 @@ import {
|
|||||||
} from "@/types/ai-improve";
|
} from "@/types/ai-improve";
|
||||||
import { openai } from "@/lib/ai";
|
import { openai } from "@/lib/ai";
|
||||||
import { CoreMessage, generateText } from "ai";
|
import { CoreMessage, generateText } from "ai";
|
||||||
import prisma from '@/generated/client';
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调用AI优化代码
|
* 调用AI优化代码
|
||||||
@ -31,9 +31,6 @@ export const optimizeCode = async (
|
|||||||
Problem Requirements:
|
Problem Requirements:
|
||||||
-------------------
|
-------------------
|
||||||
Description: ${problem.description}
|
Description: ${problem.description}
|
||||||
Input: ${problem.inputSpec}
|
|
||||||
Output: ${problem.outputSpec}
|
|
||||||
Test Cases: ${JSON.stringify(problem.testCases)}
|
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user