From 88ce1102d9c3c4aa9c69b773c05d5162f3569aac Mon Sep 17 00:00:00 2001 From: leo-gan Date: Thu, 22 Feb 2024 11:24:39 -0800 Subject: [PATCH 1/2] added dosctrings --- libs/partners/robocorp/langchain_robocorp/toolkits.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/partners/robocorp/langchain_robocorp/toolkits.py b/libs/partners/robocorp/langchain_robocorp/toolkits.py index 92f082667f3e9..f314ae50e91d7 100644 --- a/libs/partners/robocorp/langchain_robocorp/toolkits.py +++ b/libs/partners/robocorp/langchain_robocorp/toolkits.py @@ -33,7 +33,13 @@ class RunDetailsCallbackHandler(BaseCallbackHandler): + """Callback handler to add run details to the run.""" def __init__(self, run_details: dict) -> None: + """Initialize the callback handler. + + Args: + run_details (dict): Run details. + """ self.run_details = run_details def on_tool_start( @@ -50,10 +56,12 @@ def on_tool_start( class ToolInputSchema(BaseModel): + """Tool input schema.""" question: str = Field(...) class ToolArgs(TypedDict): + """Tool arguments.""" name: str description: str callback_manager: CallbackManager From 12bcb6eb8c3cfa40b0248cbacef0f61fc442a1f1 Mon Sep 17 00:00:00 2001 From: leo-gan Date: Thu, 22 Feb 2024 11:55:32 -0800 Subject: [PATCH 2/2] linting --- libs/partners/robocorp/langchain_robocorp/toolkits.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/partners/robocorp/langchain_robocorp/toolkits.py b/libs/partners/robocorp/langchain_robocorp/toolkits.py index f314ae50e91d7..aab04859e6624 100644 --- a/libs/partners/robocorp/langchain_robocorp/toolkits.py +++ b/libs/partners/robocorp/langchain_robocorp/toolkits.py @@ -34,6 +34,7 @@ class RunDetailsCallbackHandler(BaseCallbackHandler): """Callback handler to add run details to the run.""" + def __init__(self, run_details: dict) -> None: """Initialize the callback handler. @@ -57,11 +58,13 @@ def on_tool_start( class ToolInputSchema(BaseModel): """Tool input schema.""" + question: str = Field(...) class ToolArgs(TypedDict): """Tool arguments.""" + name: str description: str callback_manager: CallbackManager