| 1234567891011121314151617181920212223242526272829303132 |
- import os
- import sys
- sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
- import yaml
- from logger.loggering import server_logger
- from utils.yaml_utils import system_prompt_config , get_business_scene_prompt
- # 测试yaml 文件读取
- def test_get_system_prompt():
- system_prompt = system_prompt_config
- server_logger.info(f"获取系统提示语,template: {system_prompt["template"]}")
- # 获取任务 提示词
- def test_get_task_prompt():
- #business_scene = "common_model_query"
- #business_scene = "cattle_farm_common"
- #business_scene = "cattle_farm_query"
- business_scene = "cattle_farm_warning_plan"
- #business_scene = "cattle_farm_warning_task_execute"
- business_scene_enum , task_prompt_config = get_business_scene_prompt(business_scene)
- server_logger.info(f"获取系统提示语,business_scene_enum:{business_scene_enum},task_prompt: {task_prompt_config["task_prompt"]}")
- server_logger.info(f"获取系统提示语,business_scene_enum:{business_scene_enum},template: {task_prompt_config["template"]}")
- if __name__ == '__main__':
- #test_get_system_prompt() # 获取系统提示语
- test_get_task_prompt() # 获取任务 提示词
|