mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-05-18 15:26:36 +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";
|
||||
import { openai } from "@/lib/ai";
|
||||
import { CoreMessage, generateText } from "ai";
|
||||
import prisma from '@/generated/client';
|
||||
import prisma from "@/lib/prisma";
|
||||
|
||||
/**
|
||||
* 调用AI优化代码
|
||||
@ -31,9 +31,6 @@ export const optimizeCode = async (
|
||||
Problem Requirements:
|
||||
-------------------
|
||||
Description: ${problem.description}
|
||||
Input: ${problem.inputSpec}
|
||||
Output: ${problem.outputSpec}
|
||||
Test Cases: ${JSON.stringify(problem.testCases)}
|
||||
`;
|
||||
}
|
||||
} catch (error) {
|
||||
|
Loading…
Reference in New Issue
Block a user