llm生成参数

This commit is contained in:
gongwenxin
2025-08-07 23:54:35 +08:00
parent 4212d47400
commit 7c93176d86
7 changed files with 216 additions and 13 deletions
+8 -3
View File
@@ -175,6 +175,9 @@ class DmsCrudScenarioStage(BaseAPIStage):
tags = ["dms", "crud", "scenario"]
continue_on_failure = False
# DMS Stage专用配置:自动启用LLM智能数据生成
enable_llm_data_generation = True # 如果LLM服务可用,自动使用LLM生成测试数据
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# scenarios will be populated by is_applicable_to_api_group
@@ -272,9 +275,11 @@ class DmsCrudScenarioStage(BaseAPIStage):
create_payload = all_pk_values.copy() # 包含所有主键的基础负载
if create_schema:
# 尝试使用LLM智能生成数据(如果可用)
if self.llm_service:
self.logger.info(f"使用LLM为CRUD Stage生成智能测试数据,端点: {create_op.path}")
# DMS Stage内部直接启用LLM(如果LLM服务可用且已启用)
# 使用类属性控制,不需要额外的命令行参数
if self.llm_service and self.enable_llm_data_generation:
self.logger.info(f"🤖 DMS Stage自动启用LLM智能数据生成,端点: {create_op.path}")
self.logger.info(f"🔧 LLM模型: {getattr(self.llm_service, 'model_name', 'unknown')}")
# 构建针对业务规则的提示
business_rules_prompt = self._build_business_rules_prompt(create_schema, pk_name, pk_value)