Building AI agents, atomically
docs update
KennyVaneetveldec67f96c9742b
diff --git a/atomic_agents/lib/tools/README.md b/atomic_agents/lib/tools/README.mdindex 9d665cb..5b33561 100644--- a/atomic_agents/lib/tools/README.md+++ b/atomic_agents/lib/tools/README.md@@ -1,8 +1,9 @@-# Creating a New Tool+# Tools+## Creating a New ToolThis guide will walk you through the steps to create a new tool in the `atomic_agents` framework. We will cover the necessary components and provide an example to illustrate the process.-## Components of a Tool+### Components of a ToolA tool in the `atomic_agents` framework consists of the following components:@@ -11,9 +12,9 @@ A tool in the `atomic_agents` framework consists of the following components:3. **Tool Logic**: Implements the core functionality of the tool.4. **Example Usage**: Demonstrates how to use the tool.-## Step-by-Step Guide+### Step-by-Step Guide-### 1. Define the Input Schema+#### 1. Define the Input SchemaThe input schema is a Pydantic `BaseModel` that specifies the input parameters for the tool. It can include simple fields, complex nested data structures, and even child schemas.An input schema should include a `Config` class with `title`, `description`, and `json_schema_extra` attributes. This is not just informational or aesthetic; it also helps generate the OpenAPI documentation for the tool, which is consumed by the LLM in order to generate the output.@@ -39,7 +40,7 @@ class MyToolInputSchema(BaseModel):}```-### 2. Define the Output Schema+#### 2. Define the Output SchemaThe output schema is a Pydantic `BaseModel` that specifies the structure of the tool's output. It can also include complex nested data structures and multiple properties just like the input schema. Here is an example:@@ -49,7 +50,7 @@ class MyToolOutputSchema(BaseModel):details: dict = Field(..., description="Additional details about the result.")```-### 3. Implement the Tool Logic+#### 3. Implement the Tool LogicCreate a class that inherits from `BaseTool` and implements the core functionality of the tool. This class should define the `input_schema` and `output_schema` attributes and implement the `run` method.@@ -71,7 +72,7 @@ class MyTool(BaseTool):return MyToolOutputSchema(result=result, details=details)```-### 4. Example Usage+#### 4. Example UsageProvide an example of how to use the tool. This typically involves initializing the tool and running it with sample input. If you don't plan to merge this tool into the atomic_agents repository, you can exclude this part if you wish.@@ -88,7 +89,7 @@ if __name__ == "__main__":print(output)```-## Full Example+### Full ExampleHere is a complete example of a new tool called `MyTool`:@@ -149,6 +150,6 @@ if __name__ == "__main__":print(output)```-## Conclusion+### ConclusionBy following these steps, you can create a new tool in the `atomic_agents` framework. Define the input and output schemas, implement the tool logic, and provide an example usage to demonstrate how the tool works. Remember that the input and output schemas can be as simple or as complex as needed, including nested data structures and multiple properties.\ No newline at end of filediff --git a/docs/README.md b/docs/README.mdindex 418c104..5d7be76 100644--- a/docs/README.md+++ b/docs/README.md@@ -14,7 +14,7 @@ A full list of `Atomic_agents_redux` project modules.- [SystemPromptGenerator](atomic_agents/lib/components/system_prompt_generator.md#systempromptgenerator)- [Models](atomic_agents/lib/models/index.md#models)- [WebDocument](atomic_agents/lib/models/web_document.md#webdocument)- - [Creating a New Tool](atomic_agents/lib/tools/index.md#creating-a-new-tool)+ - [Tools](atomic_agents/lib/tools/index.md#tools)- [Base](atomic_agents/lib/tools/base.md#base)- [CalculatorTool](atomic_agents/lib/tools/calculator_tool.md#calculatortool)- [Searx](atomic_agents/lib/tools/searx.md#searx)diff --git a/docs/atomic_agents/lib/index.md b/docs/atomic_agents/lib/index.mdindex 1d6c6a5..1d9008d 100644--- a/docs/atomic_agents/lib/index.md+++ b/docs/atomic_agents/lib/index.md@@ -11,5 +11,5 @@- [Components](components/index.md)- [Models](models/index.md)-- [Creating a New Tool](tools/index.md)+- [Tools](tools/index.md)- [Utils](utils/index.md)\ No newline at end of filediff --git a/docs/atomic_agents/lib/tools/base.md b/docs/atomic_agents/lib/tools/base.mdindex 2809470..795e4e4 100644--- a/docs/atomic_agents/lib/tools/base.md+++ b/docs/atomic_agents/lib/tools/base.md@@ -1,6 +1,6 @@# Base-[Atomic_agents_redux Index](../../../README.md#atomic_agents_redux-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / [Creating a New Tool](./index.md#creating-a-new-tool) / Base+[Atomic_agents_redux Index](../../../README.md#atomic_agents_redux-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / [Tools](./index.md#tools) / Base> Auto-generated documentation for [atomic_agents.lib.tools.base](../../../../atomic_agents/lib/tools/base.py) module.diff --git a/docs/atomic_agents/lib/tools/calculator_tool.md b/docs/atomic_agents/lib/tools/calculator_tool.mdindex 1454869..dc6261a 100644--- a/docs/atomic_agents/lib/tools/calculator_tool.md+++ b/docs/atomic_agents/lib/tools/calculator_tool.md@@ -1,6 +1,6 @@# CalculatorTool-[Atomic_agents_redux Index](../../../README.md#atomic_agents_redux-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / [Creating a New Tool](./index.md#creating-a-new-tool) / CalculatorTool+[Atomic_agents_redux Index](../../../README.md#atomic_agents_redux-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / [Tools](./index.md#tools) / CalculatorTool> Auto-generated documentation for [atomic_agents.lib.tools.calculator_tool](../../../../atomic_agents/lib/tools/calculator_tool.py) module.diff --git a/docs/atomic_agents/lib/tools/index.md b/docs/atomic_agents/lib/tools/index.mdindex aa96753..7b29d80 100644--- a/docs/atomic_agents/lib/tools/index.md+++ b/docs/atomic_agents/lib/tools/index.md@@ -1,10 +1,10 @@-# Creating a New Tool+# Tools-[Atomic_agents_redux Index](../../../README.md#atomic_agents_redux-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / Creating a New Tool+[Atomic_agents_redux Index](../../../README.md#atomic_agents_redux-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / Tools> Auto-generated documentation for [atomic_agents.lib.tools](../../../../atomic_agents/lib/tools/__init__.py) module.-- [Creating a New Tool](#creating-a-new-tool)+- [Tools](#tools)- [Modules](#modules)## Modulesdiff --git a/docs/atomic_agents/lib/tools/searx.md b/docs/atomic_agents/lib/tools/searx.mdindex 71d2598..b2acaf2 100644--- a/docs/atomic_agents/lib/tools/searx.md+++ b/docs/atomic_agents/lib/tools/searx.md@@ -1,6 +1,6 @@# Searx-[Atomic_agents_redux Index](../../../README.md#atomic_agents_redux-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / [Creating a New Tool](./index.md#creating-a-new-tool) / Searx+[Atomic_agents_redux Index](../../../README.md#atomic_agents_redux-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / [Tools](./index.md#tools) / Searx> Auto-generated documentation for [atomic_agents.lib.tools.searx](../../../../atomic_agents/lib/tools/searx.py) module.diff --git a/docs/atomic_agents/lib/tools/web_scraping_tool.md b/docs/atomic_agents/lib/tools/web_scraping_tool.mdindex e83a362..cf299f3 100644--- a/docs/atomic_agents/lib/tools/web_scraping_tool.md+++ b/docs/atomic_agents/lib/tools/web_scraping_tool.md@@ -1,6 +1,6 @@# Web Scraping Tool-[Atomic_agents_redux Index](../../../README.md#atomic_agents_redux-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / [Creating a New Tool](./index.md#creating-a-new-tool) / Web Scraping Tool+[Atomic_agents_redux Index](../../../README.md#atomic_agents_redux-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / [Tools](./index.md#tools) / Web Scraping Tool> Auto-generated documentation for [atomic_agents.lib.tools.web_scraping_tool](../../../../atomic_agents/lib/tools/web_scraping_tool.py) module.