Skip to content

Commit

Permalink
llm invoke error default raise exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuzhongshu123 committed Dec 25, 2024
1 parent 6055c46 commit d9019b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kag/interface/common/llm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def invoke(
variables: Dict[str, Any],
prompt_op: PromptABC,
with_json_parse: bool = True,
with_except: bool = False,
with_except: bool = True,
):
"""
Call the model and process the result.
Expand Down Expand Up @@ -112,7 +112,7 @@ def invoke(
logger.error(f"Error {e} during invocation: {traceback.format_exc()}")
if with_except:
raise RuntimeError(
f"call llm exception! llm output = {response} , llm input={prompt}, err={e}"
f"LLM invoke exception, info: {e}\nllm input: {input}\nllm output: {response}"
)
return result

Expand Down

0 comments on commit d9019b8

Please sign in to comment.