Skip to content

Commit e328c28

Browse files
committed
fix: resolve flake8 linting errors
1 parent 9770445 commit e328c28

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

atomic-agents/atomic_agents/agents/atomic_agent.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
from instructor import Mode
33
from instructor.processing.multimodal import Image, Audio, PDF
44
from pydantic import BaseModel, Field
5-
from typing import Optional, Type, Generator, AsyncGenerator, get_args, get_origin, Dict, List, Callable, Any, Union
5+
from typing import Optional, Type, Generator, AsyncGenerator, get_args, get_origin, Dict, List, Callable, Any
66
import logging
77
from atomic_agents.context.chat_history import ChatHistory
88
from atomic_agents.context.system_prompt_generator import (
99
BaseDynamicContextProvider,
1010
SystemPromptGenerator,
1111
)
1212
from atomic_agents.base.base_io_schema import BaseIOSchema
13-
from atomic_agents.utils.token_counter import get_token_counter, TokenCountResult, TokenCountError
13+
from atomic_agents.utils.token_counter import get_token_counter, TokenCountResult
1414
import json
1515

1616
from instructor.dsl.partial import PartialBase
@@ -690,7 +690,6 @@ def hooks_enabled(self) -> bool:
690690
import instructor
691691
import asyncio
692692
from rich.live import Live
693-
import json
694693

695694
def _create_schema_table(title: str, schema: Type[BaseModel]) -> Table:
696695
"""Create a table displaying schema information.

atomic-agents/tests/agents/test_atomic_agent.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ def test_get_context_token_count_includes_schema_overhead(
827827
)
828828
agent = AtomicAgent[BasicChatInputSchema, BasicChatOutputSchema](config)
829829

830-
result = agent.get_context_token_count()
830+
agent.get_context_token_count()
831831

832832
# Verify count_context was called with system message that includes schema
833833
call_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
860860
)
861861
agent = AtomicAgent[BasicChatInputSchema, BasicChatOutputSchema](config)
862862

863-
result = agent.get_context_token_count()
863+
agent.get_context_token_count()
864864

865865
# Even without system prompt, schema should be included (for JSON mode)
866866
call_args = mock_counter_instance.count_context.call_args
@@ -932,7 +932,7 @@ def hook_handler(result):
932932

933933
agent.register_hook("token:counted", hook_handler)
934934

935-
result = agent.get_context_token_count()
935+
agent.get_context_token_count()
936936

937937
assert len(hook_called) == 1
938938
assert hook_called[0] == expected_result
@@ -965,7 +965,6 @@ def hook_handler(result):
965965
def test_get_context_token_count_multimodal_content(mock_get_token_counter, mock_instructor):
966966
"""Test that multimodal content is properly serialized for token counting."""
967967
from instructor.processing.multimodal import Image
968-
from instructor import Mode
969968

970969
mock_counter_instance = Mock()
971970
mock_get_token_counter.return_value = mock_counter_instance
@@ -993,7 +992,7 @@ class MultimodalInputSchema(BaseIOSchema):
993992
agent.history.add_message("user", multimodal_input)
994993

995994
# Get token count
996-
result = agent.get_context_token_count()
995+
agent.get_context_token_count()
997996

998997
# Verify count_context was called
999998
assert mock_counter_instance.count_context.called

atomic-agents/tests/utils/test_token_counter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from unittest.mock import Mock, patch
2+
from unittest.mock import patch
33
from atomic_agents.utils.token_counter import (
44
TokenCounter,
55
TokenCountResult,

0 commit comments

Comments
 (0)