Showing
1 changed file
with
4 additions
and
8 deletions
| @@ -145,13 +145,12 @@ def create_llm_repair_functions() -> List: | @@ -145,13 +145,12 @@ def create_llm_repair_functions() -> List: | ||
| 145 | def repair_with_report_engine(widget_block: Dict[str, Any], errors: List[str]) -> Optional[Dict[str, Any]]: | 145 | def repair_with_report_engine(widget_block: Dict[str, Any], errors: List[str]) -> Optional[Dict[str, Any]]: |
| 146 | """使用ReportEngine的LLM修复图表""" | 146 | """使用ReportEngine的LLM修复图表""" |
| 147 | try: | 147 | try: |
| 148 | - from llm_client import LLMClient | 148 | + from ReportEngine.llms import LLMClient |
| 149 | 149 | ||
| 150 | client = LLMClient( | 150 | client = LLMClient( |
| 151 | api_key=settings.REPORT_ENGINE_API_KEY, | 151 | api_key=settings.REPORT_ENGINE_API_KEY, |
| 152 | base_url=settings.REPORT_ENGINE_BASE_URL, | 152 | base_url=settings.REPORT_ENGINE_BASE_URL, |
| 153 | model_name=settings.REPORT_ENGINE_MODEL_NAME or "gpt-4", | 153 | model_name=settings.REPORT_ENGINE_MODEL_NAME or "gpt-4", |
| 154 | - provider="openai" | ||
| 155 | ) | 154 | ) |
| 156 | 155 | ||
| 157 | prompt = build_chart_repair_prompt(widget_block, errors) | 156 | prompt = build_chart_repair_prompt(widget_block, errors) |
| @@ -180,13 +179,12 @@ def create_llm_repair_functions() -> List: | @@ -180,13 +179,12 @@ def create_llm_repair_functions() -> List: | ||
| 180 | def repair_with_forum_engine(widget_block: Dict[str, Any], errors: List[str]) -> Optional[Dict[str, Any]]: | 179 | def repair_with_forum_engine(widget_block: Dict[str, Any], errors: List[str]) -> Optional[Dict[str, Any]]: |
| 181 | """使用ForumEngine的LLM修复图表""" | 180 | """使用ForumEngine的LLM修复图表""" |
| 182 | try: | 181 | try: |
| 183 | - from llm_client import LLMClient | 182 | + from ReportEngine.llms import LLMClient |
| 184 | 183 | ||
| 185 | client = LLMClient( | 184 | client = LLMClient( |
| 186 | api_key=settings.FORUM_HOST_API_KEY, | 185 | api_key=settings.FORUM_HOST_API_KEY, |
| 187 | base_url=settings.FORUM_HOST_BASE_URL, | 186 | base_url=settings.FORUM_HOST_BASE_URL, |
| 188 | model_name=settings.FORUM_HOST_MODEL_NAME or "gpt-4", | 187 | model_name=settings.FORUM_HOST_MODEL_NAME or "gpt-4", |
| 189 | - provider="openai" | ||
| 190 | ) | 188 | ) |
| 191 | 189 | ||
| 192 | prompt = build_chart_repair_prompt(widget_block, errors) | 190 | prompt = build_chart_repair_prompt(widget_block, errors) |
| @@ -214,13 +212,12 @@ def create_llm_repair_functions() -> List: | @@ -214,13 +212,12 @@ def create_llm_repair_functions() -> List: | ||
| 214 | def repair_with_insight_engine(widget_block: Dict[str, Any], errors: List[str]) -> Optional[Dict[str, Any]]: | 212 | def repair_with_insight_engine(widget_block: Dict[str, Any], errors: List[str]) -> Optional[Dict[str, Any]]: |
| 215 | """使用InsightEngine的LLM修复图表""" | 213 | """使用InsightEngine的LLM修复图表""" |
| 216 | try: | 214 | try: |
| 217 | - from llm_client import LLMClient | 215 | + from ReportEngine.llms import LLMClient |
| 218 | 216 | ||
| 219 | client = LLMClient( | 217 | client = LLMClient( |
| 220 | api_key=settings.INSIGHT_ENGINE_API_KEY, | 218 | api_key=settings.INSIGHT_ENGINE_API_KEY, |
| 221 | base_url=settings.INSIGHT_ENGINE_BASE_URL, | 219 | base_url=settings.INSIGHT_ENGINE_BASE_URL, |
| 222 | model_name=settings.INSIGHT_ENGINE_MODEL_NAME or "gpt-4", | 220 | model_name=settings.INSIGHT_ENGINE_MODEL_NAME or "gpt-4", |
| 223 | - provider="openai" | ||
| 224 | ) | 221 | ) |
| 225 | 222 | ||
| 226 | prompt = build_chart_repair_prompt(widget_block, errors) | 223 | prompt = build_chart_repair_prompt(widget_block, errors) |
| @@ -248,13 +245,12 @@ def create_llm_repair_functions() -> List: | @@ -248,13 +245,12 @@ def create_llm_repair_functions() -> List: | ||
| 248 | def repair_with_media_engine(widget_block: Dict[str, Any], errors: List[str]) -> Optional[Dict[str, Any]]: | 245 | def repair_with_media_engine(widget_block: Dict[str, Any], errors: List[str]) -> Optional[Dict[str, Any]]: |
| 249 | """使用MediaEngine的LLM修复图表""" | 246 | """使用MediaEngine的LLM修复图表""" |
| 250 | try: | 247 | try: |
| 251 | - from llm_client import LLMClient | 248 | + from ReportEngine.llms import LLMClient |
| 252 | 249 | ||
| 253 | client = LLMClient( | 250 | client = LLMClient( |
| 254 | api_key=settings.MEDIA_ENGINE_API_KEY, | 251 | api_key=settings.MEDIA_ENGINE_API_KEY, |
| 255 | base_url=settings.MEDIA_ENGINE_BASE_URL, | 252 | base_url=settings.MEDIA_ENGINE_BASE_URL, |
| 256 | model_name=settings.MEDIA_ENGINE_MODEL_NAME or "gpt-4", | 253 | model_name=settings.MEDIA_ENGINE_MODEL_NAME or "gpt-4", |
| 257 | - provider="openai" | ||
| 258 | ) | 254 | ) |
| 259 | 255 | ||
| 260 | prompt = build_chart_repair_prompt(widget_block, errors) | 256 | prompt = build_chart_repair_prompt(widget_block, errors) |
-
Please register or login to post a comment