Skip to content

Commit 92166a3

Browse files
committed
fix: bard lang getter
1 parent b0d3813 commit 92166a3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ExceptNotifier/base/bard_receiver.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ def receive_bard_advice(_BARD_API_KEY: str, error_message: str) -> str:
1616
environ["_BARD_API_KEY"] = _BARD_API_KEY
1717

1818
if environ.get("_PROMPT_COMMAND") is None:
19-
if environ.get["_BARD_ADVICE_LANG"] is not None:
19+
if environ.get("_BARD_ADVICE_LANG") is None:
20+
input_text = f"Give me more explanation for the following error. And if you have a code example and a way to solve it, please suggest it. Please provide as much information as possible. error is {error_message}."
21+
else:
2022
if environ["_BARD_ADVICE_LANG"]=='ko':
21-
input_text = f"다음 error를 어떻게 고칠 수 있을까? 다음 에러에 대해서 설명해주고, 어떤 위치에서 어떤 코드가 잘못 되었는지 말해줘. 그리고 이 코드를 고칠 수 있는 예시 코드를 보여줘 error=={error_message}"
23+
input_text = f"다음 에러와 관련된 더 많은 설명을 알려줘. 그리고 만약 이 오류와 관련된 코드 예제 및 유용한 자료가 있다면 가능한 많이 알려줘. 오류는 {error_message} 입니다."
2224
elif environ["_BARD_ADVICE_LANG"]=='jp':
23-
input_text = f"次のエラーをどのように修正できますか?次のエラーについて説明し、どの場所でどのコードが間違っているかを教えてください。そして、このコードを修正できるサンプルコードを見せてください。 error=={error_message}"
25+
input_text = f"いくつかのリンクまたはコード例を見つけてください。このエラーに関する詳細情報と、この問題に関連する StackOverflow URL を教えてください。 エラーは {error_message} です。"
2426
else:
2527
print('You can only use ko or jp for the _BARD_ADVICE_LANG variable. Hence, answers will be provided in English.')
26-
input_text = f"How can I fix this error? Give me short infomation about next error. Let me know which code line and which code is incorrect. and try to make it fix or fix example. error=={error_message}"
27-
else:
28-
input_text = f"How can I fix this error? Give me short infomation about next error. Let me know which code line and which code is incorrect. and try to make it fix or fix example. error=={error_message}"
28+
input_text = f"Give me more explanation for the following error. And if you have a code example and a way to solve it, please suggest it. Please provide as much information as possible. error is {error_message}."
2929
else:
3030
input_text = f"{environ['_PROMPT_COMMAND']} error=={error_message}"
3131

3232
response = bardapi.core.Bard().get_answer(input_text)
33-
advice_msg = response["content"]
33+
advice_msg = response['content']
3434

3535
return advice_msg
3636

0 commit comments

Comments
 (0)