feat: init commint
This commit is contained in:
@@ -4,7 +4,13 @@ from apps.modelhub.models import ModelDeployment, ModelProvider
|
||||
from apps.skills.models import SkillDefinition, SkillVersion
|
||||
|
||||
|
||||
def create_deployment(*, capability="text_chat", provider=None, suffix=""):
|
||||
def create_deployment(
|
||||
*,
|
||||
capability="text_chat",
|
||||
provider=None,
|
||||
suffix="",
|
||||
structured_output_mode="native_json_schema",
|
||||
):
|
||||
provider = provider or ModelProvider.objects.create(
|
||||
name=f"模型渠道{suffix}",
|
||||
base_url="https://models.example.com/v1",
|
||||
@@ -15,6 +21,8 @@ def create_deployment(*, capability="text_chat", provider=None, suffix=""):
|
||||
display_name=f"支持模型{suffix}",
|
||||
model_name=f"support-model{suffix}",
|
||||
capability=capability,
|
||||
structured_output_mode=structured_output_mode,
|
||||
structured_output_test_status="passed",
|
||||
)
|
||||
|
||||
|
||||
@@ -46,6 +54,7 @@ def create_agent(deployment=None, *, published=False, two_steps=True):
|
||||
"type": "object",
|
||||
"properties": {"summary": {"type": "string"}},
|
||||
"required": ["summary"],
|
||||
"additionalProperties": False,
|
||||
},
|
||||
)
|
||||
second_skill = None
|
||||
@@ -56,6 +65,7 @@ def create_agent(deployment=None, *, published=False, two_steps=True):
|
||||
"type": "object",
|
||||
"properties": {"reply": {"type": "string"}},
|
||||
"required": ["reply"],
|
||||
"additionalProperties": False,
|
||||
},
|
||||
)
|
||||
definition = AgentDefinition.objects.create(code="support-agent", name="支持 Agent")
|
||||
|
||||
Reference in New Issue
Block a user