Toggle navigation
Toggle navigation
This project
Loading...
Sign in
万朱浩
/
Venue-Ops
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
马一丁
2025-11-21 05:33:47 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
373b85a3f83542762a66c8b8c7bbb10f24703e77
373b85a3
1 parent
a2c42bda
Repair the Logic of Automatically Repairing Charts
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
ReportEngine/utils/chart_repair_api.py
ReportEngine/utils/chart_repair_api.py
View file @
373b85a
...
...
@@ -145,13 +145,12 @@ def create_llm_repair_functions() -> List:
def
repair_with_report_engine
(
widget_block
:
Dict
[
str
,
Any
],
errors
:
List
[
str
])
->
Optional
[
Dict
[
str
,
Any
]]:
"""使用ReportEngine的LLM修复图表"""
try
:
from
llm_client
import
LLMClient
from
ReportEngine.llms
import
LLMClient
client
=
LLMClient
(
api_key
=
settings
.
REPORT_ENGINE_API_KEY
,
base_url
=
settings
.
REPORT_ENGINE_BASE_URL
,
model_name
=
settings
.
REPORT_ENGINE_MODEL_NAME
or
"gpt-4"
,
provider
=
"openai"
)
prompt
=
build_chart_repair_prompt
(
widget_block
,
errors
)
...
...
@@ -180,13 +179,12 @@ def create_llm_repair_functions() -> List:
def
repair_with_forum_engine
(
widget_block
:
Dict
[
str
,
Any
],
errors
:
List
[
str
])
->
Optional
[
Dict
[
str
,
Any
]]:
"""使用ForumEngine的LLM修复图表"""
try
:
from
llm_client
import
LLMClient
from
ReportEngine.llms
import
LLMClient
client
=
LLMClient
(
api_key
=
settings
.
FORUM_HOST_API_KEY
,
base_url
=
settings
.
FORUM_HOST_BASE_URL
,
model_name
=
settings
.
FORUM_HOST_MODEL_NAME
or
"gpt-4"
,
provider
=
"openai"
)
prompt
=
build_chart_repair_prompt
(
widget_block
,
errors
)
...
...
@@ -214,13 +212,12 @@ def create_llm_repair_functions() -> List:
def
repair_with_insight_engine
(
widget_block
:
Dict
[
str
,
Any
],
errors
:
List
[
str
])
->
Optional
[
Dict
[
str
,
Any
]]:
"""使用InsightEngine的LLM修复图表"""
try
:
from
llm_client
import
LLMClient
from
ReportEngine.llms
import
LLMClient
client
=
LLMClient
(
api_key
=
settings
.
INSIGHT_ENGINE_API_KEY
,
base_url
=
settings
.
INSIGHT_ENGINE_BASE_URL
,
model_name
=
settings
.
INSIGHT_ENGINE_MODEL_NAME
or
"gpt-4"
,
provider
=
"openai"
)
prompt
=
build_chart_repair_prompt
(
widget_block
,
errors
)
...
...
@@ -248,13 +245,12 @@ def create_llm_repair_functions() -> List:
def
repair_with_media_engine
(
widget_block
:
Dict
[
str
,
Any
],
errors
:
List
[
str
])
->
Optional
[
Dict
[
str
,
Any
]]:
"""使用MediaEngine的LLM修复图表"""
try
:
from
llm_client
import
LLMClient
from
ReportEngine.llms
import
LLMClient
client
=
LLMClient
(
api_key
=
settings
.
MEDIA_ENGINE_API_KEY
,
base_url
=
settings
.
MEDIA_ENGINE_BASE_URL
,
model_name
=
settings
.
MEDIA_ENGINE_MODEL_NAME
or
"gpt-4"
,
provider
=
"openai"
)
prompt
=
build_chart_repair_prompt
(
widget_block
,
errors
)
...
...
Please
register
or
login
to post a comment