Building AI agents, atomically
Rename BaseAgentIO to BaseIOSchema
KennyVaneetvelde5b5283bb3ce4
diff --git a/atomic_agents/agents/base_agent.py b/atomic_agents/agents/base_agent.pyindex 4e2b425..b5812dd 100644--- a/atomic_agents/agents/base_agent.py+++ b/atomic_agents/agents/base_agent.py@@ -8,7 +8,7 @@ from atomic_agents.lib.components.agent_memory import AgentMemoryfrom atomic_agents.lib.components.system_prompt_generator import SystemPromptContextProviderBase, SystemPromptGenerator-class BaseAgentIO(BaseModel):+class BaseIOSchema(BaseModel):"""Base class for input and output schemas for chat agents."""@@ -21,7 +21,7 @@ class BaseAgentIO(BaseModel):return JSON(json_str)-class BaseAgentInputSchema(BaseAgentIO):+class BaseAgentInputSchema(BaseIOSchema):chat_message: str = Field(...,description="The chat message sent by the user to the assistant.",@@ -36,7 +36,7 @@ class BaseAgentInputSchema(BaseAgentIO):}-class BaseAgentOutputSchema(BaseAgentIO):+class BaseAgentOutputSchema(BaseIOSchema):chat_message: str = Field(...,description=(@@ -76,8 +76,8 @@ class BaseAgent:generating system prompts, and obtaining responses from a language model.Attributes:- input_schema (Type[BaseAgentIO]): Schema for the input data.- output_schema (Type[BaseAgentIO]): Schema for the output data.+ input_schema (Type[BaseIOSchema]): Schema for the input data.+ output_schema (Type[BaseIOSchema]): Schema for the output data.client: Client for interacting with the language model.model (str): The model to use for generating responses.memory (AgentMemory): Memory component for storing chat history.@@ -133,15 +133,15 @@ class BaseAgent:response = self.client.chat.completions.create(model=self.model, messages=messages, response_model=response_model)return response- def run(self, user_input: Optional[Type[BaseAgentIO]] = None) -> Type[BaseAgentIO]:+ def run(self, user_input: Optional[Type[BaseIOSchema]] = None) -> Type[BaseIOSchema]:"""Runs the chat agent with the given user input.Args:- user_input (Optional[Type[BaseAgentIO]]): The input from the user. If not provided, skips adding to memory.+ user_input (Optional[Type[BaseIOSchema]]): The input from the user. If not provided, skips adding to memory.Returns:- Type[BaseAgentIO]: The response from the chat agent.+ Type[BaseIOSchema]: The response from the chat agent."""if user_input:self.current_user_input = user_inputdiff --git a/atomic_agents/agents/tool_interface_agent.py b/atomic_agents/agents/tool_interface_agent.pyindex b44907d..df9dfaf 100644--- a/atomic_agents/agents/tool_interface_agent.py+++ b/atomic_agents/agents/tool_interface_agent.py@@ -2,7 +2,7 @@ import jsonfrom pydantic import Field, create_model-from atomic_agents.agents.base_agent import BaseAgentIO, BaseAgent, BaseAgentConfig+from atomic_agents.agents.base_agent import BaseIOSchema, BaseAgent, BaseAgentConfigfrom atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator, SystemPromptInfofrom atomic_agents.lib.tools.base import BaseToolfrom atomic_agents.lib.utils.format_tool_message import format_tool_message@@ -13,7 +13,7 @@ class ToolInterfaceAgentConfig(BaseAgentConfig):return_raw_output: bool = False-class ToolInputModel(BaseAgentIO):+class ToolInputModel(BaseIOSchema):tool_input: str = Field(..., description="Tool input. Presented as a single question or instruction")class Config:diff --git a/atomic_agents/lib/models/web_document.py b/atomic_agents/lib/models/web_document.pyindex 38af39f..f21c1e9 100644--- a/atomic_agents/lib/models/web_document.py+++ b/atomic_agents/lib/models/web_document.py@@ -1,6 +1,6 @@from pydantic import BaseModel, Field-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchemaclass WebDocumentMetadata(BaseModel):@@ -11,6 +11,6 @@ class WebDocumentMetadata(BaseModel):author: str = Field(default="")-class WebDocument(BaseAgentIO):+class WebDocument(BaseIOSchema):content: strmetadata: WebDocumentMetadata = Field(default_factory=lambda: WebDocumentMetadata(url=""))diff --git a/atomic_agents/lib/tools/base.py b/atomic_agents/lib/tools/base.pyindex 08401ce..b0a23b2 100644--- a/atomic_agents/lib/tools/base.py+++ b/atomic_agents/lib/tools/base.py@@ -2,7 +2,7 @@ from typing import Optional, Typefrom pydantic import BaseModel-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchemaclass BaseToolConfig(BaseModel):@@ -15,15 +15,15 @@ class BaseTool:Base class for all tools in the Atomic Agents framework.Attributes:- input_schema (Type[BaseAgentIO]): The schema for the input data.- output_schema (Type[BaseAgentIO]): The schema for the output data.+ input_schema (Type[BaseIOSchema]): The schema for the input data.+ output_schema (Type[BaseIOSchema]): The schema for the output data.tool_name (str): The name of the tool, derived from the input schema's title.tool_description (str):The description of the tool, derived from the input schema's description or overridden by the user."""- input_schema: Type[BaseAgentIO]- output_schema: Type[BaseAgentIO]+ input_schema: Type[BaseIOSchema]+ output_schema: Type[BaseIOSchema]def __init__(self, config: BaseToolConfig = BaseToolConfig()):"""@@ -35,15 +35,15 @@ class BaseTool:self.tool_name = config.title or self.input_schema.Config.titleself.tool_description = config.description or self.input_schema.Config.description- def run(self, params: Type[BaseAgentIO]) -> BaseAgentIO:+ def run(self, params: Type[BaseIOSchema]) -> BaseIOSchema:"""Runs the tool with the given parameters. This method should be implemented by subclasses.Args:- params (BaseAgentIO): The input parameters for the tool, adhering to the input schema.+ params (BaseIOSchema): The input parameters for the tool, adhering to the input schema.Returns:- BaseAgentIO: The output of the tool, adhering to the output schema.+ BaseIOSchema: The output of the tool, adhering to the output schema.Raises:NotImplementedError: If the method is not implemented by a subclass.diff --git a/atomic_agents/lib/tools/calculator_tool.py b/atomic_agents/lib/tools/calculator_tool.pyindex 2a9a85e..eca2fd6 100644--- a/atomic_agents/lib/tools/calculator_tool.py+++ b/atomic_agents/lib/tools/calculator_tool.py@@ -2,7 +2,7 @@ from pydantic import Fieldfrom rich.console import Consolefrom sympy import sympify-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchemafrom atomic_agents.lib.tools.base import BaseTool, BaseToolConfig################@@ -10,7 +10,7 @@ from atomic_agents.lib.tools.base import BaseTool, BaseToolConfig################-class CalculatorToolSchema(BaseAgentIO):+class CalculatorToolSchema(BaseIOSchema):expression: str = Field(..., description="Mathematical expression to evaluate. For example, '2 + 2'.")class Config:@@ -27,9 +27,7 @@ class CalculatorToolSchema(BaseAgentIO):##################### OUTPUT SCHEMA(S) #####################---class CalculatorToolOutputSchema(BaseAgentIO):+class CalculatorToolOutputSchema(BaseIOSchema):result: str = Field(..., description="Result of the calculation.")diff --git a/atomic_agents/lib/tools/content_scraping_tool.py b/atomic_agents/lib/tools/content_scraping_tool.pyindex 43cc5c3..30724be 100644--- a/atomic_agents/lib/tools/content_scraping_tool.py+++ b/atomic_agents/lib/tools/content_scraping_tool.py@@ -8,7 +8,7 @@ from pydantic import Fieldfrom rich.console import Consolefrom rich.markdown import Markdown-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchemafrom atomic_agents.lib.tools.base import BaseTool, BaseToolConfigfrom atomic_agents.lib.utils.scraping.pdf_to_markdown import PdfToMarkdownConverterfrom atomic_agents.lib.utils.scraping.url_to_markdown import UrlToMarkdownConverter@@ -18,7 +18,7 @@ from atomic_agents.lib.utils.scraping.url_to_markdown import UrlToMarkdownConver################-class ContentScrapingToolSchema(BaseAgentIO):+class ContentScrapingToolSchema(BaseIOSchema):url: str = Field(..., description="URL of the web page or PDF to scrape.")class Config:@@ -35,7 +35,7 @@ class ContentScrapingToolSchema(BaseAgentIO):####################-class ContentScrapingToolOutputSchema(BaseAgentIO):+class ContentScrapingToolOutputSchema(BaseIOSchema):content: strmetadata: Optional[dict] = Nonediff --git a/atomic_agents/lib/tools/search/searx_tool.py b/atomic_agents/lib/tools/search/searx_tool.pyindex e1fa4c6..e3bed85 100644--- a/atomic_agents/lib/tools/search/searx_tool.py+++ b/atomic_agents/lib/tools/search/searx_tool.py@@ -5,7 +5,7 @@ import requestsfrom pydantic import Fieldfrom rich.console import Console-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchemafrom atomic_agents.lib.tools.base import BaseTool, BaseToolConfig################@@ -13,7 +13,7 @@ from atomic_agents.lib.tools.base import BaseTool, BaseToolConfig################-class SearxNGSearchToolSchema(BaseAgentIO):+class SearxNGSearchToolSchema(BaseIOSchema):queries: List[str] = Field(..., description="List of search queries.")category: Optional[Literal["general", "news", "social_media"]] = Field("general", description="Category of the search queries."@@ -33,13 +33,13 @@ class SearxNGSearchToolSchema(BaseAgentIO):####################-class SearxNGSearchResultSchema(BaseAgentIO):+class SearxNGSearchResultSchema(BaseIOSchema):url: strtitle: strcontent: Optional[str] = None-class SearxNGSearchToolOutputSchema(BaseAgentIO):+class SearxNGSearchToolOutputSchema(BaseIOSchema):results: List[SearxNGSearchResultSchema]category: Optional[str] = None@@ -47,8 +47,6 @@ class SearxNGSearchToolOutputSchema(BaseAgentIO):############### TOOL LOGIC ###############--class SearxNGSearchToolConfig(BaseToolConfig):base_url: str = ""max_results: int = 10diff --git a/atomic_agents/lib/tools/search/serper_tool.py b/atomic_agents/lib/tools/search/serper_tool.pyindex 73ef6f3..b03cdc9 100644--- a/atomic_agents/lib/tools/search/serper_tool.py+++ b/atomic_agents/lib/tools/search/serper_tool.py@@ -6,7 +6,7 @@ import requestsfrom pydantic import Fieldfrom rich.console import Console-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchemafrom atomic_agents.lib.tools.base import BaseTool, BaseToolConfig################@@ -14,7 +14,7 @@ from atomic_agents.lib.tools.base import BaseTool, BaseToolConfig################-class SerperSearchToolSchema(BaseAgentIO):+class SerperSearchToolSchema(BaseIOSchema):queries: List[str] = Field(..., description="List of search queries.")class Config:@@ -31,14 +31,14 @@ class SerperSearchToolSchema(BaseAgentIO):####################-class SerperSearchResultSchema(BaseAgentIO):+class SerperSearchResultSchema(BaseIOSchema):url: strtitle: strcontent: Optional[str] = Noneposition: Optional[int] = None-class SerperSearchToolOutputSchema(BaseAgentIO):+class SerperSearchToolOutputSchema(BaseIOSchema):results: List[SerperSearchResultSchema]diff --git a/atomic_agents/lib/tools/yelp_restaurant_finder_tool.py b/atomic_agents/lib/tools/yelp_restaurant_finder_tool.pyindex 1fcdd37..f04c216 100644--- a/atomic_agents/lib/tools/yelp_restaurant_finder_tool.py+++ b/atomic_agents/lib/tools/yelp_restaurant_finder_tool.py@@ -6,7 +6,7 @@ import requestsfrom pydantic import Fieldfrom rich.console import Console-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchemafrom atomic_agents.lib.tools.base import BaseTool, BaseToolConfig################@@ -43,7 +43,7 @@ class PriceRange(Enum):FOUR = "4"-class YelpSearchToolSchema(BaseAgentIO):+class YelpSearchToolSchema(BaseIOSchema):location: str = Field(..., description="Location to search for food.")term: Optional[str] = Field(None, description="Search term (e.g., 'pizza', 'sushi').")categories: Optional[List[YelpCategory]] = Field(None, description="Categories to filter by (e.g., 'italian, mexican').")@@ -75,7 +75,7 @@ class YelpSearchToolSchema(BaseAgentIO):####################-class YelpSearchResultSchema(BaseAgentIO):+class YelpSearchResultSchema(BaseIOSchema):name: strurl: strrating: float@@ -85,7 +85,7 @@ class YelpSearchResultSchema(BaseAgentIO):categories: List[str]-class YelpSearchToolOutputSchema(BaseAgentIO):+class YelpSearchToolOutputSchema(BaseIOSchema):results: List[YelpSearchResultSchema]class Config:diff --git a/atomic_agents/lib/tools/yt_transcript_scraper.py b/atomic_agents/lib/tools/yt_transcript_scraper_tool.pysimilarity index 97%rename from atomic_agents/lib/tools/yt_transcript_scraper.pyrename to atomic_agents/lib/tools/yt_transcript_scraper_tool.pyindex 8d67ed4..7f11ea5 100644--- a/atomic_agents/lib/tools/yt_transcript_scraper.py+++ b/atomic_agents/lib/tools/yt_transcript_scraper_tool.py@@ -6,7 +6,7 @@ from pydantic import Fieldfrom rich.console import Consolefrom youtube_transcript_api import NoTranscriptFound, TranscriptsDisabled, YouTubeTranscriptApi-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchemafrom atomic_agents.lib.tools.base import BaseTool, BaseToolConfig################@@ -14,7 +14,7 @@ from atomic_agents.lib.tools.base import BaseTool, BaseToolConfig################-class YouTubeTranscriptToolSchema(BaseAgentIO):+class YouTubeTranscriptToolSchema(BaseIOSchema):video_url: str = Field(..., description="URL of the YouTube video to fetch the transcript for.")language: Optional[str] = Field(None, description="Language code for the transcript (e.g., 'en' for English).")@@ -32,7 +32,7 @@ class YouTubeTranscriptToolSchema(BaseAgentIO):####################-class YouTubeTranscriptToolOutputSchema(BaseAgentIO):+class YouTubeTranscriptToolOutputSchema(BaseIOSchema):transcript: strduration: floatcomments: List[str]diff --git a/docs/api/atomic_agents/agents/base_agent.md b/docs/api/atomic_agents/agents/base_agent.mdindex 82e97ab..ab50752 100644--- a/docs/api/atomic_agents/agents/base_agent.md+++ b/docs/api/atomic_agents/agents/base_agent.md@@ -13,7 +13,7 @@- [BaseAgent().run](#baseagent()run)- [BaseAgent().unregister_context_provider](#baseagent()unregister_context_provider)- [BaseAgentConfig](#baseagentconfig)- - [BaseAgentIO](#baseagentio)+ - [BaseIOSchema](#baseagentio)- [BaseAgentInputSchema](#baseagentinputschema)- [BaseAgentOutputSchema](#baseagentoutputschema)@@ -28,8 +28,8 @@ generating system prompts, and obtaining responses from a language model.#### Attributes-- `input_schema` *Type[BaseAgentIO]* - Schema for the input data.-- `output_schema` *Type[BaseAgentIO]* - Schema for the output data.+- `input_schema` *Type[BaseIOSchema]* - Schema for the input data.+- `output_schema` *Type[BaseIOSchema]* - Schema for the output data.- `client` - Client for interacting with the language model.- `model` *str* - The model to use for generating responses.- `memory` *AgentMemory* - Memory component for storing chat history.@@ -141,21 +141,21 @@ Runs the chat agent with the given user input.#### Arguments-- `user_input` *Optional[Type[BaseAgentIO]]* - The input from the user. If not provided, skips adding to memory.+- `user_input` *Optional[Type[BaseIOSchema]]* - The input from the user. If not provided, skips adding to memory.#### Returns-- `Type[BaseAgentIO]` - The response from the chat agent.+- `Type[BaseIOSchema]` - The response from the chat agent.#### Signature```python-def run(self, user_input: Optional[Type[BaseAgentIO]] = None) -> Type[BaseAgentIO]: ...+def run(self, user_input: Optional[Type[BaseIOSchema]] = None) -> Type[BaseIOSchema]: ...```#### See also-- [BaseAgentIO](#baseagentio)+- [BaseIOSchema](#baseagentio)### BaseAgent().unregister_context_provider@@ -187,7 +187,7 @@ class BaseAgentConfig(BaseModel): ...-## BaseAgentIO+## BaseIOSchema[Show source in base_agent.py:11](../../../../atomic_agents/agents/base_agent.py#L11)@@ -196,7 +196,7 @@ Base class for input and output schemas for chat agents.#### Signature```python-class BaseAgentIO(BaseModel): ...+class BaseIOSchema(BaseModel): ...```@@ -208,12 +208,12 @@ class BaseAgentIO(BaseModel): ...#### Signature```python-class BaseAgentInputSchema(BaseAgentIO): ...+class BaseAgentInputSchema(BaseIOSchema): ...```#### See also-- [BaseAgentIO](#baseagentio)+- [BaseIOSchema](#baseagentio)@@ -224,9 +224,9 @@ class BaseAgentInputSchema(BaseAgentIO): ...#### Signature```python-class BaseAgentOutputSchema(BaseAgentIO): ...+class BaseAgentOutputSchema(BaseIOSchema): ...```#### See also-- [BaseAgentIO](#baseagentio)\ No newline at end of file+- [BaseIOSchema](#baseagentio)\ No newline at end of filediff --git a/docs/api/atomic_agents/agents/tool_interface_agent.md b/docs/api/atomic_agents/agents/tool_interface_agent.mdindex c2144b4..b999711 100644--- a/docs/api/atomic_agents/agents/tool_interface_agent.md+++ b/docs/api/atomic_agents/agents/tool_interface_agent.md@@ -17,12 +17,12 @@#### Signature```python-class ToolInputModel(BaseAgentIO): ...+class ToolInputModel(BaseIOSchema): ...```#### See also-- [BaseAgentIO](./base_agent.md#baseagentio)+- [BaseIOSchema](./base_agent.md#baseagentio)diff --git a/docs/api/atomic_agents/lib/models/web_document.md b/docs/api/atomic_agents/lib/models/web_document.mdindex 677672c..a3b6ac1 100644--- a/docs/api/atomic_agents/lib/models/web_document.md+++ b/docs/api/atomic_agents/lib/models/web_document.md@@ -15,12 +15,12 @@#### Signature```python-class WebDocument(BaseAgentIO): ...+class WebDocument(BaseIOSchema): ...```#### See also-- [BaseAgentIO](../../agents/base_agent.md#baseagentio)+- [BaseIOSchema](../../agents/base_agent.md#baseagentio)diff --git a/docs/api/atomic_agents/lib/tools/base.md b/docs/api/atomic_agents/lib/tools/base.mdindex 8f22666..7287245 100644--- a/docs/api/atomic_agents/lib/tools/base.md+++ b/docs/api/atomic_agents/lib/tools/base.md@@ -17,8 +17,8 @@ Base class for all tools in the Atomic Agents framework.#### Attributes-- `input_schema` *Type[BaseAgentIO]* - The schema for the input data.-- `output_schema` *Type[BaseAgentIO]* - The schema for the output data.+- `input_schema` *Type[BaseIOSchema]* - The schema for the input data.+- `output_schema` *Type[BaseIOSchema]* - The schema for the output data.- `tool_name` *str* - The name of the tool, derived from the input schema's title.tool_description (str):The description of the tool, derived from the input schema's description or overridden by the user.@@ -42,11 +42,11 @@ Runs the tool with the given parameters. This method should be implemented by su#### Arguments-- `params` *BaseAgentIO* - The input parameters for the tool, adhering to the input schema.+- `params` *BaseIOSchema* - The input parameters for the tool, adhering to the input schema.#### Returns-- `BaseAgentIO` - The output of the tool, adhering to the output schema.+- `BaseIOSchema` - The output of the tool, adhering to the output schema.#### Raises@@ -55,12 +55,12 @@ Runs the tool with the given parameters. This method should be implemented by su#### Signature```python-def run(self, params: Type[BaseAgentIO]) -> BaseAgentIO: ...+def run(self, params: Type[BaseIOSchema]) -> BaseIOSchema: ...```#### See also-- [BaseAgentIO](../../agents/base_agent.md#baseagentio)+- [BaseIOSchema](../../agents/base_agent.md#baseagentio)diff --git a/docs/api/atomic_agents/lib/tools/calculator_tool.md b/docs/api/atomic_agents/lib/tools/calculator_tool.mdindex c3403a3..1c22a34 100644--- a/docs/api/atomic_agents/lib/tools/calculator_tool.md+++ b/docs/api/atomic_agents/lib/tools/calculator_tool.md@@ -84,12 +84,12 @@ class CalculatorToolConfig(BaseToolConfig): ...#### Signature```python-class CalculatorToolOutputSchema(BaseAgentIO): ...+class CalculatorToolOutputSchema(BaseIOSchema): ...```#### See also-- [BaseAgentIO](../../agents/base_agent.md#baseagentio)+- [BaseIOSchema](../../agents/base_agent.md#baseagentio)@@ -100,9 +100,9 @@ class CalculatorToolOutputSchema(BaseAgentIO): ...#### Signature```python-class CalculatorToolSchema(BaseAgentIO): ...+class CalculatorToolSchema(BaseIOSchema): ...```#### See also-- [BaseAgentIO](../../agents/base_agent.md#baseagentio)\ No newline at end of file+- [BaseIOSchema](../../agents/base_agent.md#baseagentio)\ No newline at end of filediff --git a/docs/api/atomic_agents/lib/tools/content_scraping_tool.md b/docs/api/atomic_agents/lib/tools/content_scraping_tool.mdindex 54adb96..c28575e 100644--- a/docs/api/atomic_agents/lib/tools/content_scraping_tool.md+++ b/docs/api/atomic_agents/lib/tools/content_scraping_tool.md@@ -97,12 +97,12 @@ class ContentScrapingToolConfig(BaseToolConfig): ...#### Signature```python-class ContentScrapingToolOutputSchema(BaseAgentIO): ...+class ContentScrapingToolOutputSchema(BaseIOSchema): ...```#### See also-- [BaseAgentIO](../../agents/base_agent.md#baseagentio)+- [BaseIOSchema](../../agents/base_agent.md#baseagentio)@@ -113,9 +113,9 @@ class ContentScrapingToolOutputSchema(BaseAgentIO): ...#### Signature```python-class ContentScrapingToolSchema(BaseAgentIO): ...+class ContentScrapingToolSchema(BaseIOSchema): ...```#### See also-- [BaseAgentIO](../../agents/base_agent.md#baseagentio)\ No newline at end of file+- [BaseIOSchema](../../agents/base_agent.md#baseagentio)\ No newline at end of filediff --git a/docs/api/atomic_agents/lib/tools/yelp_restaurant_finder_tool.md b/docs/api/atomic_agents/lib/tools/yelp_restaurant_finder_tool.mdindex c283f89..9e21fb4 100644--- a/docs/api/atomic_agents/lib/tools/yelp_restaurant_finder_tool.md+++ b/docs/api/atomic_agents/lib/tools/yelp_restaurant_finder_tool.md@@ -45,12 +45,12 @@ class YelpCategory(Enum): ...#### Signature```python-class YelpSearchResultSchema(BaseAgentIO): ...+class YelpSearchResultSchema(BaseIOSchema): ...```#### See also-- [BaseAgentIO](../../agents/base_agent.md#baseagentio)+- [BaseIOSchema](../../agents/base_agent.md#baseagentio)@@ -135,12 +135,12 @@ class YelpSearchToolConfig(BaseToolConfig): ...#### Signature```python-class YelpSearchToolOutputSchema(BaseAgentIO): ...+class YelpSearchToolOutputSchema(BaseIOSchema): ...```#### See also-- [BaseAgentIO](../../agents/base_agent.md#baseagentio)+- [BaseIOSchema](../../agents/base_agent.md#baseagentio)@@ -151,9 +151,9 @@ class YelpSearchToolOutputSchema(BaseAgentIO): ...#### Signature```python-class YelpSearchToolSchema(BaseAgentIO): ...+class YelpSearchToolSchema(BaseIOSchema): ...```#### See also-- [BaseAgentIO](../../agents/base_agent.md#baseagentio)\ No newline at end of file+- [BaseIOSchema](../../agents/base_agent.md#baseagentio)\ No newline at end of filediff --git a/docs/api/atomic_agents/lib/tools/yt_transcript_scraper.md b/docs/api/atomic_agents/lib/tools/yt_transcript_scraper.mdindex 6575ca4..3a60118 100644--- a/docs/api/atomic_agents/lib/tools/yt_transcript_scraper.md+++ b/docs/api/atomic_agents/lib/tools/yt_transcript_scraper.md@@ -133,12 +133,12 @@ class YouTubeTranscriptToolConfig(BaseToolConfig): ...#### Signature```python-class YouTubeTranscriptToolOutputSchema(BaseAgentIO): ...+class YouTubeTranscriptToolOutputSchema(BaseIOSchema): ...```#### See also-- [BaseAgentIO](../../agents/base_agent.md#baseagentio)+- [BaseIOSchema](../../agents/base_agent.md#baseagentio)@@ -149,9 +149,9 @@ class YouTubeTranscriptToolOutputSchema(BaseAgentIO): ...#### Signature```python-class YouTubeTranscriptToolSchema(BaseAgentIO): ...+class YouTubeTranscriptToolSchema(BaseIOSchema): ...```#### See also-- [BaseAgentIO](../../agents/base_agent.md#baseagentio)\ No newline at end of file+- [BaseIOSchema](../../agents/base_agent.md#baseagentio)\ No newline at end of filediff --git a/docs/guides/creating_a_new_tool.md b/docs/guides/creating_a_new_tool.mdindex 9e6bdeb..9185371 100644--- a/docs/guides/creating_a_new_tool.md+++ b/docs/guides/creating_a_new_tool.md@@ -17,13 +17,13 @@ A tool in the `atomic_agents` framework consists of the following components:#### 1. Define the Input Schema-The input schema is a Pydantic `BaseModel` that specifies the input parameters for the tool. It should inherit from `BaseAgentIO` and include a `Config` class with `title`, `description`, and `json_schema_extra` attributes. Here's an example:+The input schema is a Pydantic `BaseModel` that specifies the input parameters for the tool. It should inherit from `BaseIOSchema` and include a `Config` class with `title`, `description`, and `json_schema_extra` attributes. Here's an example:```pythonfrom pydantic import Field-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchema-class MyToolInputSchema(BaseAgentIO):+class MyToolInputSchema(BaseIOSchema):parameter: str = Field(..., description="Description of the parameter.")list_param: list[str] = Field(..., description="A list of strings.")@@ -38,10 +38,10 @@ class MyToolInputSchema(BaseAgentIO):#### 2. Define the Output Schema-The output schema is also a Pydantic `BaseModel` that inherits from `BaseAgentIO`. It specifies the structure of the tool's output. Here's an example:+The output schema is also a Pydantic `BaseModel` that inherits from `BaseIOSchema`. It specifies the structure of the tool's output. Here's an example:```python-class MyToolOutputSchema(BaseAgentIO):+class MyToolOutputSchema(BaseIOSchema):result: str = Field(..., description="Result of the tool's operation.")details: dict = Field(..., description="Additional details about the result.")```@@ -107,12 +107,12 @@ Here is a complete example of a new tool called `MyTool`:# my_tool.pyfrom pydantic import Field-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchemafrom atomic_agents.lib.tools.base import BaseTool, BaseToolConfigfrom rich.console import Console# Input Schema-class MyToolInputSchema(BaseAgentIO):+class MyToolInputSchema(BaseIOSchema):parameter: str = Field(..., description="Description of the parameter.")list_param: list[str] = Field(..., description="A list of strings.")@@ -125,7 +125,7 @@ class MyToolInputSchema(BaseAgentIO):}# Output Schema-class MyToolOutputSchema(BaseAgentIO):+class MyToolOutputSchema(BaseIOSchema):result: str = Field(..., description="Result of the tool's operation.")details: dict = Field(..., description="Additional details about the result.")@@ -164,4 +164,4 @@ if __name__ == "__main__":### Conclusion-By 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 to inherit from the appropriate base classes (`BaseAgentIO`, `BaseToolConfig`, and `BaseTool`) and use the `rich` library for console output in your example usage.+By 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 to inherit from the appropriate base classes (`BaseIOSchema`, `BaseToolConfig`, and `BaseTool`) and use the `rich` library for console output in your example usage.diff --git a/examples/deep_research_multi_agent/agents/info_refiner_agent.py b/examples/deep_research_multi_agent/agents/info_refiner_agent.pyindex c33acd5..1f67ee0 100644--- a/examples/deep_research_multi_agent/agents/info_refiner_agent.py+++ b/examples/deep_research_multi_agent/agents/info_refiner_agent.py@@ -1,11 +1,11 @@from pydantic import BaseModel, Field-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchemaimport instructorimport openaifrom atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfigfrom atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator, SystemPromptInfo-class RefineAnswerInputSchema(BaseAgentIO):+class RefineAnswerInputSchema(BaseIOSchema):question: str = Field(..., description='The question that was asked.')answer: str = Field(..., description='The initial answer to the question.')diff --git a/examples/deep_research_multi_agent/agents/query_agent.py b/examples/deep_research_multi_agent/agents/query_agent.pyindex ad10692..26546d4 100644--- a/examples/deep_research_multi_agent/agents/query_agent.py+++ b/examples/deep_research_multi_agent/agents/query_agent.py@@ -1,10 +1,10 @@import instructorimport openai-from atomic_agents.agents.base_agent import BaseAgentIO, BaseAgent, BaseAgentConfig+from atomic_agents.agents.base_agent import BaseIOSchema, BaseAgent, BaseAgentConfigfrom atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator, SystemPromptInfofrom atomic_agents.lib.tools.search.searx_tool import SearxNGSearchTool-class QueryAgentInputSchema(BaseAgentIO):+class QueryAgentInputSchema(BaseIOSchema):instruction: str = 'A detailed instruction or request to generate deep research queries for.'num_queries: int = 'The number of queries to generate.'diff --git a/examples/deep_research_multi_agent/agents/question_answering_agent.py b/examples/deep_research_multi_agent/agents/question_answering_agent.pyindex b7f0588..d02fc2e 100644--- a/examples/deep_research_multi_agent/agents/question_answering_agent.py+++ b/examples/deep_research_multi_agent/agents/question_answering_agent.py@@ -1,13 +1,13 @@import instructorimport openaifrom pydantic import BaseModel, Field-from atomic_agents.agents.base_agent import BaseAgentIO, BaseAgent, BaseAgentConfig+from atomic_agents.agents.base_agent import BaseIOSchema, BaseAgent, BaseAgentConfigfrom atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator, SystemPromptInfo-class AnswerAgentInputSchema(BaseAgentIO):+class AnswerAgentInputSchema(BaseIOSchema):question: str = Field(..., description='A question that needs to be answered based on the provided context.')-class AnswerAgentOutputSchema(BaseAgentIO):+class AnswerAgentOutputSchema(BaseIOSchema):markdown_output: str = Field(..., description='The answer to the question in markdown format.')# Create the answer agentdiff --git a/examples/deep_research_multi_agent/agents/top_urls_selector_agent.py b/examples/deep_research_multi_agent/agents/top_urls_selector_agent.pyindex ec66863..72236c0 100644--- a/examples/deep_research_multi_agent/agents/top_urls_selector_agent.py+++ b/examples/deep_research_multi_agent/agents/top_urls_selector_agent.py@@ -2,14 +2,14 @@ from typing import Listimport instructorimport openaifrom pydantic import BaseModel, Field, HttpUrl-from atomic_agents.agents.base_agent import BaseAgentIO, BaseAgent, BaseAgentConfig+from atomic_agents.agents.base_agent import BaseIOSchema, BaseAgent, BaseAgentConfigfrom atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator, SystemPromptInfo-class TopUrlsSelectorInputSchema(BaseAgentIO):+class TopUrlsSelectorInputSchema(BaseIOSchema):user_input: str = Field(..., description='The user input or question.')num_urls: int = Field(..., description='The number of top URLs to select.')-class TopUrlsSelectorOutputSchema(BaseAgentIO):+class TopUrlsSelectorOutputSchema(BaseIOSchema):top_urls: List[HttpUrl] = Field(..., description='The list of top URLs selected based on the user input.')# Create the top URLs selector agentdiff --git a/examples/minimal_multi_agent_tool_use.py b/examples/minimal_multi_agent_tool_use.pyindex e67f55c..7b58a33 100644--- a/examples/minimal_multi_agent_tool_use.py+++ b/examples/minimal_multi_agent_tool_use.py@@ -4,7 +4,7 @@ import instructorimport openaifrom pydantic import create_modelfrom rich.console import Console-from atomic_agents.agents.base_agent import BaseAgentIO, BaseAgent, BaseAgentConfig+from atomic_agents.agents.base_agent import BaseIOSchema, BaseAgent, BaseAgentConfigfrom atomic_agents.agents.tool_interface_agent import ToolInterfaceAgent, ToolInterfaceAgentConfigfrom atomic_agents.lib.tools.search.searx_tool import SearxNGSearchTool, SearxNGSearchToolConfigfrom atomic_agents.lib.tools.calculator_tool import CalculatorTool, CalculatorToolConfig@@ -19,7 +19,7 @@ calculator_agent_config = ToolInterfaceAgentConfig(client=client, model='gpt-3.5searx_agent = ToolInterfaceAgent(config=search_agent_config)calc_agent = ToolInterfaceAgent(config=calculator_agent_config)-UnionResponse = create_model('UnionResponse', __base__=BaseAgentIO, response=(Union[searx_agent.input_schema, calc_agent.input_schema], ...))+UnionResponse = create_model('UnionResponse', __base__=BaseIOSchema, response=(Union[searx_agent.input_schema, calc_agent.input_schema], ...))orchestration_agent = BaseAgent(config=BaseAgentConfig(client=client, model='gpt-3.5-turbo', output_schema=UnionResponse))diff --git a/examples/notebooks/multi_agent_quickstart.ipynb b/examples/notebooks/multi_agent_quickstart.ipynbindex b7117b5..9d6444d 100644--- a/examples/notebooks/multi_agent_quickstart.ipynb+++ b/examples/notebooks/multi_agent_quickstart.ipynb@@ -65,7 +65,7 @@"import openai\n","from pydantic import create_model\n","from rich.console import Console\n",- "from atomic_agents.agents.base_agent import BaseAgentIO, BaseAgent, BaseAgentConfig\n",+ "from atomic_agents.agents.base_agent import BaseIOSchema, BaseAgent, BaseAgentConfig\n","from atomic_agents.agents.tool_interface_agent import ToolInterfaceAgent, ToolInterfaceAgentConfig\n","from atomic_agents.lib.tools.search.searx_tool import SearxNGSearchTool, SearxNGSearchToolConfig\n","from atomic_agents.lib.tools.calculator_tool import CalculatorTool, CalculatorToolConfig"@@ -141,7 +141,7 @@"outputs": [],"source": ["# Define a union response schema\n",- "UnionResponse = create_model('UnionResponse', __base__=BaseAgentIO, response=(Union[searx_agent.input_schema, calc_agent.input_schema], ...))"+ "UnionResponse = create_model('UnionResponse', __base__=BaseIOSchema, response=(Union[searx_agent.input_schema, calc_agent.input_schema], ...))"]},{diff --git a/examples/notebooks/what_is_atomic_agents.ipynb b/examples/notebooks/what_is_atomic_agents.ipynbindex 59a650a..14245eb 100644--- a/examples/notebooks/what_is_atomic_agents.ipynb+++ b/examples/notebooks/what_is_atomic_agents.ipynb@@ -286,7 +286,7 @@"\n","First off, as mentioned before, each tool and each agent has an **input schema** and an **output schema**.\n","\n",- "These schemas all extend from what is called the `BaseAgentIO` class. This class itself is a Pydantic model with some predefined methods to facilitate storing a structured response in memory and to facilitate printing the response to the console using the `rich` library."+ "These schemas all extend from what is called the `BaseIOSchema` class. This class itself is a Pydantic model with some predefined methods to facilitate storing a structured response in memory and to facilitate printing the response to the console using the `rich` library."]},{@@ -298,7 +298,7 @@"from pydantic import BaseModel, Field\n","from rich.json import JSON\n","\n",- "class BaseAgentIO(BaseModel):\n",+ "class BaseIOSchema(BaseModel):\n"," \"\"\"\n"," Base class for input and output schemas for chat agents.\n"," \"\"\"\n",@@ -309,7 +309,7 @@" json_str = self.model_dump_json()\n"," return JSON(json_str)\n"," \n",- "class BaseAgentInputSchema(BaseAgentIO):\n",+ "class BaseAgentInputSchema(BaseIOSchema):\n"," chat_message: str = Field(\n"," ...,\n"," description='The chat message exchanged between the user and the chat agent. '\n",@@ -324,7 +324,7 @@" \"description\": description,\n"," }\n","\n",- "class BaseAgentOutputSchema(BaseAgentIO):\n",+ "class BaseAgentOutputSchema(BaseIOSchema):\n"," chat_message: str = Field(\n"," ...,\n"," description='The chat message exchanged between the user and the chat agent. '\n",@@ -345,7 +345,7 @@"metadata": {},"source": ["In the code above, you can see that the `BaseAgentInputSchema` and `BaseAgentOutputSchema` both:\n",- "- Extend from `BaseAgentIO`\n",+ "- Extend from `BaseIOSchema`\n","- Have a `chat_message` field with a `description` property \n","- Have a Config class with a `title`, `description`, and `json_schema_extra` property.\n","\n",@@ -433,7 +433,7 @@" THREE = \"3\"\n"," FOUR = \"4\"\n","\n",- "class YelpSearchToolSchema(BaseAgentIO):\n",+ "class YelpSearchToolSchema(BaseIOSchema):\n"," location: str = Field(..., description=\"Location to search for food.\")\n"," term: Optional[str] = Field(None, description=\"Search term (e.g., 'pizza', 'sushi').\")\n"," categories: Optional[List[YelpCategory]] = Field(None, description=\"Categories to filter by (e.g., 'italian, mexican').\")\n",@@ -475,7 +475,7 @@"source": ["import json\n","from pydantic import Field, create_model\n",- "from atomic_agents.agents.base_agent import BaseAgentIO, BaseAgent, BaseAgentConfig\n",+ "from atomic_agents.agents.base_agent import BaseIOSchema, BaseAgent, BaseAgentConfig\n","from atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator, SystemPromptInfo\n","from atomic_agents.lib.tools.base import BaseTool\n","from atomic_agents.lib.utils.format_tool_message import format_tool_message\n",@@ -484,7 +484,7 @@" tool_instance: BaseTool\n"," return_raw_output: bool = False\n","\n",- "class ToolInputModel(BaseAgentIO):\n",+ "class ToolInputModel(BaseIOSchema):\n"," tool_input: str = Field(..., description=\"Tool input. Presented as a single question or instruction\")\n","\n"," class Config:\n",diff --git a/tests/agents/test_base_agent.py b/tests/agents/test_base_agent.pyindex acbce59..86d9dad 100644--- a/tests/agents/test_base_agent.py+++ b/tests/agents/test_base_agent.py@@ -3,7 +3,7 @@ from unittest.mock import Mock, callfrom pydantic import BaseModelimport instructorfrom atomic_agents.agents.base_agent import (- BaseAgentIO,+ BaseIOSchema,BaseAgent,BaseAgentConfig,BaseAgentInputSchema,@@ -152,7 +152,7 @@ def test_custom_input_output_schemas(mock_instructor):def test_base_agent_io_str_and_rich():- class TestIO(BaseAgentIO):+ class TestIO(BaseIOSchema):field: strtest_io = TestIO(field="test")diff --git a/tests/agents/test_tool_interface_agent.py b/tests/agents/test_tool_interface_agent.pyindex 3edbc87..77e5fb2 100644--- a/tests/agents/test_tool_interface_agent.py+++ b/tests/agents/test_tool_interface_agent.py@@ -5,18 +5,18 @@ import instructorfrom atomic_agents.agents.tool_interface_agent import ToolInterfaceAgent, ToolInterfaceAgentConfig, ToolInputModelfrom atomic_agents.lib.tools.base import BaseTool-from atomic_agents.agents.base_agent import BaseAgentIO, BaseAgentOutputSchema+from atomic_agents.agents.base_agent import BaseIOSchema, BaseAgentOutputSchemafrom atomic_agents.lib.components.agent_memory import Messageclass MockTool(BaseTool):- class InputSchema(BaseAgentIO):+ class InputSchema(BaseIOSchema):query: str = Field(..., description="The query to process")class Config:title = "MockTool"description = "A mock tool for testing"- class OutputSchema(BaseAgentIO):+ class OutputSchema(BaseIOSchema):result: str = Field(..., description="The result of the tool operation")input_schema = InputSchemadiff --git a/tests/lib/models/test_web_document.py b/tests/lib/models/test_web_document.pyindex 5efd240..d451fb4 100644--- a/tests/lib/models/test_web_document.py+++ b/tests/lib/models/test_web_document.py@@ -1,7 +1,7 @@import pytestfrom pydantic import ValidationErrorfrom atomic_agents.lib.models.web_document import WebDocumentMetadata, WebDocument-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchemadef test_web_document_metadata_creation():metadata = WebDocumentMetadata(url="https://example.com")@@ -49,7 +49,7 @@ def test_web_document_content_required():def test_web_document_inheritance():doc = WebDocument(content="This is the content")assert isinstance(doc, WebDocument)- assert isinstance(doc, BaseAgentIO)+ assert isinstance(doc, BaseIOSchema)def test_web_document_metadata_serialization():metadata = WebDocumentMetadata(url="https://example.com", title="Example")diff --git a/tests/lib/tools/test_base.py b/tests/lib/tools/test_base.pyindex 93ce33b..8eb8e36 100644--- a/tests/lib/tools/test_base.py+++ b/tests/lib/tools/test_base.py@@ -1,15 +1,15 @@import pytestfrom pydantic import BaseModelfrom atomic_agents.lib.tools.base import BaseToolConfig, BaseTool-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchema# Mock classes for testing-class MockInputSchema(BaseAgentIO):+class MockInputSchema(BaseIOSchema):class Config:title = "Mock Input"description = "Mock input description"-class MockOutputSchema(BaseAgentIO):+class MockOutputSchema(BaseIOSchema):result: strclass MockTool(BaseTool):diff --git a/tests/lib/tools/test_yelp_restaurant_finder_tool.py b/tests/lib/tools/test_yelp_restaurant_finder_tool.pyindex 03117c7..8946f54 100644--- a/tests/lib/tools/test_yelp_restaurant_finder_tool.py+++ b/tests/lib/tools/test_yelp_restaurant_finder_tool.py@@ -11,7 +11,7 @@ from atomic_agents.lib.tools.yelp_restaurant_finder_tool import (PriceRange)from atomic_agents.lib.tools.base import BaseTool-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchema# Sample dataSAMPLE_YELP_RESPONSE = {@@ -39,14 +39,14 @@ def test_yelp_search_tool_initialization(yelp_search_tool):assert yelp_search_tool.max_results == 10def test_yelp_search_tool_input_schema():- assert issubclass(YelpSearchToolSchema, BaseAgentIO)+ assert issubclass(YelpSearchToolSchema, BaseIOSchema)assert "location" in YelpSearchToolSchema.model_fieldsassert "term" in YelpSearchToolSchema.model_fieldsassert "categories" in YelpSearchToolSchema.model_fieldsassert "price" in YelpSearchToolSchema.model_fieldsdef test_yelp_search_tool_output_schema():- assert issubclass(YelpSearchToolOutputSchema, BaseAgentIO)+ assert issubclass(YelpSearchToolOutputSchema, BaseIOSchema)assert "results" in YelpSearchToolOutputSchema.model_fields@patch('atomic_agents.lib.tools.yelp_restaurant_finder_tool.requests.get')diff --git a/tests/lib/tools/test_yt_transcript_scraper.py b/tests/lib/tools/test_yt_transcript_scraper.pyindex 7c3c6ab..3cb2a09 100644--- a/tests/lib/tools/test_yt_transcript_scraper.py+++ b/tests/lib/tools/test_yt_transcript_scraper.py@@ -10,7 +10,7 @@ from atomic_agents.lib.tools.yt_transcript_scraper import (YouTubeTranscriptToolOutputSchema,)from atomic_agents.lib.tools.base import BaseTool-from atomic_agents.agents.base_agent import BaseAgentIO+from atomic_agents.agents.base_agent import BaseIOSchemafrom youtube_transcript_api import YouTubeTranscriptApi@@ -37,12 +37,12 @@ def test_youtube_transcript_tool_initialization(youtube_transcript_tool):assert youtube_transcript_tool.api_key == "dummy_api_key"def test_youtube_transcript_tool_input_schema():- assert issubclass(YouTubeTranscriptToolSchema, BaseAgentIO)+ assert issubclass(YouTubeTranscriptToolSchema, BaseIOSchema)assert "video_url" in YouTubeTranscriptToolSchema.model_fieldsassert "language" in YouTubeTranscriptToolSchema.model_fieldsdef test_youtube_transcript_tool_output_schema():- assert issubclass(YouTubeTranscriptToolOutputSchema, BaseAgentIO)+ assert issubclass(YouTubeTranscriptToolOutputSchema, BaseIOSchema)assert "transcript" in YouTubeTranscriptToolOutputSchema.model_fieldsassert "duration" in YouTubeTranscriptToolOutputSchema.model_fieldsassert "comments" in YouTubeTranscriptToolOutputSchema.model_fields