19 lines
543 B
Python
19 lines
543 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="http://110.40.24.85:3000/v1",
|
|
api_key="sk-YLeQEboTsCEzfbmhbnytWRPyuC8Swe7OsBRKH30X26Jf1fsm",
|
|
llm_model="o3-mini",
|
|
)
|
|
if created:
|
|
print("初始化AI配置已创建")
|
|
else:
|
|
print("初始化AI配置已存在")
|