Building AI agents, atomically
type parameter introduction
Koichi KAWAMURA90db4e7eff49
diff --git a/README.md b/README.mdindex 2bd0e73..360cbc4 100644--- a/README.md+++ b/README.md@@ -118,13 +118,12 @@ system_prompt_generator = SystemPromptGenerator()# Initialize the agent-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, CustomOutputSchema](config=BaseAgentConfig(client=your_openai_client, # Replace with your actual clientmodel="gpt-4o-mini",system_prompt_generator=system_prompt_generator,memory=AgentMemory(),- output_schema=CustomOutputSchema))@@ -234,8 +233,8 @@ class QueryAgentInputSchema(BaseIOSchema):num_queries: int = Field(..., description="Number of queries to generate.")# Initialize the query agent-query_agent = BaseAgent(- BaseAgentConfig(+query_agent = BaseAgent[QueryAgentInputSchema, SearxNGSearchTool.input_schema](+ config=BaseAgentConfig(client=instructor.from_openai(openai.OpenAI()),model="gpt-4o-mini",system_prompt_generator=SystemPromptGenerator(@@ -252,8 +251,6 @@ query_agent = BaseAgent("Provide the queries in the expected schema."],),- input_schema=QueryAgentInputSchema,- output_schema=SearxNGSearchTool.input_schema, # Align output schema))```diff --git a/atomic-agents/atomic_agents/agents/base_agent.py b/atomic-agents/atomic_agents/agents/base_agent.pyindex 183e763..5b1a7f0 100644--- a/atomic-agents/atomic_agents/agents/base_agent.py+++ b/atomic-agents/atomic_agents/agents/base_agent.py@@ -1,6 +1,6 @@import instructorfrom pydantic import BaseModel, Field-from typing import Optional, Type, TypeVar, Generator, AsyncGenerator+from typing import Optional, Type, Generator, AsyncGenerator, get_argsimport warningsfrom atomic_agents.lib.components.agent_memory import AgentMemoryfrom atomic_agents.lib.components.system_prompt_generator import (@@ -68,50 +68,33 @@ class BaseAgentConfig(BaseModel):system_role: Optional[str] = Field("system", description="The role of the system in the conversation. None means no system prompt.")- input_schema: Optional[Type[BaseModel]] = Field(None, description="The schema for the input data.")- output_schema: Optional[Type[BaseModel]] = Field(None, description="The schema for the output data.")model_config = {"arbitrary_types_allowed": True}- temperature: Optional[float] = Field(- None,- description="Temperature for response generation, typically ranging from 0 to 1.",- )- max_tokens: Optional[int] = Field(- None,- description="Maximum number of token allowed in the response generation.",- )model_api_parameters: Optional[dict] = Field(None, description="Additional parameters passed to the API provider.")-TI = TypeVar("TI", bound=BaseIOSchema) # InputSchema-TO = TypeVar("TO", bound=BaseIOSchema) # OutputSchema---class BaseAgent:+class BaseAgent[InputSchema: BaseIOSchema, OutputSchema: BaseIOSchema]:"""Base class for chat agents.This class provides the core functionality for handling chat interactions, including managing memory,generating system prompts, and obtaining responses from a language model.+ Type Parameters:+ InputSchema: Schema for the user input, must be a subclass of BaseIOSchema.+ OutputSchema: Schema for the agent's output, must be a subclass of BaseIOSchema.+Attributes:- 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.system_prompt_generator (SystemPromptGenerator): Component for generating system prompts.+ system_role (Optional[str]): The role of the system in the conversation. None means no system prompt.initial_memory (AgentMemory): Initial state of the memory.- temperature (float): Temperature for response generation, typically ranging from 0 to 1. For models such as- OpenAI o3-mini that do not support temperature, you must explicitly pass 'None'.- DEPRECATED: Include 'temperature' in model_api_parameters instead.- max_tokens (int): Maximum number of tokens allowed in the response.- DEPRECATED: Include 'max_tokens' in model_api_parameters instead.+ current_user_input (Optional[InputSchema]): The current user input being processed.model_api_parameters (dict): Additional parameters passed to the API provider.+ - Use this for parameters like 'temperature', 'max_tokens', etc."""- input_schema = BaseAgentInputSchema- output_schema = BaseAgentOutputSchema-def __init__(self, config: BaseAgentConfig):"""Initializes the BaseAgent.@@ -119,8 +102,6 @@ class BaseAgent:Args:config (BaseAgentConfig): Configuration for the chat agent."""- self.input_schema = config.input_schema or self.input_schema- self.output_schema = config.output_schema or self.output_schemaself.client = config.clientself.model = config.modelself.memory = config.memory or AgentMemory()@@ -129,19 +110,6 @@ class BaseAgent:self.initial_memory = self.memory.copy()self.current_user_input = Noneself.model_api_parameters = config.model_api_parameters or {}- if config.temperature is not None:- warnings.warn(- "'temperature' is deprecated and will soon be removed. Please use 'model_api_parameters' instead.",- DeprecationWarning,- )- if "temperature" not in self.model_api_parameters:- self.model_api_parameters["temperature"] = config.temperature- if config.max_tokens is not None:- warnings.warn(- "'max_tokens' is deprecated and will soon be removed. Please use 'model_api_parameters' instead.",- DeprecationWarning,- )- self.model_api_parameters["max_tokens"] = config.max_tokensdef reset_memory(self):"""@@ -149,6 +117,24 @@ class BaseAgent:"""self.memory = self.initial_memory.copy()+ @property+ def input_schema(self) -> Type[BaseIOSchema]:+ if hasattr(self, "__orig_class__"):+ TI, _ = get_args(self.__orig_class__)+ else:+ TI = BaseAgentInputSchema++ return TI++ @property+ def output_schema(self) -> Type[BaseIOSchema]:+ if hasattr(self, "__orig_class__"):+ _, TO = get_args(self.__orig_class__)+ else:+ TO = BaseAgentOutputSchema++ return TO+def _prepare_messages(self):if self.system_role is None:self.messages = []@@ -162,15 +148,15 @@ class BaseAgent:self.messages += self.memory.get_history()- def run(self, user_input: Optional[TI] = None) -> TO:+ def run(self, user_input: Optional[InputSchema] = None) -> OutputSchema:"""Runs the chat agent with the given user input synchronously.Args:- user_input (Optional[TI]): The input from the user. If not provided, skips adding to memory.+ user_input (Optional[InputSchema]): The input from the user. If not provided, skips adding to memory.Returns:- TO: The response from the chat agent.+ OutputSchema: The response from the chat agent."""assert not isinstance(self.client, instructor.client.AsyncInstructor@@ -191,18 +177,18 @@ class BaseAgent:return response- def run_stream(self, user_input: Optional[TI] = None) -> Generator[TO, None, TO]:+ def run_stream(self, user_input: Optional[InputSchema] = None) -> Generator[OutputSchema, None, OutputSchema]:"""Runs the chat agent with the given user input, supporting streaming output.Args:- user_input (Optional[TI]): The input from the user. If not provided, skips adding to memory.+ user_input (Optional[InputSchema]): The input from the user. If not provided, skips adding to memory.Yields:- TO: Partial responses from the chat agent.+ OutputSchema: Partial responses from the chat agent.Returns:- TO: The final response from the chat agent.+ OutputSchema: The final response from the chat agent."""assert not isinstance(self.client, instructor.client.AsyncInstructor@@ -230,15 +216,15 @@ class BaseAgent:return full_response_content- async def run_async(self, user_input: Optional[TI] = None) -> TO:+ async def run_async(self, user_input: Optional[InputSchema] = None) -> OutputSchema:"""Runs the chat agent asynchronously with the given user input.Args:- user_input (Optional[TI]): The input from the user. If not provided, skips adding to memory.+ user_input (Optional[InputSchema]): The input from the user. If not provided, skips adding to memory.Returns:- TO: The response from the chat agent.+ OutputSchema: The response from the chat agent.Raises:NotAsyncIterableError: If used as an async generator (in an async for loop).@@ -253,21 +239,24 @@ class BaseAgent:self._prepare_messages()response = await self.client.chat.completions.create(- model=self.model, messages=self.messages, response_model=self.output_schema, **self.model_api_parameters+ model=self.model,+ messages=self.messages,+ response_model=self.output_schema,+ **self.model_api_parameters)self.memory.add_message("assistant", response)return response- async def run_async_stream(self, user_input: Optional[TI] = None) -> AsyncGenerator[TO, None]:+ async def run_async_stream(self, user_input: Optional[InputSchema] = None) -> AsyncGenerator[OutputSchema, None]:"""Runs the chat agent asynchronously with the given user input, supporting streaming output.Args:- user_input (Optional[TI]): The input from the user. If not provided, skips adding to memory.+ user_input (Optional[InputSchema]): The input from the user. If not provided, skips adding to memory.Yields:- TO: Partial responses from the chat agent.+ OutputSchema: Partial responses from the chat agent."""assert isinstance(self.client, instructor.client.AsyncInstructor), "The run_async method is for async clients."if user_input:@@ -294,24 +283,6 @@ class BaseAgent:full_response_content = self.output_schema(**last_response.model_dump())self.memory.add_message("assistant", full_response_content)- async def stream_response_async(self, user_input: Optional[Type[BaseIOSchema]] = None):- """- Deprecated method for streaming responses asynchronously. Use run_async_stream instead.-- Args:- user_input (Optional[Type[BaseIOSchema]]): The input from the user. If not provided, skips adding to memory.-- Yields:- BaseModel: Partial responses from the chat agent.- """- warnings.warn(- "stream_response_async is deprecated and will be removed in version 1.1. Use run_async_stream instead.",- DeprecationWarning,- stacklevel=2,- )- async for response in self.run_async_stream(user_input):- yield response-def get_context_provider(self, provider_name: str) -> Type[SystemPromptContextProviderBase]:"""Retrieves a context provider by name.@@ -446,11 +417,11 @@ if __name__ == "__main__":if streaming:client = instructor.from_openai(AsyncOpenAI())config = BaseAgentConfig(client=client, model="gpt-4o-mini")- agent = BaseAgent(config)+ agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config)else:client = instructor.from_openai(OpenAI())config = BaseAgentConfig(client=client, model="gpt-4o-mini")- agent = BaseAgent(config)+ agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config)# Display agent information before starting the chatdisplay_agent_info(agent)diff --git a/atomic-agents/atomic_agents/lib/base/base_tool.py b/atomic-agents/atomic_agents/lib/base/base_tool.pyindex 149b507..b4ec922 100644--- a/atomic-agents/atomic_agents/lib/base/base_tool.py+++ b/atomic-agents/atomic_agents/lib/base/base_tool.py@@ -1,4 +1,5 @@-from typing import Optional, Type+from typing import Optional, Type, get_args+from abc import ABC, abstractmethodfrom pydantic import BaseModelfrom atomic_agents.lib.base.base_io_schema import BaseIOSchema@@ -17,20 +18,26 @@ class BaseToolConfig(BaseModel):description: Optional[str] = None-class BaseTool:+class BaseTool[InputSchema: BaseIOSchema, OutputSchema: BaseIOSchema](ABC):"""Base class for tools within the Atomic Agents framework.+ Tools enable agents to perform specific tasks by providing a standardized interface+ for input and output. Each tool is defined with specific input and output schemas+ that enforce type safety and provide documentation.++ Type Parameters:+ InputSchema: Schema defining the input data, must be a subclass of BaseIOSchema.+ OutputSchema: Schema defining the output data, must be a subclass of BaseIOSchema.+Attributes:- input_schema (Type[BaseIOSchema]): Schema defining the input data.- output_schema (Type[BaseIOSchema]): Schema defining the output data.- tool_name (str): The name of the tool, derived from the input schema's description or overridden by the user.- tool_description (str): Description of the tool, derived from the input schema's description or overridden by the user.+ config (BaseToolConfig): Configuration for the tool, including optional title and description overrides.+ input_schema (Type[InputSchema]): Schema class defining the input data (derived from generic type parameter).+ output_schema (Type[OutputSchema]): Schema class defining the output data (derived from generic type parameter).+ tool_name (str): The name of the tool, derived from the input schema's title or overridden by the config.+ tool_description (str): Description of the tool, derived from the input schema's description or overridden by the config."""- input_schema: Type[BaseIOSchema]- output_schema: Type[BaseIOSchema]-def __init__(self, config: BaseToolConfig = BaseToolConfig()):"""Initializes the BaseTool with an optional configuration override.@@ -38,20 +45,70 @@ class BaseTool:Args:config (BaseToolConfig, optional): Configuration for the tool, including optional title and description overrides."""- self.tool_name = config.title or self.input_schema.model_json_schema()["title"]- self.tool_description = config.description or self.input_schema.model_json_schema()["description"]+ self.config = config++ @property+ def input_schema(self) -> Type[InputSchema]:+ """+ Returns the input schema class for the tool.++ Returns:+ Type[InputSchema]: The input schema class.+ """+ if hasattr(self, "__orig_class__"):+ TI, _ = get_args(self.__orig_class__)+ else:+ TI = BaseIOSchema++ return TI++ @property+ def output_schema(self) -> Type[OutputSchema]:+ """+ Returns the output schema class for the tool.++ Returns:+ Type[OutputSchema]: The output schema class.+ """+ if hasattr(self, "__orig_class__"):+ _, TO = get_args(self.__orig_class__)+ else:+ TO = BaseIOSchema++ return TO++ @property+ def tool_name(self) -> str:+ """+ Returns the name of the tool.++ Returns:+ str: The name of the tool.+ """+ return self.config.title or self.input_schema.model_json_schema()["title"]++ @property+ def tool_description(self) -> str:+ """+ Returns the description of the tool.++ Returns:+ str: The description of the tool.+ """+ return self.config.description or self.input_schema.model_json_schema()["description"]- def run(self, params: Type[BaseIOSchema]) -> BaseIOSchema:+ @abstractmethod+ def run(self, params: InputSchema) -> OutputSchema:"""Executes the tool with the provided parameters.Args:- params (BaseIOSchema): Input parameters adhering to the input schema.+ params (InputSchema): Input parameters adhering to the input schema.Returns:- BaseIOSchema: Output resulting from executing the tool, adhering to the output schema.+ OutputSchema: Output resulting from executing the tool, adhering to the output schema.Raises:NotImplementedError: If the method is not implemented by a subclass."""- raise NotImplementedError("Subclasses should implement this method")+ passdiff --git a/atomic-agents/tests/agents/test_base_agent.py b/atomic-agents/tests/agents/test_base_agent.pyindex 2879696..af61284 100644--- a/atomic-agents/tests/agents/test_base_agent.py+++ b/atomic-agents/tests/agents/test_base_agent.py@@ -86,7 +86,7 @@ def agent_config(mock_instructor, mock_memory, mock_system_prompt_generator):@pytest.fixturedef agent(agent_config):- return BaseAgent(agent_config)+ return BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](agent_config)@pytest.fixture@@ -101,7 +101,7 @@ def agent_config_async(mock_instructor_async, mock_memory, mock_system_prompt_ge@pytest.fixturedef agent_async(agent_config_async):- return BaseAgent(agent_config_async)+ return BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](agent_config_async)def test_initialization(agent, mock_instructor, mock_memory, mock_system_prompt_generator):@@ -109,22 +109,19 @@ def test_initialization(agent, mock_instructor, mock_memory, mock_system_prompt_assert agent.model == "gpt-4o-mini"assert agent.memory == mock_memoryassert agent.system_prompt_generator == mock_system_prompt_generator- assert agent.input_schema == BaseAgentInputSchema- assert agent.output_schema == BaseAgentOutputSchemaassert "max_tokens" not in agent.model_api_parameters-# model_api_parameters should have priority over the deprecated temperature parameter if both are provided.+# model_api_parameters should have priority over other settingsdef test_initialization_temperature_priority(mock_instructor, mock_memory, mock_system_prompt_generator):config = BaseAgentConfig(client=mock_instructor,model="gpt-4o-mini",memory=mock_memory,system_prompt_generator=mock_system_prompt_generator,- temperature=0.5,model_api_parameters={"temperature": 1.0},)- agent = BaseAgent(config)+ agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config)assert agent.model_api_parameters["temperature"] == 1.0@@ -134,10 +131,9 @@ def test_initialization_without_temperature(mock_instructor, mock_memory, mock_smodel="gpt-4o-mini",memory=mock_memory,system_prompt_generator=mock_system_prompt_generator,- temperature=0.5,- model_api_parameters={}, # No temperature specified+ model_api_parameters={"temperature": 0.5},)- agent = BaseAgent(config)+ agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config)assert agent.model_api_parameters["temperature"] == 0.5@@ -147,10 +143,9 @@ def test_initialization_without_max_tokens(mock_instructor, mock_memory, mock_symodel="gpt-4o-mini",memory=mock_memory,system_prompt_generator=mock_system_prompt_generator,- max_tokens=1024,- model_api_parameters={}, # No temperature specified+ model_api_parameters={"max_tokens": 1024},)- agent = BaseAgent(config)+ agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config)assert agent.model_api_parameters["max_tokens"] == 1024@@ -163,7 +158,7 @@ def test_initialization_system_role_equals_developer(mock_instructor, mock_memorsystem_role="developer",model_api_parameters={}, # No temperature specified)- agent = BaseAgent(config)+ agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config)_ = agent._prepare_messages()assert isinstance(agent.messages, list) and agent.messages[0]["role"] == "developer"@@ -177,7 +172,7 @@ def test_initialization_system_role_equals_None(mock_instructor, mock_memory, mosystem_role=None,model_api_parameters={}, # No temperature specified)- agent = BaseAgent(config)+ agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config)_ = agent._prepare_messages()assert isinstance(agent.messages, list) and len(agent.messages) == 0@@ -219,6 +214,18 @@ def test_unregister_context_provider(agent, mock_system_prompt_generator):agent.unregister_context_provider("non_existent_provider")+def test_no_type_parameters(mock_instructor):+ custom_config = BaseAgentConfig(+ client=mock_instructor,+ model="gpt-4o-mini",+ )++ custom_agent = BaseAgent(custom_config)++ assert custom_agent.input_schema == BaseAgentInputSchema+ assert custom_agent.output_schema == BaseAgentOutputSchema++def test_custom_input_output_schemas(mock_instructor):class CustomInputSchema(BaseModel):custom_field: str@@ -229,11 +236,9 @@ def test_custom_input_output_schemas(mock_instructor):custom_config = BaseAgentConfig(client=mock_instructor,model="gpt-4o-mini",- input_schema=CustomInputSchema,- output_schema=CustomOutputSchema,)- custom_agent = BaseAgent(custom_config)+ custom_agent = BaseAgent[CustomInputSchema, CustomOutputSchema](custom_config)assert custom_agent.input_schema == CustomInputSchemaassert custom_agent.output_schema == CustomOutputSchema@@ -294,7 +299,7 @@ def test_run_stream(mock_instructor, mock_memory):memory=mock_memory,system_prompt_generator=None, # No system prompt generator)- agent = BaseAgent(config)+ agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config)mock_input = BaseAgentInputSchema(chat_message="Test input")mock_output = BaseAgentOutputSchema(chat_message="Test output")@@ -347,36 +352,6 @@ async def test_run_async_stream(agent_async, mock_memory):mock_memory.add_message.assert_any_call("assistant", full_response_content)-async def test_stream_response_async(agent, mock_memory, mock_instructor_async, mock_system_prompt_generator):- # Replace the agent's client with the async version- agent.client = mock_instructor_async-- mock_input = BaseAgentInputSchema(chat_message="Test input")- mock_output = BaseAgentOutputSchema(chat_message="Test output")-- # Since stream_response_async is deprecated and now just wraps run_async_stream,- # we need to mock run_async_stream directly-- # Create a simple async generator for testing- async def mock_async_gen():- yield mock_output-- # Mock the run_async_stream method- agent.run_async_stream = Mock(return_value=mock_async_gen())-- responses = []- async for partial_response in agent.stream_response_async(mock_input):- responses.append(partial_response)-- # Verify run_async_stream was called- agent.run_async_stream.assert_called_once_with(mock_input)-- # Verify we got the expected response- assert len(responses) == 1- assert responses[0] == mock_output--def test_model_from_chunks_patched():class TestPartialModel(PartialBase):@classmethoddiff --git a/atomic-agents/tests/lib/base/test_base_tool.py b/atomic-agents/tests/lib/base/test_base_tool.pyindex 72f6662..6ef7dfb 100644--- a/atomic-agents/tests/lib/base/test_base_tool.py+++ b/atomic-agents/tests/lib/base/test_base_tool.py@@ -17,12 +17,14 @@ class MockOutputSchema(BaseIOSchema):result: str-class MockTool(BaseTool):- input_schema = MockInputSchema- output_schema = MockOutputSchema-- def run(self, params: MockInputSchema) -> MockOutputSchema:- return MockOutputSchema(result="Mock result")+class MockTool[InputSchema: BaseIOSchema, OutputSchema: BaseIOSchema](BaseTool):+ def run(self, params: InputSchema) -> OutputSchema:+ if self.output_schema == MockOutputSchema:+ return MockOutputSchema(result="Mock result")+ elif self.output_schema == BaseIOSchema:+ return BaseIOSchema()+ else:+ raise ValueError("Unsupported output schema")def test_base_tool_config_creation():@@ -37,55 +39,52 @@ def test_base_tool_config_with_values():assert config.description == "Test description"-def test_base_tool_initialization():+def test_base_tool_initialization_without_type_parameters():tool = MockTool()+ assert tool.tool_name == "BaseIOSchema"+ assert tool.tool_description == "Base schema for input/output in the Atomic Agents framework."+ assert tool.output_schema == BaseIOSchema+++def test_base_tool_initialization():+ tool = MockTool[MockInputSchema, MockOutputSchema]()assert tool.tool_name == "MockInputSchema"assert tool.tool_description == "Mock input schema for testing"def test_base_tool_with_config():config = BaseToolConfig(title="Custom Title", description="Custom description")- tool = MockTool(config=config)+ tool = MockTool[MockInputSchema, MockOutputSchema](config=config)assert tool.tool_name == "Custom Title"assert tool.tool_description == "Custom description"def test_base_tool_with_custom_title():config = BaseToolConfig(title="Custom Tool Name")- tool = MockTool(config=config)+ tool = MockTool[MockInputSchema, MockOutputSchema](config=config)assert tool.tool_name == "Custom Tool Name"assert tool.tool_description == "Mock input schema for testing"-def test_base_tool_run_not_implemented():- class UnimplementedTool(BaseTool):- input_schema = MockInputSchema- output_schema = MockOutputSchema-- tool = UnimplementedTool()- with pytest.raises(NotImplementedError):- tool.run(MockInputSchema(query="mock query"))--def test_mock_tool_run():- tool = MockTool()+ tool = MockTool[MockInputSchema, MockOutputSchema]()result = tool.run(MockInputSchema(query="mock query"))assert isinstance(result, MockOutputSchema)assert result.result == "Mock result"def test_base_tool_input_schema():- tool = MockTool()+ tool = MockTool[MockInputSchema, MockOutputSchema]()assert tool.input_schema == MockInputSchemadef test_base_tool_output_schema():- tool = MockTool()+ tool = MockTool[MockInputSchema, MockOutputSchema]()assert tool.output_schema == MockOutputSchemadef test_base_tool_inheritance():- tool = MockTool()+ tool = MockTool[MockInputSchema, MockOutputSchema]()assert isinstance(tool, BaseTool)diff --git a/atomic-agents/tests/lib/components/test_agent_memory.py b/atomic-agents/tests/lib/components/test_agent_memory.pyindex fb8484c..68532ae 100644--- a/atomic-agents/tests/lib/components/test_agent_memory.py+++ b/atomic-agents/tests/lib/components/test_agent_memory.py@@ -13,37 +13,37 @@ class InputSchema(BaseIOSchema):test_field: str = Field(..., description="A test field")-class TestOutputSchema(BaseIOSchema):+class MockOutputSchema(BaseIOSchema):"""Test Output Schema"""test_field: str = Field(..., description="A test field")-class TestNestedSchema(BaseIOSchema):+class MockNestedSchema(BaseIOSchema):"""Test Nested Schema"""nested_field: str = Field(..., description="A nested field")nested_int: int = Field(..., description="A nested integer")-class TestComplexInputSchema(BaseIOSchema):+class MockComplexInputSchema(BaseIOSchema):"""Test Complex Input Schema"""text_field: str = Field(..., description="A text field")number_field: float = Field(..., description="A number field")list_field: List[str] = Field(..., description="A list of strings")- nested_field: TestNestedSchema = Field(..., description="A nested schema")+ nested_field: MockNestedSchema = Field(..., description="A nested schema")-class TestComplexOutputSchema(BaseIOSchema):+class MockComplexOutputSchema(BaseIOSchema):"""Test Complex Output Schema"""response_text: str = Field(..., description="A response text")calculated_value: int = Field(..., description="A calculated value")- data_dict: Dict[str, TestNestedSchema] = Field(..., description="A dictionary of nested schemas")+ data_dict: Dict[str, MockNestedSchema] = Field(..., description="A dictionary of nested schemas")-class TestMultimodalSchema(BaseIOSchema):+class MockMultimodalSchema(BaseIOSchema):"""Test schema for multimodal content"""instruction_text: str = Field(..., description="The instruction text")@@ -83,7 +83,7 @@ def test_manage_overflow(memory):def test_get_history(memory):memory.add_message("user", InputSchema(test_field="Hello"))- memory.add_message("assistant", TestOutputSchema(test_field="Hi there"))+ memory.add_message("assistant", MockOutputSchema(test_field="Hi there"))history = memory.get_history()assert len(history) == 2assert history[0]["role"] == "user"@@ -115,19 +115,19 @@ def test_get_message_count(memory):def test_dump_and_load(memory):memory.add_message("user",- TestComplexInputSchema(+ MockComplexInputSchema(text_field="Hello",number_field=3.14,list_field=["item1", "item2"],- nested_field=TestNestedSchema(nested_field="Nested", nested_int=42),+ nested_field=MockNestedSchema(nested_field="Nested", nested_int=42),),)memory.add_message("assistant",- TestComplexOutputSchema(+ MockComplexOutputSchema(response_text="Hi there",calculated_value=100,- data_dict={"key": TestNestedSchema(nested_field="Nested Output", nested_int=10)},+ data_dict={"key": MockNestedSchema(nested_field="Nested Output", nested_int=10)},),)@@ -138,8 +138,8 @@ def test_dump_and_load(memory):assert new_memory.max_messages == memory.max_messagesassert new_memory.current_turn_id == memory.current_turn_idassert len(new_memory.history) == len(memory.history)- assert isinstance(new_memory.history[0].content, TestComplexInputSchema)- assert isinstance(new_memory.history[1].content, TestComplexOutputSchema)+ assert isinstance(new_memory.history[0].content, MockComplexInputSchema)+ assert isinstance(new_memory.history[1].content, MockComplexOutputSchema)assert new_memory.history[0].content.text_field == "Hello"assert new_memory.history[1].content.response_text == "Hi there"@@ -173,23 +173,23 @@ def test_complex_scenario(memory):# Add complex inputmemory.add_message("user",- TestComplexInputSchema(+ MockComplexInputSchema(text_field="Complex input",number_field=2.718,list_field=["a", "b", "c"],- nested_field=TestNestedSchema(nested_field="Nested input", nested_int=99),+ nested_field=MockNestedSchema(nested_field="Nested input", nested_int=99),),)# Add complex outputmemory.add_message("assistant",- TestComplexOutputSchema(+ MockComplexOutputSchema(response_text="Complex output",calculated_value=200,data_dict={- "key1": TestNestedSchema(nested_field="Nested output 1", nested_int=10),- "key2": TestNestedSchema(nested_field="Nested output 2", nested_int=20),+ "key1": MockNestedSchema(nested_field="Nested output 1", nested_int=10),+ "key2": MockNestedSchema(nested_field="Nested output 2", nested_int=20),},),)@@ -201,8 +201,8 @@ def test_complex_scenario(memory):# Verify loaded dataassert len(new_memory.history) == 2- assert isinstance(new_memory.history[0].content, TestComplexInputSchema)- assert isinstance(new_memory.history[1].content, TestComplexOutputSchema)+ assert isinstance(new_memory.history[0].content, MockComplexInputSchema)+ assert isinstance(new_memory.history[1].content, MockComplexOutputSchema)assert new_memory.history[0].content.text_field == "Complex input"assert new_memory.history[0].content.nested_field.nested_int == 99assert new_memory.history[1].content.response_text == "Complex output"@@ -233,7 +233,7 @@ def test_memory_turn_consistency():memory.initialize_turn()turn_id = memory.get_current_turn_id()memory.add_message("user", InputSchema(test_field="Hello"))- memory.add_message("assistant", TestOutputSchema(test_field="Hi"))+ memory.add_message("assistant", MockOutputSchema(test_field="Hi"))assert memory.history[0].turn_id == turn_idassert memory.history[1].turn_id == turn_id@@ -290,7 +290,7 @@ def test_get_history_with_multimodal_content(memory):mock_image = instructor.Image(source="test_url", media_type="image/jpeg", detail="low")# Add a multimodal message- memory.add_message("user", TestMultimodalSchema(instruction_text="Analyze this image", images=[mock_image]))+ memory.add_message("user", MockMultimodalSchema(instruction_text="Analyze this image", images=[mock_image]))# Get history and verify formathistory = memory.get_history()@@ -304,7 +304,7 @@ def test_get_history_with_multimodal_content(memory):def test_get_history_with_multiple_images_multimodal_content(memory):"""Test that get_history correctly handles multimodal content"""- class TestMultimodalSchemaArbitraryKeys(BaseIOSchema):+ class MockMultimodalSchemaArbitraryKeys(BaseIOSchema):"""Test schema for multimodal content"""instruction_text: str = Field(..., description="The instruction text")@@ -319,7 +319,7 @@ def test_get_history_with_multiple_images_multimodal_content(memory):# Add a multimodal messagememory.add_message("user",- TestMultimodalSchemaArbitraryKeys(+ MockMultimodalSchemaArbitraryKeys(instruction_text="Analyze this image",some_other_key_with_image=mock_image,some_key_for_images=[mock_image_2, mock_image_3],diff --git a/atomic-examples/basic-multimodal/basic_multimodal/main.py b/atomic-examples/basic-multimodal/basic_multimodal/main.pyindex 6657ec8..7d60b82 100644--- a/atomic-examples/basic-multimodal/basic_multimodal/main.py+++ b/atomic-examples/basic-multimodal/basic_multimodal/main.py@@ -60,7 +60,7 @@ class NutritionAnalysisOutput(BaseIOSchema):# Configure the nutrition analysis system-nutrition_analyzer = BaseAgent(+nutrition_analyzer = BaseAgent[NutritionAnalysisInput, NutritionAnalysisOutput](config=BaseAgentConfig(client=instructor.from_openai(openai.OpenAI(api_key=API_KEY)),model="gpt-4o-mini",@@ -86,8 +86,6 @@ nutrition_analyzer = BaseAgent("4. Include all extracted labels in the final result",],),- input_schema=NutritionAnalysisInput,- output_schema=NutritionAnalysisOutput,))diff --git a/atomic-examples/basic-multimodal/pyproject.toml b/atomic-examples/basic-multimodal/pyproject.tomlindex 1375e5e..40faec3 100644--- a/atomic-examples/basic-multimodal/pyproject.toml+++ b/atomic-examples/basic-multimodal/pyproject.toml@@ -6,7 +6,7 @@ authors = ["Kenny Vaneetvelde <[email protected]>"]readme = "README.md"[tool.poetry.dependencies]-python = "^3.11"+python = ">=3.12,<4.0"atomic-agents = {path = "../..", develop = true}instructor = ">=1.3.4,<2.0.0"openai = ">=1.35.12,<2.0.0"diff --git a/atomic-examples/deep-research/deep_research/agents/choice_agent.py b/atomic-examples/deep-research/deep_research/agents/choice_agent.pyindex 62dbb0a..49f080a 100644--- a/atomic-examples/deep-research/deep_research/agents/choice_agent.py+++ b/atomic-examples/deep-research/deep_research/agents/choice_agent.py@@ -21,7 +21,7 @@ class ChoiceAgentOutputSchema(BaseIOSchema):decision: bool = Field(..., description="The final decision based on the analysis")-choice_agent = BaseAgent(+choice_agent = BaseAgent[ChoiceAgentInputSchema, ChoiceAgentOutputSchema](BaseAgentConfig(client=instructor.from_openai(openai.OpenAI(api_key=ChatConfig.api_key)),model=ChatConfig.model,@@ -45,8 +45,7 @@ choice_agent = BaseAgent("Your decision must match your reasoning - don't contradict yourself",],),- input_schema=ChoiceAgentInputSchema,- output_schema=ChoiceAgentOutputSchema,+ model_api_parameters={"temperature": 0.1},))diff --git a/atomic-examples/deep-research/deep_research/agents/qa_agent.py b/atomic-examples/deep-research/deep_research/agents/qa_agent.pyindex c12b549..eefc9e0 100644--- a/atomic-examples/deep-research/deep_research/agents/qa_agent.py+++ b/atomic-examples/deep-research/deep_research/agents/qa_agent.py@@ -27,7 +27,7 @@ class QuestionAnsweringAgentOutputSchema(BaseIOSchema):)-question_answering_agent = BaseAgent(+question_answering_agent = BaseAgent[QuestionAnsweringAgentInputSchema, QuestionAnsweringAgentOutputSchema](BaseAgentConfig(client=instructor.from_openai(openai.OpenAI(api_key=ChatConfig.api_key)),model=ChatConfig.model,@@ -57,7 +57,6 @@ question_answering_agent = BaseAgent("- What are the limitations of your search capabilities?",],),- input_schema=QuestionAnsweringAgentInputSchema,- output_schema=QuestionAnsweringAgentOutputSchema,+ model_api_parameters={"temperature": 0.1},))diff --git a/atomic-examples/deep-research/deep_research/agents/query_agent.py b/atomic-examples/deep-research/deep_research/agents/query_agent.pyindex 3032fe9..40c6afa 100644--- a/atomic-examples/deep-research/deep_research/agents/query_agent.py+++ b/atomic-examples/deep-research/deep_research/agents/query_agent.py@@ -15,7 +15,7 @@ class QueryAgentInputSchema(BaseIOSchema):num_queries: int = Field(..., description="The number of search queries to generate.")-query_agent = BaseAgent(+query_agent = BaseAgent[QueryAgentInputSchema, SearxNGSearchTool.input_schema.__class__](BaseAgentConfig(client=instructor.from_openai(openai.OpenAI(api_key=ChatConfig.api_key)),model=ChatConfig.model,@@ -37,7 +37,5 @@ query_agent = BaseAgent("Each query should be a concise string of keywords and operators",],),- input_schema=QueryAgentInputSchema,- output_schema=SearxNGSearchTool.input_schema,))diff --git a/atomic-examples/deep-research/deep_research/tools/searxng_search.py b/atomic-examples/deep-research/deep_research/tools/searxng_search.pyindex 4d1582e..35afdf4 100644--- a/atomic-examples/deep-research/deep_research/tools/searxng_search.py+++ b/atomic-examples/deep-research/deep_research/tools/searxng_search.py@@ -51,7 +51,7 @@ class SearxNGSearchToolConfig(BaseToolConfig):max_results: int = 10-class SearxNGSearchTool(BaseTool):+class SearxNGSearchTool(BaseTool[SearxNGSearchToolInputSchema, SearxNGSearchToolOutputSchema]):"""Tool for performing searches on SearxNG based on the provided queries and category.@@ -62,9 +62,6 @@ class SearxNGSearchTool(BaseTool):base_url (str): The base URL for the SearxNG instance to use."""- input_schema = SearxNGSearchToolInputSchema- output_schema = SearxNGSearchToolOutputSchema-def __init__(self, config: SearxNGSearchToolConfig = SearxNGSearchToolConfig()):"""Initializes the SearxNGTool.diff --git a/atomic-examples/deep-research/deep_research/tools/webpage_scraper.py b/atomic-examples/deep-research/deep_research/tools/webpage_scraper.pyindex f9bafa2..3a74e1f 100644--- a/atomic-examples/deep-research/deep_research/tools/webpage_scraper.py+++ b/atomic-examples/deep-research/deep_research/tools/webpage_scraper.py@@ -1,12 +1,14 @@-from typing import Optional-from urllib.parse import urlparse-import re+from time import sleep+from typing import Optional, Dict, List, Any+import asyncio+from concurrent.futures import ThreadPoolExecutor+import loggingimport requestsfrom bs4 import BeautifulSoupfrom markdownify import markdownifyfrom pydantic import Field, HttpUrl-from readability import Document+import trafilaturafrom atomic_agents.agents.base_agent import BaseIOSchemafrom atomic_agents.lib.base.base_tool import BaseTool, BaseToolConfig@@ -54,46 +56,54 @@ class WebpageScraperToolOutputSchema(BaseIOSchema):# CONFIGURATION ##################class WebpageScraperToolConfig(BaseToolConfig):- """Configuration for the WebpageScraperTool."""-- user_agent: str = Field(- default=(- "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "- "AppleWebKit/537.36 (KHTML, like Gecko) "- "Chrome/91.0.4472.124 Safari/537.36"- ),- description="User agent string to use for requests.",- )- timeout: int = Field(- default=30,- description="Timeout in seconds for HTTP requests.",- )- max_content_length: int = Field(- default=100_000_000,- description="Maximum content length in bytes to process.",- )+ """+ Configuration for the WebpageScraperTool.++ Attributes:+ timeout (int): Timeout for the HTTP request in seconds.+ headers (Dict[str, str]): HTTP headers to use for the request.+ min_text_length (int): Minimum length of text to consider the webpage valid.+ use_trafilatura (bool): Whether to use trafilatura for webpage parsing.+ """++ timeout: int = 30+ headers: Dict[str, str] = {+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3",+ "Accept": "text/html,application/xhtml+xml,application/xml",+ "Accept-Language": "en-US,en;q=0.9",+ }+ min_text_length: int = 200+ use_trafilatura: bool = True###################### MAIN TOOL & LOGIC ######################-class WebpageScraperTool(BaseTool):+class WebpageScraperTool(BaseTool[WebpageScraperToolInputSchema, WebpageScraperToolOutputSchema]):"""- Tool for scraping webpage content and converting it to markdown format.+ Tool for scraping and extracting information from a webpage.++ Attributes:+ input_schema (WebpageScraperToolInputSchema): The schema for the input data.+ output_schema (WebpageScraperToolOutputSchema): The schema for the output data.+ timeout (int): Timeout for the HTTP request in seconds.+ headers (Dict[str, str]): HTTP headers to use for the request.+ min_text_length (int): Minimum length of text to consider the webpage valid.+ use_trafilatura (bool): Whether to use trafilatura for webpage parsing."""- input_schema = WebpageScraperToolInputSchema- output_schema = WebpageScraperToolOutputSchema-def __init__(self, config: WebpageScraperToolConfig = WebpageScraperToolConfig()):"""Initializes the WebpageScraperTool.Args:- config (WebpageScraperToolConfig): Configuration for the tool.+ config (WebpageScraperToolConfig): Configuration for the WebpageScraperTool."""super().__init__(config)- self.config = config+ self.timeout = config.timeout+ self.headers = config.headers+ self.min_text_length = config.min_text_length+ self.use_trafilatura = config.use_trafilaturadef _fetch_webpage(self, url: str) -> str:"""@@ -105,15 +115,7 @@ class WebpageScraperTool(BaseTool):Returns:str: The HTML content of the webpage."""- headers = {- "User-Agent": self.config.user_agent,- "Accept": "text/html,application/xhtml+xml,application/xml;" "q=0.9,image/webp,*/*;q=0.8",- "Accept-Language": "en-US,en;q=0.5",- "Connection": "keep-alive",- }-- response = requests.get(url, headers=headers, timeout=self.config.timeout)- # response.raise_for_status()+ response = requests.get(url, headers=self.headers, timeout=self.timeout)if len(response.content) > self.config.max_content_length:raise ValueError(f"Content length exceeds maximum of {self.config.max_content_length} bytes")diff --git a/atomic-examples/deep-research/poetry.lock b/atomic-examples/deep-research/poetry.lockindex 2ddc11b..bfe993c 100644--- a/atomic-examples/deep-research/poetry.lock+++ b/atomic-examples/deep-research/poetry.lock@@ -1,4 +1,4 @@-# This file is automatically @generated by Poetry 2.0.0 and should not be changed by hand.+# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand.[[package]]name = "aiohappyeyeballs"@@ -108,7 +108,7 @@ propcache = ">=0.2.0"yarl = ">=1.17.0,<2.0"[package.extras]-speedups = ["Brotli", "aiodns (>=3.2.0)", "brotlicffi"]+speedups = ["Brotli ; platform_python_implementation == \"CPython\"", "aiodns (>=3.2.0) ; sys_platform == \"linux\" or sys_platform == \"darwin\"", "brotlicffi ; platform_python_implementation != \"CPython\""][[package]]name = "aiosignal"@@ -155,15 +155,15 @@ sniffio = ">=1.1"[package.extras]doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"]-test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"]+test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1) ; python_version >= \"3.10\"", "uvloop (>=0.21.0b1) ; platform_python_implementation == \"CPython\" and platform_system != \"Windows\""]trio = ["trio (>=0.26.1)"][[package]]name = "atomic-agents"-version = "1.0.16"+version = "1.0.26"description = "A versatile framework for creating and managing intelligent agents."optional = false-python-versions = ">=3.9,<4.0"+python-versions = ">=3.12,<4.0"groups = ["main"]files = []develop = true@@ -195,12 +195,27 @@ files = [][package.extras]-benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"]-cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]-dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]+benchmark = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\"", "pytest-xdist[psutil]"]+cov = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\"", "pytest-xdist[psutil]"]+dev = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\"", "pytest-xdist[psutil]"]docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier (<24.7)"]-tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]-tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"]+tests = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\"", "pytest-xdist[psutil]"]+tests-mypy = ["mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\""]++[[package]]+name = "babel"+version = "2.17.0"+description = "Internationalization utilities"+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "babel-2.17.0-py3-none-any.whl", hash = "sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2"},+ {file = "babel-2.17.0.tar.gz", hash = "sha256:0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d"},+]++[package.extras]+dev = ["backports.zoneinfo ; python_version < \"3.9\"", "freezegun (>=1.0,<2.0)", "jinja2 (>=3.0)", "pytest (>=6.0)", "pytest-cov", "pytz", "setuptools", "tzdata ; sys_platform == \"win32\""][[package]]name = "beautifulsoup4"@@ -391,6 +406,26 @@ files = [{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},]+[[package]]+name = "courlan"+version = "1.3.2"+description = "Clean, filter and sample URLs to optimize data collection – includes spam, content type and language filters."+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "courlan-1.3.2-py3-none-any.whl", hash = "sha256:d0dab52cf5b5b1000ee2839fbc2837e93b2514d3cb5bb61ae158a55b7a04c6be"},+ {file = "courlan-1.3.2.tar.gz", hash = "sha256:0b66f4db3a9c39a6e22dd247c72cfaa57d68ea660e94bb2c84ec7db8712af190"},+]++[package.dependencies]+babel = ">=2.16.0"+tld = ">=0.13"+urllib3 = ">=1.26,<3"++[package.extras]+dev = ["black", "flake8", "mypy", "pytest", "pytest-cov", "types-urllib3"]+[[package]]name = "cssselect"version = "1.2.0"@@ -403,6 +438,29 @@ files = [{file = "cssselect-1.2.0.tar.gz", hash = "sha256:666b19839cfaddb9ce9d36bfe4c969132c647b92fc9088c4e23f786b30f1b3dc"},]+[[package]]+name = "dateparser"+version = "1.2.1"+description = "Date parsing library designed to parse dates from HTML pages"+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "dateparser-1.2.1-py3-none-any.whl", hash = "sha256:bdcac262a467e6260030040748ad7c10d6bacd4f3b9cdb4cfd2251939174508c"},+ {file = "dateparser-1.2.1.tar.gz", hash = "sha256:7e4919aeb48481dbfc01ac9683c8e20bfe95bb715a38c1e9f6af889f4f30ccc3"},+]++[package.dependencies]+python-dateutil = ">=2.7.0"+pytz = ">=2024.2"+regex = ">=2015.06.24,<2019.02.19 || >2019.02.19,<2021.8.27 || >2021.8.27"+tzlocal = ">=0.2"++[package.extras]+calendars = ["convertdate (>=2.2.1)", "hijridate"]+fasttext = ["fasttext (>=0.9.1)", "numpy (>=1.19.3,<2)"]+langdetect = ["langdetect (>=1.0.0)"]+[[package]]name = "distro"version = "1.9.0"@@ -561,7 +619,7 @@ gitdb = ">=4.0.1,<5"[package.extras]doc = ["sphinx (==4.3.2)", "sphinx-autodoc-typehints", "sphinx-rtd-theme", "sphinxcontrib-applehelp (>=1.0.2,<=1.0.4)", "sphinxcontrib-devhelp (==1.0.2)", "sphinxcontrib-htmlhelp (>=2.0.0,<=2.0.1)", "sphinxcontrib-qthelp (==1.0.3)", "sphinxcontrib-serializinghtml (==1.1.5)"]-test = ["coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mock", "mypy", "pre-commit", "pytest (>=7.3.1)", "pytest-cov", "pytest-instafail", "pytest-mock", "pytest-sugar", "typing-extensions"]+test = ["coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mock ; python_version < \"3.8\"", "mypy", "pre-commit", "pytest (>=7.3.1)", "pytest-cov", "pytest-instafail", "pytest-mock", "pytest-sugar", "typing-extensions ; python_version < \"3.11\""][[package]]name = "h11"@@ -575,6 +633,30 @@ files = [{file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"},]+[[package]]+name = "htmldate"+version = "1.9.3"+description = "Fast and robust extraction of original and updated publication dates from URLs and web pages."+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "htmldate-1.9.3-py3-none-any.whl", hash = "sha256:3fadc422cf3c10a5cdb5e1b914daf37ec7270400a80a1b37e2673ff84faaaff8"},+ {file = "htmldate-1.9.3.tar.gz", hash = "sha256:ac0caf4628c3ded4042011e2d60dc68dfb314c77b106587dd307a80d77e708e9"},+]++[package.dependencies]+charset_normalizer = ">=3.4.0"+dateparser = ">=1.1.2"+lxml = {version = ">=5.3.0,<6", markers = "platform_system != \"Darwin\" or python_version > \"3.8\""}+python-dateutil = ">=2.9.0.post0"+urllib3 = ">=1.26,<3"++[package.extras]+all = ["htmldate[dev]", "htmldate[speed]"]+dev = ["black", "flake8", "mypy", "pytest", "pytest-cov", "types-dateparser", "types-lxml", "types-python-dateutil", "types-urllib3"]+speed = ["backports-datetime-fromisoformat ; python_version < \"3.11\"", "faust-cchardet (>=2.1.19)", "urllib3[brotli]"]+[[package]]name = "httpcore"version = "1.0.6"@@ -617,7 +699,7 @@ idna = "*"sniffio = "*"[package.extras]-brotli = ["brotli", "brotlicffi"]+brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""]cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"]http2 = ["h2 (>=3,<5)"]socks = ["socksio (==1.*)"]@@ -763,6 +845,21 @@ files = [{file = "jiter-0.5.0.tar.gz", hash = "sha256:1d916ba875bcab5c5f7d927df998c4cb694d27dceddf3392e58beaf10563368a"},]+[[package]]+name = "justext"+version = "3.0.2"+description = "Heuristic based boilerplate removal tool"+optional = false+python-versions = "*"+groups = ["main"]+files = [+ {file = "justext-3.0.2-py2.py3-none-any.whl", hash = "sha256:62b1c562b15c3c6265e121cc070874243a443bfd53060e869393f09d6b6cc9a7"},+ {file = "justext-3.0.2.tar.gz", hash = "sha256:13496a450c44c4cd5b5a75a5efcd9996066d2a189794ea99a49949685a0beb05"},+]++[package.dependencies]+lxml = {version = ">=4.4.2", extras = ["html-clean"]}+[[package]]name = "linkify-it-py"version = "2.0.3"@@ -932,6 +1029,9 @@ files = [{file = "lxml-5.3.0.tar.gz", hash = "sha256:4e109ca30d1edec1ac60cdbe341905dc3b8f55b16855e03a54aaf59e51ec8c6f"},]+[package.dependencies]+lxml-html-clean = {version = "*", optional = true, markers = "extra == \"html-clean\""}+[package.extras]cssselect = ["cssselect (>=0.7)"]html-clean = ["lxml-html-clean"]@@ -1371,7 +1471,7 @@ typing-extensions = ">=4.12.2"[package.extras]email = ["email-validator (>=2.0.0)"]-timezone = ["tzdata"]+timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""][[package]]name = "pydantic-core"@@ -1513,6 +1613,21 @@ files = [[package.extras]windows-terminal = ["colorama (>=0.4.6)"]+[[package]]+name = "python-dateutil"+version = "2.9.0.post0"+description = "Extensions to the standard Python datetime module"+optional = false+python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"+groups = ["main"]+files = [+ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"},+ {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"},+]++[package.dependencies]+six = ">=1.5"+[[package]]name = "python-dotenv"version = "1.0.1"@@ -1528,6 +1643,18 @@ files = [[package.extras]cli = ["click (>=5.0)"]+[[package]]+name = "pytz"+version = "2025.2"+description = "World timezone definitions, modern and historical"+optional = false+python-versions = "*"+groups = ["main"]+files = [+ {file = "pytz-2025.2-py2.py3-none-any.whl", hash = "sha256:5ddf76296dd8c44c26eb8f4b6f35488f3ccbf6fbbd7adee0b7262d43f0ec2f00"},+ {file = "pytz-2025.2.tar.gz", hash = "sha256:360b9e3dbb49a209c21ad61809c7fb453643e048b38924c765813546746e81c3"},+]+[[package]]name = "pyyaml"version = "6.0.2"@@ -1611,6 +1738,110 @@ lxml = "*"[package.extras]test = ["timeout-decorator"]+[[package]]+name = "regex"+version = "2024.11.6"+description = "Alternative regular expression module, to replace re."+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "regex-2024.11.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ff590880083d60acc0433f9c3f713c51f7ac6ebb9adf889c79a261ecf541aa91"},+ {file = "regex-2024.11.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:658f90550f38270639e83ce492f27d2c8d2cd63805c65a13a14d36ca126753f0"},+ {file = "regex-2024.11.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:164d8b7b3b4bcb2068b97428060b2a53be050085ef94eca7f240e7947f1b080e"},+ {file = "regex-2024.11.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3660c82f209655a06b587d55e723f0b813d3a7db2e32e5e7dc64ac2a9e86fde"},+ {file = "regex-2024.11.6-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d22326fcdef5e08c154280b71163ced384b428343ae16a5ab2b3354aed12436e"},+ {file = "regex-2024.11.6-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f1ac758ef6aebfc8943560194e9fd0fa18bcb34d89fd8bd2af18183afd8da3a2"},+ {file = "regex-2024.11.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:997d6a487ff00807ba810e0f8332c18b4eb8d29463cfb7c820dc4b6e7562d0cf"},+ {file = "regex-2024.11.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:02a02d2bb04fec86ad61f3ea7f49c015a0681bf76abb9857f945d26159d2968c"},+ {file = "regex-2024.11.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f02f93b92358ee3f78660e43b4b0091229260c5d5c408d17d60bf26b6c900e86"},+ {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:06eb1be98df10e81ebaded73fcd51989dcf534e3c753466e4b60c4697a003b67"},+ {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:040df6fe1a5504eb0f04f048e6d09cd7c7110fef851d7c567a6b6e09942feb7d"},+ {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:fdabbfc59f2c6edba2a6622c647b716e34e8e3867e0ab975412c5c2f79b82da2"},+ {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:8447d2d39b5abe381419319f942de20b7ecd60ce86f16a23b0698f22e1b70008"},+ {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:da8f5fc57d1933de22a9e23eec290a0d8a5927a5370d24bda9a6abe50683fe62"},+ {file = "regex-2024.11.6-cp310-cp310-win32.whl", hash = "sha256:b489578720afb782f6ccf2840920f3a32e31ba28a4b162e13900c3e6bd3f930e"},+ {file = "regex-2024.11.6-cp310-cp310-win_amd64.whl", hash = "sha256:5071b2093e793357c9d8b2929dfc13ac5f0a6c650559503bb81189d0a3814519"},+ {file = "regex-2024.11.6-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:5478c6962ad548b54a591778e93cd7c456a7a29f8eca9c49e4f9a806dcc5d638"},+ {file = "regex-2024.11.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2c89a8cc122b25ce6945f0423dc1352cb9593c68abd19223eebbd4e56612c5b7"},+ {file = "regex-2024.11.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:94d87b689cdd831934fa3ce16cc15cd65748e6d689f5d2b8f4f4df2065c9fa20"},+ {file = "regex-2024.11.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1062b39a0a2b75a9c694f7a08e7183a80c63c0d62b301418ffd9c35f55aaa114"},+ {file = "regex-2024.11.6-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:167ed4852351d8a750da48712c3930b031f6efdaa0f22fa1933716bfcd6bf4a3"},+ {file = "regex-2024.11.6-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d548dafee61f06ebdb584080621f3e0c23fff312f0de1afc776e2a2ba99a74f"},+ {file = "regex-2024.11.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2a19f302cd1ce5dd01a9099aaa19cae6173306d1302a43b627f62e21cf18ac0"},+ {file = "regex-2024.11.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bec9931dfb61ddd8ef2ebc05646293812cb6b16b60cf7c9511a832b6f1854b55"},+ {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:9714398225f299aa85267fd222f7142fcb5c769e73d7733344efc46f2ef5cf89"},+ {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:202eb32e89f60fc147a41e55cb086db2a3f8cb82f9a9a88440dcfc5d37faae8d"},+ {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:4181b814e56078e9b00427ca358ec44333765f5ca1b45597ec7446d3a1ef6e34"},+ {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:068376da5a7e4da51968ce4c122a7cd31afaaec4fccc7856c92f63876e57b51d"},+ {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ac10f2c4184420d881a3475fb2c6f4d95d53a8d50209a2500723d831036f7c45"},+ {file = "regex-2024.11.6-cp311-cp311-win32.whl", hash = "sha256:c36f9b6f5f8649bb251a5f3f66564438977b7ef8386a52460ae77e6070d309d9"},+ {file = "regex-2024.11.6-cp311-cp311-win_amd64.whl", hash = "sha256:02e28184be537f0e75c1f9b2f8847dc51e08e6e171c6bde130b2687e0c33cf60"},+ {file = "regex-2024.11.6-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:52fb28f528778f184f870b7cf8f225f5eef0a8f6e3778529bdd40c7b3920796a"},+ {file = "regex-2024.11.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fdd6028445d2460f33136c55eeb1f601ab06d74cb3347132e1c24250187500d9"},+ {file = "regex-2024.11.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:805e6b60c54bf766b251e94526ebad60b7de0c70f70a4e6210ee2891acb70bf2"},+ {file = "regex-2024.11.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b85c2530be953a890eaffde05485238f07029600e8f098cdf1848d414a8b45e4"},+ {file = "regex-2024.11.6-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bb26437975da7dc36b7efad18aa9dd4ea569d2357ae6b783bf1118dabd9ea577"},+ {file = "regex-2024.11.6-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:abfa5080c374a76a251ba60683242bc17eeb2c9818d0d30117b4486be10c59d3"},+ {file = "regex-2024.11.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b7fa6606c2881c1db9479b0eaa11ed5dfa11c8d60a474ff0e095099f39d98e"},+ {file = "regex-2024.11.6-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0c32f75920cf99fe6b6c539c399a4a128452eaf1af27f39bce8909c9a3fd8cbe"},+ {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:982e6d21414e78e1f51cf595d7f321dcd14de1f2881c5dc6a6e23bbbbd68435e"},+ {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a7c2155f790e2fb448faed6dd241386719802296ec588a8b9051c1f5c481bc29"},+ {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:149f5008d286636e48cd0b1dd65018548944e495b0265b45e1bffecce1ef7f39"},+ {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:e5364a4502efca094731680e80009632ad6624084aff9a23ce8c8c6820de3e51"},+ {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0a86e7eeca091c09e021db8eb72d54751e527fa47b8d5787caf96d9831bd02ad"},+ {file = "regex-2024.11.6-cp312-cp312-win32.whl", hash = "sha256:32f9a4c643baad4efa81d549c2aadefaeba12249b2adc5af541759237eee1c54"},+ {file = "regex-2024.11.6-cp312-cp312-win_amd64.whl", hash = "sha256:a93c194e2df18f7d264092dc8539b8ffb86b45b899ab976aa15d48214138e81b"},+ {file = "regex-2024.11.6-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a6ba92c0bcdf96cbf43a12c717eae4bc98325ca3730f6b130ffa2e3c3c723d84"},+ {file = "regex-2024.11.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:525eab0b789891ac3be914d36893bdf972d483fe66551f79d3e27146191a37d4"},+ {file = "regex-2024.11.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:086a27a0b4ca227941700e0b31425e7a28ef1ae8e5e05a33826e17e47fbfdba0"},+ {file = "regex-2024.11.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bde01f35767c4a7899b7eb6e823b125a64de314a8ee9791367c9a34d56af18d0"},+ {file = "regex-2024.11.6-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b583904576650166b3d920d2bcce13971f6f9e9a396c673187f49811b2769dc7"},+ {file = "regex-2024.11.6-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1c4de13f06a0d54fa0d5ab1b7138bfa0d883220965a29616e3ea61b35d5f5fc7"},+ {file = "regex-2024.11.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3cde6e9f2580eb1665965ce9bf17ff4952f34f5b126beb509fee8f4e994f143c"},+ {file = "regex-2024.11.6-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0d7f453dca13f40a02b79636a339c5b62b670141e63efd511d3f8f73fba162b3"},+ {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:59dfe1ed21aea057a65c6b586afd2a945de04fc7db3de0a6e3ed5397ad491b07"},+ {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:b97c1e0bd37c5cd7902e65f410779d39eeda155800b65fc4d04cc432efa9bc6e"},+ {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:f9d1e379028e0fc2ae3654bac3cbbef81bf3fd571272a42d56c24007979bafb6"},+ {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:13291b39131e2d002a7940fb176e120bec5145f3aeb7621be6534e46251912c4"},+ {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4f51f88c126370dcec4908576c5a627220da6c09d0bff31cfa89f2523843316d"},+ {file = "regex-2024.11.6-cp313-cp313-win32.whl", hash = "sha256:63b13cfd72e9601125027202cad74995ab26921d8cd935c25f09c630436348ff"},+ {file = "regex-2024.11.6-cp313-cp313-win_amd64.whl", hash = "sha256:2b3361af3198667e99927da8b84c1b010752fa4b1115ee30beaa332cabc3ef1a"},+ {file = "regex-2024.11.6-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:3a51ccc315653ba012774efca4f23d1d2a8a8f278a6072e29c7147eee7da446b"},+ {file = "regex-2024.11.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ad182d02e40de7459b73155deb8996bbd8e96852267879396fb274e8700190e3"},+ {file = "regex-2024.11.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ba9b72e5643641b7d41fa1f6d5abda2c9a263ae835b917348fc3c928182ad467"},+ {file = "regex-2024.11.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40291b1b89ca6ad8d3f2b82782cc33807f1406cf68c8d440861da6304d8ffbbd"},+ {file = "regex-2024.11.6-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cdf58d0e516ee426a48f7b2c03a332a4114420716d55769ff7108c37a09951bf"},+ {file = "regex-2024.11.6-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a36fdf2af13c2b14738f6e973aba563623cb77d753bbbd8d414d18bfaa3105dd"},+ {file = "regex-2024.11.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1cee317bfc014c2419a76bcc87f071405e3966da434e03e13beb45f8aced1a6"},+ {file = "regex-2024.11.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:50153825ee016b91549962f970d6a4442fa106832e14c918acd1c8e479916c4f"},+ {file = "regex-2024.11.6-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ea1bfda2f7162605f6e8178223576856b3d791109f15ea99a9f95c16a7636fb5"},+ {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:df951c5f4a1b1910f1a99ff42c473ff60f8225baa1cdd3539fe2819d9543e9df"},+ {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:072623554418a9911446278f16ecb398fb3b540147a7828c06e2011fa531e773"},+ {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:f654882311409afb1d780b940234208a252322c24a93b442ca714d119e68086c"},+ {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:89d75e7293d2b3e674db7d4d9b1bee7f8f3d1609428e293771d1a962617150cc"},+ {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:f65557897fc977a44ab205ea871b690adaef6b9da6afda4790a2484b04293a5f"},+ {file = "regex-2024.11.6-cp38-cp38-win32.whl", hash = "sha256:6f44ec28b1f858c98d3036ad5d7d0bfc568bdd7a74f9c24e25f41ef1ebfd81a4"},+ {file = "regex-2024.11.6-cp38-cp38-win_amd64.whl", hash = "sha256:bb8f74f2f10dbf13a0be8de623ba4f9491faf58c24064f32b65679b021ed0001"},+ {file = "regex-2024.11.6-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5704e174f8ccab2026bd2f1ab6c510345ae8eac818b613d7d73e785f1310f839"},+ {file = "regex-2024.11.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:220902c3c5cc6af55d4fe19ead504de80eb91f786dc102fbd74894b1551f095e"},+ {file = "regex-2024.11.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5e7e351589da0850c125f1600a4c4ba3c722efefe16b297de54300f08d734fbf"},+ {file = "regex-2024.11.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5056b185ca113c88e18223183aa1a50e66507769c9640a6ff75859619d73957b"},+ {file = "regex-2024.11.6-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2e34b51b650b23ed3354b5a07aab37034d9f923db2a40519139af34f485f77d0"},+ {file = "regex-2024.11.6-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5670bce7b200273eee1840ef307bfa07cda90b38ae56e9a6ebcc9f50da9c469b"},+ {file = "regex-2024.11.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:08986dce1339bc932923e7d1232ce9881499a0e02925f7402fb7c982515419ef"},+ {file = "regex-2024.11.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:93c0b12d3d3bc25af4ebbf38f9ee780a487e8bf6954c115b9f015822d3bb8e48"},+ {file = "regex-2024.11.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:764e71f22ab3b305e7f4c21f1a97e1526a25ebdd22513e251cf376760213da13"},+ {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:f056bf21105c2515c32372bbc057f43eb02aae2fda61052e2f7622c801f0b4e2"},+ {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:69ab78f848845569401469da20df3e081e6b5a11cb086de3eed1d48f5ed57c95"},+ {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:86fddba590aad9208e2fa8b43b4c098bb0ec74f15718bb6a704e3c63e2cef3e9"},+ {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:684d7a212682996d21ca12ef3c17353c021fe9de6049e19ac8481ec35574a70f"},+ {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a03e02f48cd1abbd9f3b7e3586d97c8f7a9721c436f51a5245b3b9483044480b"},+ {file = "regex-2024.11.6-cp39-cp39-win32.whl", hash = "sha256:41758407fc32d5c3c5de163888068cfee69cb4c2be844e7ac517a52770f9af57"},+ {file = "regex-2024.11.6-cp39-cp39-win_amd64.whl", hash = "sha256:b2837718570f95dd41675328e111345f9b7095d821bac435aac173ac80b19983"},+ {file = "regex-2024.11.6.tar.gz", hash = "sha256:7ab159b063c52a0333c884e4679f8d7a85112ee3078fe3d9004b2dd875585519"},+]+[[package]]name = "requests"version = "2.32.3"@@ -1749,6 +1980,18 @@ typing-extensions = ">=4.4.0,<5.0.0"[package.extras]syntax = ["tree-sitter (>=0.20.1,<0.21.0)", "tree-sitter-languages (==1.10.2)"]+[[package]]+name = "tld"+version = "0.13"+description = "Extract the top-level domain (TLD) from the URL given."+optional = false+python-versions = ">=3.7, <4"+groups = ["main"]+files = [+ {file = "tld-0.13-py2.py3-none-any.whl", hash = "sha256:f75b2be080f767ed17c2338a339eaa4fab5792586319ca819119da252f9f3749"},+ {file = "tld-0.13.tar.gz", hash = "sha256:93dde5e1c04bdf1844976eae440706379d21f4ab235b73c05d7483e074fb5629"},+]+[[package]]name = "tqdm"version = "4.67.0"@@ -1771,6 +2014,31 @@ notebook = ["ipywidgets (>=6)"]slack = ["slack-sdk"]telegram = ["requests"]+[[package]]+name = "trafilatura"+version = "1.12.2"+description = "Python package and command-line tool designed to gather text on the Web, includes all necessary discovery and text processing components to perform web crawling, downloads, scraping, and extraction of main texts, metadata and comments."+optional = false+python-versions = ">=3.6"+groups = ["main"]+files = [+ {file = "trafilatura-1.12.2-py3-none-any.whl", hash = "sha256:6df5b666f625c9579a50d7cc715005f450fa75606696aceab73eeda0a76dbe96"},+ {file = "trafilatura-1.12.2.tar.gz", hash = "sha256:4c9cb1434f7e13ef0b16cb44ee1d44e84523ec7268940b9559c374e7effc9a96"},+]++[package.dependencies]+certifi = "*"+charset-normalizer = {version = ">=3.2.0", markers = "python_version >= \"3.7\""}+courlan = ">=1.2.0"+htmldate = ">=1.8.1"+justext = ">=3.0.1"+lxml = {version = ">=5.2.2", markers = "platform_system != \"Darwin\" or python_version > \"3.8\""}+urllib3 = {version = ">=1.26,<3", markers = "python_version >= \"3.7\""}++[package.extras]+all = ["brotli", "cchardet (>=2.1.7) ; python_version < \"3.11\"", "faust-cchardet (>=2.1.19) ; python_version >= \"3.11\"", "htmldate[speed] (>=1.8.1)", "py3langid (>=0.2.2)", "pycurl (>=7.45.3)", "urllib3[socks]", "zstandard (>=0.20.0)"]+gui = ["Gooey (>=1.0.1)"]+[[package]]name = "typer"version = "0.13.0"@@ -1801,6 +2069,37 @@ files = [{file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"},]+[[package]]+name = "tzdata"+version = "2025.2"+description = "Provider of IANA time zone data"+optional = false+python-versions = ">=2"+groups = ["main"]+markers = "platform_system == \"Windows\""+files = [+ {file = "tzdata-2025.2-py2.py3-none-any.whl", hash = "sha256:1a403fada01ff9221ca8044d701868fa132215d84beb92242d9acd2147f667a8"},+ {file = "tzdata-2025.2.tar.gz", hash = "sha256:b60a638fcc0daffadf82fe0f57e53d06bdec2f36c4df66280ae79bce6bd6f2b9"},+]++[[package]]+name = "tzlocal"+version = "5.3.1"+description = "tzinfo object for the local timezone"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "tzlocal-5.3.1-py3-none-any.whl", hash = "sha256:eb1a66c3ef5847adf7a834f1be0800581b683b5608e74f86ecbcef8ab91bb85d"},+ {file = "tzlocal-5.3.1.tar.gz", hash = "sha256:cceffc7edecefea1f595541dbd6e990cb1ea3d19bf01b2809f362a03dd7921fd"},+]++[package.dependencies]+tzdata = {version = "*", markers = "platform_system == \"Windows\""}++[package.extras]+devenv = ["check-manifest", "pytest (>=4.3)", "pytest-cov", "pytest-mock (>=3.3)", "zest.releaser"]+[[package]]name = "uc-micro-py"version = "1.0.3"@@ -1829,7 +2128,7 @@ files = [][package.extras]-brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"]+brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""]h2 = ["h2 (>=4,<5)"]socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]zstd = ["zstandard (>=0.18.0)"]@@ -1933,5 +2232,5 @@ propcache = ">=0.2.0"[metadata]lock-version = "2.1"-python-versions = "^3.11"-content-hash = "607c2bbc0001117884749bc7dbfb468be318090b45daff5d6caee92233a4d43e"+python-versions = ">=3.12,<4.0"+content-hash = "b22ee4c1dccfd4866fb4a28c565790ecb8f78cb00a85692a189dc6ac0c591e17"diff --git a/atomic-examples/deep-research/pyproject.toml b/atomic-examples/deep-research/pyproject.tomlindex ad32d2a..57e4cf9 100644--- a/atomic-examples/deep-research/pyproject.toml+++ b/atomic-examples/deep-research/pyproject.toml@@ -6,7 +6,7 @@ authors = ["Kenny Vaneetvelde <[email protected]>"]readme = "README.md"[tool.poetry.dependencies]-python = ">=3.11,<4.0"+python = ">=3.12,<4.0"atomic-agents = {path = "../..", develop = true}requests = "^2.32.3"beautifulsoup4 = "^4.12.3"@@ -16,7 +16,7 @@ lxml-html-clean = "^0.4.0"lxml = "^5.3.0"python-dotenv = ">=1.0.1,<2.0.0"openai = ">=1.35.12,<2.0.0"-+trafilatura = "^1.6.3"[build-system]requires = ["poetry-core"]diff --git a/atomic-examples/orchestration-agent/orchestration_agent/orchestrator.py b/atomic-examples/orchestration-agent/orchestration_agent/orchestrator.pyindex 7c59551..6f8a204 100644--- a/atomic-examples/orchestration-agent/orchestration_agent/orchestrator.py+++ b/atomic-examples/orchestration-agent/orchestration_agent/orchestrator.py@@ -72,7 +72,7 @@ class CurrentDateProvider(SystemPromptContextProviderBase):####################### ORCHESTRATOR AGENT #######################-orchestrator_agent = BaseAgent(+orchestrator_agent = BaseAgent[OrchestratorInputSchema, OrchestratorOutputSchema](BaseAgentConfig(client=instructor.from_openai(openai.OpenAI()),model="gpt-4o-mini",@@ -90,8 +90,6 @@ orchestrator_agent = BaseAgent("Format the output using the appropriate schema.",],),- input_schema=OrchestratorInputSchema,- output_schema=OrchestratorOutputSchema,))diff --git a/atomic-examples/orchestration-agent/orchestration_agent/tools/calculator.py b/atomic-examples/orchestration-agent/orchestration_agent/tools/calculator.pyindex ae5ecfd..ed0b731 100644--- a/atomic-examples/orchestration-agent/orchestration_agent/tools/calculator.py+++ b/atomic-examples/orchestration-agent/orchestration_agent/tools/calculator.py@@ -44,7 +44,7 @@ class CalculatorToolConfig(BaseToolConfig):###################### MAIN TOOL & LOGIC ######################-class CalculatorTool(BaseTool):+class CalculatorTool(BaseTool[CalculatorToolInputSchema, CalculatorToolOutputSchema]):"""Tool for performing calculations based on the provided mathematical expression.diff --git a/atomic-examples/orchestration-agent/orchestration_agent/tools/searxng_search.py b/atomic-examples/orchestration-agent/orchestration_agent/tools/searxng_search.pyindex 4d1582e..ab78f49 100644--- a/atomic-examples/orchestration-agent/orchestration_agent/tools/searxng_search.py+++ b/atomic-examples/orchestration-agent/orchestration_agent/tools/searxng_search.py@@ -51,7 +51,7 @@ class SearxNGSearchToolConfig(BaseToolConfig):max_results: int = 10-class SearxNGSearchTool(BaseTool):+class SearxNGSearchTool(BaseTool[SearxNGSearchToolInputSchema, SearxNGSearchToolOutputSchema]):"""Tool for performing searches on SearxNG based on the provided queries and category.diff --git a/atomic-examples/orchestration-agent/pyproject.toml b/atomic-examples/orchestration-agent/pyproject.tomlindex 6251c93..33dfb09 100644--- a/atomic-examples/orchestration-agent/pyproject.toml+++ b/atomic-examples/orchestration-agent/pyproject.toml@@ -6,7 +6,7 @@ authors = ["KennyVaneetvelde <[email protected]>"]readme = "README.md"[tool.poetry.dependencies]-python = "^3.11"+python = ">=3.12,<4.0"atomic-agents = {path = "../..", develop = true}instructor = "^1.6.1"pydantic = "^2.9.2"diff --git a/atomic-examples/quickstart/poetry.lock b/atomic-examples/quickstart/poetry.lockindex bf6b13d..e3a6bef 100644--- a/atomic-examples/quickstart/poetry.lock+++ b/atomic-examples/quickstart/poetry.lock@@ -1,4 +1,4 @@-# This file is automatically @generated by Poetry 2.0.0 and should not be changed by hand.+# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand.[[package]]name = "aiohappyeyeballs"@@ -122,7 +122,7 @@ multidict = ">=4.5,<7.0"yarl = ">=1.12.0,<2.0"[package.extras]-speedups = ["Brotli", "aiodns (>=3.2.0)", "brotlicffi"]+speedups = ["Brotli ; platform_python_implementation == \"CPython\"", "aiodns (>=3.2.0) ; sys_platform == \"linux\" or sys_platform == \"darwin\"", "brotlicffi ; platform_python_implementation != \"CPython\""][[package]]name = "aiosignal"@@ -194,15 +194,15 @@ sniffio = ">=1.1"[package.extras]doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"]-test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"]+test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1) ; python_version >= \"3.10\"", "uvloop (>=0.21.0b1) ; platform_python_implementation == \"CPython\" and platform_system != \"Windows\""]trio = ["trio (>=0.26.1)"][[package]]name = "atomic-agents"-version = "1.0.16"+version = "1.0.26"description = "A versatile framework for creating and managing intelligent agents."optional = false-python-versions = ">=3.9,<4.0"+python-versions = ">=3.12,<4.0"groups = ["main"]files = []develop = true@@ -234,12 +234,12 @@ files = [][package.extras]-benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"]-cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]-dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]+benchmark = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\"", "pytest-xdist[psutil]"]+cov = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\"", "pytest-xdist[psutil]"]+dev = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\"", "pytest-xdist[psutil]"]docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier (<24.7)"]-tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]-tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"]+tests = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\"", "pytest-xdist[psutil]"]+tests-mypy = ["mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\""][[package]]name = "certifi"@@ -556,7 +556,7 @@ gitdb = ">=4.0.1,<5"[package.extras]doc = ["sphinx (==4.3.2)", "sphinx-autodoc-typehints", "sphinx-rtd-theme", "sphinxcontrib-applehelp (>=1.0.2,<=1.0.4)", "sphinxcontrib-devhelp (==1.0.2)", "sphinxcontrib-htmlhelp (>=2.0.0,<=2.0.1)", "sphinxcontrib-qthelp (==1.0.3)", "sphinxcontrib-serializinghtml (==1.1.5)"]-test = ["coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mock", "mypy", "pre-commit", "pytest (>=7.3.1)", "pytest-cov", "pytest-instafail", "pytest-mock", "pytest-sugar", "typing-extensions"]+test = ["coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mock ; python_version < \"3.8\"", "mypy", "pre-commit", "pytest (>=7.3.1)", "pytest-cov", "pytest-instafail", "pytest-mock", "pytest-sugar", "typing-extensions ; python_version < \"3.11\""][[package]]name = "groq"@@ -632,7 +632,7 @@ idna = "*"sniffio = "*"[package.extras]-brotli = ["brotli", "brotlicffi"]+brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""]cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"]http2 = ["h2 (>=3,<5)"]socks = ["socksio (==1.*)"]@@ -1247,7 +1247,7 @@ typing-extensions = ">=4.12.2"[package.extras]email = ["email-validator (>=2.0.0)"]-timezone = ["tzdata"]+timezone = ["tzdata ; python_version >= \"3.9\" and sys_platform == \"win32\""][[package]]name = "pydantic-core"@@ -1704,7 +1704,7 @@ files = [][package.extras]-brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"]+brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""]h2 = ["h2 (>=4,<5)"]socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]zstd = ["zstandard (>=0.18.0)"]@@ -1808,5 +1808,5 @@ propcache = ">=0.2.0"[metadata]lock-version = "2.1"-python-versions = "^3.11"-content-hash = "5bbff7fce352cb47cd8e53993daf72ff6011d8a7ae2352058ad9d51219ca15d9"+python-versions = ">=3.12,<4.0"+content-hash = "79f09bfe49acc48a76792390ba5e0e746f611a69d09b0755d5d7a392e9d4e543"diff --git a/atomic-examples/quickstart/pyproject.toml b/atomic-examples/quickstart/pyproject.tomlindex fc11dae..2b93f09 100644--- a/atomic-examples/quickstart/pyproject.toml+++ b/atomic-examples/quickstart/pyproject.toml@@ -6,7 +6,7 @@ authors = ["Kenny Vaneetvelde <[email protected]>"]readme = "README.md"[tool.poetry.dependencies]-python = "^3.11"+python = ">=3.12,<4.0"atomic-agents = {path = "../..", develop = true}instructor = ">=1.3.4,<2.0.0"openai = ">=1.35.12,<2.0.0"diff --git a/atomic-examples/quickstart/quickstart/1_1_basic_chatbot_streaming.py b/atomic-examples/quickstart/quickstart/1_1_basic_chatbot_streaming.pyindex 5c44f1e..c5479f5 100644--- a/atomic-examples/quickstart/quickstart/1_1_basic_chatbot_streaming.py+++ b/atomic-examples/quickstart/quickstart/1_1_basic_chatbot_streaming.py@@ -32,7 +32,7 @@ memory.add_message("assistant", initial_message)client = instructor.from_openai(openai.AsyncOpenAI(api_key=API_KEY))# Agent setup with specified configuration-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config=BaseAgentConfig(client=client,model="gpt-4o-mini",diff --git a/atomic-examples/quickstart/quickstart/1_2_basic_chatbot_sync_streaming.py b/atomic-examples/quickstart/quickstart/1_2_basic_chatbot_sync_streaming.pyindex e8c1114..1d379c8 100644--- a/atomic-examples/quickstart/quickstart/1_2_basic_chatbot_sync_streaming.py+++ b/atomic-examples/quickstart/quickstart/1_2_basic_chatbot_sync_streaming.py@@ -31,7 +31,7 @@ memory.add_message("assistant", initial_message)client = instructor.from_openai(openai.OpenAI(api_key=API_KEY))# Agent setup with specified configuration-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config=BaseAgentConfig(client=client,model="gpt-4o-mini",diff --git a/atomic-examples/quickstart/quickstart/1_basic_chatbot.py b/atomic-examples/quickstart/quickstart/1_basic_chatbot.pyindex 4b62647..0d3c577 100644--- a/atomic-examples/quickstart/quickstart/1_basic_chatbot.py+++ b/atomic-examples/quickstart/quickstart/1_basic_chatbot.py@@ -31,7 +31,7 @@ memory.add_message("assistant", initial_message)client = instructor.from_openai(openai.OpenAI(api_key=API_KEY))# Agent setup with specified configuration-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config=BaseAgentConfig(client=client,model="gpt-4o-mini",diff --git a/atomic-examples/quickstart/quickstart/2_basic_custom_chatbot.py b/atomic-examples/quickstart/quickstart/2_basic_custom_chatbot.pyindex 09c76e6..a4b553e 100644--- a/atomic-examples/quickstart/quickstart/2_basic_custom_chatbot.py+++ b/atomic-examples/quickstart/quickstart/2_basic_custom_chatbot.py@@ -6,7 +6,7 @@ from rich.panel import Panelfrom rich.text import Textfrom atomic_agents.lib.components.system_prompt_generator import SystemPromptGeneratorfrom atomic_agents.lib.components.agent_memory import AgentMemory-from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentOutputSchema+from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema, BaseAgentOutputSchema# API Key setupAPI_KEY = ""@@ -50,7 +50,7 @@ system_prompt_generator = SystemPromptGenerator(console.print(Panel(system_prompt_generator.generate_prompt(), width=console.width, style="bold cyan"), style="bold cyan")# Agent setup with specified configuration-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config=BaseAgentConfig(client=client,model="gpt-4o-mini",diff --git a/atomic-examples/quickstart/quickstart/3_1_basic_custom_chatbot_with_custom_schema_streaming.py b/atomic-examples/quickstart/quickstart/3_1_basic_custom_chatbot_with_custom_schema_streaming.pyindex fb2d5d7..a6d3983 100644--- a/atomic-examples/quickstart/quickstart/3_1_basic_custom_chatbot_with_custom_schema_streaming.py+++ b/atomic-examples/quickstart/quickstart/3_1_basic_custom_chatbot_with_custom_schema_streaming.py@@ -73,13 +73,12 @@ system_prompt_generator = SystemPromptGenerator(console.print(Panel(system_prompt_generator.generate_prompt(), width=console.width, style="bold cyan"), style="bold cyan")# Agent setup with specified configuration and custom output schema-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, CustomOutputSchema](config=BaseAgentConfig(client=client,model="gpt-4o-mini",system_prompt_generator=system_prompt_generator,memory=memory,- output_schema=CustomOutputSchema,))diff --git a/atomic-examples/quickstart/quickstart/3_basic_custom_chatbot_with_custom_schema.py b/atomic-examples/quickstart/quickstart/3_basic_custom_chatbot_with_custom_schema.pyindex 8f4169d..1d74b5a 100644--- a/atomic-examples/quickstart/quickstart/3_basic_custom_chatbot_with_custom_schema.py+++ b/atomic-examples/quickstart/quickstart/3_basic_custom_chatbot_with_custom_schema.py@@ -72,13 +72,12 @@ system_prompt_generator = SystemPromptGenerator(console.print(Panel(system_prompt_generator.generate_prompt(), width=console.width, style="bold cyan"), style="bold cyan")# Agent setup with specified configuration and custom output schema-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, CustomOutputSchema](config=BaseAgentConfig(client=client,model="gpt-4o-mini",system_prompt_generator=system_prompt_generator,memory=memory,- output_schema=CustomOutputSchema,))diff --git a/atomic-examples/quickstart/quickstart/4_basic_chatbot_different_providers.py b/atomic-examples/quickstart/quickstart/4_basic_chatbot_different_providers.pyindex 05f507f..ea10501 100644--- a/atomic-examples/quickstart/quickstart/4_basic_chatbot_different_providers.py+++ b/atomic-examples/quickstart/quickstart/4_basic_chatbot_different_providers.py@@ -79,7 +79,9 @@ provider = console.input(providers_str).lower()client, model = setup_client(provider)# Agent setup with specified configuration-agent = BaseAgent(config=BaseAgentConfig(client=client, model=model, memory=memory, model_api_parameters={"max_tokens": 2048}))+agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](+ config=BaseAgentConfig(client=client, model=model, memory=memory, model_api_parameters={"max_tokens": 2048})+)# Generate the default system prompt for the agentdefault_system_prompt = agent.system_prompt_generator.generate_prompt()diff --git a/atomic-examples/quickstart/quickstart/5_custom_system_role_for_reasoning_models copy.py b/atomic-examples/quickstart/quickstart/5_custom_system_role_for_reasoning_models copy.pyindex 7290ae0..97c6f57 100644--- a/atomic-examples/quickstart/quickstart/5_custom_system_role_for_reasoning_models copy.py+++ b/atomic-examples/quickstart/quickstart/5_custom_system_role_for_reasoning_models copy.py@@ -3,7 +3,7 @@ import instructorimport openaifrom rich.console import Consolefrom rich.text import Text-from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema+from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema, BaseAgentOutputSchemafrom atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator# API Key setup@@ -29,7 +29,7 @@ sysyem_prompt_generator = SystemPromptGenerator(output_instructions=["Answer in plain English plus formulas."],)# Agent setup with specified configuration-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config=BaseAgentConfig(client=client,model="o3-mini",diff --git a/atomic-examples/quickstart/quickstart/6_asynchronous_processing.py b/atomic-examples/quickstart/quickstart/6_asynchronous_processing_streaming.pysimilarity index 75%rename from atomic-examples/quickstart/quickstart/6_asynchronous_processing.pyrename to atomic-examples/quickstart/quickstart/6_asynchronous_processing_streaming.pyindex 058656d..2f013fa 100644--- a/atomic-examples/quickstart/quickstart/6_asynchronous_processing.py+++ b/atomic-examples/quickstart/quickstart/6_asynchronous_processing_streaming.py@@ -54,9 +54,11 @@ dataset = [sem = asyncio.Semaphore(2)# Agent setup with specified configuration-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, PersonSchema](config=BaseAgentConfig(- client=client, model="gpt-4o-mini", sysyem_prompt_generator=sysyem_prompt_generator, output_schema=PersonSchema # type: ignore+ client=client,+ model="gpt-4o-mini",+ sysyem_prompt_generator=sysyem_prompt_generator))@@ -85,22 +87,7 @@ async def process(dataset: list[str]):# Prompt the user for input with a styled promptreturn responses--async def main():- # Get input from the user- user_input_text = console.input("[bold blue]You:[/bold blue] ")- user_input = BaseAgentInputSchema(chat_message=user_input_text)-- console.print("\n[bold green]Agent (streaming):[/bold green]")-- # Use Live display to show the streaming response- with Live(auto_refresh=True, refresh_per_second=10) as live:- # Use run_async_stream instead of run_async for streaming functionality- async for partial_response in agent.run_async_stream(user_input):- # Display the partial response- if partial_response.chat_message:- live.update(Text(partial_response.chat_message))--if __name__ == "__main__":- asyncio.run(main())+ responses = asyncio.run(process(dataset))+ console.print(f"\n[bold green]Responses: {responses}[/bold green]")+diff --git a/atomic-examples/quickstart/quickstart/7_asynchronous_processing_batch.py b/atomic-examples/quickstart/quickstart/7_asynchronous_processing.pysimilarity index 93%rename from atomic-examples/quickstart/quickstart/7_asynchronous_processing_batch.pyrename to atomic-examples/quickstart/quickstart/7_asynchronous_processing.pyindex aa71a10..5f541aa 100644--- a/atomic-examples/quickstart/quickstart/7_asynchronous_processing_batch.py+++ b/atomic-examples/quickstart/quickstart/7_asynchronous_processing.py@@ -52,9 +52,11 @@ dataset = [sem = asyncio.Semaphore(2)# Agent setup with specified configuration-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, PersonSchema](config=BaseAgentConfig(- client=client, model="gpt-4o-mini", sysyem_prompt_generator=sysyem_prompt_generator, output_schema=PersonSchema # type: ignore+ client=client,+ model="gpt-4o-mini",+ sysyem_prompt_generator=sysyem_prompt_generator))diff --git a/atomic-examples/rag-chatbot/pyproject.toml b/atomic-examples/rag-chatbot/pyproject.tomlindex 1711471..a7e270f 100644--- a/atomic-examples/rag-chatbot/pyproject.toml+++ b/atomic-examples/rag-chatbot/pyproject.toml@@ -6,7 +6,7 @@ authors = ["Your Name <[email protected]>"]readme = "README.md"[tool.poetry.dependencies]-python = ">=3.11,<4.0"+python = ">=3.12,<4.0"atomic-agents = {path = "../..", develop = true}chromadb = "^0.4.24"python-dotenv = ">=1.0.1,<2.0.0"diff --git a/atomic-examples/rag-chatbot/rag_chatbot/agents/qa_agent.py b/atomic-examples/rag-chatbot/rag_chatbot/agents/qa_agent.pyindex 3a935ae..d6acb64 100644--- a/atomic-examples/rag-chatbot/rag_chatbot/agents/qa_agent.py+++ b/atomic-examples/rag-chatbot/rag_chatbot/agents/qa_agent.py@@ -20,7 +20,7 @@ class RAGQuestionAnsweringAgentOutputSchema(BaseIOSchema):answer: str = Field(..., description="The answer to the user's question based on the retrieved context")-qa_agent = BaseAgent(+qa_agent = BaseAgent[RAGQuestionAnsweringAgentInputSchema, RAGQuestionAnsweringAgentOutputSchema](BaseAgentConfig(client=instructor.from_openai(openai.OpenAI(api_key=ChatConfig.api_key)),model=ChatConfig.model,@@ -44,7 +44,5 @@ qa_agent = BaseAgent("Focus on being accurate and concise",],),- input_schema=RAGQuestionAnsweringAgentInputSchema,- output_schema=RAGQuestionAnsweringAgentOutputSchema,))diff --git a/atomic-examples/rag-chatbot/rag_chatbot/agents/query_agent.py b/atomic-examples/rag-chatbot/rag_chatbot/agents/query_agent.pyindex ffb36a8..3ff1e62 100644--- a/atomic-examples/rag-chatbot/rag_chatbot/agents/query_agent.py+++ b/atomic-examples/rag-chatbot/rag_chatbot/agents/query_agent.py@@ -20,7 +20,7 @@ class RAGQueryAgentOutputSchema(BaseIOSchema):query: str = Field(..., description="The semantic search query to use for retrieving relevant chunks")-query_agent = BaseAgent(+query_agent = BaseAgent[RAGQueryAgentInputSchema, RAGQueryAgentOutputSchema](BaseAgentConfig(client=instructor.from_openai(openai.OpenAI(api_key=ChatConfig.api_key)),model=ChatConfig.model,@@ -42,7 +42,5 @@ query_agent = BaseAgent("Explain your reasoning for the query formulation",],),- input_schema=RAGQueryAgentInputSchema,- output_schema=RAGQueryAgentOutputSchema,))diff --git a/atomic-examples/web-search-agent/pyproject.toml b/atomic-examples/web-search-agent/pyproject.tomlindex eb9dbc3..9154b74 100644--- a/atomic-examples/web-search-agent/pyproject.toml+++ b/atomic-examples/web-search-agent/pyproject.toml@@ -6,7 +6,7 @@ authors = ["Kenny Vaneetvelde <[email protected]>"]readme = "README.md"[tool.poetry.dependencies]-python = "^3.11"+python = ">=3.12,<4.0"atomic-agents = {path = "../..", develop = true}openai = ">=1.35.12,<2.0.0"pydantic = ">=2.9.2,<3.0.0"diff --git a/atomic-examples/web-search-agent/web_search_agent/agents/query_agent.py b/atomic-examples/web-search-agent/web_search_agent/agents/query_agent.pyindex 2851db4..383d5ec 100644--- a/atomic-examples/web-search-agent/web_search_agent/agents/query_agent.py+++ b/atomic-examples/web-search-agent/web_search_agent/agents/query_agent.py@@ -1,6 +1,7 @@import instructorimport openaifrom pydantic import Field+from typing import Listfrom atomic_agents.agents.base_agent import BaseIOSchema, BaseAgent, BaseAgentConfigfrom atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator@@ -14,26 +15,31 @@ class QueryAgentInputSchema(BaseIOSchema):num_queries: int = Field(..., description="The number of queries to generate.")-query_agent = BaseAgent(+class QueryAgentOutputSchema(BaseIOSchema):+ """This is the output schema for the QueryAgent."""++ queries: List[str] = Field(..., description="A list of search queries.")+++query_agent = BaseAgent[QueryAgentInputSchema, QueryAgentOutputSchema](BaseAgentConfig(client=instructor.from_openai(openai.OpenAI()),model="gpt-4o-mini",system_prompt_generator=SystemPromptGenerator(background=[- "You are an intelligent query generation expert.",- "Your task is to generate a specified number of diverse and highly relevant queries based on a given instruction or request.",- "The queries should cover different aspects of the instruction to ensure comprehensive exploration.",+ "You are an advanced search query generator.",+ "Your task is to convert user questions into multiple effective search queries.",],steps=[- "You will receive a detailed instruction or request and the number of queries to generate.",- "Generate the requested number of queries in a JSON format.",+ "Analyze the user's question to understand the core information need.",+ "Generate multiple search queries that capture the question's essence from different angles.",+ "Ensure each query is optimized for search engines (compact, focused, and unambiguous)."],output_instructions=[- "Ensure clarity and conciseness in each query.",- "Ensure each query is unique and as diverse as possible while remaining relevant to the instruction.",- ],+ "Generate 3-5 different search queries.",+ "Do not include special search operators or syntax.",+ "Each query should be concise and focused on retrieving relevant information."+ ]),- input_schema=QueryAgentInputSchema,- output_schema=SearxNGSearchTool.input_schema,))diff --git a/atomic-examples/web-search-agent/web_search_agent/agents/question_answering_agent.py b/atomic-examples/web-search-agent/web_search_agent/agents/question_answering_agent.pyindex 5859613..fd5342f 100644--- a/atomic-examples/web-search-agent/web_search_agent/agents/question_answering_agent.py+++ b/atomic-examples/web-search-agent/web_search_agent/agents/question_answering_agent.py@@ -25,7 +25,7 @@ class QuestionAnsweringAgentOutputSchema(BaseIOSchema):# Create the question answering agent-question_answering_agent = BaseAgent(+question_answering_agent = BaseAgent[QuestionAnsweringAgentInputSchema, QuestionAnsweringAgentOutputSchema](BaseAgentConfig(client=instructor.from_openai(openai.OpenAI()),model="gpt-4o-mini",@@ -47,7 +47,5 @@ question_answering_agent = BaseAgent("Provide up to 3 follow-up questions to encourage further exploration of the topic.",],),- input_schema=QuestionAnsweringAgentInputSchema,- output_schema=QuestionAnsweringAgentOutputSchema,))diff --git a/atomic-examples/web-search-agent/web_search_agent/main.py b/atomic-examples/web-search-agent/web_search_agent/main.pyindex fcb9a6d..f484c68 100644--- a/atomic-examples/web-search-agent/web_search_agent/main.py+++ b/atomic-examples/web-search-agent/web_search_agent/main.py@@ -30,8 +30,17 @@ memory = AgentMemory()# Initialize the SearxNGSearchToolsearch_tool = SearxNGSearchTool(config=SearxNGSearchToolConfig(base_url=os.getenv("SEARXNG_BASE_URL"), max_results=5))+# Define input/output schemas for the main agent+class MainAgentInputSchema(BaseIOSchema):+ """Input schema for the main agent."""+ chat_message: str = Field(..., description="Chat message from the user.")++class MainAgentOutputSchema(BaseIOSchema):+ """Output schema for the main agent."""+ chat_message: str = Field(..., description="Response to the user's message.")+# Initialize the BaseAgent-agent = BaseAgent(+agent = BaseAgent[MainAgentInputSchema, MainAgentOutputSchema](config=BaseAgentConfig(client=instructor.from_openai(openai.OpenAI(api_key=os.getenv("OPENAI_API_KEY"))),model="gpt-4o-mini",diff --git a/atomic-examples/web-search-agent/web_search_agent/tools/searxng_search.py b/atomic-examples/web-search-agent/web_search_agent/tools/searxng_search.pyindex 265602f..e874377 100644--- a/atomic-examples/web-search-agent/web_search_agent/tools/searxng_search.py+++ b/atomic-examples/web-search-agent/web_search_agent/tools/searxng_search.py@@ -52,7 +52,7 @@ class SearxNGSearchToolConfig(BaseToolConfig):max_results: int = 10-class SearxNGSearchTool(BaseTool):+class SearxNGSearchTool(BaseTool[SearxNGSearchToolInputSchema, SearxNGSearchToolOutputSchema]):"""Tool for performing searches on SearxNG based on the provided queries and category.@@ -63,9 +63,6 @@ class SearxNGSearchTool(BaseTool):base_url (str): The base URL for the SearxNG instance to use."""- input_schema = SearxNGSearchToolInputSchema- output_schema = SearxNGSearchToolOutputSchema-def __init__(self, config: SearxNGSearchToolConfig = SearxNGSearchToolConfig()):"""Initializes the SearxNGTool.diff --git a/atomic-examples/youtube-summarizer/pyproject.toml b/atomic-examples/youtube-summarizer/pyproject.tomlindex b6b8e91..91777a6 100644--- a/atomic-examples/youtube-summarizer/pyproject.toml+++ b/atomic-examples/youtube-summarizer/pyproject.toml@@ -6,7 +6,7 @@ authors = ["Kenny Vaneetvelde <[email protected]>"]readme = "README.md"[tool.poetry.dependencies]-python = "^3.11"+python = ">=3.12,<4.0"atomic-agents = {path = "../..", develop = true}openai = ">=1.35.12,<2.0.0"pydantic = ">=2.9.2,<3.0.0"diff --git a/atomic-examples/youtube-summarizer/youtube_summarizer/agent.py b/atomic-examples/youtube-summarizer/youtube_summarizer/agent.pyindex ccde8ed..cbdf823 100644--- a/atomic-examples/youtube-summarizer/youtube_summarizer/agent.py+++ b/atomic-examples/youtube-summarizer/youtube_summarizer/agent.py@@ -68,7 +68,7 @@ class YouTubeKnowledgeExtractionOutputSchema(BaseIOSchema):transcript_provider = YtTranscriptProvider(title="YouTube Transcript")-youtube_knowledge_extraction_agent = BaseAgent(+youtube_knowledge_extraction_agent = BaseAgent[YouTubeKnowledgeExtractionInputSchema, YouTubeKnowledgeExtractionOutputSchema](config=BaseAgentConfig(client=instructor.from_openai(openai.OpenAI()),model="gpt-4o-mini",@@ -87,7 +87,5 @@ youtube_knowledge_extraction_agent = BaseAgent(],context_providers={"yt_transcript": transcript_provider},),- input_schema=YouTubeKnowledgeExtractionInputSchema,- output_schema=YouTubeKnowledgeExtractionOutputSchema,))diff --git a/atomic-examples/youtube-summarizer/youtube_summarizer/tools/youtube_transcript_scraper.py b/atomic-examples/youtube-summarizer/youtube_summarizer/tools/youtube_transcript_scraper.pyindex 0ee5a0f..464cd86 100644--- a/atomic-examples/youtube-summarizer/youtube_summarizer/tools/youtube_transcript_scraper.py+++ b/atomic-examples/youtube-summarizer/youtube_summarizer/tools/youtube_transcript_scraper.py@@ -1,6 +1,10 @@import os-from typing import List, Optional-from pydantic import Field, BaseModel+import re+from typing import List, Optional, Dict, Any+import asyncio+from concurrent.futures import ThreadPoolExecutor++from pydantic import Field, BaseModel, HttpUrlfrom datetime import datetimefrom googleapiclient.discovery import build@@ -9,6 +13,8 @@ from youtube_transcript_api import (TranscriptsDisabled,YouTubeTranscriptApi,)+import requests+from bs4 import BeautifulSoupfrom atomic_agents.agents.base_agent import BaseIOSchemafrom atomic_agents.lib.base.base_tool import BaseTool, BaseToolConfig@@ -54,28 +60,33 @@ class YouTubeTranscriptToolOutputSchema(BaseIOSchema):# CONFIGURATION ##################class YouTubeTranscriptToolConfig(BaseToolConfig):- api_key: str = Field(- description="YouTube API key for fetching video metadata.",- default=os.getenv("YOUTUBE_API_KEY"),- )+ """+ Configuration for the YouTubeTranscriptTool.++ Attributes:+ languages (List[str]): List of language codes to try when fetching transcripts.+ """++ languages: List[str] = ["en", "en-US", "en-GB"]###################### MAIN TOOL & LOGIC ######################-class YouTubeTranscriptTool(BaseTool):+class YouTubeTranscriptTool(BaseTool[YouTubeTranscriptToolInputSchema, YouTubeTranscriptToolOutputSchema]):"""- Tool for fetching the transcript of a YouTube video using the YouTube Transcript API.+ Tool for extracting transcripts from YouTube videos.Attributes:input_schema (YouTubeTranscriptToolInputSchema): The schema for the input data.output_schema (YouTubeTranscriptToolOutputSchema): The schema for the output data.+ languages (List[str]): List of language codes to try when fetching transcripts."""input_schema = YouTubeTranscriptToolInputSchemaoutput_schema = YouTubeTranscriptToolOutputSchema- def __init__(self, config: YouTubeTranscriptToolConfig):+ def __init__(self, config: YouTubeTranscriptToolConfig = YouTubeTranscriptToolConfig()):"""Initializes the YouTubeTranscriptTool.@@ -83,7 +94,7 @@ class YouTubeTranscriptTool(BaseTool):config (YouTubeTranscriptToolConfig): Configuration for the tool."""super().__init__(config)- self.api_key = config.api_key+ self.languages = config.languagesdef run(self, params: YouTubeTranscriptToolInputSchema) -> YouTubeTranscriptToolOutputSchema:"""@@ -172,7 +183,7 @@ if __name__ == "__main__":rich_console = Console()api_key = os.getenv("YOUTUBE_API_KEY")- search_tool_instance = YouTubeTranscriptTool(config=YouTubeTranscriptToolConfig(api_key=api_key))+ search_tool_instance = YouTubeTranscriptTool(config=YouTubeTranscriptToolConfig())search_input = YouTubeTranscriptTool.input_schema(video_url="https://www.youtube.com/watch?v=t1e8gqXLbsU", language="en")diff --git a/atomic-examples/youtube-to-recipe/pyproject.toml b/atomic-examples/youtube-to-recipe/pyproject.tomlindex ed933f1..bd19633 100644--- a/atomic-examples/youtube-to-recipe/pyproject.toml+++ b/atomic-examples/youtube-to-recipe/pyproject.toml@@ -6,7 +6,7 @@ authors = ["Kenny Vaneetvelde <[email protected]>"]readme = "README.md"[tool.poetry.dependencies]-python = "^3.11"+python = ">=3.12,<4.0"atomic-agents = {path = "../..", develop = true}openai = ">=1.35.12,<2.0.0"pydantic = ">=2.9.2,<3.0.0"diff --git a/atomic-examples/youtube-to-recipe/youtube_to_recipe/agent.py b/atomic-examples/youtube-to-recipe/youtube_to_recipe/agent.pyindex 8859bdf..d94de75 100644--- a/atomic-examples/youtube-to-recipe/youtube_to_recipe/agent.py+++ b/atomic-examples/youtube-to-recipe/youtube_to_recipe/agent.py@@ -64,7 +64,7 @@ class YouTubeRecipeExtractionOutputSchema(BaseIOSchema):transcript_provider = YtTranscriptProvider(title="YouTube Recipe Transcript")-youtube_recipe_extraction_agent = BaseAgent(+youtube_recipe_extraction_agent = BaseAgent[YouTubeRecipeExtractionInputSchema, YouTubeRecipeExtractionOutputSchema](config=BaseAgentConfig(client=instructor.from_openai(openai.OpenAI()),model="gpt-4o-mini",@@ -86,7 +86,5 @@ youtube_recipe_extraction_agent = BaseAgent(],context_providers={"yt_transcript": transcript_provider},),- input_schema=YouTubeRecipeExtractionInputSchema,- output_schema=YouTubeRecipeExtractionOutputSchema,))diff --git a/atomic-examples/youtube-to-recipe/youtube_to_recipe/tools/youtube_transcript_scraper.py b/atomic-examples/youtube-to-recipe/youtube_to_recipe/tools/youtube_transcript_scraper.pyindex 0ee5a0f..93c4485 100644--- a/atomic-examples/youtube-to-recipe/youtube_to_recipe/tools/youtube_transcript_scraper.py+++ b/atomic-examples/youtube-to-recipe/youtube_to_recipe/tools/youtube_transcript_scraper.py@@ -1,5 +1,9 @@import os+import refrom typing import List, Optional+import asyncio+from concurrent.futures import ThreadPoolExecutor+from pydantic import Field, BaseModelfrom datetime import datetime@@ -9,6 +13,8 @@ from youtube_transcript_api import (TranscriptsDisabled,YouTubeTranscriptApi,)+import requests+from bs4 import BeautifulSoupfrom atomic_agents.agents.base_agent import BaseIOSchemafrom atomic_agents.lib.base.base_tool import BaseTool, BaseToolConfig@@ -54,28 +60,30 @@ class YouTubeTranscriptToolOutputSchema(BaseIOSchema):# CONFIGURATION ##################class YouTubeTranscriptToolConfig(BaseToolConfig):- api_key: str = Field(- description="YouTube API key for fetching video metadata.",- default=os.getenv("YOUTUBE_API_KEY"),- )+ """+ Configuration for the YouTubeTranscriptTool.++ Attributes:+ languages (List[str]): List of language codes to try when fetching transcripts.+ """++ languages: List[str] = ["en", "en-US", "en-GB"]###################### MAIN TOOL & LOGIC ######################-class YouTubeTranscriptTool(BaseTool):+class YouTubeTranscriptTool(BaseTool[YouTubeTranscriptToolInputSchema, YouTubeTranscriptToolOutputSchema]):"""- Tool for fetching the transcript of a YouTube video using the YouTube Transcript API.+ Tool for extracting transcripts from YouTube videos.Attributes:input_schema (YouTubeTranscriptToolInputSchema): The schema for the input data.output_schema (YouTubeTranscriptToolOutputSchema): The schema for the output data.+ languages (List[str]): List of language codes to try when fetching transcripts."""- input_schema = YouTubeTranscriptToolInputSchema- output_schema = YouTubeTranscriptToolOutputSchema-- def __init__(self, config: YouTubeTranscriptToolConfig):+ def __init__(self, config: YouTubeTranscriptToolConfig = YouTubeTranscriptToolConfig()):"""Initializes the YouTubeTranscriptTool.@@ -83,7 +91,7 @@ class YouTubeTranscriptTool(BaseTool):config (YouTubeTranscriptToolConfig): Configuration for the tool."""super().__init__(config)- self.api_key = config.api_key+ self.languages = config.languagesdef run(self, params: YouTubeTranscriptToolInputSchema) -> YouTubeTranscriptToolOutputSchema:"""diff --git a/atomic-forge/guides/tool_structure.md b/atomic-forge/guides/tool_structure.mdindex ec08366..ec8b9a5 100644--- a/atomic-forge/guides/tool_structure.md+++ b/atomic-forge/guides/tool_structure.md@@ -326,17 +326,11 @@ This is the core of your tool, where you implement the main functionality. Your# Main Tool & Logic ######################-class PizzaOrderingTool(BaseTool):+class PizzaOrderingTool(BaseTool[PizzaOrderInputSchema, OrderConfirmationSchema]):"""Tool for placing pizza orders through the Pizza Orders API."""- input_schema = PizzaOrderInputSchema- output_schemas = {- "confirmation": OrderConfirmationSchema,- "payment": PaymentDetailsSchema- }-def __init__(self, config: PizzaOrderingToolConfig = PizzaOrderingToolConfig()):"""Initializes the PizzaOrderingTool with the provided configuration.@@ -429,7 +423,7 @@ class PizzaOrderingTool(BaseTool):**Explanation:**-- **Inheritance:** The tool class inherits from `BaseTool`.+- **Inheritance:** The tool class inherits from `BaseTool` with generic type parameters.- **Run Method:** The `run` method is mandatory and serves as the entry point for your tool.- **Title and Description Overrides:** Uses the configuration's `title` and `description`.- **Helper Methods:** Break down complex logic into smaller methods for clarity and maintainability.diff --git a/atomic-forge/tools/calculator/tool/calculator.py b/atomic-forge/tools/calculator/tool/calculator.pyindex ae5ecfd..37581d3 100644--- a/atomic-forge/tools/calculator/tool/calculator.py+++ b/atomic-forge/tools/calculator/tool/calculator.py@@ -1,3 +1,5 @@+import numexpr+from typing import Optional, Dict, Anyfrom pydantic import Fieldfrom sympy import sympify@@ -36,21 +38,30 @@ class CalculatorToolOutputSchema(BaseIOSchema):class CalculatorToolConfig(BaseToolConfig):"""Configuration for the CalculatorTool.++ Attributes:+ title (Optional[str]): Overrides the default title of the tool.+ description (Optional[str]): Overrides the default description of the tool.+ safe_mode (bool): Whether to run in safe mode with restricted operations.+ allowed_functions (Dict[str, Any]): Functions to make available in the calculator."""- pass+ safe_mode: bool = True+ allowed_functions: Dict[str, Any] = {}###################### MAIN TOOL & LOGIC ######################-class CalculatorTool(BaseTool):+class CalculatorTool(BaseTool[CalculatorToolInputSchema, CalculatorToolOutputSchema]):"""- Tool for performing calculations based on the provided mathematical expression.+ Tool for evaluating mathematical expressions.Attributes:- input_schema (CalculatorToolInputSchema): The schema for the input data.- output_schema (CalculatorToolOutputSchema): The schema for the output data.+ input_schema (CalculatorToolInputSchema): Schema defining the input data.+ output_schema (CalculatorToolOutputSchema): Schema defining the output data.+ safe_mode (bool): Whether to run in safe mode with restricted operations.+ allowed_functions (Dict[str, Any]): Functions to make available in the calculator."""input_schema = CalculatorToolInputSchema@@ -64,6 +75,8 @@ class CalculatorTool(BaseTool):config (CalculatorToolConfig): Configuration for the tool."""super().__init__(config)+ self.safe_mode = config.safe_mode+ self.allowed_functions = config.allowed_functionsdef run(self, params: CalculatorToolInputSchema) -> CalculatorToolOutputSchema:"""diff --git a/atomic-forge/tools/searxng_search/tool/searxng_search.py b/atomic-forge/tools/searxng_search/tool/searxng_search.pyindex 265602f..e874377 100644--- a/atomic-forge/tools/searxng_search/tool/searxng_search.py+++ b/atomic-forge/tools/searxng_search/tool/searxng_search.py@@ -52,7 +52,7 @@ class SearxNGSearchToolConfig(BaseToolConfig):max_results: int = 10-class SearxNGSearchTool(BaseTool):+class SearxNGSearchTool(BaseTool[SearxNGSearchToolInputSchema, SearxNGSearchToolOutputSchema]):"""Tool for performing searches on SearxNG based on the provided queries and category.@@ -63,9 +63,6 @@ class SearxNGSearchTool(BaseTool):base_url (str): The base URL for the SearxNG instance to use."""- input_schema = SearxNGSearchToolInputSchema- output_schema = SearxNGSearchToolOutputSchema-def __init__(self, config: SearxNGSearchToolConfig = SearxNGSearchToolConfig()):"""Initializes the SearxNGTool.diff --git a/atomic-forge/tools/tavily_search/tool/tavily_search.py b/atomic-forge/tools/tavily_search/tool/tavily_search.pyindex ddd2219..2261266 100644--- a/atomic-forge/tools/tavily_search/tool/tavily_search.py+++ b/atomic-forge/tools/tavily_search/tool/tavily_search.py@@ -1,9 +1,11 @@import os-from typing import List, Optional+from typing import List, Literal, Optionalimport asynciofrom concurrent.futures import ThreadPoolExecutor+import datetimeimport aiohttp+from tavily import TavilyClientfrom pydantic import Fieldfrom atomic_agents.agents.base_agent import BaseIOSchema@@ -48,50 +50,37 @@ class TavilySearchToolOutputSchema(BaseIOSchema):##############class TavilySearchToolConfig(BaseToolConfig):api_key: str = ""- max_results: Optional[int] = 10- search_depth: Optional[str] = "basic"- topic: Optional[str] = "general"- include_query: Optional[bool] = False- include_domains: Optional[List[str]] = []- include_answer: Optional[bool] = False- include_raw_content: Optional[bool] = False+ max_results: int = 5+ search_depth: Literal["basic", "advanced"] = "basic"+ include_domains: Optional[List[str]] = None+ exclude_domains: Optional[List[str]] = None-class TavilySearchTool(BaseTool):+class TavilySearchTool(BaseTool[TavilySearchToolInputSchema, TavilySearchToolOutputSchema]):"""- Tool for performing searches on Tavily based on the provided queries and topic.+ Tool for performing searches using the Tavily search API.Attributes:input_schema (TavilySearchToolInputSchema): The schema for the input data.output_schema (TavilySearchToolOutputSchema): The schema for the output data.max_results (int): The maximum number of search results to return.- search_depth (string): The depth of the search to perform. (advanced or basic)- topic (string): The category that the result is classified under. (general or news)- include_domains (List[str]): A list of domains to pull results from.- include_answer (bool): Include the answer in the respones from Tavily.- include_raw_content (bool): Include the raw content of the search results.+ api_key (str): The API key for the Tavily API."""- input_schema = TavilySearchToolInputSchema- output_schema = TavilySearchToolOutputSchema-def __init__(self, config: TavilySearchToolConfig = TavilySearchToolConfig()):"""- Initializes the TavilyTool.+ Initializes the TavilySearchTool.Args:config (TavilySearchToolConfig):- Configuration for the tool, including base URL, max results, and optional title and description overrides.+ Configuration for the tool, including API key, max results, and optional title and description overrides."""super().__init__(config)- self.api_key = config.api_key+ self.api_key = config.api_key or os.getenv("TAVILY_API_KEY", "")self.max_results = config.max_resultsself.search_depth = config.search_depth- self.topic = config.topic- self.include_query = config.include_queryself.include_domains = config.include_domains- self.include_answer = config.include_answer- self.include_raw_content = config.include_raw_content+ self.exclude_domains = config.exclude_domainsasync def _fetch_search_results(self, session: aiohttp.ClientSession, query: str) -> List[dict]:headers = {@@ -106,11 +95,8 @@ class TavilySearchTool(BaseTool):"query": query,"api_key": self.api_key,"search_depth": self.search_depth,- "topic": self.topic,- "include_query": self.include_query,- "include_answer": self.include_answer,- "include_raw_content": self.include_raw_content,"include_domains": self.include_domains,+ "exclude_domains": self.exclude_domains,"max_results": self.max_results,}@@ -127,8 +113,6 @@ class TavilySearchTool(BaseTool):# Add query information to each resultfor result in results:result["query"] = query- if self.include_answer:- result["answer"] = answerreturn results@@ -153,8 +137,7 @@ class TavilySearchTool(BaseTool):content=result.get("content", ""),score=result.get("score", 0),raw_content=result.get("raw_content"),- query=result.get("query") if self.include_query else None,- answer=result.get("answer") if self.include_answer else None,+ query=result.get("query"),))else:diff --git a/atomic-forge/tools/webpage_scraper/tool/webpage_scraper.py b/atomic-forge/tools/webpage_scraper/tool/webpage_scraper.pyindex 5513c7b..20bf642 100644--- a/atomic-forge/tools/webpage_scraper/tool/webpage_scraper.py+++ b/atomic-forge/tools/webpage_scraper/tool/webpage_scraper.py@@ -77,14 +77,11 @@ class WebpageScraperToolConfig(BaseToolConfig):###################### MAIN TOOL & LOGIC ######################-class WebpageScraperTool(BaseTool):+class WebpageScraperTool(BaseTool[WebpageScraperToolInputSchema, WebpageScraperToolOutputSchema]):"""Tool for scraping webpage content and converting it to markdown format."""- input_schema = WebpageScraperToolInputSchema- output_schema = WebpageScraperToolOutputSchema-def __init__(self, config: WebpageScraperToolConfig = WebpageScraperToolConfig()):"""Initializes the WebpageScraperTool.diff --git a/atomic-forge/tools/youtube_transcript_scraper/tool/youtube_transcript_scraper.py b/atomic-forge/tools/youtube_transcript_scraper/tool/youtube_transcript_scraper.pyindex 0ee5a0f..0cd9fa9 100644--- a/atomic-forge/tools/youtube_transcript_scraper/tool/youtube_transcript_scraper.py+++ b/atomic-forge/tools/youtube_transcript_scraper/tool/youtube_transcript_scraper.py@@ -63,7 +63,7 @@ class YouTubeTranscriptToolConfig(BaseToolConfig):###################### MAIN TOOL & LOGIC ######################-class YouTubeTranscriptTool(BaseTool):+class YouTubeTranscriptTool(BaseTool[YouTubeTranscriptToolInputSchema, YouTubeTranscriptToolOutputSchema]):"""Tool for fetching the transcript of a YouTube video using the YouTube Transcript API.diff --git a/docs/api/agents.md b/docs/api/agents.mdindex 251167e..88a70fc 100644--- a/docs/api/agents.md+++ b/docs/api/agents.md@@ -107,7 +107,7 @@ from atomic_agents.lib.components.agent_memory import AgentMemoryfrom atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator# Create agent with basic configuration-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config=BaseAgentConfig(client=instructor.from_openai(OpenAI()),model="gpt-4-turbo-preview",@@ -244,8 +244,6 @@ agent = BaseAgent[CustomInput, CustomOutput](config=BaseAgentConfig(client=client,model=model,- input_schema=CustomInput,- output_schema=CustomOutput))```diff --git a/docs/api/components.md b/docs/api/components.mdindex 260a5c6..c2a8508 100644--- a/docs/api/components.md+++ b/docs/api/components.md@@ -179,7 +179,7 @@ class MyToolConfig(BaseToolConfig):description="API key for the service")-class MyTool(BaseTool):+class MyTool(BaseTool[MyToolInputSchema, MyToolOutputSchema]):"""Tool implementation"""input_schema = MyToolInputSchemaoutput_schema = MyToolOutputSchemadiff --git a/docs/contributing.md b/docs/contributing.mdindex a64bafa..9b3246e 100644--- a/docs/contributing.md+++ b/docs/contributing.md@@ -69,7 +69,7 @@ When creating new tools:# Define output schemapass- class MyTool(BaseTool):+ class MyTool(BaseTool[MyToolInputs, MyToolOutputs]):name = "my_tool"description = "Tool description"inputs_schema = MyToolInputsdiff --git a/docs/guides/quickstart.md b/docs/guides/quickstart.mdindex 633ea56..78e4d8b 100644--- a/docs/guides/quickstart.md+++ b/docs/guides/quickstart.md@@ -30,10 +30,11 @@ memory = AgentMemory()memory.add_assistant_message("Hello! I'm your AI assistant. How can I help you today?")# Create agent-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config=BaseAgentConfig(client=instructor.from_openai(OpenAI(api_key=os.getenv("OPENAI_API_KEY"))),model="gpt-4-turbo-preview",+ memory=memory,model_api_parameters={"max_tokens": 2048}))@@ -143,7 +144,7 @@ prompt_generator = SystemPromptGenerator()# Create agent with dynamic context-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config=BaseAgentConfig(client=client,model=model,@@ -286,7 +287,7 @@ provider = "openai" # or "anthropic", "groq", "ollama", "gemini"client, model = setup_client(provider)# Create agent with chosen provider-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config=BaseAgentConfig(client=client,model=model,diff --git a/docs/guides/tools.md b/docs/guides/tools.mdindex acae497..8cd6067 100644--- a/docs/guides/tools.md+++ b/docs/guides/tools.md@@ -123,7 +123,7 @@ class MyToolConfig(BaseToolConfig):# Main Tool & Logic ######################-class MyTool(BaseTool):+class MyTool(BaseTool[MyToolInputSchema, MyToolOutputSchema]):"""Main tool implementation"""input_schema = MyToolInputSchemaoutput_schema = MyToolOutputSchemadiff --git a/docs/index.md b/docs/index.mdindex e4c34bc..e944374 100644--- a/docs/index.md+++ b/docs/index.md@@ -62,7 +62,7 @@ Here's a glimpse of how easy it is to create an agent:import instructorimport openaifrom atomic_agents.lib.components.agent_memory import AgentMemory-from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema+from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema, BaseAgentOutputSchema# Set up your API key (either in environment or pass directly)@@ -76,7 +76,7 @@ memory = AgentMemory()client = instructor.from_openai(openai.OpenAI()) # Pass your API key here if not in environment# Create an agent-agent = BaseAgent(+agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](config=BaseAgentConfig(client=client,model="gpt-4o-mini", # Use your provider's modeldiff --git a/pyproject.toml b/pyproject.tomlindex bc58aad..57f817d 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -15,7 +15,7 @@ packages = [][tool.poetry.dependencies]-python = ">=3.9,<4.0"+python = ">=3.12,<4.0"instructor = ">=1.3.4,<2.0.0"pydantic = ">=2.8.0,<3.0.0"rich = ">=13.7.1,<14.0.0"diff --git a/pytest.ini b/pytest.ininew file mode 100644index 0000000..24cac01--- /dev/null+++ b/pytest.ini@@ -0,0 +1,9 @@+[pytest]+# Configure pytest-asyncio plugin+asyncio_default_fixture_loop_scope = function++# Other common pytest configurations+testpaths = atomic-agents/tests+python_files = test_*.py+python_classes = Test*+python_functions = test_*\ No newline at end of filediff --git a/setup.py b/setup.pyindex 08799a9..6249cfb 100644--- a/setup.py+++ b/setup.py@@ -13,4 +13,5 @@ setup(packages=find_packages(where="atomic-agents") + find_packages(where="atomic-assembler"),package_dir={"atomic_agents": "atomic-agents/atomic_agents", "atomic_assembler": "atomic-assembler/atomic_assembler"},include_package_data=True,+ python_requires=">=3.12",)