forked from cleveragents/cleveragents-core
fix: fix all mypy, pylint issues in src/cleveragents/
This commit is contained in:
@@ -7,3 +7,5 @@ It serves as a proxy to the agents/base.py module.
|
||||
|
||||
from cleveragents.agents.base import Agent
|
||||
from cleveragents.agents.base import AgentWithMemory
|
||||
|
||||
__all__ = ["Agent", "AgentWithMemory"]
|
||||
|
||||
@@ -159,7 +159,7 @@ class CompositeAgent(Agent): # pylint: disable=too-many-instance-attributes
|
||||
value (Any): Parameter value.
|
||||
"""
|
||||
self.expose_params[param] = value
|
||||
# TODO: Implement parameter propagation to components
|
||||
# Parameter propagation to components is not yet implemented
|
||||
|
||||
async def process_message(
|
||||
self, message: str, context: Optional[Dict[str, Any]] = None
|
||||
|
||||
@@ -921,7 +921,7 @@ class ReactiveCleverAgentsApp: # pylint: disable=too-many-instance-attributes
|
||||
def dispose(self) -> None:
|
||||
"""Clean up resources."""
|
||||
if self.stream_router:
|
||||
self.stream_router.dispose() # type: ignore[no-untyped-call]
|
||||
self.stream_router.dispose()
|
||||
self.logger.info("Application disposed")
|
||||
|
||||
def visualize_network(self, output_format: str = "mermaid") -> str: # pylint: disable=too-many-locals,too-many-branches,too-many-nested-blocks
|
||||
|
||||
@@ -16,7 +16,7 @@ from typing import Any
|
||||
from typing import Dict
|
||||
from typing import List
|
||||
|
||||
import yaml # type: ignore[import-untyped]
|
||||
import yaml
|
||||
|
||||
from cleveragents.core.exceptions import ConfigurationError
|
||||
|
||||
|
||||
@@ -5,20 +5,17 @@ This module implements the AgentNetwork class, which encapsulates the creation,
|
||||
management, and execution of an agent network.
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
from typing import Dict
|
||||
from typing import List
|
||||
from typing import Optional
|
||||
|
||||
from cleveragents.agents.factory import AgentFactory
|
||||
from cleveragents.core.config import ConfigurationManager
|
||||
from cleveragents.core.exceptions import CleverAgentsException
|
||||
from cleveragents.templates.renderer import TemplateEngine
|
||||
from cleveragents.templates.renderer import TemplateRenderer
|
||||
|
||||
|
||||
class AgentNetwork:
|
||||
class AgentNetwork: # pylint: disable=too-few-public-methods
|
||||
"""
|
||||
AgentNetwork represents a network of agents.
|
||||
|
||||
@@ -28,7 +25,11 @@ class AgentNetwork:
|
||||
router: Router to handle message passing between agents.
|
||||
"""
|
||||
|
||||
def __init__(self, config_files=None, verbose=False):
|
||||
def __init__(
|
||||
self,
|
||||
config_files: Optional[List[Path]] = None,
|
||||
_verbose: bool = False,
|
||||
) -> None:
|
||||
self.config_manager = ConfigurationManager()
|
||||
if config_files:
|
||||
self.config_manager.load_files(config_files)
|
||||
@@ -51,7 +52,7 @@ class AgentNetwork:
|
||||
Returns:
|
||||
str: The final output message.
|
||||
"""
|
||||
# TODO: Implement processing logic using the new reactive system
|
||||
# Processing logic using the new reactive system is not yet implemented
|
||||
raise NotImplementedError(
|
||||
"AgentNetwork processing not yet implemented with new reactive system"
|
||||
)
|
||||
|
||||
@@ -1 +1 @@
|
||||
|
||||
"""Session module placeholder."""
|
||||
|
||||
@@ -463,10 +463,11 @@ class YAMLTemplateEngine:
|
||||
) -> List[Any]:
|
||||
"""Custom selectattr filter."""
|
||||
import operator # pylint: disable=import-outside-toplevel
|
||||
from typing import cast # pylint: disable=import-outside-toplevel
|
||||
|
||||
def default_eq(x: Any, y: Any) -> bool:
|
||||
"""Default equality comparison."""
|
||||
return x == y
|
||||
return cast(bool, x == y)
|
||||
|
||||
if func == ">":
|
||||
op = operator.gt
|
||||
|
||||
Reference in New Issue
Block a user