张建平 5ae5471cbd .
2025-04-24 17:45:25 +08:00

19 lines
548 B
Python

from django.core.management.base import BaseCommand
from pr import models
class Command(BaseCommand):
help = "数据初始化"
def handle(self, *args, **options):
ai_config, created = models.AIConfig.objects.get_or_create(
api_base="https://api-n-cd.playones.com/v1",
api_key="sk-YLeQEboTsCEzfbmhbnytWRPyuC8Swe7OsBRKH30X26Jf1fsm",
llm_model="o3-mini",
)
if created:
print("初始化AI配置已创建")
else:
print("初始化AI配置已存在")