commit some debug log
This commit is contained in:
parent
b225390080
commit
52bf829a84
|
|
@ -30,18 +30,22 @@ def _new_parse_input(
|
||||||
tool_input: Union[str, Dict],
|
tool_input: Union[str, Dict],
|
||||||
) -> Union[str, Dict[str, Any]]:
|
) -> Union[str, Dict[str, Any]]:
|
||||||
"""Convert tool input to pydantic model."""
|
"""Convert tool input to pydantic model."""
|
||||||
input_args = self.args_schema
|
try:
|
||||||
if isinstance(tool_input, str):
|
input_args = self.args_schema
|
||||||
print(f"tool_input:{tool_input}")
|
if isinstance(tool_input, str):
|
||||||
if input_args is not None:
|
logging.info(f"tool_input:{tool_input}")
|
||||||
key_ = next(iter(input_args.__fields__.keys()))
|
if input_args is not None:
|
||||||
input_args.validate({key_: tool_input})
|
key_ = next(iter(input_args.__fields__.keys()))
|
||||||
return tool_input
|
input_args.validate({key_: tool_input})
|
||||||
else:
|
return tool_input
|
||||||
if input_args is not None:
|
else:
|
||||||
result = input_args.parse_obj(tool_input)
|
if input_args is not None:
|
||||||
logging.info(f"result:{result}")
|
result = input_args.parse_obj(tool_input)
|
||||||
return result.dict()
|
logging.info(f"result:{result}")
|
||||||
|
return result.dict()
|
||||||
|
except Exception as e:
|
||||||
|
msg = f"Caught exception: {e}"
|
||||||
|
logging.error(f"{e.__class__.__name__}: {msg}")
|
||||||
|
|
||||||
|
|
||||||
def _new_to_args_and_kwargs(self, tool_input: Union[str, Dict]) -> Tuple[Tuple, Dict]:
|
def _new_to_args_and_kwargs(self, tool_input: Union[str, Dict]) -> Tuple[Tuple, Dict]:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue