初始化SQL查询智能体 Args: llm: 语言模型实例 db_path: 数据库路径 num_examples: Few-shot示例数量
(self, llm: BaseLLM, db_path: str, num_examples: int = 3)
| 25 | """SQL查询子智能体,支持自动纠错循环(ReAct/Reflection 模式)""" |
| 26 | |
| 27 | def __init__(self, llm: BaseLLM, db_path: str, num_examples: int = 3): |
| 28 | """初始化SQL查询智能体 |
| 29 | |
| 30 | Args: |
| 31 | llm: 语言模型实例 |
| 32 | db_path: 数据库路径 |
| 33 | num_examples: Few-shot示例数量 |
| 34 | """ |
| 35 | self.llm = llm |
| 36 | self.db_path = db_path |
| 37 | self.num_examples = num_examples |
| 38 | |
| 39 | @staticmethod |
| 40 | def _llm_to_str(result) -> str: |
nothing calls this directly
no outgoing calls
no test coverage detected