Building AI agents, atomically
fix: resolve flake8 linting errors
KennyVaneetveldee328c280e59f
diff --git a/atomic-agents/atomic_agents/agents/atomic_agent.py b/atomic-agents/atomic_agents/agents/atomic_agent.pyindex b1bdb1b..5f1dee6 100644--- a/atomic-agents/atomic_agents/agents/atomic_agent.py+++ b/atomic-agents/atomic_agents/agents/atomic_agent.py@@ -2,7 +2,7 @@ import instructorfrom instructor import Modefrom instructor.processing.multimodal import Image, Audio, PDFfrom pydantic import BaseModel, Field-from typing import Optional, Type, Generator, AsyncGenerator, get_args, get_origin, Dict, List, Callable, Any, Union+from typing import Optional, Type, Generator, AsyncGenerator, get_args, get_origin, Dict, List, Callable, Anyimport loggingfrom atomic_agents.context.chat_history import ChatHistoryfrom atomic_agents.context.system_prompt_generator import (@@ -10,7 +10,7 @@ from atomic_agents.context.system_prompt_generator import (SystemPromptGenerator,)from atomic_agents.base.base_io_schema import BaseIOSchema-from atomic_agents.utils.token_counter import get_token_counter, TokenCountResult, TokenCountError+from atomic_agents.utils.token_counter import get_token_counter, TokenCountResultimport jsonfrom instructor.dsl.partial import PartialBase@@ -690,7 +690,6 @@ if __name__ == "__main__":import instructorimport asynciofrom rich.live import Live- import jsondef _create_schema_table(title: str, schema: Type[BaseModel]) -> Table:"""Create a table displaying schema information.diff --git a/atomic-agents/tests/agents/test_atomic_agent.py b/atomic-agents/tests/agents/test_atomic_agent.pyindex e5ceb4f..5df37ce 100644--- a/atomic-agents/tests/agents/test_atomic_agent.py+++ b/atomic-agents/tests/agents/test_atomic_agent.py@@ -827,7 +827,7 @@ def test_get_context_token_count_includes_schema_overhead()agent = AtomicAgent[BasicChatInputSchema, BasicChatOutputSchema](config)- result = agent.get_context_token_count()+ agent.get_context_token_count()# Verify count_context was called with system message that includes schemacall_args = mock_counter_instance.count_context.call_args@@ -860,7 +860,7 @@ def test_get_context_token_count_no_system_prompt(mock_get_token_counter, mock_i)agent = AtomicAgent[BasicChatInputSchema, BasicChatOutputSchema](config)- result = agent.get_context_token_count()+ agent.get_context_token_count()# Even without system prompt, schema should be included (for JSON mode)call_args = mock_counter_instance.count_context.call_args@@ -932,7 +932,7 @@ def test_get_context_token_count_hook_dispatch(mock_get_token_counter, agent):agent.register_hook("token:counted", hook_handler)- result = agent.get_context_token_count()+ agent.get_context_token_count()assert len(hook_called) == 1assert hook_called[0] == expected_result@@ -965,7 +965,6 @@ def test_get_context_token_count_hook_not_called_when_disabled(mock_get_token_codef test_get_context_token_count_multimodal_content(mock_get_token_counter, mock_instructor):"""Test that multimodal content is properly serialized for token counting."""from instructor.processing.multimodal import Image- from instructor import Modemock_counter_instance = Mock()mock_get_token_counter.return_value = mock_counter_instance@@ -993,7 +992,7 @@ def test_get_context_token_count_multimodal_content(mock_get_token_counter, mockagent.history.add_message("user", multimodal_input)# Get token count- result = agent.get_context_token_count()+ agent.get_context_token_count()# Verify count_context was calledassert mock_counter_instance.count_context.calleddiff --git a/atomic-agents/tests/utils/test_token_counter.py b/atomic-agents/tests/utils/test_token_counter.pyindex da2f706..9534e7a 100644--- a/atomic-agents/tests/utils/test_token_counter.py+++ b/atomic-agents/tests/utils/test_token_counter.py@@ -1,5 +1,5 @@import pytest-from unittest.mock import Mock, patch+from unittest.mock import patchfrom atomic_agents.utils.token_counter import (TokenCounter,TokenCountResult,