自动生成流程图
This commit is contained in:
@@ -9,10 +9,9 @@ from django.db.models import Min, Count
|
||||
from django.db.models.functions import TruncDate
|
||||
from django.http import StreamingHttpResponse
|
||||
from django.utils import timezone
|
||||
from openai import OpenAI
|
||||
|
||||
from utils.api import APIView
|
||||
from utils.shortcuts import get_env
|
||||
from utils.openai import get_ai_client
|
||||
|
||||
from account.models import User
|
||||
from problem.models import Problem
|
||||
@@ -528,12 +527,7 @@ class AIAnalysisAPI(APIView):
|
||||
details = request.data.get("details")
|
||||
duration = request.data.get("duration")
|
||||
|
||||
api_key = get_env("AI_KEY")
|
||||
|
||||
if not api_key:
|
||||
return self.error("API_KEY is not set")
|
||||
|
||||
client = OpenAI(api_key=api_key, base_url="https://api.deepseek.com")
|
||||
client = get_ai_client()
|
||||
|
||||
system_prompt = "你是一个风趣的编程老师,学生使用判题狗平台进行编程练习。请根据学生提供的详细数据和每周数据,给出用户的学习建议,最后写一句鼓励学生的话。请使用 markdown 格式输出,不要在代码块中输出。"
|
||||
user_prompt = f"这段时间内的详细数据: {details}\n(其中部分字段含义是 flowcharts:流程图的提交,solved:代码的提交)\n每周或每月的数据: {duration}"
|
||||
|
||||
Reference in New Issue
Block a user