Skip to content

Commit

Permalink
fix: improve debug bilingual
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshinesmilelk authored and BroKun committed Oct 31, 2024
1 parent 46c1c5d commit fbbc0f6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libro-ai/src/libro_ai/chat/debug_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class DebugChat(LLMChat):
name: str = "debug"
model: str = Field(default="gpt-4o")
system_message: SystemMessage = SystemMessage(content="你是一个代码调试小助手,在 notebook 执行时,输出了一些报错信息,请尝试解释报错并给出解决方案,每次对话都会给出代码以及报错信息")
system_message: SystemMessage = SystemMessage(content="You are a code debugging assistant. When errors are encountered during notebook execution, you output some error messages. Please attempt to explain the error and provide a solution. Each conversation will include code and error messages. Please respond in the language type used in the input.")
chat: Union[ChatOpenAI, ChatTongyi] = None
api_key: str = None
model_type: List[str] = ['openai']
Expand All @@ -43,10 +43,10 @@ def load(self):
def run(self, value:StringPromptValue, language = None, stream = False,sync=True,system_prompt = None,**kwargs):
if not self.chat:
self.load()
if language == 'en-US':
self.system_message = SystemMessage(content="You are a code debugging assistant. When errors are encountered during notebook execution, you output some error messages. Please attempt to explain the error and provide a solution. Each conversation will include code and error messages. Please answer in English")
else:
self.system_message = SystemMessage(content="你是一个代码调试小助手,在 notebook 执行时,输出了一些报错信息,请尝试解释报错并给出解决方案,每次对话都会给出代码以及报错信息")
# if language == 'en-US':
# self.system_message = SystemMessage(content="You are a code debugging assistant. When errors are encountered during notebook execution, you output some error messages. Please attempt to explain the error and provide a solution. Each conversation will include code and error messages. Please respond in the language type used in the input.")
# else:
# self.system_message = SystemMessage(content="你是一个代码调试小助手,在 notebook 执行时,输出了一些报错信息,请尝试解释报错并给出解决方案,每次对话都会给出代码以及报错信息")
if stream:
try:
if not self.chat:
Expand Down

0 comments on commit fbbc0f6

Please sign in to comment.