diff --git a/README.md b/README.md index 85721803..9f69b06f 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Follow these steps to setup the Automata environment # Copy the env and setup files cp .setup.sh.example setup.sh && cp .env.example .env -# Allow for execution +# Allow for execution chmod 755 setup.sh # Update the setup and env files with your local paths @@ -103,8 +103,9 @@ Sometimes the best way to understand a complicated system is to start by underst import logging from automata.config.openai_agent import AutomataOpenAIAgentConfigBuilder from automata.core.agent.providers import OpenAIAutomataAgent -from automata.core.agent.tool.tool_utils import AgentToolFactory, dependency_factory -from automata.core.coding.py.module_loader import py_module_loader +from automata.core.tools.tool_utils import AgentToolFactory +from automata.core.singletons.dependency_factory import dependency_factory +from automata.core.singletons.module_loader import py_module_loader logger = logging.getLogger(__name__) @@ -142,9 +143,10 @@ Examples of these classes are: `SymbolDocEmbedding` a class used for storing embeddings related to the documentation of a symbol. Code example for creating an instance of 'SymbolCodeEmbedding': + ```python import numpy as np -from automata.core.base.symbol_embedding import SymbolCodeEmbedding +from automata.core.symbol_embedding.base import SymbolCodeEmbedding from automata.core.symbol.parser import parse_symbol symbol_str = 'scip-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `automata.core.agent.agent_enums`/ActionIndicator#' @@ -156,8 +158,9 @@ embedding = SymbolCodeEmbedding(symbol=symbol, source_code=source_code, vector=v ``` Code example for creating an instance of 'SymbolDocEmbedding': + ```python -from automata.core.base.symbol_embedding import SymbolDocEmbedding +from automata.core.symbol_embedding.base import SymbolDocEmbedding from automata.core.symbol.parser import parse_symbol import numpy as np @@ -185,7 +188,6 @@ discussion, and please direct specific questions.** The Automata project strives to abide by generally accepted best practices in open-source software development. - ## Future The ultimate goal of the Automata project is to achieve a level of proficiency where it can independently design, write, test, and refine complex software systems. This includes the ability to understand and navigate large codebases, reason about software architecture, optimize performance, and even invent new algorithms or data structures when necessary. diff --git a/automata/cli/scripts/run_agent.py b/automata/cli/scripts/run_agent.py index 17523d1a..6409fc69 100644 --- a/automata/cli/scripts/run_agent.py +++ b/automata/cli/scripts/run_agent.py @@ -5,9 +5,10 @@ from automata.config.base import AgentConfigName from automata.config.openai_agent import AutomataOpenAIAgentConfigBuilder from automata.core.agent.providers import OpenAIAutomataAgent -from automata.core.agent.tool.tool_utils import AgentToolFactory, dependency_factory -from automata.core.base.github_manager import GitHubManager -from automata.core.coding.py.module_loader import py_module_loader +from automata.core.github_management.client import GitHubClient +from automata.core.singletons.dependency_factory import dependency_factory +from automata.core.singletons.module_loader import py_module_loader +from automata.core.tools.factory import AgentToolFactory logger = logging.getLogger(__name__) @@ -17,7 +18,7 @@ # Solve the GitHub issues by writing the relevant code via the PyWriter tool. The issues begin now:""" -def process_issues(issue_numbers: List[int], github_manager: GitHubManager) -> List[str]: +def process_issues(issue_numbers: List[int], github_manager: GitHubClient) -> List[str]: """ Process the issues and create tasks for each of them. @@ -41,7 +42,7 @@ def process_issues(issue_numbers: List[int], github_manager: GitHubManager) -> L def main(*args, **kwargs): py_module_loader.initialize() - github_manager = GitHubManager(access_token=GITHUB_API_KEY, remote_name=REPOSITORY_NAME) + github_manager = GitHubClient(access_token=GITHUB_API_KEY, remote_name=REPOSITORY_NAME) # Pre-process issues if they are passsed issue_numbers = kwargs.get("fetch_issues", "") diff --git a/automata/cli/scripts/run_code_embedding.py b/automata/cli/scripts/run_code_embedding.py index 35477099..46df45ef 100644 --- a/automata/cli/scripts/run_code_embedding.py +++ b/automata/cli/scripts/run_code_embedding.py @@ -4,12 +4,12 @@ from tqdm import tqdm from automata.config.base import ConfigCategory -from automata.core.base.symbol_embedding import JSONSymbolEmbeddingVectorDatabase -from automata.core.coding.py.module_loader import py_module_loader from automata.core.llm.providers.openai import OpenAIEmbeddingProvider from automata.core.memory_store.symbol_code_embedding import SymbolCodeEmbeddingHandler +from automata.core.singletons.module_loader import py_module_loader from automata.core.symbol.graph import SymbolGraph from automata.core.symbol.symbol_utils import get_rankable_symbols +from automata.core.symbol_embedding.base import JSONSymbolEmbeddingVectorDatabase from automata.core.symbol_embedding.builders import SymbolCodeEmbeddingBuilder from automata.core.utils import get_config_fpath diff --git a/automata/cli/scripts/run_doc_embedding_l2.py b/automata/cli/scripts/run_doc_embedding_l2.py index 62791b3c..bffebc2a 100644 --- a/automata/cli/scripts/run_doc_embedding_l2.py +++ b/automata/cli/scripts/run_doc_embedding_l2.py @@ -4,23 +4,23 @@ from tqdm import tqdm from automata.config.base import ConfigCategory -from automata.core.base.symbol import SymbolDescriptor -from automata.core.base.symbol_embedding import JSONSymbolEmbeddingVectorDatabase -from automata.core.coding.py.module_loader import py_module_loader -from automata.core.context.py.retriever import ( - PyContextRetriever, - PyContextRetrieverConfig, -) +from automata.core.experimental.search.rank import SymbolRankConfig +from automata.core.experimental.search.symbol_search import SymbolSearch from automata.core.llm.providers.openai import ( OpenAIChatCompletionProvider, OpenAIEmbeddingProvider, ) from automata.core.memory_store.symbol_code_embedding import SymbolCodeEmbeddingHandler from automata.core.memory_store.symbol_doc_embedding import SymbolDocEmbeddingHandler +from automata.core.retrievers.py.context import ( + PyContextRetriever, + PyContextRetrieverConfig, +) +from automata.core.singletons.module_loader import py_module_loader +from automata.core.symbol.base import SymbolDescriptor from automata.core.symbol.graph import SymbolGraph -from automata.core.symbol.search.rank import SymbolRankConfig -from automata.core.symbol.search.symbol_search import SymbolSearch from automata.core.symbol.symbol_utils import get_rankable_symbols +from automata.core.symbol_embedding.base import JSONSymbolEmbeddingVectorDatabase from automata.core.symbol_embedding.builders import ( SymbolCodeEmbeddingBuilder, SymbolDocEmbeddingBuilder, diff --git a/automata/cli/scripts/run_doc_embedding_l3.py b/automata/cli/scripts/run_doc_embedding_l3.py index 34e124df..71349bcf 100644 --- a/automata/cli/scripts/run_doc_embedding_l3.py +++ b/automata/cli/scripts/run_doc_embedding_l3.py @@ -4,23 +4,23 @@ from tqdm import tqdm from automata.config.base import ConfigCategory -from automata.core.base.symbol import SymbolDescriptor -from automata.core.base.symbol_embedding import JSONSymbolEmbeddingVectorDatabase -from automata.core.coding.py.module_loader import py_module_loader -from automata.core.context.py.retriever import ( - PyContextRetriever, - PyContextRetrieverConfig, -) +from automata.core.experimental.search.rank import SymbolRankConfig +from automata.core.experimental.search.symbol_search import SymbolSearch from automata.core.llm.providers.openai import ( OpenAIChatCompletionProvider, OpenAIEmbeddingProvider, ) from automata.core.memory_store.symbol_code_embedding import SymbolCodeEmbeddingHandler from automata.core.memory_store.symbol_doc_embedding import SymbolDocEmbeddingHandler +from automata.core.retrievers.py.context import ( + PyContextRetriever, + PyContextRetrieverConfig, +) +from automata.core.singletons.module_loader import py_module_loader +from automata.core.symbol.base import SymbolDescriptor from automata.core.symbol.graph import SymbolGraph -from automata.core.symbol.search.rank import SymbolRankConfig -from automata.core.symbol.search.symbol_search import SymbolSearch from automata.core.symbol.symbol_utils import get_rankable_symbols +from automata.core.symbol_embedding.base import JSONSymbolEmbeddingVectorDatabase from automata.core.symbol_embedding.builders import ( SymbolCodeEmbeddingBuilder, SymbolDocEmbeddingBuilder, diff --git a/automata/cli/scripts/run_doc_post_process.py b/automata/cli/scripts/run_doc_post_process.py index 911363a4..64ee598f 100644 --- a/automata/cli/scripts/run_doc_post_process.py +++ b/automata/cli/scripts/run_doc_post_process.py @@ -2,8 +2,8 @@ import os from automata.config.base import ConfigCategory -from automata.core.base.symbol_embedding import JSONSymbolEmbeddingVectorDatabase -from automata.core.coding.py.writer import PyDocWriter +from automata.core.code_handling.py.writer import PyDocWriter +from automata.core.symbol_embedding.base import JSONSymbolEmbeddingVectorDatabase from automata.core.utils import get_config_fpath, get_root_py_fpath logger = logging.getLogger(__name__) diff --git a/automata/config/base.py b/automata/config/base.py index 4a6d45a0..d22441d2 100644 --- a/automata/config/base.py +++ b/automata/config/base.py @@ -6,7 +6,7 @@ import yaml from pydantic import BaseModel, PrivateAttr -from automata.core.base.tool import Tool +from automata.core.tools.base import Tool from automata.core.utils import convert_kebab_to_snake diff --git a/automata/config/openai_agent.py b/automata/config/openai_agent.py index 29474943..89b10203 100644 --- a/automata/config/openai_agent.py +++ b/automata/config/openai_agent.py @@ -10,8 +10,8 @@ InstructionConfigVersion, LLMProvider, ) -from automata.core.agent.tool.tool_utils import dependency_factory -from automata.core.symbol.search.rank import SymbolRank +from automata.core.experimental.search.rank import SymbolRank +from automata.core.singletons.dependency_factory import dependency_factory class AutomataOpenAIAgentConfig(AgentConfig): diff --git a/automata/config/symbol/symbol_code_embedding.json b/automata/config/symbol/symbol_code_embedding.json index ca53e8c6..10441dab 100644 --- a/automata/config/symbol/symbol_code_embedding.json +++ b/automata/config/symbol/symbol_code_embedding.json @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b580458618ea01a98d157581145c5f5eb8006361831dd005ab9cc3b60df46434 -size 14237656 +oid sha256:db9d3265f90dbb085197897410315ff092e8c18a9b3a561c863eeb2e9922ccb4 +size 7849630 diff --git a/automata/config/symbol/symbol_doc_embedding_l2.json b/automata/config/symbol/symbol_doc_embedding_l2.json index 0b91e15b..d5d84648 100644 --- a/automata/config/symbol/symbol_doc_embedding_l2.json +++ b/automata/config/symbol/symbol_doc_embedding_l2.json @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:58cdc098f5620304a3ab74fcefdccc9328b5db1412a68040143787995d483e1f -size 4966841 +oid sha256:d54222081c9522f2ea62427114f62bdf2dc7bbed35a6e7f5007eb7f24d239e74 +size 2354600 diff --git a/automata/config/symbol/symbol_doc_embedding_l3.json b/automata/config/symbol/symbol_doc_embedding_l3.json index 28312210..7d266977 100644 --- a/automata/config/symbol/symbol_doc_embedding_l3.json +++ b/automata/config/symbol/symbol_doc_embedding_l3.json @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:555e11327dd4c75e824cb17e8be2e3544c6cf228478a7c01a3ea813114fd3a12 -size 5649084 +oid sha256:9039e79cf77e363a4618047854f6c2e00d99241da09d6a17f234e635b5e701fa +size 2590080 diff --git a/automata/core/base/agent.py b/automata/core/agent/agent.py similarity index 98% rename from automata/core/base/agent.py rename to automata/core/agent/agent.py index cf6935b7..f936d003 100644 --- a/automata/core/base/agent.py +++ b/automata/core/agent/agent.py @@ -6,11 +6,11 @@ from pydantic import BaseModel from automata.config.base import AgentConfigName, LLMProvider -from automata.core.base.tool import Tool from automata.core.llm.foundation import ( LLMConversationDatabaseProvider, LLMIterationResult, ) +from automata.core.tools.base import Tool logger = logging.getLogger(__name__) diff --git a/automata/core/agent/instances.py b/automata/core/agent/instances.py index 10c7acf9..49f200ce 100644 --- a/automata/core/agent/instances.py +++ b/automata/core/agent/instances.py @@ -4,7 +4,7 @@ from automata.config.base import AgentConfigName from automata.config.openai_agent import AutomataOpenAIAgentConfigBuilder -from automata.core.base.agent import AgentInstance +from automata.core.agent.agent import AgentInstance if TYPE_CHECKING: from automata.core.agent.providers import OpenAIAutomataAgent diff --git a/automata/core/agent/providers.py b/automata/core/agent/providers.py index 795f4593..f1b64d7d 100644 --- a/automata/core/agent/providers.py +++ b/automata/core/agent/providers.py @@ -4,6 +4,7 @@ from automata.config.base import ConfigCategory from automata.config.openai_agent import AutomataOpenAIAgentConfig +from automata.core.agent.agent import Agent, AgentToolkit from automata.core.agent.error import ( AgentDatabaseError, AgentGeneralError, @@ -11,7 +12,6 @@ AgentResultError, AgentStopIteration, ) -from automata.core.base.agent import Agent, AgentToolkit from automata.core.llm.foundation import ( LLMChatMessage, LLMConversationDatabaseProvider, diff --git a/automata/core/agent/task/environment.py b/automata/core/agent/task/environment.py deleted file mode 100644 index 09ae8d31..00000000 --- a/automata/core/agent/task/environment.py +++ /dev/null @@ -1,116 +0,0 @@ -import logging -import logging.config -import os - -from automata.core.agent.error import AgentTaskGeneralError, AgentTaskStateError -from automata.core.agent.task.task import AutomataTask -from automata.core.base.github_manager import GitHubManager -from automata.core.base.task import Task, TaskEnvironment, TaskStatus - -logger = logging.getLogger(__name__) - - -class AutomataTaskEnvironment(TaskEnvironment): - """A concrete implementation of the Abstract TaskEnvironment for Automata providers.""" - - def __init__(self, github_manager: GitHubManager) -> None: - self.github_manager = github_manager - - def setup(self, task: Task) -> None: - """ - Set up the environment by cloning the repository into the task directory. - Further, set the task status to PENDING. - - Raises: - Exception: If the task is not status CREATED. - """ - if task.status != TaskStatus.REGISTERED: - raise AgentTaskStateError( - f"Cannot setup task environment because task is not in REGISTERED state. Task status = {task.status}" - ) - if not isinstance(task, AutomataTask): - raise AgentTaskGeneralError( - "AutomataTaskEnvironment requires an AutomataTask instance" - ) - - logger.debug(f"Setting up the task environment in directory {task.task_dir}.") - # TODO - Consider more methods for environment initlization than git clone - self.github_manager.clone_repository(task.task_dir) - - task.status = TaskStatus.PENDING - logger.info(f"Task {task.task_id} environment setup successfully.") - - def teardown(self) -> None: - # TODO - Implement teardown environment - raise NotImplementedError - - def validate(self) -> None: - # TODO - Implement validate environment - raise NotImplementedError - - def reset(self) -> None: - # TODO - Implement reset environment which clears the state - raise NotImplementedError - - def commit_task( - self, - task: AutomataTask, - commit_message: str, - pull_title: str, - pull_body: str, - pull_branch_name: str = "feature/test", - ) -> str: - """ - Commits the task to the remote repository. - - Raises AgentTaskException: - If the task is not status SUCCESS. - If the task output directory is missing. - If the branch already exists. - If the checkout fails. - If the commit fails. - """ - logger.debug("Comitting task...") - - if task.status != TaskStatus.SUCCESS: - raise AgentTaskStateError( - "Cannot commit task to repository because the task has not been successfully executed." - ) - if not os.path.exists(task.task_dir): - raise AgentTaskGeneralError( - "Cannot commit task to repository because the task output directory is missing." - ) - # Check if the branch already exists, if not create it - if not self.github_manager.branch_exists(pull_branch_name): - self.github_manager.create_branch(pull_branch_name) - # Checkout the new branch - try: - self.github_manager.checkout_branch(task.task_dir, pull_branch_name) - except Exception as e: - logger.debug(f"Checkout failed with exception: {e}, Trying with b=False") - self.github_manager.checkout_branch(task.task_dir, pull_branch_name, b=False) - - # Stage all changes - self.github_manager.stage_all_changes(task.task_dir) - - try: - # Commit and push changes - self.github_manager.commit_and_push_changes( - task.task_dir, pull_branch_name, commit_message - ) - except Exception as e: - logger.debug(f"Commit failed with exception: {e}") - - # Create a pull request - pull_request = self.github_manager.create_pull_request( - pull_branch_name, pull_title, pull_body - ) - pull_url = pull_request.html_url - task.status = TaskStatus.COMMITTED - - logger.info( - "Task %s committed successfully with Title:\n%s\n\nBody:\n%s\n\nBranch:\n%s\nAt URL:\n%s\n" - % (task.task_id, pull_title, pull_body, pull_branch_name, pull_url), - ) - - return pull_request.html_url diff --git a/automata/core/agent/task/executor.py b/automata/core/agent/task/executor.py deleted file mode 100644 index e7474452..00000000 --- a/automata/core/agent/task/executor.py +++ /dev/null @@ -1,103 +0,0 @@ -import logging -import logging.config -import time - -from automata.config.openai_agent import AutomataOpenAIAgentConfigBuilder -from automata.core.agent.error import AgentTaskGeneralError, AgentTaskStateError -from automata.core.agent.providers import OpenAIAutomataAgent -from automata.core.agent.task.task import AutomataTask -from automata.core.base.task import ITaskExecution, Task, TaskStatus - -logger = logging.getLogger(__name__) - - -class IAutomataTaskExecution(ITaskExecution): - """Class for executing general tasks.""" - - def execute(self, task: Task) -> None: - """ - Executes the task by creating and running an AutomataAgent. - Eachtime the execution fails, the task's retry count is incremented. - After the maximum number of retries is reached, the task is marked as failed. - - Raises: - Exception: If the task fails on execution - """ - if not isinstance(task, AutomataTask): - raise AgentTaskGeneralError( - "AutomataTaskEnvironment requires an AutomataTask instance" - ) - - task.status = TaskStatus.RUNNING - try: - agent = IAutomataTaskExecution._build_agent(task) - result = agent.run() - task.result = result - task.status = TaskStatus.SUCCESS - except Exception as e: - logger.exception(f"AutomataTask failed: {e}") - task.error = str(e) - task.status = TaskStatus.FAILED - task.retry_count += 1 - raise e - - @staticmethod - def _build_agent(task: AutomataTask) -> OpenAIAutomataAgent: - """ - Uses the task's arguments to build an AutomataAgent from - the AutomataOpenAIAgentConfigBuilder. - TODO - Consider explicitly passing args to the ConfigFactory - Instead of passing kwargs to the create_config method. - """ - agent_config = AutomataOpenAIAgentConfigBuilder.create_from_args(**task.kwargs) - return OpenAIAutomataAgent( - task.instructions, - agent_config, - ) - - -class AutomataTaskExecutor: - """A class for using ITaskExecution behavior to execute a task.""" - - def __init__(self, execution: ITaskExecution) -> None: - self.execution = execution - - def execute(self, task: AutomataTask) -> None: - """ - Executes the task using the specified execution behavior. - - This method will retry the task if it fails, - until the maximum number of retries is reached. - - Raises Exception: - If the task is not status PENDING. - If the task fails and the maximum number of retries is reached. - """ - if task.status != TaskStatus.PENDING: - raise AgentTaskStateError( - f"Cannot execute task because task is not in PENDING state. Task status = {task.status}" - ) - for attempt in range(task.max_retries): - try: - logger.debug(f"Executing task {task.task_id}") - task.status = TaskStatus.RUNNING - self.execution.execute(task) - task.status = TaskStatus.SUCCESS - logger.info(f"Task {task.task_id} executed successfully.") - break - - except Exception as e: - logging.exception(f"AutomataTask failed: {e}") - task.status = TaskStatus.RETRYING - task.error = str(e) - - # If we've used up all retries, re-raise the exception - if attempt == task.max_retries - 1: - raise e - - # Otherwise, wait before retrying - time.sleep(AutomataTaskExecutor._exponential_backoff(attempt)) - - @staticmethod - def _exponential_backoff(attempt_number: int) -> int: - return 2**attempt_number # Exponential backoff in seconds diff --git a/automata/core/agent/task/registry.py b/automata/core/agent/task/registry.py deleted file mode 100644 index c70842ba..00000000 --- a/automata/core/agent/task/registry.py +++ /dev/null @@ -1,133 +0,0 @@ -import logging -import logging.config -from typing import List, Optional, Tuple - -import jsonpickle - -from automata.config import TASK_DB_PATH -from automata.core.agent.error import AgentTaskGeneralError, AgentTaskStateError -from automata.core.agent.task.task import AutomataTask -from automata.core.base.database.relational import SQLDatabase -from automata.core.base.task import TaskStatus - -logger = logging.getLogger(__name__) - - -class AutomataTaskDatabase(SQLDatabase): - """The database creates a local store for all tasks.""" - - TABLE_NAME = "tasks" - TABLE_FIELDS = { - "id": "TEXT PRIMARY KEY", - "json": "TEXT", - "instructions": "TEXT", - "status": "TEXT", - } - - def __init__(self, db_path: str = TASK_DB_PATH): - self.connect(db_path) - self.create_table(self.TABLE_NAME, self.TABLE_FIELDS) - - def insert_task(self, task: AutomataTask) -> None: - task_id = task.task_id - task_json = jsonpickle.encode(task) - instructions = task.instructions - status = task.status.value - self.insert( - self.TABLE_NAME, - { - "id": str(task_id), - "json": task_json, - "instructions": instructions, - "status": status, - }, - ) - - def update_task(self, task: AutomataTask) -> None: - task_json = jsonpickle.encode(task) - instructions = task.instructions - status = task.status.value - self.update_database( - self.TABLE_NAME, - {"json": task_json, "instructions": instructions, "status": status}, - {"id": str(task.task_id)}, - ) - - def get_tasks_by_query(self, query: str, params: Tuple = ()) -> List[AutomataTask]: - """Gets the list of tasks by applying the specified query.""" - rows = self.select(self.TABLE_NAME, ["json"], conditions=dict(zip(query, params))) - tasks = [] - for row in rows: - task_json = row[0] - try: - task = jsonpickle.decode(task_json) - tasks.append(task) - except Exception as e: - logger.error(f"Failed to decode task with error: {e}") - - return tasks - - def contains(self, task: AutomataTask) -> bool: - """Checks if a task exists in the database.""" - result = self.select(self.TABLE_NAME, ["id"], conditions={"id": str(task.task_id)}) - return len(result) > 0 - - -class AutomataTaskRegistry: - """The registry manages storing and retrieving tasks.""" - - def __init__(self, db: AutomataTaskDatabase) -> None: - self.db = db - - def register(self, task: AutomataTask) -> None: - """ - Initializes a task by adding it to the registry and setting its status to REGISTERED. - - Raises: - Exception: If the task is not status CREATED. - """ - if task.status != TaskStatus.CREATED: - raise AgentTaskStateError( - f"Cannot register task because task is not in CREATED state. Task status = {task.status}" - ) - task.observer = self.update_task - if self.fetch_task_by_id(str(task.task_id)): - raise AgentTaskGeneralError(f"Task with id {task.task_id} already exists") - self.db.insert_task(task) - task.status = TaskStatus.REGISTERED - logger.info(f"Task {task.task_id} registered successfully.") - - def update_task(self, task: AutomataTask) -> None: - """ - Updates a task in the registry. - - Raises: - Exception: If the task does not exist in the registry. - """ - if not self.db.contains(task): - raise AgentTaskStateError(f"Task with id {task.task_id} does not exist") - task.observer = None - self.db.update_task(task) - task.observer = self.update_task - - def fetch_task_by_id(self, task_id: str) -> Optional[AutomataTask]: - """ - Raises: - Exception: If multiple tasks are found with the same id. - """ - results = self.db.get_tasks_by_query( - query="SELECT json FROM tasks WHERE id = ?", params=(task_id,) - ) - if not results: - return None - if len(results) != 1: - raise AgentTaskGeneralError(f"Found multiple tasks with id {task_id}") - task = results[0] - task.observer = self.update_task - return task - - def get_all_tasks(self) -> List[AutomataTask]: - results = self.db.get_tasks_by_query(query="SELECT json FROM tasks") - for result in results: - result.observer = self.update_task - return results diff --git a/automata/core/agent/task/task.py b/automata/core/agent/task/task.py deleted file mode 100644 index eef4ab20..00000000 --- a/automata/core/agent/task/task.py +++ /dev/null @@ -1,53 +0,0 @@ -import logging -import logging.config -import os - -from automata.core.agent.error import AgentTaskInstructions -from automata.core.base.task import Task -from automata.core.utils import get_logging_config, get_root_fpath, get_root_py_fpath - -logger = logging.getLogger(__name__) - - -class AutomataTask(Task): - """A task that is to be executed by the TaskExecutor.""" - - def __init__(self, *args, **kwargs): - """ - Keyword Args: - instructions (str): The instructions for the task. - path_to_root_py (str): The path to the root python folder. - """ - super().__init__(*args, **kwargs) - self.args = args - self.kwargs = kwargs - if "instructions" not in self.kwargs or self.kwargs["instructions"] == "": - raise AgentTaskInstructions("Task instructions cannot be empty.") - self.instructions = self.kwargs["instructions"] - # Note, this assumes the python folder is in the root folder - default_python_folder = os.path.relpath(get_root_py_fpath(), get_root_fpath()) - self.path_to_root_py = kwargs.get("path_to_root_py", default_python_folder) - - def initialize_logging(self) -> None: - """ - Initializes logging for the task by creating a log file in the task directory. - If the task directory does not exist, it is created. - """ - log_dir = self._get_log_dir() - if not os.path.exists(log_dir): - os.makedirs(log_dir) - - log_file = os.path.join(log_dir, Task.TASK_LOG_NAME.replace("TASK_ID", str(self.task_id))) - log_level = logging.DEBUG if self.kwargs.get("verbose") else logging.INFO - logging.config.dictConfig(get_logging_config(log_level=log_level, log_file=log_file)) - logging.debug("Logging initialized.") - - def get_logs(self) -> str: - log_dir = self._get_log_dir() - log_file = os.path.join(log_dir, Task.TASK_LOG_NAME.replace("TASK_ID", str(self.task_id))) - - if not os.path.exists(log_file): - raise FileNotFoundError(f"Log file {log_file} not found.") - with open(log_file, "r") as f: - log_content = f.read() - return log_content diff --git a/automata/core/base/observer.py b/automata/core/base/patterns/observer.py similarity index 100% rename from automata/core/base/observer.py rename to automata/core/base/patterns/observer.py diff --git a/automata/core/base/singleton.py b/automata/core/base/patterns/singleton.py similarity index 100% rename from automata/core/base/singleton.py rename to automata/core/base/patterns/singleton.py diff --git a/automata/core/base/task.py b/automata/core/base/task.py deleted file mode 100644 index 88747e07..00000000 --- a/automata/core/base/task.py +++ /dev/null @@ -1,152 +0,0 @@ -import os -import uuid -from abc import ABC, abstractmethod -from collections.abc import Hashable -from enum import Enum -from typing import Callable, Optional - -from automata.config import TASK_OUTPUT_PATH - - -class TaskStatus(Enum): - CREATED = "created" - REGISTERED = "registered" - PENDING = "pending" - RUNNING = "running" - SUCCESS = "success" - COMMITTED = "committed" - FAILED = "failed" - RETRYING = "retrying" - - -class Task: - """ - A generic `Task` object used by the `TaskExecutor`. - - A `Task` is responsible for storing the task id, priority, and max retries. - It receives kwargs that are passed to the task function when the task is executed. - It also exposes a method to generate a deterministic task id based on the hash of the hashable kwargs. - """ - - TASK_LOG_NAME = "task_TASK_ID.log" - TASK_LOG_REL_DIR = "logs" - - def __init__(self, *args, **kwargs) -> None: - """ - Initializes a task object. - - Keyword Args: - generate_deterministic_id (bool): Whether to generate a deterministic task id or not. - In the case of a deterministic task id, the task id is generated based on the hash of - the hashable kwargs. Defaults to False. - priority (int): The priority of the task. Defaults to 0. - max_retries (int): The maximum number of retries for the task. Defaults to 3. - """ - self.task_id = ( - self._deterministic_task_id(**kwargs) - if kwargs.get("generate_deterministic_id", False) - else uuid.uuid4() - ) - self.priority = kwargs.get("priority", 0) - self.max_retries = kwargs.get("max_retries", 3) - self._status = TaskStatus.CREATED - self.retry_count = 0 - self.observer: Optional[Callable] = None - self.task_dir = self._get_task_dir(kwargs.get("task_dir", TASK_OUTPUT_PATH)) - self.result: Optional[str] = None - self.error: Optional[str] = None - - def __str__(self): - return f"Task {self.task_id} ({self.status})" - - def notify_observer(self) -> None: - """ - Used to notify the observer when the task status changes. - """ - if self.observer: - self.observer(self) - - @property - def status(self) -> TaskStatus: - """ - The status of the task is updated by the task executor as the task progresses through - different stages of execution. - """ - return self._status - - @status.setter - def status(self, new_status: TaskStatus) -> None: - """ - Sets the status of the `Task`. - - If the new status is RETRYING, the retry count is incremented - and the task status is set to FAILED if the retry count exceeds the max retries. - """ - if new_status == TaskStatus.RETRYING: - self.retry_count += 1 - if self.retry_count == self.max_retries: - self._status = TaskStatus.FAILED - else: - self._status = new_status - else: - self._status = new_status - self.notify_observer() - - def _deterministic_task_id(self, **kwargs) -> uuid.UUID: - """ - Returns a deterministic session id for the task which is - generated based on the hash of the hashable kwargs. - - Keyword Args: - kwargs (dict): The keyword arguments passed to the task. - """ - # Generate the hash of the hashable kwargs - hashable_items = sorted([item for item in kwargs.items() if isinstance(item[1], Hashable)]) - kwargs_hash = hash(tuple(hashable_items)) - - # Combine the hashes and use it as a seed for generating a deterministic UUID - return uuid.uuid5(uuid.NAMESPACE_DNS, f"{kwargs_hash}") - - def _get_task_dir(self, base_dir: str) -> str: - """ - Gets the output directory for the task. - Use of the task_id as the directory name ensures that the task directory is unique. - """ - return os.path.join(base_dir, f"task_{self.task_id}") - - def _get_log_dir(self) -> str: - """ - Gets the output directory where task logs are saved.""" - return os.path.join(self.task_dir, Task.TASK_LOG_REL_DIR) - - -class ITaskExecution(ABC): - """Interface for task execution behaviors.""" - - @abstractmethod - def execute(self, task: Task): - pass - - -class TaskEnvironment(ABC): - """An abstract base class for implementing a task environment.""" - - @abstractmethod - def setup(self, task: Task): - """Set up the environment.""" - pass - - @abstractmethod - def teardown(self): - """Tear down the environment.""" - pass - - @abstractmethod - def validate(self): - """Validate the environment.""" - pass - - @abstractmethod - def reset(self): - """Reset the environment to its initial state.""" - pass diff --git a/automata/core/agent/tool/__init__.py b/automata/core/code_handling/__init__.py similarity index 100% rename from automata/core/agent/tool/__init__.py rename to automata/core/code_handling/__init__.py diff --git a/automata/core/coding/py/reader.py b/automata/core/code_handling/py/reader.py similarity index 96% rename from automata/core/coding/py/reader.py rename to automata/core/code_handling/py/reader.py index 4716ddda..60f33cdc 100644 --- a/automata/core/coding/py/reader.py +++ b/automata/core/code_handling/py/reader.py @@ -5,8 +5,8 @@ from redbaron import ClassNode, DefNode, Node, RedBaron, StringNode -from automata.core.coding.py.module_loader import NO_RESULT_FOUND_STR, py_module_loader -from automata.core.coding.py.navigation import find_syntax_tree_node +from automata.core.navigation.py.navigation_utils import find_syntax_tree_node +from automata.core.singletons.module_loader import NO_RESULT_FOUND_STR, py_module_loader logger = logging.getLogger(__name__) FSTNode = Union[Node, RedBaron] diff --git a/automata/core/coding/py/writer.py b/automata/core/code_handling/py/writer.py similarity index 97% rename from automata/core/coding/py/writer.py rename to automata/core/code_handling/py/writer.py index 23de56e8..60233763 100644 --- a/automata/core/coding/py/writer.py +++ b/automata/core/code_handling/py/writer.py @@ -8,17 +8,17 @@ import pypandoc from redbaron import ClassNode, DefNode, Node, NodeList, RedBaron -from automata.core.base.symbol import Symbol -from automata.core.base.symbol_embedding import SymbolDocEmbedding -from automata.core.coding.directory import DirectoryManager -from automata.core.coding.py.module_loader import py_module_loader -from automata.core.coding.py.navigation import ( +from automata.core.code_handling.py.reader import PyReader +from automata.core.navigation.directory import DirectoryManager +from automata.core.navigation.py.navigation_utils import ( find_all_function_and_class_syntax_tree_nodes, find_import_syntax_tree_node_by_name, find_import_syntax_tree_nodes, find_syntax_tree_node, ) -from automata.core.coding.py.reader import PyReader +from automata.core.singletons.module_loader import py_module_loader +from automata.core.symbol.base import Symbol +from automata.core.symbol_embedding.base import SymbolDocEmbedding logger = logging.getLogger(__name__) diff --git a/automata/core/base/embedding.py b/automata/core/embedding/base.py similarity index 97% rename from automata/core/base/embedding.py rename to automata/core/embedding/base.py index 8c6e4299..bbf4f4d1 100644 --- a/automata/core/base/embedding.py +++ b/automata/core/embedding/base.py @@ -5,7 +5,7 @@ import numpy as np -from automata.core.base.symbol import Symbol +from automata.core.symbol.base import Symbol logger = logging.getLogger(__name__) diff --git a/automata/core/coding/__init__.py b/automata/core/experimental/__init__.py similarity index 100% rename from automata/core/coding/__init__.py rename to automata/core/experimental/__init__.py diff --git a/automata/core/context/py/__init__.py b/automata/core/experimental/search/__init__.py similarity index 100% rename from automata/core/context/py/__init__.py rename to automata/core/experimental/search/__init__.py diff --git a/automata/core/symbol/search/rank.py b/automata/core/experimental/search/rank.py similarity index 99% rename from automata/core/symbol/search/rank.py rename to automata/core/experimental/search/rank.py index 502bc0d4..7299139b 100644 --- a/automata/core/symbol/search/rank.py +++ b/automata/core/experimental/search/rank.py @@ -4,7 +4,7 @@ from networkx.exception import NetworkXError from pydantic import BaseModel -from automata.core.base.symbol import Symbol +from automata.core.symbol.base import Symbol class SymbolRankConfig(BaseModel): diff --git a/automata/core/symbol/search/symbol_search.py b/automata/core/experimental/search/symbol_search.py similarity index 96% rename from automata/core/symbol/search/symbol_search.py rename to automata/core/experimental/search/symbol_search.py index 43e1110b..ee04da8c 100644 --- a/automata/core/symbol/search/symbol_search.py +++ b/automata/core/experimental/search/symbol_search.py @@ -4,11 +4,11 @@ import networkx as nx import numpy as np -from automata.core.base.symbol import Symbol, SymbolReference -from automata.core.coding.py.module_loader import py_module_loader +from automata.core.experimental.search.rank import SymbolRank, SymbolRankConfig +from automata.core.singletons.module_loader import py_module_loader +from automata.core.symbol.base import Symbol, SymbolReference from automata.core.symbol.graph import SymbolGraph from automata.core.symbol.parser import parse_symbol -from automata.core.symbol.search.rank import SymbolRank, SymbolRankConfig from automata.core.symbol.symbol_utils import convert_to_fst_object from automata.core.symbol_embedding.similarity import SymbolSimilarityCalculator diff --git a/automata/core/base/github_manager.py b/automata/core/github_management/client.py similarity index 98% rename from automata/core/base/github_manager.py rename to automata/core/github_management/client.py index 53b56947..00087ce1 100644 --- a/automata/core/base/github_manager.py +++ b/automata/core/github_management/client.py @@ -5,7 +5,7 @@ from github import Github, Issue, PullRequest -class RepositoryManager(ABC): +class RepositoryClient(ABC): """An abstract class for managing repositories""" @abstractmethod @@ -43,7 +43,7 @@ def fetch_issue(self, issue_number: int) -> Any: pass -class GitHubManager: +class GitHubClient: """The GitHub manager provides an interface for interacting with GitHub repositories""" def __init__(self, access_token: str, remote_name: str, primary_branch: str = "main") -> None: diff --git a/automata/core/llm/foundation.py b/automata/core/llm/foundation.py index dc3bcf61..021d8002 100644 --- a/automata/core/llm/foundation.py +++ b/automata/core/llm/foundation.py @@ -4,7 +4,7 @@ from pydantic import BaseModel from automata.core.base.database.relational import SQLDatabase -from automata.core.base.observer import Observer +from automata.core.base.patterns.observer import Observer class LLMCompletionResult(BaseModel): diff --git a/automata/core/llm/providers/openai.py b/automata/core/llm/providers/openai.py index 4ef60513..9408a69b 100644 --- a/automata/core/llm/providers/openai.py +++ b/automata/core/llm/providers/openai.py @@ -7,14 +7,14 @@ import tiktoken from termcolor import colored -from automata.core.base.embedding import EmbeddingProvider -from automata.core.base.tool import Tool +from automata.core.embedding.base import EmbeddingProvider from automata.core.llm.foundation import ( LLMChatCompletionProvider, LLMChatMessage, LLMCompletionResult, LLMConversation, ) +from automata.core.tools.base import Tool from automata.core.utils import set_openai_api_key logger = logging.getLogger(__name__) diff --git a/automata/core/memory_store/symbol_code_embedding.py b/automata/core/memory_store/symbol_code_embedding.py index d37610c8..f3bbe0ed 100644 --- a/automata/core/memory_store/symbol_code_embedding.py +++ b/automata/core/memory_store/symbol_code_embedding.py @@ -1,7 +1,7 @@ import logging -from automata.core.base.symbol import Symbol -from automata.core.base.symbol_embedding import ( +from automata.core.symbol.base import Symbol +from automata.core.symbol_embedding.base import ( JSONSymbolEmbeddingVectorDatabase, SymbolCodeEmbedding, SymbolEmbeddingHandler, diff --git a/automata/core/memory_store/symbol_doc_embedding.py b/automata/core/memory_store/symbol_doc_embedding.py index e294ba41..85dc0331 100644 --- a/automata/core/memory_store/symbol_doc_embedding.py +++ b/automata/core/memory_store/symbol_doc_embedding.py @@ -1,7 +1,7 @@ import logging -from automata.core.base.symbol import Symbol -from automata.core.base.symbol_embedding import ( +from automata.core.symbol.base import Symbol +from automata.core.symbol_embedding.base import ( JSONSymbolEmbeddingVectorDatabase, SymbolDocEmbedding, SymbolEmbeddingHandler, diff --git a/automata/core/symbol/search/__init__.py b/automata/core/navigation/__init__.py similarity index 100% rename from automata/core/symbol/search/__init__.py rename to automata/core/navigation/__init__.py diff --git a/automata/core/coding/directory.py b/automata/core/navigation/directory.py similarity index 100% rename from automata/core/coding/directory.py rename to automata/core/navigation/directory.py diff --git a/automata/core/coding/py/navigation.py b/automata/core/navigation/py/navigation_utils.py similarity index 98% rename from automata/core/coding/py/navigation.py rename to automata/core/navigation/py/navigation_utils.py index f5e62d2d..eaf62c37 100644 --- a/automata/core/coding/py/navigation.py +++ b/automata/core/navigation/py/navigation_utils.py @@ -13,7 +13,7 @@ RedBaron, ) -from automata.core.coding.py.module_loader import DOT_SEP +from automata.core.singletons.module_loader import DOT_SEP logger = logging.getLogger(__name__) diff --git a/automata/core/retrievers/py/__init__.py b/automata/core/retrievers/py/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/automata/core/context/py/retriever.py b/automata/core/retrievers/py/context.py similarity index 98% rename from automata/core/context/py/retriever.py rename to automata/core/retrievers/py/context.py index 61bdb474..a7a5c4b2 100644 --- a/automata/core/context/py/retriever.py +++ b/automata/core/retrievers/py/context.py @@ -7,8 +7,8 @@ from redbaron import RedBaron from automata.core.base.database.vector import VectorDatabaseProvider -from automata.core.base.symbol import Symbol -from automata.core.coding.py.reader import PyReader +from automata.core.code_handling.py.reader import PyReader +from automata.core.symbol.base import Symbol from automata.core.symbol.graph import SymbolGraph from automata.core.symbol.symbol_utils import ( convert_to_fst_object, diff --git a/automata/core/agent/tool/tool_utils.py b/automata/core/singletons/dependency_factory.py similarity index 76% rename from automata/core/agent/tool/tool_utils.py rename to automata/core/singletons/dependency_factory.py index f3c63320..3413910f 100644 --- a/automata/core/agent/tool/tool_utils.py +++ b/automata/core/singletons/dependency_factory.py @@ -1,35 +1,32 @@ -import logging import os from functools import lru_cache -from typing import Any, Dict, List, Sequence, Set, Tuple +from typing import Any, Dict, List, Set, Tuple -from automata.config.base import ConfigCategory, LLMProvider +from automata.config.base import ConfigCategory +from automata.core.agent.agent import AgentToolkitNames from automata.core.agent.error import AgentGeneralError, UnknownToolError -from automata.core.base.agent import AgentToolkitNames -from automata.core.base.singleton import Singleton -from automata.core.base.symbol_embedding import JSONSymbolEmbeddingVectorDatabase -from automata.core.base.tool import Tool -from automata.core.coding.py.reader import PyReader -from automata.core.coding.py.writer import PyWriter -from automata.core.context.py.retriever import ( - PyContextRetriever, - PyContextRetrieverConfig, -) +from automata.core.base.patterns.singleton import Singleton +from automata.core.code_handling.py.reader import PyReader +from automata.core.code_handling.py.writer import PyWriter +from automata.core.experimental.search.rank import SymbolRank, SymbolRankConfig +from automata.core.experimental.search.symbol_search import SymbolSearch from automata.core.llm.providers.openai import ( OpenAIChatCompletionProvider, OpenAIEmbeddingProvider, ) from automata.core.memory_store.symbol_code_embedding import SymbolCodeEmbeddingHandler from automata.core.memory_store.symbol_doc_embedding import SymbolDocEmbeddingHandler +from automata.core.retrievers.py.context import ( + PyContextRetriever, + PyContextRetrieverConfig, +) from automata.core.symbol.graph import SymbolGraph -from automata.core.symbol.search.rank import SymbolRank, SymbolRankConfig -from automata.core.symbol.search.symbol_search import SymbolSearch +from automata.core.symbol_embedding.base import JSONSymbolEmbeddingVectorDatabase from automata.core.symbol_embedding.builders import SymbolDocEmbeddingBuilder from automata.core.symbol_embedding.similarity import SymbolSimilarityCalculator +from automata.core.tools.factory import AgentToolFactory, logger from automata.core.utils import get_config_fpath -logger = logging.getLogger(__name__) - class DependencyFactory(metaclass=Singleton): """Creates dependencies for input Tool construction.""" @@ -71,16 +68,12 @@ def get(self, dependency: str) -> Any: Gets a dependency by name. The dependency argument corresponds to the names of the creation methods of the DependencyFactory class without the 'create_' prefix. For example, to get a SymbolGraph instance you'd call `get('symbol_graph')`. - Args: dependency (str): The name of the dependency to be retrieved. - Returns: The instance of the requested dependency. - Raises: AgentGeneralError: If the dependency is not found. - """ if dependency in self.overrides: return self.overrides[dependency] @@ -236,50 +229,4 @@ def create_py_writer(self) -> PyWriter: return PyWriter(self.get("py_reader")) -class AgentToolFactory: - """The AgentToolFactory class is responsible for creating tools from a given agent tool name.""" - - TOOLKIT_TYPE_TO_ARGS: Dict[AgentToolkitNames, List[Tuple[str, Any]]] = { - AgentToolkitNames.PY_READER: [("py_reader", PyReader)], - AgentToolkitNames.PY_WRITER: [("py_writer", PyWriter)], - AgentToolkitNames.SYMBOL_SEARCH: [("symbol_search", SymbolSearch)], - AgentToolkitNames.CONTEXT_ORACLE: [ - ("symbol_doc_similarity", SymbolSimilarityCalculator), - ("symbol_code_similarity", SymbolSimilarityCalculator), - ], - } - - @staticmethod - def create_tools_from_builder(agent_tool: AgentToolkitNames, **kwargs) -> Sequence[Tool]: - """Uses the Builder Registry to create tools from a given agent tool name.""" - from automata.core.agent.tool.registry import ( # import here for easy mocking - AutomataOpenAIAgentToolkitRegistry, - ) - - for builder in AutomataOpenAIAgentToolkitRegistry.get_all_builders(): - if builder.can_handle(agent_tool): - if builder.PLATFORM == LLMProvider.OPENAI: - return builder(**kwargs).build_for_open_ai() - else: - return builder(**kwargs).build() - - raise UnknownToolError(agent_tool.value) - - @staticmethod - def build_tools(toolkit_list: List[str], **kwargs) -> List[Tool]: - """Given a list of tools this method builds the tools and returns them.""" - tools: List[Tool] = [] - - for tool_name in toolkit_list: - tool_name = tool_name.strip() - agent_tool_manager = AgentToolkitNames(tool_name) - - if agent_tool_manager is None: - raise UnknownToolError(agent_tool_manager) - - tools.extend(AgentToolFactory.create_tools_from_builder(agent_tool_manager, **kwargs)) - - return tools - - dependency_factory = DependencyFactory() diff --git a/automata/core/coding/py/module_loader.py b/automata/core/singletons/module_loader.py similarity index 99% rename from automata/core/coding/py/module_loader.py rename to automata/core/singletons/module_loader.py index bfe42675..09e39992 100644 --- a/automata/core/coding/py/module_loader.py +++ b/automata/core/singletons/module_loader.py @@ -4,7 +4,7 @@ from redbaron import RedBaron -from automata.core.base.singleton import Singleton +from automata.core.base.patterns.singleton import Singleton from automata.core.utils import get_root_fpath, get_root_py_fpath logger = logging.getLogger(__name__) diff --git a/automata/core/base/symbol.py b/automata/core/symbol/base.py similarity index 97% rename from automata/core/base/symbol.py rename to automata/core/symbol/base.py index 684c3a66..0d558156 100644 --- a/automata/core/base/symbol.py +++ b/automata/core/symbol/base.py @@ -3,7 +3,7 @@ from enum import Enum from typing import Any, Dict, Optional, Tuple -from automata.core.base.scip_pb2 import Descriptor as DescriptorProto # type: ignore +from automata.core.symbol.scip_pb2 import Descriptor as DescriptorProto # type: ignore class SymbolDescriptor: @@ -146,14 +146,14 @@ class Symbol: ::= any UTF-8 character, escape backticks with double backtick. Examples - - from automata.core.symbol.search.symbol_parser import parse_symbol + from automata.core.experimental.search.symbol_parser import parse_symbol symbol_class = parse_symbol( "scip-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `automata.core.agent.agent_enums`/ActionIndicator#" ) symbol_method = parse_symbol( - "scip-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `automata.core.base.tool`/ToolNotFoundError#__init__()." + "scip-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `automata.core.tools.base`/ToolNotFoundError#__init__()." ) """ diff --git a/automata/core/symbol/graph.py b/automata/core/symbol/graph.py index d828d7a5..d6acaea0 100644 --- a/automata/core/symbol/graph.py +++ b/automata/core/symbol/graph.py @@ -10,15 +10,15 @@ from tqdm import tqdm from automata.config import MAX_WORKERS -from automata.core.base.scip_pb2 import Index, SymbolRole # type: ignore -from automata.core.base.symbol import ( +from automata.core.singletons.module_loader import py_module_loader +from automata.core.symbol.base import ( Symbol, SymbolDescriptor, SymbolFile, SymbolReference, ) -from automata.core.coding.py.module_loader import py_module_loader from automata.core.symbol.parser import parse_symbol +from automata.core.symbol.scip_pb2 import Index, SymbolRole # type: ignore from automata.core.symbol.symbol_utils import ( convert_to_fst_object, get_rankable_symbols, diff --git a/automata/core/symbol/parser.py b/automata/core/symbol/parser.py index 9ec3d835..0329d0d1 100644 --- a/automata/core/symbol/parser.py +++ b/automata/core/symbol/parser.py @@ -1,7 +1,7 @@ import re from typing import List, Optional -from automata.core.base.symbol import Symbol, SymbolDescriptor, SymbolPackage +from automata.core.symbol.base import Symbol, SymbolDescriptor, SymbolPackage class _SymbolParser: diff --git a/automata/core/base/scip_pb2.py b/automata/core/symbol/scip_pb2.py similarity index 100% rename from automata/core/base/scip_pb2.py rename to automata/core/symbol/scip_pb2.py diff --git a/automata/core/symbol/symbol_utils.py b/automata/core/symbol/symbol_utils.py index 99656982..6de0aa32 100644 --- a/automata/core/symbol/symbol_utils.py +++ b/automata/core/symbol/symbol_utils.py @@ -2,8 +2,8 @@ from redbaron import RedBaron -from automata.core.base.symbol import Symbol, SymbolDescriptor -from automata.core.coding.py.module_loader import py_module_loader +from automata.core.singletons.module_loader import py_module_loader +from automata.core.symbol.base import Symbol, SymbolDescriptor def convert_to_fst_object(symbol: Symbol) -> RedBaron: diff --git a/automata/core/base/symbol_embedding.py b/automata/core/symbol_embedding/base.py similarity index 97% rename from automata/core/base/symbol_embedding.py rename to automata/core/symbol_embedding/base.py index 7d348d7c..08e2c91d 100644 --- a/automata/core/base/symbol_embedding.py +++ b/automata/core/symbol_embedding/base.py @@ -4,8 +4,8 @@ import numpy as np from automata.core.base.database.vector import JSONVectorDatabase -from automata.core.base.embedding import EmbeddingProvider -from automata.core.base.symbol import Symbol +from automata.core.embedding.base import EmbeddingProvider +from automata.core.symbol.base import Symbol class SymbolEmbedding(abc.ABC): diff --git a/automata/core/symbol_embedding/builders.py b/automata/core/symbol_embedding/builders.py index 0b43da7e..2a51c164 100644 --- a/automata/core/symbol_embedding/builders.py +++ b/automata/core/symbol_embedding/builders.py @@ -3,16 +3,16 @@ from jinja2 import Template from automata.config.prompt.doc_generation import DEFAULT_DOC_GENERATION_PROMPT -from automata.core.base.embedding import EmbeddingProvider -from automata.core.base.symbol import Symbol -from automata.core.base.symbol_embedding import ( +from automata.core.embedding.base import EmbeddingProvider +from automata.core.experimental.search.symbol_search import SymbolSearch +from automata.core.llm.foundation import LLMChatCompletionProvider +from automata.core.retrievers.py.context import PyContextRetriever +from automata.core.symbol.base import Symbol +from automata.core.symbol_embedding.base import ( SymbolCodeEmbedding, SymbolDocEmbedding, SymbolEmbeddingBuilder, ) -from automata.core.context.py.retriever import PyContextRetriever -from automata.core.llm.foundation import LLMChatCompletionProvider -from automata.core.symbol.search.symbol_search import SymbolSearch class SymbolCodeEmbeddingBuilder(SymbolEmbeddingBuilder): @@ -61,7 +61,7 @@ def build(self, source_code: str, symbol: Symbol) -> SymbolDocEmbedding: - ``automata.core.agent.instances.OpenAIAutomataAgentInstance.Config`` - ``automata.tests.unit.test_automata_agent_builder.test_builder_default_config`` - ``automata.tests.unit.test_task_environment.TestURL`` - - ``automata.core.base.agent.AgentInstance.Config`` + - ``automata.core.agent.agent.AgentInstance.Config`` Example ------- The following example demonstrates how to create a custom agent diff --git a/automata/core/symbol_embedding/similarity.py b/automata/core/symbol_embedding/similarity.py index 50455752..e2bc969e 100644 --- a/automata/core/symbol_embedding/similarity.py +++ b/automata/core/symbol_embedding/similarity.py @@ -3,13 +3,13 @@ import numpy as np -from automata.core.base.embedding import ( +from automata.core.embedding.base import ( EmbeddingNormType, EmbeddingProvider, EmbeddingSimilarityCalculator, ) -from automata.core.base.symbol import Symbol -from automata.core.base.symbol_embedding import SymbolEmbeddingHandler +from automata.core.symbol.base import Symbol +from automata.core.symbol_embedding.base import SymbolEmbeddingHandler logger = logging.getLogger(__name__) diff --git a/automata/core/tools/__init__.py b/automata/core/tools/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/automata/core/base/tool.py b/automata/core/tools/base.py similarity index 100% rename from automata/core/base/tool.py rename to automata/core/tools/base.py diff --git a/automata/core/agent/tool/builder/context_oracle.py b/automata/core/tools/builders/context_oracle.py similarity index 95% rename from automata/core/agent/tool/builder/context_oracle.py rename to automata/core/tools/builders/context_oracle.py index 7c4e750e..7d9d7e1c 100644 --- a/automata/core/agent/tool/builder/context_oracle.py +++ b/automata/core/tools/builders/context_oracle.py @@ -3,12 +3,12 @@ from typing import List from automata.config.base import LLMProvider +from automata.core.agent.agent import AgentToolkit, AgentToolkitNames from automata.core.agent.providers import OpenAIAgentToolkit -from automata.core.agent.tool.registry import AutomataOpenAIAgentToolkitRegistry -from automata.core.base.agent import AgentToolkit, AgentToolkitNames -from automata.core.base.tool import Tool from automata.core.llm.providers.openai import OpenAITool from automata.core.symbol_embedding.similarity import SymbolSimilarityCalculator +from automata.core.tools.base import Tool +from automata.core.tools.registries import OpenAIAutomataAgentToolkitRegistry logger = logging.getLogger(__name__) @@ -104,7 +104,7 @@ def _get_context(self, query: str, max_related_symbols=1) -> str: return result -@AutomataOpenAIAgentToolkitRegistry.register_tool_manager +@OpenAIAutomataAgentToolkitRegistry.register_tool_manager class ContextOracleOpenAIToolkit(ContextOracleToolkit, OpenAIAgentToolkit): TOOL_TYPE = AgentToolkitNames.CONTEXT_ORACLE PLATFORM = LLMProvider.OPENAI diff --git a/automata/core/agent/tool/builder/py_reader.py b/automata/core/tools/builders/py_reader.py similarity index 92% rename from automata/core/agent/tool/builder/py_reader.py rename to automata/core/tools/builders/py_reader.py index 04a9e18f..f161bf2e 100644 --- a/automata/core/agent/tool/builder/py_reader.py +++ b/automata/core/tools/builders/py_reader.py @@ -2,13 +2,13 @@ from typing import List, Optional from automata.config.base import LLMProvider +from automata.core.agent.agent import AgentToolkit, AgentToolkitNames from automata.core.agent.providers import OpenAIAgentToolkit -from automata.core.agent.tool.registry import AutomataOpenAIAgentToolkitRegistry -from automata.core.base.agent import AgentToolkit, AgentToolkitNames -from automata.core.base.tool import Tool -from automata.core.coding.py.module_loader import NO_RESULT_FOUND_STR -from automata.core.coding.py.reader import PyReader +from automata.core.code_handling.py.reader import PyReader from automata.core.llm.providers.openai import OpenAITool +from automata.core.singletons.module_loader import NO_RESULT_FOUND_STR +from automata.core.tools.base import Tool +from automata.core.tools.registries import OpenAIAutomataAgentToolkitRegistry logger = logging.getLogger(__name__) @@ -92,7 +92,7 @@ def _run_indexer_retrieve_raw_code( return f"Failed to retrieve raw code with error - {str(e)}" -@AutomataOpenAIAgentToolkitRegistry.register_tool_manager +@OpenAIAutomataAgentToolkitRegistry.register_tool_manager class PyReaderOpenAIToolkit(PyReaderToolkit, OpenAIAgentToolkit): TOOL_TYPE = AgentToolkitNames.PY_READER PLATFORM = LLMProvider.OPENAI diff --git a/automata/core/agent/tool/builder/py_writer.py b/automata/core/tools/builders/py_writer.py similarity index 93% rename from automata/core/agent/tool/builder/py_writer.py rename to automata/core/tools/builders/py_writer.py index 2a578f44..e53a16cc 100644 --- a/automata/core/agent/tool/builder/py_writer.py +++ b/automata/core/tools/builders/py_writer.py @@ -2,12 +2,12 @@ from typing import List, Optional from automata.config.base import LLMProvider +from automata.core.agent.agent import AgentToolkit, AgentToolkitNames from automata.core.agent.providers import OpenAIAgentToolkit -from automata.core.agent.tool.registry import AutomataOpenAIAgentToolkitRegistry -from automata.core.base.agent import AgentToolkit, AgentToolkitNames -from automata.core.base.tool import Tool -from automata.core.coding.py.writer import PyWriter +from automata.core.code_handling.py.writer import PyWriter from automata.core.llm.providers.openai import OpenAITool +from automata.core.tools.base import Tool +from automata.core.tools.registries import OpenAIAutomataAgentToolkitRegistry logger = logging.getLogger(__name__) @@ -74,7 +74,7 @@ def _create_new_module(self, module_dotpath: str, code: str) -> str: return f"Failed to create the module with error - {str(e)}" -@AutomataOpenAIAgentToolkitRegistry.register_tool_manager +@OpenAIAutomataAgentToolkitRegistry.register_tool_manager class PyWriterOpenAIToolkit(PyWriterToolkit, OpenAIAgentToolkit): TOOL_TYPE = AgentToolkitNames.PY_WRITER PLATFORM = LLMProvider.OPENAI diff --git a/automata/core/agent/tool/builder/symbol_search.py b/automata/core/tools/builders/symbol_search.py similarity index 93% rename from automata/core/agent/tool/builder/symbol_search.py rename to automata/core/tools/builders/symbol_search.py index cef5ddb8..12f864bb 100644 --- a/automata/core/agent/tool/builder/symbol_search.py +++ b/automata/core/tools/builders/symbol_search.py @@ -2,19 +2,19 @@ from typing import List, Optional, Union from automata.config.base import LLMProvider +from automata.core.agent.agent import AgentToolkit, AgentToolkitNames from automata.core.agent.error import UnknownToolError from automata.core.agent.providers import OpenAIAgentToolkit -from automata.core.agent.tool.registry import AutomataOpenAIAgentToolkitRegistry -from automata.core.base.agent import AgentToolkit, AgentToolkitNames -from automata.core.base.tool import Tool -from automata.core.llm.providers.openai import OpenAITool -from automata.core.symbol.search.symbol_search import ( +from automata.core.experimental.search.symbol_search import ( ExactSearchResult, SourceCodeResult, SymbolRankResult, SymbolReferencesResult, SymbolSearch, ) +from automata.core.llm.providers.openai import OpenAITool +from automata.core.tools.base import Tool +from automata.core.tools.registries import OpenAIAutomataAgentToolkitRegistry class SearchTool(Enum): @@ -95,7 +95,7 @@ def _exact_search_processor(self, query: str) -> str: ) -@AutomataOpenAIAgentToolkitRegistry.register_tool_manager +@OpenAIAutomataAgentToolkitRegistry.register_tool_manager class SymbolSearchOpenAIToolkit(SymbolSearchToolkit, OpenAIAgentToolkit): TOOL_TYPE = AgentToolkitNames.SYMBOL_SEARCH PLATFORM = LLMProvider.OPENAI diff --git a/automata/core/tools/factory.py b/automata/core/tools/factory.py new file mode 100644 index 00000000..a67f1e94 --- /dev/null +++ b/automata/core/tools/factory.py @@ -0,0 +1,59 @@ +import logging +from typing import Any, Dict, List, Sequence, Tuple + +from automata.config.base import LLMProvider +from automata.core.agent.agent import AgentToolkitNames +from automata.core.agent.error import UnknownToolError +from automata.core.code_handling.py.reader import PyReader +from automata.core.code_handling.py.writer import PyWriter +from automata.core.experimental.search.symbol_search import SymbolSearch +from automata.core.symbol_embedding.similarity import SymbolSimilarityCalculator +from automata.core.tools.base import Tool + +logger = logging.getLogger(__name__) + + +class AgentToolFactory: + """The AgentToolFactory class is responsible for creating tools from a given agent tool name.""" + + TOOLKIT_TYPE_TO_ARGS: Dict[AgentToolkitNames, List[Tuple[str, Any]]] = { + AgentToolkitNames.PY_READER: [("py_reader", PyReader)], + AgentToolkitNames.PY_WRITER: [("py_writer", PyWriter)], + AgentToolkitNames.SYMBOL_SEARCH: [("symbol_search", SymbolSearch)], + AgentToolkitNames.CONTEXT_ORACLE: [ + ("symbol_doc_similarity", SymbolSimilarityCalculator), + ("symbol_code_similarity", SymbolSimilarityCalculator), + ], + } + + @staticmethod + def create_tools_from_builder(agent_tool: AgentToolkitNames, **kwargs) -> Sequence[Tool]: + """Uses the Builder Registry to create tools from a given agent tool name.""" + from automata.core.tools.registries import ( # import here for easy mocking + OpenAIAutomataAgentToolkitRegistry, + ) + + for builder in OpenAIAutomataAgentToolkitRegistry.get_all_builders(): + if builder.can_handle(agent_tool): + if builder.PLATFORM == LLMProvider.OPENAI: + return builder(**kwargs).build_for_open_ai() + else: + return builder(**kwargs).build() + + raise UnknownToolError(agent_tool.value) + + @staticmethod + def build_tools(toolkit_list: List[str], **kwargs) -> List[Tool]: + """Given a list of tools this method builds the tools and returns them.""" + tools: List[Tool] = [] + + for tool_name in toolkit_list: + tool_name = tool_name.strip() + agent_tool_manager = AgentToolkitNames(tool_name) + + if agent_tool_manager is None: + raise UnknownToolError(agent_tool_manager) + + tools.extend(AgentToolFactory.create_tools_from_builder(agent_tool_manager, **kwargs)) + + return tools diff --git a/automata/core/agent/tool/registry.py b/automata/core/tools/registries.py similarity index 66% rename from automata/core/agent/tool/registry.py rename to automata/core/tools/registries.py index b121b671..837bdb9e 100644 --- a/automata/core/agent/tool/registry.py +++ b/automata/core/tools/registries.py @@ -4,13 +4,13 @@ from automata.core.agent.providers import OpenAIAgentToolkit -class AutomataOpenAIAgentToolkitRegistry: +class OpenAIAutomataAgentToolkitRegistry: _all_builders: Set[Type[OpenAIAgentToolkit]] = set([]) _is_initialized: bool = False @staticmethod def register_tool_manager(cls: Type[OpenAIAgentToolkit]): - AutomataOpenAIAgentToolkitRegistry._all_builders.add(cls) + OpenAIAutomataAgentToolkitRegistry._all_builders.add(cls) return cls @staticmethod @@ -20,9 +20,9 @@ def get_all_builders() -> List[Type[OpenAIAgentToolkit]]: Initializes the builder registry if it has not been initialized yet. """ # Ensure that the registry is initialized - if not AutomataOpenAIAgentToolkitRegistry._is_initialized: - AutomataOpenAIAgentToolkitRegistry.initialize() - return list(AutomataOpenAIAgentToolkitRegistry._all_builders) + if not OpenAIAutomataAgentToolkitRegistry._is_initialized: + OpenAIAutomataAgentToolkitRegistry.initialize() + return list(OpenAIAutomataAgentToolkitRegistry._all_builders) @staticmethod def initialize(): @@ -31,13 +31,13 @@ def initialize(): This triggers the registration of the builders through the register_tool_manager decorator. """ # Check if the registry has already been initialized - if AutomataOpenAIAgentToolkitRegistry._is_initialized: + if OpenAIAutomataAgentToolkitRegistry._is_initialized: return # Import all builder modules to ensure the classes get registered - import automata.core.agent.tool.builder as builder_package + import automata.core.tools.builders as builder_package for _, module_name, _ in pkgutil.iter_modules(builder_package.__path__): - __import__(f"automata.core.agent.tool.builder.{module_name}", fromlist=[""]) + __import__(f"automata.core.tools.builders.{module_name}", fromlist=[""]) # Mark the registry as initialized - AutomataOpenAIAgentToolkitRegistry._is_initialized = True + OpenAIAutomataAgentToolkitRegistry._is_initialized = True diff --git a/automata/docs/config/agent_config_builder.rst b/automata/docs/config/agent_config_builder.rst index c2746cff..874006f3 100644 --- a/automata/docs/config/agent_config_builder.rst +++ b/automata/docs/config/agent_config_builder.rst @@ -40,7 +40,7 @@ The following example demonstrates how to create an instance of .. code:: python from automata.config.openai_agent import AutomataOpenAIAgentConfigBuilder - from automata.tools.registry import Tool + from automata.tools.registries import Tool builder = AutomataOpenAIAgentConfigBuilder() builder = builder.with_model("gpt-3.5-turbo") diff --git a/automata/docs/config/automata_open_ai_agent_config.rst b/automata/docs/config/automata_open_ai_agent_config.rst index ef9075e3..6224e8d3 100644 --- a/automata/docs/config/automata_open_ai_agent_config.rst +++ b/automata/docs/config/automata_open_ai_agent_config.rst @@ -27,7 +27,7 @@ Related Symbols - ``automata.tests.unit.test_automata_agent_builder.test_builder_creates_proper_instance`` - ``automata.tests.unit.test_automata_agent_builder.test_automata_agent_init`` - ``automata.tests.unit.test_automata_agent_builder.test_config_loading_different_versions`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.tool.Tool`` - ``automata.config.config_types.InstructionConfigVersion`` Example diff --git a/automata/docs/config/config_category.rst b/automata/docs/config/config_category.rst index 8c2baafb..5ebfb538 100644 --- a/automata/docs/config/config_category.rst +++ b/automata/docs/config/config_category.rst @@ -20,7 +20,7 @@ Related Symbols - ``automata.config.base.ConfigCategory`` - ``automata.config.base.AgentConfig.Config`` - ``automata.core.agent.instances.AutomataOpenAIAgentInstance.Config`` -- ``automata.core.base.agent.AgentInstance.Config`` +- ``automata.core.agent.agent.AgentInstance.Config`` Example 1 --------- diff --git a/automata/docs/core/agent/action_indicator.rst b/automata/docs/core/agent/action_indicator.rst index 8b3ffab7..f6741498 100644 --- a/automata/docs/core/agent/action_indicator.rst +++ b/automata/docs/core/agent/action_indicator.rst @@ -21,7 +21,7 @@ Related Symbols - ``automata.core.agent.action.AutomataActionExtractor`` - ``automata.core.agent.agent_enums.ActionIndicator`` - ``automata.core.agent.agent_enums.ToolField`` -- ``automata.core.base.tool.ToolkitType`` +- ``automata.core.tools.tool.ToolkitType`` - ``automata.tests.unit.sample_modules.sample.EmptyClass`` - ``automata.tests.unit.test_tool.TestTool`` diff --git a/automata/docs/core/agent/agent_stop_iteration.rst b/automata/docs/core/agent/agent_stop_iteration.rst index 6b6b2970..ddc42239 100644 --- a/automata/docs/core/agent/agent_stop_iteration.rst +++ b/automata/docs/core/agent/agent_stop_iteration.rst @@ -12,7 +12,7 @@ Related Symbols - ``automata.tests.unit.test_automata_agent.test_run_with_no_completion`` - ``automata.tests.unit.test_automata_agent.test_iter_step_without_api_call`` - ``automata.core.agent.error.AgentMaxIterError`` -- ``automata.core.base.agent.Agent.__iter__`` +- ``automata.core.agent.agent.Agent.__iter__`` - ``automata.core.agent.providers.OpenAIAutomataAgent.__iter__`` - ``automata.core.agent.providers.OpenAIAutomataAgent.run`` diff --git a/automata/docs/core/agent/agent_task_git_error.rst b/automata/docs/core/agent/agent_task_git_error.rst index 117477be..327f4810 100644 --- a/automata/docs/core/agent/agent_task_git_error.rst +++ b/automata/docs/core/agent/agent_task_git_error.rst @@ -9,10 +9,10 @@ and pushing changes, and creating a pull request. Related Symbols --------------- -- ``automata.core.base.github_manager.GitHubManager`` -- ``automata.core.base.github_manager.RepositoryManager`` -- ``automata.core.agent.task.environment.AutomataTaskEnvironment`` -- ``automata.tests.conftest.MockRepositoryManager`` +- ``automata.core.base.github_management.client.GitHubClient`` +- ``automata.core.base.github_management.client.RepositoryClient`` +- ``automata.core.tasks.environment.AutomataTaskEnvironment`` +- ``automata.tests.conftest.MockRepositoryClient`` Example ------- @@ -24,12 +24,12 @@ repository using the ``AutomataTaskEnvironment``. .. code:: python from automata.core.agent.error import AgentTaskGitError - from automata.core.agent.task.environment import AutomataTaskEnvironment - from automata.core.base.github_manager import GitHubManager + from automata.core.tasks.environment import AutomataTaskEnvironment + from automata.core.base.github_management.client import GitHubClient access_token = "your_github_access_token" remote_name = "your_repo_remote_name" - github_manager = GitHubManager(access_token, remote_name) + github_manager = GitHubClient(access_token, remote_name) environment = AutomataTaskEnvironment(github_manager) try: diff --git a/automata/docs/core/agent/agent_task_instructions.rst b/automata/docs/core/agent/agent_task_instructions.rst index 87748fe0..965b8fa2 100644 --- a/automata/docs/core/agent/agent_task_instructions.rst +++ b/automata/docs/core/agent/agent_task_instructions.rst @@ -9,16 +9,16 @@ empty, and if they are empty, the relevant code raises this exception. Related Symbols --------------- -- ``automata.core.agent.task.task.AutomataTask`` +- ``automata.core.tasks.tasks.AutomataTask`` - ``automata.tests.unit.test_task_database.task`` -- ``automata.core.base.agent.Agent`` +- ``automata.core.agent.agent.Agent`` Usage Example ------------- .. code:: python - from automata.core.agent.task.task import AutomataTask + from automata.core.tasks.tasks import AutomataTask from automata.core.agent.error import AgentTaskInstructions try: diff --git a/automata/docs/core/agent/agent_task_state_error.rst b/automata/docs/core/agent/agent_task_state_error.rst index 39a60e84..0a540f6a 100644 --- a/automata/docs/core/agent/agent_task_state_error.rst +++ b/automata/docs/core/agent/agent_task_state_error.rst @@ -9,7 +9,7 @@ under valid and expected conditions. Related Symbols --------------- -- ``automata.core.base.task.TaskStatus`` +- ``automata.core.tasks.base.TaskStatus`` - ``automata.tests.unit.test_task.test_task_inital_state`` - ``automata.tests.unit.test_task.test_status_setter`` - ``automata.core.agent.error.AgentTaskGitError`` @@ -24,7 +24,7 @@ The following is an example demonstrating how to raise the .. code:: python - from automata.core.base.task import AutomataTask, TaskStatus + from automata.core.tasks.base import AutomataTask, TaskStatus from automata.core.agent.error import AgentTaskStateError # Define your task @@ -43,7 +43,7 @@ Limitations The primary limitation of ``AgentTaskStateError`` is that it assumes that a task’s state is based on the ``TaskStatus`` enumeration. It may not be compatible with other task states defined outside -``automata.core.base.task.TaskStatus``. +``automata.core.tasks.base.TaskStatus``. Follow-up Questions: -------------------- diff --git a/automata/docs/core/agent/automata_memory_database.rst b/automata/docs/core/agent/automata_memory_database.rst index 29441deb..1dba2afb 100644 --- a/automata/docs/core/agent/automata_memory_database.rst +++ b/automata/docs/core/agent/automata_memory_database.rst @@ -9,14 +9,14 @@ allowing users to get and put messages for a specific session. Related Symbols --------------- -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.core.agent.agent.AutomataAgent`` - ``config.config_types.AgentConfigName`` - ``automata.core.database.vector.JSONEmbeddingVectorDatabase`` - ``automata.config.config_types.AutomataAgentConfig`` -- ``automata.core.coding.py_coding.writer.PyCodeWriter`` -- ``automata.core.coding.py_coding.module_tree.LazyModuleTreeMap`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.code_handling.py_coding.writer.PyCodeWriter`` +- ``automata.core.code_handling.py_coding.module_tree.LazyModuleTreeMap`` +- ``automata.core.tools.tool.Tool`` - ``automata.core.symbol.graph.SymbolGraph`` - ``automata.core.agent.action.AutomataActionExtractor`` - ``automata.core.base.openai.OpenAIChatMessage`` diff --git a/automata/docs/core/agent/automata_open_ai_agent.rst b/automata/docs/core/agent/automata_open_ai_agent.rst index 280ab619..a2668edd 100644 --- a/automata/docs/core/agent/automata_open_ai_agent.rst +++ b/automata/docs/core/agent/automata_open_ai_agent.rst @@ -28,7 +28,7 @@ Related Symbols - ``automata.core.llm.providers.openai.OpenAIAgent`` - ``automata.config.config_types.AutomataAgentConfig`` - ``config.automata_agent_config_utils.AutomataAgentConfigBuilder`` -- ``automata.core.agent.task.executor.IAutomataTaskExecution._build_agent`` +- ``automata.core.tasks.executor.IAutomataTaskExecution._build_agent`` Example ------- diff --git a/automata/docs/core/agent/automata_open_ai_agent_instance.rst b/automata/docs/core/agent/automata_open_ai_agent_instance.rst index 89440d45..bc8f34e0 100644 --- a/automata/docs/core/agent/automata_open_ai_agent_instance.rst +++ b/automata/docs/core/agent/automata_open_ai_agent_instance.rst @@ -21,7 +21,7 @@ Related Symbols - ``automata.core.agent.instances.AutomataOpenAIAgentInstance`` - ``automata.config.agent_config_builder.AutomataAgentConfigFactory`` - ``automata.config.config_types.AgentConfigName`` -- ``automata.core.base.agent.AgentInstance`` +- ``automata.core.agent.agent.AgentInstance`` - ``automata.core.agent.providers.OpenAIAutomataAgent`` - ``automata.config.agent_config_builder`` diff --git a/automata/docs/core/agent/instances/config.rst b/automata/docs/core/agent/instances/config.rst index e36e6980..4b39fe54 100644 --- a/automata/docs/core/agent/instances/config.rst +++ b/automata/docs/core/agent/instances/config.rst @@ -24,7 +24,7 @@ Related Symbols - ``automata.tests.unit.test_automata_agent_builder.test_builder_creates_proper_instance`` - ``automata.core.agent.providers.OpenAIAutomataAgent`` - ``automata.tests.unit.test_automata_agent_builder.test_automata_agent_init`` -- ``automata.core.agent.tool.builder.context_oracle.ContextOracleOpenAIToolkit`` +- ``automata.core.tools.builders.context_oracle.ContextOracleOpenAIToolkit`` Example ------- diff --git a/automata/docs/core/agent/open_ai_automata_agent.rst b/automata/docs/core/agent/open_ai_automata_agent.rst index 280ab619..a2668edd 100644 --- a/automata/docs/core/agent/open_ai_automata_agent.rst +++ b/automata/docs/core/agent/open_ai_automata_agent.rst @@ -28,7 +28,7 @@ Related Symbols - ``automata.core.llm.providers.openai.OpenAIAgent`` - ``automata.config.config_types.AutomataAgentConfig`` - ``config.automata_agent_config_utils.AutomataAgentConfigBuilder`` -- ``automata.core.agent.task.executor.IAutomataTaskExecution._build_agent`` +- ``automata.core.tasks.executor.IAutomataTaskExecution._build_agent`` Example ------- diff --git a/automata/docs/core/agent/open_ai_automata_agent_instance.rst b/automata/docs/core/agent/open_ai_automata_agent_instance.rst index f312a517..f052da3e 100644 --- a/automata/docs/core/agent/open_ai_automata_agent_instance.rst +++ b/automata/docs/core/agent/open_ai_automata_agent_instance.rst @@ -20,11 +20,11 @@ Related Symbols - ``automata.tests.conftest.automata_agent`` - ``automata.config.openai_agent.AutomataOpenAIAgentConfigBuilder`` - ``automata.tests.conftest.task`` -- ``automata.core.agent.tool.builder.context_oracle.ContextOracleOpenAIToolkit`` +- ``automata.core.tools.builders.context_oracle.ContextOracleOpenAIToolkit`` - ``automata.tests.unit.test_automata_agent`` - ``automata.config.openai_agent.AutomataOpenAIAgentConfigBuilder.create_from_args`` - ``automata.core.agent.providers.OpenAIAutomataAgent.run`` -- ``automata.core.base.agent.AgentInstance`` +- ``automata.core.agent.agent.AgentInstance`` - ``automata.config.base.AgentConfigName`` Example Usage diff --git a/automata/docs/core/agent/task/automata_task.rst b/automata/docs/core/agent/task/automata_task.rst index c313e84b..ea92305c 100644 --- a/automata/docs/core/agent/task/automata_task.rst +++ b/automata/docs/core/agent/task/automata_task.rst @@ -22,7 +22,7 @@ accessed after the task execution. Related Symbols --------------- -- ``automata.core.base.task.Task`` +- ``automata.core.tasks.base.Task`` - ``automata.core.agent.error.AgentTaskInstructions`` - ``automata.core.utils.get_logging_config`` - ``automata.core.utils.get_root_fpath`` @@ -37,7 +37,7 @@ folder. .. code:: python - from automata.core.agent.task.task import AutomataTask + from automata.core.tasks.tasks import AutomataTask instructions = "Perform text analysis and store the results." task = AutomataTask(instructions=instructions) diff --git a/automata/docs/core/agent/task/automata_task_database.rst b/automata/docs/core/agent/task/automata_task_database.rst index 09f3d6d0..c9e0349c 100644 --- a/automata/docs/core/agent/task/automata_task_database.rst +++ b/automata/docs/core/agent/task/automata_task_database.rst @@ -1,7 +1,7 @@ -AutomataTaskDatabase +AutomataAgentTaskDatabase ==================== -``AutomataTaskDatabase`` is a database that provides a local store for +``AutomataAgentTaskDatabase`` is a database that provides a local store for all tasks. It contains methods for inserting, updating, and querying tasks within the database, interacting with the ``AutomataTask`` class objects to perform various operations related to tasks. The connection @@ -11,7 +11,7 @@ provides a SQL interface for these operations. Overview -------- -``AutomataTaskDatabase`` prioritizes tasks handling by offering methods +``AutomataAgentTaskDatabase`` prioritizes tasks handling by offering methods that allow users to check the existence of a task in the database, get tasks by specified queries, insert new tasks, and update existing tasks. The class utilizes ``jsonpickle`` for encoding and decoding tasks in @@ -20,26 +20,26 @@ JSON format. Related Symbols --------------- -- ``automata.core.agent.task.task.AutomataTask`` +- ``automata.core.tasks.tasks.AutomataTask`` - ``automata.core.base.database.relational.SQLDatabase`` - ``automata.tests.unit.test_task_database.db`` -- ``automata.core.agent.task.registry.AutomataTaskRegistry`` +- ``automata.core.tasks.agent_database.AutomataTaskRegistry`` Example ------- The following is an example demonstrating how to create an instance of -``AutomataTaskDatabase``, insert a task, and check if it exists in the +``AutomataAgentTaskDatabase``, insert a task, and check if it exists in the database. .. code:: python from automata.config import TASK_DB_PATH - from automata.core.agent.task.registry import AutomataTaskDatabase - from automata.core.agent.task.task import AutomataTask + from automata.core.tasks.agent_database import AutomataAgentTaskDatabase + from automata.core.tasks.tasks import AutomataTask - # Create an instance of AutomataTaskDatabase - task_db = AutomataTaskDatabase(db_path=TASK_DB_PATH) + # Create an instance of AutomataAgentTaskDatabase + task_db = AutomataAgentTaskDatabase(db_path=TASK_DB_PATH) # Create a task task = AutomataTask("task1", instructions="instruction1") @@ -54,7 +54,7 @@ database. Limitations ----------- -``AutomataTaskDatabase`` assumes a specific table structure in the +``AutomataAgentTaskDatabase`` assumes a specific table structure in the database and relies on JSON encoding/decoding for task storage. Custom configurations or alternative storage methods for tasks are not supported. diff --git a/automata/docs/core/agent/task/automata_task_environment.rst b/automata/docs/core/agent/task/automata_task_environment.rst index df397344..37b367a5 100644 --- a/automata/docs/core/agent/task/automata_task_environment.rst +++ b/automata/docs/core/agent/task/automata_task_environment.rst @@ -13,7 +13,7 @@ Overview ``AutomataTaskEnvironment`` provides methods to setup and interact with the task environment, which is based on a GitHub repository. It uses a -``GitHubManager`` instance to perform repository-related operations such +``GitHubClient`` instance to perform repository-related operations such as cloning, creating branches, and handling pull requests. The task environment is prepared with the necessary files and directories during the setup process, and task status is updated accordingly throughout the @@ -22,23 +22,23 @@ task lifecycle. Related Symbols --------------- -- ``automata.core.agent.task.task.AutomataTask`` +- ``automata.core.tasks.tasks.AutomataTask`` - ``automata.tests.conftest.environment`` -- ``automata.core.base.task.TaskEnvironment`` -- ``automata.core.base.github_manager.GitHubManager`` +- ``automata.core.tasks.base.TaskEnvironment`` +- ``automata.core.base.github_management.client.GitHubClient`` Example ------- The following example demonstrates how to create an instance of -``AutomataTaskEnvironment`` using a ``GitHubManager`` instance. +``AutomataTaskEnvironment`` using a ``GitHubClient`` instance. .. code:: python - from automata.core.base.github_manager import GitHubManager - from automata.core.agent.task.environment import AutomataTaskEnvironment + from automata.core.base.github_management.client import GitHubClient + from automata.core.tasks.environment import AutomataTaskEnvironment - github_manager = GitHubManager(access_token="your_access_token", remote_name="your_remote_repo") + github_manager = GitHubClient(access_token="your_access_token", remote_name="your_remote_repo") task_environment = AutomataTaskEnvironment(github_manager) Limitations diff --git a/automata/docs/core/agent/task/automata_task_executor.rst b/automata/docs/core/agent/task/automata_task_executor.rst index 1dbe600b..59a5d8f1 100644 --- a/automata/docs/core/agent/task/automata_task_executor.rst +++ b/automata/docs/core/agent/task/automata_task_executor.rst @@ -24,9 +24,9 @@ of failure, up to the maximum number of retries specified in the task. Related Symbols --------------- -- ``automata.core.agent.task.task.AutomataTask`` -- ``automata.core.base.task.ITaskExecution`` -- ``automata.core.agent.task.executor.IAutomataTaskExecution`` +- ``automata.core.tasks.tasks.AutomataTask`` +- ``automata.core.tasks.base.ITaskExecution`` +- ``automata.core.tasks.executor.IAutomataTaskExecution`` Example ------- @@ -36,8 +36,8 @@ The following is an example demonstrating how to create an instance of .. code:: python - from automata.core.agent.task.executor import AutomataTaskExecutor, ITaskExecution - from automata.core.agent.task.task import AutomataTask + from automata.core.tasks.executor import AutomataTaskExecutor, ITaskExecution + from automata.core.tasks.tasks import AutomataTask # Define custom execution behavior by implementing ITaskExecution class CustomExecuteBehavior(ITaskExecution): diff --git a/automata/docs/core/agent/task/automata_task_registry.rst b/automata/docs/core/agent/task/automata_task_registry.rst index 41e3efbb..5af0728c 100644 --- a/automata/docs/core/agent/task/automata_task_registry.rst +++ b/automata/docs/core/agent/task/automata_task_registry.rst @@ -3,9 +3,9 @@ AutomataTaskRegistry ``AutomataTaskRegistry`` is a class responsible for managing tasks in Automata by storing and retrieving tasks in a given task database -(``AutomataTaskDatabase``). It provides methods that allow clients to +(``AutomataAgentTaskDatabase``). It provides methods that allow clients to fetch tasks by ID, get all tasks, register new tasks, and update -existing tasks. AutomataTaskRegistry uses the AutomataTaskDatabase to +existing tasks. AutomataTaskRegistry uses the AutomataAgentTaskDatabase to perform CRUD operations on tasks, ensuring proper interactions with the underlying task storage. @@ -14,7 +14,7 @@ Overview ``AutomataTaskRegistry`` offers the following main methods: -- ``__init__(self, db: AutomataTaskDatabase) -> None``: Initializes the +- ``__init__(self, db: AutomataAgentTaskDatabase) -> None``: Initializes the registry and allows specifying a task database for managing tasks. - ``fetch_task_by_id(self, task_id: str) -> Optional[AutomataTask]``: Fetches a task from the database by its ID. @@ -28,12 +28,12 @@ Overview Related Symbols --------------- -- ``automata.core.agent.task.task.AutomataTask`` +- ``automata.core.tasks.tasks.AutomataTask`` - ``automata.config.TASK_DB_PATH`` - ``automata.core.agent.error.AgentTaskGeneralError`` - ``automata.core.agent.error.AgentTaskStateError`` - ``automata.core.base.database.relational.SQLDatabase`` -- ``automata.core.base.task.TaskStatus`` +- ``automata.core.tasks.base.TaskStatus`` Example ------- @@ -43,9 +43,9 @@ registering a new task and retrieving tasks. .. code:: python - from automata.core.agent.task.registry import AutomataTaskRegistry - from automata.core.agent.task.task import AutomataTask - from automata.core.base.task import TaskStatus + from automata.core.tasks.agent_database import AutomataTaskRegistry + from automata.core.tasks.tasks import AutomataTask + from automata.core.tasks.base import TaskStatus from automata.core.base.database.relational import SQLDatabase from automata.config import TASK_DB_PATH diff --git a/automata/docs/core/agent/task/i_automata_task_execution.rst b/automata/docs/core/agent/task/i_automata_task_execution.rst index 2ee7ecca..325f27ea 100644 --- a/automata/docs/core/agent/task/i_automata_task_execution.rst +++ b/automata/docs/core/agent/task/i_automata_task_execution.rst @@ -19,12 +19,12 @@ task accordingly. Related Symbols --------------- -- ``automata.core.base.task.Task`` +- ``automata.core.tasks.base.Task`` - ``automata.core.agent.providers.OpenAIAutomataAgent`` -- ``automata.core.agent.task.task.AutomataTask`` +- ``automata.core.tasks.tasks.AutomataTask`` - ``automata.core.agent.error.AgentTaskGeneralError`` -- ``automata.core.agent.task.executor.AutomataTaskExecutor`` -- ``automata.core.base.task.TaskStatus`` +- ``automata.core.tasks.executor.AutomataTaskExecutor`` +- ``automata.core.tasks.base.TaskStatus`` Example ------- @@ -35,9 +35,9 @@ to execute a task and handle retries. .. code:: python import time - from automata.core.agent.task.executor import IAutomataTaskExecution - from automata.core.agent.task.task import AutomataTask - from automata.core.base.task import TaskStatus + from automata.core.tasks.executor import IAutomataTaskExecution + from automata.core.tasks.tasks import AutomataTask + from automata.core.tasks.base import TaskStatus task = AutomataTask("test_task", instructions="Run test instructions") execution = IAutomataTaskExecution() diff --git a/automata/docs/core/agent/tool/agent_tool_factory.rst b/automata/docs/core/agent/tool/agent_tool_factory.rst index 1e727cc4..f7811e2f 100644 --- a/automata/docs/core/agent/tool/agent_tool_factory.rst +++ b/automata/docs/core/agent/tool/agent_tool_factory.rst @@ -13,12 +13,12 @@ tools for various agent types and their respective providers. Related Symbols --------------- -- ``automata.core.agent.tool.registry.AutomataOpenAIAgentToolkitRegistry`` -- ``automata.core.base.agent.AgentToolkitNames`` -- ``automata.core.base.tool.Tool`` -- ``automata.core.coding.py.reader.PyReader`` +- ``automata.core.tools.registries.OpenAIAutomataAgentToolkitRegistry`` +- ``automata.core.agent.agent.AgentToolkitNames`` +- ``automata.core.tools.tool.Tool`` +- ``automata.core.code_handling.py.reader.PyReader`` - ``automata.core.llm.providers.openai.OpenAIAgentToolkit`` -- ``automata.core.symbol.search.symbol_search.SymbolSearch`` +- ``automata.core.experimental.search.symbol_search.SymbolSearch`` - ``automata.core.agent.error.UnknownToolError`` Usage Example @@ -29,8 +29,8 @@ The following example demonstrates how to create tools using the .. code:: python - from automata.core.agent.tool.tool_utils import AgentToolFactory - from automata.core.base.agent import AgentToolkitNames + from automata.core.tools.tool_utils import AgentToolFactory + from automata.core.agent.agent import AgentToolkitNames # Choose any supported AgentToolkitNames instance agent_tool = AgentToolkitNames.CHAT_COMPLETION @@ -41,7 +41,7 @@ Overview -------- ``AgentToolFactory`` checks the tool builders available in -``AutomataOpenAIAgentToolkitRegistry`` and determines which builder +``OpenAIAutomataAgentToolkitRegistry`` and determines which builder can handle the given agent tool instance. It returns created tools depending on the platform the tool is built for. If the tool builder can’t handle the agent tool, it raises an ``UnknownToolError``. @@ -53,7 +53,7 @@ The current implementation of ``AgentToolFactory`` assumes all supported platforms are part of the ``LLMPlatforms`` enumeration. If new platforms are introduced in the future, it is necessary to update the implementation accordingly. Moreover, it depends on the -``AutomataOpenAIAgentToolkitRegistry``, and adding or updating +``OpenAIAutomataAgentToolkitRegistry``, and adding or updating builders should be done in this registry. Follow-up Questions: @@ -63,4 +63,4 @@ Follow-up Questions: platforms without making major changes? - How can we extend this design to include more default tool builders without registering them explicitly in the - ``AutomataOpenAIAgentToolkitRegistry``? + ``OpenAIAutomataAgentToolkitRegistry``? diff --git a/automata/docs/core/agent/tool/automata_open_ai_agent_tool_builder_registry.rst b/automata/docs/core/agent/tool/automata_open_ai_agent_tool_builder_registry.rst index 7827d7cb..b129bda8 100644 --- a/automata/docs/core/agent/tool/automata_open_ai_agent_tool_builder_registry.rst +++ b/automata/docs/core/agent/tool/automata_open_ai_agent_tool_builder_registry.rst @@ -1,11 +1,11 @@ -AutomataOpenAIAgentToolkitRegistry +OpenAIAutomataAgentToolkitRegistry ====================================== -``AutomataOpenAIAgentToolkitRegistry`` is a static registry class +``OpenAIAutomataAgentToolkitRegistry`` is a static registry class that holds a list of available ``OpenAIAgentToolkit`` classes. The main purpose of this class is to keep a registry of all available tool builders, which can be used for creating tools to interact with OpenAI -Automata Agents. The ``AutomataOpenAIAgentToolkitRegistry`` class +Automata Agents. The ``OpenAIAutomataAgentToolkitRegistry`` class provides static methods to get all registered builders, register new tool builders, and initialize the registry. @@ -15,24 +15,24 @@ Related Symbols - ``automata.tests.unit.sample_modules.sample2.PythonAgentToolkit`` - ``automata.tests.conftest.automata_agent`` - ``automata.tests.conftest.automata_agent_config_builder`` -- ``automata.core.agent.tool.builder.symbol_search.SymbolSearchOpenAIToolkit`` +- ``automata.core.tools.builders.symbol_search.SymbolSearchOpenAIToolkit`` - ``automata.tests.unit.test_automata_agent_builder.test_builder_accepts_all_fields`` - ``automata.tests.unit.test_automata_agent_builder.test_automata_agent_init`` -- ``automata.core.agent.tool.builder.context_oracle.ContextOracleOpenAIToolkit`` +- ``automata.core.tools.builders.context_oracle.ContextOracleOpenAIToolkit`` - ``automata.tests.unit.test_automata_agent_builder.test_builder_creates_proper_instance`` - ``automata.tests.unit.test_automata_agent.test_build_initial_messages`` -- ``automata.core.agent.tool.builder.py_reader.PyReaderOpenAIToolkit`` +- ``automata.core.tools.builders.py_reader.PyReaderOpenAIToolkit`` Example ------- The following is an example demonstrating how to use -``AutomataOpenAIAgentToolkitRegistry`` to register and get a custom +``OpenAIAutomataAgentToolkitRegistry`` to register and get a custom tool builder: .. code:: python - from automata.core.llm.providers.openai import OpenAIAgentToolkit, AutomataOpenAIAgentToolkitRegistry + from automata.core.llm.providers.openai import OpenAIAgentToolkit, OpenAIAutomataAgentToolkitRegistry class CustomOpenAIToolkit(OpenAIAgentToolkit): def build_for_open_ai(self) -> List[OpenAITool]: @@ -40,17 +40,17 @@ tool builder: pass # Register the new tool builder - AutomataOpenAIAgentToolkitRegistry.register_tool_manager(CustomOpenAIToolkit) + OpenAIAutomataAgentToolkitRegistry.register_tool_manager(CustomOpenAIToolkit) # Retrieve all available tool builders - all_builders = AutomataOpenAIAgentToolkitRegistry.get_all_builders() + all_builders = OpenAIAutomataAgentToolkitRegistry.get_all_builders() print(all_builders) # Should include CustomOpenAIToolkit Limitations ----------- -The primary limitation of ``AutomataOpenAIAgentToolkitRegistry`` is +The primary limitation of ``OpenAIAutomataAgentToolkitRegistry`` is that it relies on the static methods and the internal state of the ``_all_builders`` set to maintain the registry. This design could lead to potential issues in concurrent execution environments and make @@ -59,7 +59,7 @@ testing more complicated. Follow-up Questions: -------------------- -- How does ``AutomataOpenAIAgentToolkitRegistry`` ensure that all +- How does ``OpenAIAutomataAgentToolkitRegistry`` ensure that all available tool builders are registered properly? - Is it possible to use dependency injections or any other design patterns to manage ``OpenAIAgentToolkit`` classes more diff --git a/automata/docs/core/agent/tool/builder/context_oracle_open_ai_tool_builder.rst b/automata/docs/core/agent/tool/builder/context_oracle_open_ai_tool_builder.rst index 5f1a50c2..11d5cf9b 100644 --- a/automata/docs/core/agent/tool/builder/context_oracle_open_ai_tool_builder.rst +++ b/automata/docs/core/agent/tool/builder/context_oracle_open_ai_tool_builder.rst @@ -22,20 +22,20 @@ context. Related Symbols --------------- -- ``automata.core.base.agent.AgentToolkit`` +- ``automata.core.agent.agent.AgentToolkit`` - ``automata.core.symbol_embedding.similarity.SymbolSimilarity`` - ``automata.core.llm.providers.available.LLMPlatforms`` - ``automata.core.llm.providers.openai.OpenAIAgentToolkit`` -- ``automata.core.agent.tool.builder.context_oracle.ContextOracleTool`` -- ``automata.core.agent.tool.registry.AutomataOpenAIAgentToolkitRegistry`` +- ``automata.core.tools.builders.context_oracle.ContextOracleTool`` +- ``automata.core.tools.registries.OpenAIAutomataAgentToolkitRegistry`` Example ------- .. code:: python - from automata.core.agent.tool.builder.context_oracle import ContextOracleOpenAIToolkit - from automata.core.symbol.search.symbol_search import SymbolSearch + from automata.core.tools.builders.context_oracle import ContextOracleOpenAIToolkit + from automata.core.experimental.search.symbol_search import SymbolSearch from automata.core.symbol_embedding.similarity import SymbolSimilarity symbol_search = SymbolSearch() diff --git a/automata/docs/core/agent/tool/builder/context_oracle_tool.rst b/automata/docs/core/agent/tool/builder/context_oracle_tool.rst index 96840617..23315293 100644 --- a/automata/docs/core/agent/tool/builder/context_oracle_tool.rst +++ b/automata/docs/core/agent/tool/builder/context_oracle_tool.rst @@ -15,13 +15,13 @@ object and a ``SymbolSimilarity`` object. The ``build()`` method provides a list of tools associated with the context oracle. Key related symbols include: - -``automata.core.symbol.search.symbol_search.SymbolSearch`` - +``automata.core.experimental.search.symbol_search.SymbolSearch`` - ``automata.core.symbol_embedding.similarity.SymbolSimilarity`` - -``automata.core.base.tool.Tool`` - -``automata.core.agent.tool.builder.context_oracle.ContextOracleOpenAIToolkit`` -- ``automata.core.base.agent.AgentToolkit`` - -``automata.core.base.agent.AgentToolkitNames`` - -``automata.core.agent.tool_tool_utils.AgentToolFactory`` +``automata.core.tools.tool.Tool`` - +``automata.core.tools.builders.context_oracle.ContextOracleOpenAIToolkit`` +- ``automata.core.agent.agent.AgentToolkit`` - +``automata.core.agent.agent.AgentToolkitNames`` - +``automata.core.tools_tool_utils.AgentToolFactory`` Example ------- @@ -31,9 +31,9 @@ The following example demonstrates how to create an instance of .. code:: python - from automata.core.symbol.search.symbol_search import SymbolSearch + from automata.core.experimental.search.symbol_search import SymbolSearch from automata.core.symbol_embedding.similarity import SymbolSimilarity - from automata.core.agent.tool.builder.context_oracle import ContextOracleTool + from automata.core.tools.builders.context_oracle import ContextOracleTool symbol_search = SymbolSearch(...) # Set up the SymbolSearch object symbol_doc_similarity = SymbolSimilarity(...) # Set up the SymbolSimilarity object diff --git a/automata/docs/core/agent/tool/builder/context_oracle_tool_builder.rst b/automata/docs/core/agent/tool/builder/context_oracle_tool_builder.rst index acb593a7..18a026e4 100644 --- a/automata/docs/core/agent/tool/builder/context_oracle_tool_builder.rst +++ b/automata/docs/core/agent/tool/builder/context_oracle_tool_builder.rst @@ -28,12 +28,12 @@ Import Statements import textwrap from typing import List from automata.config.base import LLMProvider - from automata.core.agent.tool.registry import AutomataOpenAIAgentToolkitRegistry - from automata.core.base.agent import AgentToolkit, AgentToolkitNames - from automata.core.base.tool import Tool + from automata.core.tools.registries import OpenAIAutomataAgentToolkitRegistry + from automata.core.agent.agent import AgentToolkit, AgentToolkitNames + from automata.core.tools.tool import Tool from automata.core.symbol_embedding.similarity import SymbolSimilarityCalculator from automata.core.llm.providers.openai import OpenAIAgentToolkit, OpenAITool - from automata.core.symbol.search.symbol_search import SymbolSearch + from automata.core.experimental.search.symbol_search import SymbolSearch Related Symbols --------------- @@ -41,7 +41,7 @@ Related Symbols Here are the classes closely related to ``ContextOracleToolkit`` - ``automata.tests.unit.test_context_oracle_tool.test_init`` -- ``automata.core.agent.tool.builder.context_oracle.ContextOracleOpenAIToolkit`` +- ``automata.core.tools.builders.context_oracle.ContextOracleOpenAIToolkit`` - ``automata.tests.unit.test_context_oracle_tool.context_oracle_tool_builder`` - ``automata.tests.unit.test_context_oracle_tool.test_build`` @@ -53,8 +53,8 @@ Below is an example demonstrating how to create an instance of .. code:: python - from automata.core.agent.tool.builder.context_oracle import ContextOracleToolkit - from automata.core.symbol.search.symbol_search import SymbolSearch # Replace MagicMock in example + from automata.core.tools.builders.context_oracle import ContextOracleToolkit + from automata.core.experimental.search.symbol_search import SymbolSearch # Replace MagicMock in example from automata.core.symbol_embedding.similarity import SymbolSimilarityCalculator # Replace MagicMock in example symbol_search = SymbolSearch() # Mocked in example, replace with appropriate parameters diff --git a/automata/docs/core/agent/tool/builder/py_reader_open_ai_tool_builder.rst b/automata/docs/core/agent/tool/builder/py_reader_open_ai_tool_builder.rst index 94ac541a..92b52de4 100644 --- a/automata/docs/core/agent/tool/builder/py_reader_open_ai_tool_builder.rst +++ b/automata/docs/core/agent/tool/builder/py_reader_open_ai_tool_builder.rst @@ -19,11 +19,11 @@ additional metadata for use on the OpenAI platform. Related Symbols --------------- -- ``automata.core.agent.tool.builder.py_reader.PyReaderToolkit`` +- ``automata.core.tools.builders.py_reader.PyReaderToolkit`` - ``automata.tests.unit.test_py_reader_tool.python_retriever_tool_builder`` - ``automata.core.llm.providers.openai.OpenAIAgentToolkit`` -- ``automata.core.agent.tool.registry.AutomataOpenAIAgentToolkitRegistry`` -- ``automata.core.coding.py.reader.PyReader`` +- ``automata.core.tools.registries.OpenAIAutomataAgentToolkitRegistry`` +- ``automata.core.code_handling.py.reader.PyReader`` Example ------- @@ -34,8 +34,8 @@ tools. .. code:: python - from automata.core.coding.py.reader import PyReader - from automata.core.agent.tool.builder.py_reader import PyReaderOpenAIToolkit + from automata.core.code_handling.py.reader import PyReader + from automata.core.tools.builders.py_reader import PyReaderOpenAIToolkit py_reader = PyReader() tool_builder = PyReaderOpenAIToolkit(py_reader=py_reader) diff --git a/automata/docs/core/agent/tool/builder/py_reader_tool_builder.rst b/automata/docs/core/agent/tool/builder/py_reader_tool_builder.rst index 979463d2..61d2531d 100644 --- a/automata/docs/core/agent/tool/builder/py_reader_tool_builder.rst +++ b/automata/docs/core/agent/tool/builder/py_reader_tool_builder.rst @@ -23,9 +23,9 @@ Related Symbols - ``automata.tests.unit.test_py_reader_tool.python_retriever_tool_builder`` - ``automata.tests.unit.test_py_writer_tool.python_writer_tool_builder`` -- ``automata.core.base.agent.AgentToolkit`` -- ``automata.core.coding.py.reader.PyReader`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.agent.agent.AgentToolkit`` +- ``automata.core.code_handling.py.reader.PyReader`` +- ``automata.core.tools.tool.Tool`` Example ------- @@ -35,8 +35,8 @@ The following example demonstrates how to create an instance of .. code:: python - from automata.core.coding.py.reader import PyReader - from automata.core.agent.tool.builder.py_reader import PyReaderToolkit + from automata.core.code_handling.py.reader import PyReader + from automata.core.tools.builders.py_reader import PyReaderToolkit py_reader = PyReader() tool_builder = PyReaderToolkit(py_reader=py_reader) diff --git a/automata/docs/core/agent/tool/builder/py_writer_open_ai_tool_builder.rst b/automata/docs/core/agent/tool/builder/py_writer_open_ai_tool_builder.rst index 52667c2a..e5909235 100644 --- a/automata/docs/core/agent/tool/builder/py_writer_open_ai_tool_builder.rst +++ b/automata/docs/core/agent/tool/builder/py_writer_open_ai_tool_builder.rst @@ -19,8 +19,8 @@ to write or modify the code in the specified module, class, or function. Related Symbols --------------- -- ``automata.core.coding.py.writer.PyWriter`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterToolkit`` +- ``automata.core.code_handling.py.writer.PyWriter`` +- ``automata.core.tools.builders.py_writer.PyWriterToolkit`` - ``automata.core.llm.providers.openai.OpenAIAgentToolkit`` - ``automata.core.llm.providers.openai.OpenAITool`` @@ -29,16 +29,16 @@ Usage Example .. code:: python - from automata.core.coding.py.reader import PyReader - from automata.core.coding.py.writer import PyWriter - from automata.core.agent.tool.builder.py_writer import PyWriterToolkit + from automata.core.code_handling.py.reader import PyReader + from automata.core.code_handling.py.writer import PyWriter + from automata.core.tools.builders.py_writer import PyWriterToolkit from automata.core.llm.providers.openai import OpenAITool py_reader = PyReader() py_writer = PyWriter(py_reader) py_writer_tool_builder = PyWriterToolkit(py_writer) - # We assume that PyWriterToolkit is registered in the AutomataOpenAIAgentToolkitRegistry + # We assume that PyWriterToolkit is registered in the OpenAIAutomataAgentToolkitRegistry open_ai_tools = py_writer_tool_builder.build_for_open_ai() for tool in open_ai_tools: diff --git a/automata/docs/core/agent/tool/builder/py_writer_tool_builder.rst b/automata/docs/core/agent/tool/builder/py_writer_tool_builder.rst index c33a9e00..f7d19290 100644 --- a/automata/docs/core/agent/tool/builder/py_writer_tool_builder.rst +++ b/automata/docs/core/agent/tool/builder/py_writer_tool_builder.rst @@ -24,24 +24,24 @@ Import Statements import logging from typing import List, Optional - from automata.core.agent.tool.registry import AutomataOpenAIAgentToolkitRegistry - from automata.core.base.agent import AgentToolkit, AgentToolkitNames - from automata.core.base.tool import Tool - from automata.core.coding.py.writer import PyWriter + from automata.core.tools.registries import OpenAIAutomataAgentToolkitRegistry + from automata.core.agent.agent import AgentToolkit, AgentToolkitNames + from automata.core.tools.tool import Tool + from automata.core.code_handling.py.writer import PyWriter from automata.core.llm.providers.available import LLMPlatforms from automata.core.llm.providers.openai import OpenAIAgentToolkit, OpenAITool Related Symbols --------------- -- ``automata.core.coding.py.writer.PyWriter`` -- ``automata.core.base.agent.AgentToolkit`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.code_handling.py.writer.PyWriter`` +- ``automata.core.agent.agent.AgentToolkit`` +- ``automata.core.tools.tool.Tool`` - ``automata.tests.unit.test_py_writer_tool.test_init`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterOpenAIToolkit`` +- ``automata.core.tools.builders.py_writer.PyWriterOpenAIToolkit`` - ``automata.tests.unit.test_py_writer_tool.python_writer_tool_builder`` - ``automata.tests.unit.test_py_reader_tool.python_retriever_tool_builder`` -- ``automata.core.agent.tool.builder.py_reader.PyReaderOpenAIToolkit`` +- ``automata.core.tools.builders.py_reader.PyReaderOpenAIToolkit`` - ``automata.tests.unit.test_py_writer_tool.test_build`` Example diff --git a/automata/docs/core/agent/tool/builder/search_tool.rst b/automata/docs/core/agent/tool/builder/search_tool.rst index d3fe62a8..6120578a 100644 --- a/automata/docs/core/agent/tool/builder/search_tool.rst +++ b/automata/docs/core/agent/tool/builder/search_tool.rst @@ -19,10 +19,10 @@ of built tools. Related Symbols --------------- -- ``automata.core.agent.tool.builder.symbol_search.SearchToolkit`` -- ``automata.core.agent.tool.builder.symbol_search.SymbolSearchToolkit`` -- ``automata.core.symbol.search.symbol_search.SymbolSearch`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.builders.symbol_search.SearchToolkit`` +- ``automata.core.tools.builders.symbol_search.SymbolSearchToolkit`` +- ``automata.core.experimental.search.symbol_search.SymbolSearch`` +- ``automata.core.tools.tool.Tool`` Example ------- @@ -32,8 +32,8 @@ The following is an example demonstrating how to create an instance of .. code:: python - from automata.core.symbol.search.symbol_search import SymbolSearch - from automata.core.agent.tool.builder.symbol_search import SearchTool, SymbolSearchToolkit + from automata.core.experimental.search.symbol_search import SymbolSearch + from automata.core.tools.builders.symbol_search import SearchTool, SymbolSearchToolkit symbol_search = SymbolSearch() search_tools = [SearchTool.EXACT_SEARCH] diff --git a/automata/docs/core/agent/tool/builder/symbol_search_open_ai_tool_builder.rst b/automata/docs/core/agent/tool/builder/symbol_search_open_ai_tool_builder.rst index 0d86c9f3..bd6af3de 100644 --- a/automata/docs/core/agent/tool/builder/symbol_search_open_ai_tool_builder.rst +++ b/automata/docs/core/agent/tool/builder/symbol_search_open_ai_tool_builder.rst @@ -20,10 +20,10 @@ platforms. Related Symbols --------------- -- ``automata.core.agent.tool.builder.context_oracle.ContextOracleOpenAIToolkit`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.builders.context_oracle.ContextOracleOpenAIToolkit`` +- ``automata.core.tools.tool.Tool`` - ``automata.core.llm.providers.openai.OpenAITool`` -- ``automata.core.agent.tool.builder.symbol_search.SymbolSearchToolkit`` +- ``automata.core.tools.builders.symbol_search.SymbolSearchToolkit`` - ``automata.core.llm.providers.openai.OpenAIAgentToolkit`` Example @@ -35,8 +35,8 @@ platforms. .. code:: python - from automata.core.symbol.search.symbol_search import SymbolSearch - from automata.core.agent.tool.builder.symbol_search import ( + from automata.core.experimental.search.symbol_search import SymbolSearch + from automata.core.tools.builders.symbol_search import ( SymbolSearchOpenAIToolkit, ) diff --git a/automata/docs/core/agent/tool/builder/symbol_search_tool_builder.rst b/automata/docs/core/agent/tool/builder/symbol_search_tool_builder.rst index 08b704cd..4b478182 100644 --- a/automata/docs/core/agent/tool/builder/symbol_search_tool_builder.rst +++ b/automata/docs/core/agent/tool/builder/symbol_search_tool_builder.rst @@ -22,10 +22,10 @@ Related Symbols --------------- - ``automata.tests.unit.test_symbol_search_tool.test_build`` -- ``automata.core.agent.tool.builder.symbol_search.SymbolSearchOpenAIToolkit`` -- ``automata.core.base.agent.AgentToolkit`` -- ``automata.core.base.tool.Tool`` -- ``automata.core.symbol.search.symbol_search.SymbolSearch`` +- ``automata.core.tools.builders.symbol_search.SymbolSearchOpenAIToolkit`` +- ``automata.core.agent.agent.AgentToolkit`` +- ``automata.core.tools.tool.Tool`` +- ``automata.core.experimental.search.symbol_search.SymbolSearch`` Example ------- @@ -36,11 +36,11 @@ various search tools. .. code:: python - from automata.core.agent.tool.builder.symbol_search import ( + from automata.core.tools.builders.symbol_search import ( SymbolSearchToolkit, SearchTool, ) - from automata.core.symbol.search.symbol_search import SymbolSearch + from automata.core.experimental.search.symbol_search import SymbolSearch # Assuming an instance of SymbolSearch symbol_search = SymbolSearch( ... ) diff --git a/automata/docs/core/agent/tool/dependency_factory.rst b/automata/docs/core/agent/tool/dependency_factory.rst index 361cfa1b..deea8343 100644 --- a/automata/docs/core/agent/tool/dependency_factory.rst +++ b/automata/docs/core/agent/tool/dependency_factory.rst @@ -14,13 +14,13 @@ other functionalities. Related Symbols --------------- -- ``automata.core.agent.tool.tool_utils.classmethod_lru_cache`` -- ``automata.core.coding.py.reader.PyReader`` -- ``automata.core.coding.py.writer.PyWriter`` +- ``automata.core.tools.tool_utils.classmethod_lru_cache`` +- ``automata.core.code_handling.py.reader.PyReader`` +- ``automata.core.code_handling.py.writer.PyWriter`` - ``automata.core.base.database.vector.JSONEmbeddingVectorDatabase`` - ``automata.core.symbol.graph.SymbolGraph`` - ``automata.core.symbol_embedding.similarity.SymbolSimilarity`` -- ``automata.core.context.py.retriever.PyContextRetrieverConfig`` +- ``automata.core.retrievers.py.context.PyContextRetrieverConfig`` - ``automata.core.agent.error.AgentGeneralError`` Example @@ -31,7 +31,7 @@ Here is a simple example demonstrating the usage of .. code:: python - from automata.core.agent.tool.tool_utils import DependencyFactory + from automata.core.tools.tool_utils import DependencyFactory inst_factory = DependencyFactory() symbol_search = inst_factory.get("symbol_search") diff --git a/automata/docs/core/agent/tool_action.rst b/automata/docs/core/agent/tool_action.rst index a7a6009a..0044a142 100644 --- a/automata/docs/core/agent/tool_action.rst +++ b/automata/docs/core/agent/tool_action.rst @@ -20,7 +20,7 @@ Overview Related Symbols --------------- -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.tool.Tool`` - ``automata.core.agent.action.AutomataActionExtractor`` - ``automata.core.agent.agent_enums.ActionIndicator`` - ``core.agent.action.AutomataActionExtractor.extract_actions`` diff --git a/automata/docs/core/agent/tool_field.rst b/automata/docs/core/agent/tool_field.rst index 5e05ab8a..a6f13b81 100644 --- a/automata/docs/core/agent/tool_field.rst +++ b/automata/docs/core/agent/tool_field.rst @@ -18,7 +18,7 @@ properties. Related Symbols --------------- -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.tool.Tool`` - ``automata.core.base.base_tool.BaseTool`` - ``automata.core.agent.agent_enums.ResultField`` - ``automata.tests.unit.test_base_tool.MockTool`` @@ -32,7 +32,7 @@ of a tool. .. code:: python from automata.core.agent.agent_enums import ToolField - from automata.core.base.tool import Tool + from automata.core.tools.tool import Tool tool = Tool(name="ExampleTool", func=lambda x: "Example response", description="An example tool for demonstration purposes") diff --git a/automata/docs/core/agent/tools/agent_tool.rst b/automata/docs/core/agent/tools/agent_tool.rst index 853d1320..ff6c2148 100644 --- a/automata/docs/core/agent/tools/agent_tool.rst +++ b/automata/docs/core/agent/tools/agent_tool.rst @@ -10,11 +10,11 @@ extends ``AgentTool``. Related Symbols --------------- -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.tool.Tool`` - ``automata.tests.unit.test_tool.TestTool`` - ``automata.tests.unit.test_base_tool.MockTool`` - ``automata.core.base.base_tool.BaseTool`` -- ``automata.core.base.tool.Toolkit`` +- ``automata.core.tools.tool.Toolkit`` Example ------- @@ -24,7 +24,7 @@ extending the ``AgentTool`` class: .. code:: python - from automata.core.agent.tools.agent_tool import AgentTool + from automata.core.toolss.agent_tool import AgentTool from typing import Any class CustomTool(AgentTool): diff --git a/automata/docs/core/agent/tools/agent_tool_factory.rst b/automata/docs/core/agent/tools/agent_tool_factory.rst index da7418b3..4c988621 100644 --- a/automata/docs/core/agent/tools/agent_tool_factory.rst +++ b/automata/docs/core/agent/tools/agent_tool_factory.rst @@ -20,15 +20,15 @@ class and arguments. Related Symbols --------------- -- ``automata.core.base.tool.ToolkitType`` -- ``automata.core.agent.tools.agent_tool.AgentTool`` -- ``automata.core.agent.tools.py_code_retriever.PyCodeRetrieverTool`` -- ``automata.core.agent.tools.context_oracle.ContextOracleTool`` -- ``automata.core.agent.tools.py_code_writer.PyCodeWriterTool`` -- ``automata.core.agent.tools.symbol_search.SymbolSearchTool`` -- ``automata.core.agent.tools.tool_utils.DependencyFactory`` -- ``automata.core.agent.tools.tool_utils.UnknownToolError`` -- ``automata.core.agent.tools.tool_utils.ToolCreationError`` +- ``automata.core.tools.tool.ToolkitType`` +- ``automata.core.toolss.agent_tool.AgentTool`` +- ``automata.core.toolss.py_code_retriever.PyCodeRetrieverTool`` +- ``automata.core.toolss.context_oracle.ContextOracleTool`` +- ``automata.core.toolss.py_code_writer.PyCodeWriterTool`` +- ``automata.core.toolss.symbol_search.SymbolSearchTool`` +- ``automata.core.toolss.tool_utils.DependencyFactory`` +- ``automata.core.toolss.tool_utils.UnknownToolError`` +- ``automata.core.toolss.tool_utils.ToolCreationError`` Example ------- @@ -39,9 +39,9 @@ The following example demonstrates the usage of .. code:: python - from automata.core.agent.tools.tool_utils import AgentToolFactory - from automata.core.base.tool import ToolkitType - from automata.core.symbol.search.symbol_search import SymbolSearch + from automata.core.toolss.tool_utils import AgentToolFactory + from automata.core.tools.tool import ToolkitType + from automata.core.experimental.search.symbol_search import SymbolSearch from automata.core.symbol_embedding.similarity import SymbolSimilarity from automata.core.symbol.graph import SymbolGraph from automata.tests.unit.test_base_tool import mock_tool diff --git a/automata/docs/core/agent/tools/context_oracle_tool.rst b/automata/docs/core/agent/tools/context_oracle_tool.rst index f5328b8f..962310cb 100644 --- a/automata/docs/core/agent/tools/context_oracle_tool.rst +++ b/automata/docs/core/agent/tools/context_oracle_tool.rst @@ -21,19 +21,19 @@ of the “context-oracle” tool. Related Symbols --------------- -- ``automata.core.agent.tools.agent_tool.AgentTool`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.toolss.agent_tool.AgentTool`` +- ``automata.core.tools.tool.Tool`` - ``automata.core.symbol_embedding.similarity.SymbolSimilarity`` -- ``automata.core.symbol.search.symbol_search.SymbolSearch`` +- ``automata.core.experimental.search.symbol_search.SymbolSearch`` Example ------- .. code:: python - from automata.core.agent.tools.context_oracle import ContextOracleTool + from automata.core.toolss.context_oracle import ContextOracleTool from automata.core.symbol_embedding.similarity import SymbolSimilarity - from automata.core.symbol.search.symbol_search import SymbolSearch + from automata.core.experimental.search.symbol_search import SymbolSearch symbol_search = SymbolSearch() symbol_doc_similarity = SymbolSimilarity() diff --git a/automata/docs/core/agent/tools/dependency_factory.rst b/automata/docs/core/agent/tools/dependency_factory.rst index 1531461a..8d0e839c 100644 --- a/automata/docs/core/agent/tools/dependency_factory.rst +++ b/automata/docs/core/agent/tools/dependency_factory.rst @@ -12,12 +12,12 @@ dependencies required and can also be fetched by their names using the Related Symbols --------------- -- ``automata.core.agent.tools.agent_tool.AgentTool`` -- ``automata.core.agent.tools.context_oracle.ContextOracleTool`` -- ``automata.core.agent.tools.py_code_retriever.PyCodeRetrieverTool`` -- ``automata.core.agent.tools.py_code_writer.PyCodeWriterTool`` -- ``automata.core.agent.tools.symbol_search.SymbolSearchTool`` -- ``automata.core.base.tool.Toolkit`` +- ``automata.core.toolss.agent_tool.AgentTool`` +- ``automata.core.toolss.context_oracle.ContextOracleTool`` +- ``automata.core.toolss.py_code_retriever.PyCodeRetrieverTool`` +- ``automata.core.toolss.py_code_writer.PyCodeWriterTool`` +- ``automata.core.toolss.symbol_search.SymbolSearchTool`` +- ``automata.core.tools.tool.Toolkit`` Example ------- @@ -28,7 +28,7 @@ dependency names. .. code:: python - from automata.core.agent.tools.tool_utils import DependencyFactory + from automata.core.toolss.tool_utils import DependencyFactory dependency_factory = DependencyFactory() py_context_retriever = dependency_factory.get("py_context_retriever") diff --git a/automata/docs/core/agent/tools/py_code_retriever_tool.rst b/automata/docs/core/agent/tools/py_code_retriever_tool.rst index e185bc92..b534887b 100644 --- a/automata/docs/core/agent/tools/py_code_retriever_tool.rst +++ b/automata/docs/core/agent/tools/py_code_retriever_tool.rst @@ -24,10 +24,10 @@ files and symbols. Related Symbols --------------- -- ``automata.core.agent.tools.agent_tool.AgentTool`` -- ``automata.core.base.tool.Tool`` -- ``automata.core.coding.py_coding.retriever.PyCodeRetriever`` -- ``automata.core.coding.py_coding.writer.PyCodeWriter`` +- ``automata.core.toolss.agent_tool.AgentTool`` +- ``automata.core.tools.tool.Tool`` +- ``automata.core.code_handling.py_coding.retriever.PyCodeRetriever`` +- ``automata.core.code_handling.py_coding.writer.PyCodeWriter`` Example ------- @@ -38,8 +38,8 @@ file. .. code:: python - from automata.core.agent.tools.py_code_retriever import PyCodeRetrieverTool - from automata.core.coding.py_coding.retriever import PyCodeRetriever + from automata.core.toolss.py_code_retriever import PyCodeRetrieverTool + from automata.core.code_handling.py_coding.retriever import PyCodeRetriever py_retriever = PyCodeRetriever() tool_instance = PyCodeRetrieverTool(py_retriever=py_retriever) diff --git a/automata/docs/core/agent/tools/py_code_writer_tool.rst b/automata/docs/core/agent/tools/py_code_writer_tool.rst index 37263d8a..d019108a 100644 --- a/automata/docs/core/agent/tools/py_code_writer_tool.rst +++ b/automata/docs/core/agent/tools/py_code_writer_tool.rst @@ -23,19 +23,19 @@ Overview Related Symbols --------------- -- ``automata.core.agent.tools.py_code_writer.PyCodeWriterTool`` -- ``automata.core.coding.py_coding.retriever.PyCodeRetriever`` -- ``automata.core.coding.py_coding.writer.PyCodeWriter`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.toolss.py_code_writer.PyCodeWriterTool`` +- ``automata.core.code_handling.py_coding.retriever.PyCodeRetriever`` +- ``automata.core.code_handling.py_coding.writer.PyCodeWriter`` +- ``automata.core.tools.tool.Tool`` Usage Example ------------- .. code:: python - from automata.core.agent.tools.py_code_writer import PyCodeWriterTool - from automata.core.coding.py_coding.retriever import PyCodeRetriever - from automata.core.coding.py_coding.writer import PyCodeWriter + from automata.core.toolss.py_code_writer import PyCodeWriterTool + from automata.core.code_handling.py_coding.retriever import PyCodeRetriever + from automata.core.code_handling.py_coding.writer import PyCodeWriter py_retriever = PyCodeRetriever() py_writer = PyCodeWriter(py_retriever) diff --git a/automata/docs/core/agent/tools/search_tool.rst b/automata/docs/core/agent/tools/search_tool.rst index 07515da5..638aa578 100644 --- a/automata/docs/core/agent/tools/search_tool.rst +++ b/automata/docs/core/agent/tools/search_tool.rst @@ -5,7 +5,7 @@ SearchTool tools, each with a different functionality. The primary search tools include exact-search, symbol-rank-search, source-code-search, and symbol-references-search. The ``SearchTool`` class is part of the -``automata.core.agent.tools.symbol_search`` module and can be used to +``automata.core.toolss.symbol_search`` module and can be used to build specific tools by specifying the desired search tool type. Overview @@ -20,9 +20,9 @@ tool for exact-search can be built by specifying the Related Symbols --------------- -- ``automata.core.agent.tools.symbol_search.SymbolSearchTool`` -- ``automata.core.base.tool.Tool`` -- ``automata.core.symbol.search.symbol_search.*`` +- ``automata.core.toolss.symbol_search.SymbolSearchTool`` +- ``automata.core.tools.tool.Tool`` +- ``automata.core.experimental.search.symbol_search.*`` Example ------- @@ -32,8 +32,8 @@ and execute an exact-search tool: .. code:: python - from automata.core.symbol.search.symbol_search import SymbolSearch - from automata.core.agent.tools.symbol_search import ( + from automata.core.experimental.search.symbol_search import SymbolSearch + from automata.core.toolss.symbol_search import ( SymbolSearchTool, SearchTool, ) diff --git a/automata/docs/core/agent/tools/symbol_search_tool.rst b/automata/docs/core/agent/tools/symbol_search_tool.rst index 9ec7eda3..38eb1c48 100644 --- a/automata/docs/core/agent/tools/symbol_search_tool.rst +++ b/automata/docs/core/agent/tools/symbol_search_tool.rst @@ -21,9 +21,9 @@ using the desired tool. Related Symbols --------------- -- ``automata.core.symbol.search.symbol_search.SymbolSearch`` -- ``automata.core.agent.tools.symbol_search.SearchTool`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.experimental.search.symbol_search.SymbolSearch`` +- ``automata.core.toolss.symbol_search.SearchTool`` +- ``automata.core.tools.tool.Tool`` Example ------- @@ -34,8 +34,8 @@ of the available search tools. .. code:: python - from automata.core.symbol.search.symbol_search import SymbolSearch - from automata.core.agent.tools.symbol_search import SymbolSearchTool, SearchTool + from automata.core.experimental.search.symbol_search import SymbolSearch + from automata.core.toolss.symbol_search import SymbolSearchTool, SearchTool symbol_search = SymbolSearch() # Note: Replace with actual SymbolSearch instance symbol_search_tool = SymbolSearchTool(symbol_search) diff --git a/automata/docs/core/agent/tools/tool_creation_error.rst b/automata/docs/core/agent/tools/tool_creation_error.rst index 4bdf8883..2dedb066 100644 --- a/automata/docs/core/agent/tools/tool_creation_error.rst +++ b/automata/docs/core/agent/tools/tool_creation_error.rst @@ -12,9 +12,9 @@ Related Symbols - ``automata.tests.unit.test_tool.test_tool_instantiation`` - ``automata.tests.unit.test_tool.test_invalid_tool`` -- ``automata.core.base.tool.ToolNotFoundError`` +- ``automata.core.tools.tool.ToolNotFoundError`` - ``automata.tests.unit.test_base_tool.test_base_tool_instantiation`` -- ``automata.core.agent.tools.tool_utils.UnknownToolError`` +- ``automata.core.toolss.tool_utils.UnknownToolError`` - ``automata.tests.unit.test_tool.test_invalid_tool_async`` Example @@ -25,8 +25,8 @@ can be raised and caught during the creation of an invalid tool. .. code:: python - from automata.core.agent.tools.agent_tool import AgentTool - from automata.core.agent.tools.tool_utils import ToolCreationError + from automata.core.toolss.agent_tool import AgentTool + from automata.core.toolss.tool_utils import ToolCreationError class InvalidTool(AgentTool): pass diff --git a/automata/docs/core/agent/tools/toolkit_builder.rst b/automata/docs/core/agent/tools/toolkit_builder.rst index 33928c63..ab92b74f 100644 --- a/automata/docs/core/agent/tools/toolkit_builder.rst +++ b/automata/docs/core/agent/tools/toolkit_builder.rst @@ -21,11 +21,11 @@ context oracle. Related Symbols --------------- -- ``automata.core.base.tool.Toolkit`` -- ``automata.core.base.tool.ToolkitType`` -- ``automata.core.agent.tools.tool_utils.UnknownToolError`` -- ``automata.core.agent.tools.agent_tool.AgentTool`` -- ``automata.core.agent.tools.tool_utils.AgentToolFactory`` +- ``automata.core.tools.tool.Toolkit`` +- ``automata.core.tools.tool.ToolkitType`` +- ``automata.core.toolss.tool_utils.UnknownToolError`` +- ``automata.core.toolss.agent_tool.AgentTool`` +- ``automata.core.toolss.tool_utils.AgentToolFactory`` Example ------- @@ -35,8 +35,8 @@ using the ``ToolkitBuilder`` class. .. code:: python - from automata.core.agent.tools.tool_utils import ToolkitBuilder - from automata.core.base.tool import ToolkitType + from automata.core.toolss.tool_utils import ToolkitBuilder + from automata.core.tools.tool import ToolkitType # Create a ToolkitBuilder instance builder = ToolkitBuilder() diff --git a/automata/docs/core/agent/tools/unknown_tool_error.rst b/automata/docs/core/agent/tools/unknown_tool_error.rst index f0ad7ab3..bdb83bfb 100644 --- a/automata/docs/core/agent/tools/unknown_tool_error.rst +++ b/automata/docs/core/agent/tools/unknown_tool_error.rst @@ -9,13 +9,13 @@ message. Related Symbols --------------- -- ``automata.core.base.tool.ToolNotFoundError`` +- ``automata.core.tools.tool.ToolNotFoundError`` - ``automata.tests.unit.test_tool.test_invalid_tool`` - ``automata.tests.unit.test_tool.test_invalid_tool_async`` -- ``automata.core.base.tool.InvalidTool`` +- ``automata.core.tools.tool.InvalidTool`` - ``automata.tests.unit.test_base_tool.TestTool`` - ``automata.tests.unit.test_base_tool.MockTool`` -- ``automata.core.agent.tools.tool_utils.ToolCreationError`` +- ``automata.core.toolss.tool_utils.ToolCreationError`` Example ------- @@ -25,8 +25,8 @@ this example assumes an unknown toolkit type. .. code:: python - from automata.core.base.tool import ToolkitType - from automata.core.agent.tools.tool_utils import UnknownToolError + from automata.core.tools.tool import ToolkitType + from automata.core.toolss.tool_utils import UnknownToolError def get_tool_by_toolkit(toolkit_type: ToolkitType): if toolkit_type == ToolkitType.UNKNOWN: diff --git a/automata/docs/core/agent/unknown_tool_error.rst b/automata/docs/core/agent/unknown_tool_error.rst index ca1f90d5..dd01ca9b 100644 --- a/automata/docs/core/agent/unknown_tool_error.rst +++ b/automata/docs/core/agent/unknown_tool_error.rst @@ -9,9 +9,9 @@ system. Related Symbols --------------- -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.tool.Tool`` - ``automata.tests.unit.test_tool.TestTool`` -- ``automata.core.agent.tool.tool_utils.AgentToolFactory`` +- ``automata.core.tools.tool_utils.AgentToolFactory`` - ``automata.tests.unit.test_context_oracle_tool.test_init`` Example @@ -22,7 +22,7 @@ trying to create an unsupported tool: .. code:: python - from automata.core.agent.tool.tool_utils import AgentToolFactory + from automata.core.tools.tool_utils import AgentToolFactory from automata.core.agent.error import UnknownToolError class UnsupportedTool: diff --git a/automata/docs/core/base/agent.rst b/automata/docs/core/base/agent.rst index c6a02579..d9dbeabf 100644 --- a/automata/docs/core/base/agent.rst +++ b/automata/docs/core/base/agent.rst @@ -37,7 +37,7 @@ iteration and has a limited number of total steps. .. code:: python import logging - from automata.core.base.agent import Agent + from automata.core.agent.agent import Agent from automata.core.llm.foundation import LLMIterationResult class CustomAgent(Agent): diff --git a/automata/docs/core/base/agent/config.rst b/automata/docs/core/base/agent/config.rst index 82759f4e..72e0fe87 100644 --- a/automata/docs/core/base/agent/config.rst +++ b/automata/docs/core/base/agent/config.rst @@ -17,15 +17,15 @@ instructions on them. Related Symbols --------------- -- ``automata.core.base.agent.AgentInstance.Config`` +- ``automata.core.agent.agent.AgentInstance.Config`` - ``automata.tests.unit.test_automata_agent_builder.test_automata_agent_init`` -- ``automata.core.base.agent.AgentInstance.create`` +- ``automata.core.agent.agent.AgentInstance.create`` - ``automata.tests.conftest.task`` - ``automata.core.agent.providers.OpenAIAutomataAgent`` - ``automata.tests.conftest.automata_agent_config_builder`` - ``automata.core.agent.instances.AutomataOpenAIAgentInstance`` - ``automata.tests.unit.sample_modules.sample2.PythonAgentToolkit.python_agent_python_task`` -- ``automata.core.base.agent.Agent`` +- ``automata.core.agent.agent.Agent`` Example ------- diff --git a/automata/docs/core/base/agent_instance.rst b/automata/docs/core/base/agent_instance.rst index db918432..100db041 100644 --- a/automata/docs/core/base/agent_instance.rst +++ b/automata/docs/core/base/agent_instance.rst @@ -19,8 +19,8 @@ Related Symbols - ``automata.core.agent.providers.OpenAIAutomataAgent`` - ``automata.core.agent.instances.AutomataOpenAIAgentInstance`` -- ``automata.core.base.agent.Agent`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.agent.agent.Agent`` +- ``automata.core.tools.tool.Tool`` Example ------- @@ -30,7 +30,7 @@ instance by subclassing ``AgentInstance``. .. code:: python - from automata.core.base.agent import AgentInstance + from automata.core.agent.agent import AgentInstance from automata.core.config.config_types import AgentConfigName class CustomAgentInstance(AgentInstance): diff --git a/automata/docs/core/base/agent_tool_builder.rst b/automata/docs/core/base/agent_tool_builder.rst index a4213d8a..dff01ddd 100644 --- a/automata/docs/core/base/agent_tool_builder.rst +++ b/automata/docs/core/base/agent_tool_builder.rst @@ -18,10 +18,10 @@ the ``build`` method to define the tool creation logic. Related Symbols --------------- -- ``automata.core.base.tool.Tool`` -- ``automata.core.agent.tool.tool_utils.AgentToolFactory`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterOpenAIToolkit`` -- ``automata.core.agent.tool.builder.py_reader.PyReaderOpenAIToolkit`` +- ``automata.core.tools.tool.Tool`` +- ``automata.core.tools.tool_utils.AgentToolFactory`` +- ``automata.core.tools.builders.py_writer.PyWriterOpenAIToolkit`` +- ``automata.core.tools.builders.py_reader.PyReaderOpenAIToolkit`` Example ------- @@ -31,8 +31,8 @@ that inherits the ``AgentToolkit`` class. .. code:: python - from automata.core.base.agent import AgentToolkit - from automata.core.base.tool import Tool + from automata.core.agent.agent import AgentToolkit + from automata.core.tools.tool import Tool class CustomToolkit(AgentToolkit): def build(self) -> List[Tool]: diff --git a/automata/docs/core/base/agent_tool_providers.rst b/automata/docs/core/base/agent_tool_providers.rst index b039be95..ee92196f 100644 --- a/automata/docs/core/base/agent_tool_providers.rst +++ b/automata/docs/core/base/agent_tool_providers.rst @@ -19,14 +19,14 @@ Related Symbols --------------- - ``automata.config.config_types.AgentConfigName`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.tool.Tool`` - ``automata.core.llm.foundation.LLMConversationDatabaseProvider`` - ``automata.core.llm.foundation.LLMIterationResult`` - ``automata.core.llm.providers.available.LLMPlatforms`` -- ``automata.core.agent.tool.tool_utils.AgentToolFactory`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterOpenAIToolkit`` -- ``automata.core.agent.tool.builder.symbol_search.SymbolSearchOpenAIToolkit`` -- ``automata.core.agent.tool.registry.AutomataOpenAIAgentToolkitRegistry`` +- ``automata.core.tools.tool_utils.AgentToolFactory`` +- ``automata.core.tools.builders.py_writer.PyWriterOpenAIToolkit`` +- ``automata.core.tools.builders.symbol_search.SymbolSearchOpenAIToolkit`` +- ``automata.core.tools.registries.OpenAIAutomataAgentToolkitRegistry`` Example ------- @@ -36,7 +36,7 @@ it to an agent using ``AgentToolkitNames``. .. code:: python - from automata.core.base.agent import AgentToolkitNames + from automata.core.agent.agent import AgentToolkitNames class CustomTool(AgentToolkitNames): def __init__(self): diff --git a/automata/docs/core/base/base_tool.rst b/automata/docs/core/base/base_tool.rst index d1df8512..8e98a2fd 100644 --- a/automata/docs/core/base/base_tool.rst +++ b/automata/docs/core/base/base_tool.rst @@ -23,10 +23,10 @@ providing specific implementations for ``_run`` and ``_arun`` methods. Related Symbols --------------- -- ``automata.core.base.tool.Tool`` -- ``automata.core.agent.tools.agent_tool.AgentTool`` -- ``automata.core.base.tool.Toolkit`` -- ``automata.core.base.tool.InvalidTool`` +- ``automata.core.tools.tool.Tool`` +- ``automata.core.toolss.agent_tool.AgentTool`` +- ``automata.core.tools.tool.Toolkit`` +- ``automata.core.tools.tool.InvalidTool`` - ``automata.tests.unit.test_base_tool.MockTool``: This mock object is used for testing purposes; refer to actual implementations of ``BaseTool`` as examples. diff --git a/automata/docs/core/base/base_tool/config.rst b/automata/docs/core/base/base_tool/config.rst index 4d93fdf2..5117f73b 100644 --- a/automata/docs/core/base/base_tool/config.rst +++ b/automata/docs/core/base/base_tool/config.rst @@ -23,12 +23,12 @@ settings, like forbidding extra fields and allowing arbitrary types. Related Symbols --------------- -- ``automata.core.base.tool.Tool`` -- ``automata.core.base.tool.InvalidTool`` +- ``automata.core.tools.tool.Tool`` +- ``automata.core.tools.tool.InvalidTool`` - ``automata.tests.unit.test_base_tool.test_base_tool_instantiation`` - ``automata.tests.unit.test_base_tool.test_base_tool_call`` -- ``automata.core.base.tool.Toolkit`` -- ``automata.core.agent.tools.agent_tool.AgentTool`` +- ``automata.core.tools.tool.Toolkit`` +- ``automata.core.toolss.agent_tool.AgentTool`` Examples -------- diff --git a/automata/docs/core/base/database/json_embedding_vector_database.rst b/automata/docs/core/base/database/json_embedding_vector_database.rst index ef9a0f29..9f6e3f29 100644 --- a/automata/docs/core/base/database/json_embedding_vector_database.rst +++ b/automata/docs/core/base/database/json_embedding_vector_database.rst @@ -21,8 +21,8 @@ Related Symbols - ``JSONEmbeddingVectorDatabase`` inherits from ``automata.core.base.database.vector.VectorDatabaseProvider`` -- ``automata.core.base.symbol.Symbol`` -- ``automata.core.base.symbol_embedding.SymbolEmbedding`` +- ``automata.core.symbol.base.Symbol`` +- ``automata.core.symbol_embedding.base.SymbolEmbedding`` Example ------- @@ -34,7 +34,7 @@ and retrieving vectors associated with symbols. .. code:: python from automata.core.base.database.vector import JSONEmbeddingVectorDatabase - from automata.core.base.symbol import Symbol, SymbolEmbedding + from automata.core.symbol.base import Symbol, SymbolEmbedding file_path = "path/to/json/database.json" vector_db = JSONEmbeddingVectorDatabase(file_path) diff --git a/automata/docs/core/base/database/json_vector_database.rst b/automata/docs/core/base/database/json_vector_database.rst index fc96cd04..42333bbc 100644 --- a/automata/docs/core/base/database/json_vector_database.rst +++ b/automata/docs/core/base/database/json_vector_database.rst @@ -35,7 +35,7 @@ The following is an example demonstrating usage of the .. code:: python from automata.core.base.database.vector import JSONVectorDatabase - from automata.core.base.symbol import SymbolEmbedding + from automata.core.symbol.base import SymbolEmbedding # Creating an instance of JSONVectorDatabase vector_db = JSONVectorDatabase("path_to_json_file.json") diff --git a/automata/docs/core/base/database/relational_database.rst b/automata/docs/core/base/database/relational_database.rst index 9dd62a6d..7a5b3c6f 100644 --- a/automata/docs/core/base/database/relational_database.rst +++ b/automata/docs/core/base/database/relational_database.rst @@ -22,7 +22,7 @@ Related Symbols - ``automata.core.base.database.relational.SQLDatabase`` - ``automata.tests.unit.test_task_database.db`` - ``automata.tests.unit.test_conversation_database.db`` -- ``automata.core.agent.task.registry.AutomataTaskDatabase`` +- ``automata.core.tasks.agent_database.AutomataAgentTaskDatabase`` - ``automata.core.llm.foundation.LLMConversationDatabaseProvider`` Example diff --git a/automata/docs/core/base/database/sql_database.rst b/automata/docs/core/base/database/sql_database.rst index 80adcf4a..3a93d41c 100644 --- a/automata/docs/core/base/database/sql_database.rst +++ b/automata/docs/core/base/database/sql_database.rst @@ -21,7 +21,7 @@ Related Symbols - ``automata.core.base.database.relational.RelationalDatabase`` - ``automata.tests.unit.test_task_database.db`` - ``automata.tests.unit.test_conversation_database.db`` -- ``automata.core.agent.task.registry.AutomataTaskDatabase`` +- ``automata.core.tasks.agent_database.AutomataAgentTaskDatabase`` Usage Example ------------- diff --git a/automata/docs/core/base/database/symbol_database_provider.rst b/automata/docs/core/base/database/symbol_database_provider.rst index d1f6dc16..40558ea8 100644 --- a/automata/docs/core/base/database/symbol_database_provider.rst +++ b/automata/docs/core/base/database/symbol_database_provider.rst @@ -9,8 +9,8 @@ embeddings in the database. Related Symbols --------------- -- ``automata.core.base.symbol.Symbol`` -- ``automata.core.base.symbol_embedding.SymbolEmbedding`` +- ``automata.core.symbol.base.Symbol`` +- ``automata.core.symbol_embedding.base.SymbolEmbedding`` - ``automata.core.memory_store.symbol_code_embedding.SymbolCodeEmbeddingHandler`` - ``automata.core.base.database.vector.JSONEmbeddingVectorDatabase`` - ``automata.tests.utils.factories.symbol_search_live`` @@ -24,7 +24,7 @@ The following is an example of a custom implementation of .. code:: python from automata.core.base.database.provider import SymbolDatabaseProvider - from automata.core.base.symbol import Symbol, SymbolEmbedding + from automata.core.symbol.base import Symbol, SymbolEmbedding class CustomDatabase(SymbolDatabaseProvider): def __init__(self): diff --git a/automata/docs/core/base/database/vector_database_provider.rst b/automata/docs/core/base/database/vector_database_provider.rst index 5ff22bb2..88f80a42 100644 --- a/automata/docs/core/base/database/vector_database_provider.rst +++ b/automata/docs/core/base/database/vector_database_provider.rst @@ -25,8 +25,8 @@ Related Symbols - ``automata.core.base.database.vector.JSONEmbeddingVectorDatabase`` - ``automata.core.memory_store.symbol_code_embedding.SymbolCodeEmbeddingHandler`` - ``automata.core.base.database.provider.SymbolDatabaseProvider`` -- ``automata.core.base.symbol.Symbol`` -- ``automata.core.base.symbol_embedding.SymbolEmbedding`` +- ``automata.core.symbol.base.Symbol`` +- ``automata.core.symbol_embedding.base.SymbolEmbedding`` Example ------- diff --git a/automata/docs/core/base/git_hub_manager.rst b/automata/docs/core/base/git_hub_manager.rst index 7f5b68fc..ce113b04 100644 --- a/automata/docs/core/base/git_hub_manager.rst +++ b/automata/docs/core/base/git_hub_manager.rst @@ -1,7 +1,7 @@ -GitHubManager +GitHubClient ============= -``GitHubManager`` is a utility class that provides an interface for +``GitHubClient`` is a utility class that provides an interface for interacting with GitHub repositories. It includes functions to clone a repository, create and checkout a branch, stage, commit, and push changes, and create issues and pull requests. @@ -9,33 +9,33 @@ changes, and create issues and pull requests. Overview -------- -``GitHubManager`` makes it easy to interact with GitHub repositories +``GitHubClient`` makes it easy to interact with GitHub repositories using a simple and intuitive API. It abstracts the underlying GitHub API and Git operations into easy-to-understand methods. Related Symbols --------------- -- ``automata.tests.conftest.MockRepositoryManager`` -- ``automata.core.base.github_manager.RepositoryManager`` -- ``automata.core.agent.task.environment.AutomataTaskEnvironment`` +- ``automata.tests.conftest.MockRepositoryClient`` +- ``automata.core.base.github_management.client.RepositoryClient`` +- ``automata.core.tasks.environment.AutomataTaskEnvironment`` Example ------- -The following example demonstrates how to use the ``GitHubManager`` to +The following example demonstrates how to use the ``GitHubClient`` to clone a repository, create a branch, add changes, commit and push changes, and create a pull request. .. code:: python - from automata.core.base.github_manager import GitHubManager + from automata.core.base.github_management.client import GitHubClient access_token = "your-github-access-token" remote_name = "your-remote-repo" local_path = "your/local/path" - github_manager = GitHubManager(access_token, remote_name) + github_manager = GitHubClient(access_token, remote_name) # Clone the repository locally github_manager.clone_repository(local_path) @@ -60,11 +60,11 @@ changes, and create a pull request. Limitations ----------- -The primary limitation of ``GitHubManager`` is its reliance on the +The primary limitation of ``GitHubClient`` is its reliance on the provided access token for authentication. A user must have a valid access token for interacting with the remote repository. Follow-up Questions: -------------------- -- How can we improve the authentication methods for ``GitHubManager``? +- How can we improve the authentication methods for ``GitHubClient``? diff --git a/automata/docs/core/base/i_task_execution.rst b/automata/docs/core/base/i_task_execution.rst index 87042fab..301c7eba 100644 --- a/automata/docs/core/base/i_task_execution.rst +++ b/automata/docs/core/base/i_task_execution.rst @@ -12,14 +12,14 @@ Related Symbols - ``automata.tests.unit.test_task_executor.TestExecuteBehavior`` - ``automata.tests.unit.test_task_executor.test_execute_automata_task_fail`` -- ``automata.core.agent.task.executor.AutomataTaskExecutor.__init__`` +- ``automata.core.tasks.executor.AutomataTaskExecutor.__init__`` - ``automata.tests.unit.test_task_executor.test_execute_automata_task_success`` -- ``automata.core.base.task.TaskStatus`` +- ``automata.core.tasks.base.TaskStatus`` - ``automata.tests.unit.test_task_database.task`` - ``automata.tests.unit.test_task_database.test_database_lifecycle`` -- ``automata.core.agent.task.executor.IAutomataTaskExecution`` +- ``automata.core.tasks.executor.IAutomataTaskExecution`` - ``automata.tests.unit.test_task_database.test_update_task`` -- ``automata.core.agent.task.executor.AutomataTaskExecutor`` +- ``automata.core.tasks.executor.AutomataTaskExecutor`` Example ------- @@ -30,8 +30,8 @@ specific type of task. .. code:: python - from automata.core.base.task import Task - from automata.core.base.task.ITaskExecution import ITaskExecution + from automata.core.tasks.base import Task + from automata.core.tasks.base.ITaskExecution import ITaskExecution class CustomTaskExecution(ITaskExecution): def execute(self, task: Task) -> None: diff --git a/automata/docs/core/base/invalid_tool.rst b/automata/docs/core/base/invalid_tool.rst index 09c4d2e9..3da7abdf 100644 --- a/automata/docs/core/base/invalid_tool.rst +++ b/automata/docs/core/base/invalid_tool.rst @@ -18,9 +18,9 @@ handling for users. Related Symbols --------------- -- ``automata.core.base.tool.Toolkit`` -- ``automata.core.base.tool.Tool`` -- ``automata.core.base.tool.ToolNotFoundError`` +- ``automata.core.tools.tool.Toolkit`` +- ``automata.core.tools.tool.Tool`` +- ``automata.core.tools.tool.ToolNotFoundError`` - ``automata.core.base.base_tool.BaseTool`` Example @@ -31,7 +31,7 @@ instance and run it with an invalid tool name: .. code:: python - from automata.core.base.tool import InvalidTool + from automata.core.tools.tool import InvalidTool invalid_tool = InvalidTool() response = invalid_tool.run(("InvalidToolName",)) @@ -42,7 +42,7 @@ Additionally, ``InvalidTool`` can be run asynchronously: .. code:: python import asyncio - from automata.core.base.tool import InvalidTool + from automata.core.tools.tool import InvalidTool async def main(): invalid_tool = InvalidTool() diff --git a/automata/docs/core/base/observer.rst b/automata/docs/core/base/observer.rst index d838946a..73653dec 100644 --- a/automata/docs/core/base/observer.rst +++ b/automata/docs/core/base/observer.rst @@ -14,7 +14,7 @@ Related Symbols - ``automata.tests.unit.test_task.test_callback`` - ``automata.tests.unit.sample_modules.sample.Person`` - ``automata.core.llm.providers.openai.OpenAIConversation.register_observer`` -- ``automata.tests.conftest.MockRepositoryManager`` +- ``automata.tests.conftest.MockRepositoryClient`` - ``automata.core.llm.providers.openai.OpenAIConversation.unregister_observer`` - ``automata.tests.unit.test_py_reader.getter`` - ``automata.core.llm.foundation.LLMConversation.register_observer`` @@ -31,7 +31,7 @@ inherits from the ``Observer`` class and implements the .. code:: python - from automata.core.base.observer import Observer + from automata.core.base.patterns.observer import Observer class CustomObserver(Observer): def update_database(self, subject): diff --git a/automata/docs/core/base/repository_manager.rst b/automata/docs/core/base/repository_manager.rst index 6d91952d..900f408a 100644 --- a/automata/docs/core/base/repository_manager.rst +++ b/automata/docs/core/base/repository_manager.rst @@ -1,17 +1,17 @@ -RepositoryManager +RepositoryClient ================= -``RepositoryManager`` is an abstract base class that defines interface +``RepositoryClient`` is an abstract base class that defines interface methods for managing repositories. It provides a set of abstract methods such as ``clone_repository``, ``create_branch``, ``checkout_branch``, ``commit_and_push_changes``, and others that are implemented by -subclasses like ``GitHubManager``. +subclasses like ``GitHubClient``. Related Symbols --------------- -- ``automata.core.base.github_manager.GitHubManager`` -- ``automata.core.agent.task.environment.AutomataTaskEnvironment`` +- ``automata.core.base.github_management.client.GitHubClient`` +- ``automata.core.tasks.environment.AutomataTaskEnvironment`` - ``config.automata_agent_config.AutomataAgentConfig`` - ``automata.core.agent.agent.AutomataAgent`` @@ -20,13 +20,13 @@ Usage Example .. code:: python - from automata.core.base.github_manager import GitHubManager + from automata.core.base.github_management.client import GitHubClient access_token = "your_github_access_token" remote_name = "your/remote_repository" primary_branch = "main" - github_manager = GitHubManager(access_token, remote_name, primary_branch) + github_manager = GitHubClient(access_token, remote_name, primary_branch) Methods ------- @@ -48,7 +48,7 @@ Methods Limitations ----------- -The primary limitation of ``RepositoryManager`` is that it is an +The primary limitation of ``RepositoryClient`` is that it is an abstract base class and cannot directly interact with repositories. It needs to be subclassed, and the abstract methods need to be implemented for specific repository services like GitHub or GitLab. @@ -57,6 +57,6 @@ Follow-up Questions: -------------------- - How are the underlying git and GitHub operations managed with the - ``RepositoryManager`` abstract methods? + ``RepositoryClient`` abstract methods? - Are there other related symbols that need to be included in the documentation? diff --git a/automata/docs/core/base/singleton.rst b/automata/docs/core/base/singleton.rst index 8e04ddc4..66f4f8b7 100644 --- a/automata/docs/core/base/singleton.rst +++ b/automata/docs/core/base/singleton.rst @@ -12,13 +12,13 @@ Related Symbols - ``automata.tests.unit.sample_modules.sample.EmptyClass`` - ``automata.tests.unit.sample_modules.sample.Person`` - ``automata.tests.unit.sample_modules.sample.OuterClass`` -- ``automata.core.coding.py.module_loader.PyModuleLoader`` +- ``automata.core.singletons.module_loader.PyModuleLoader`` - ``automata.tests.unit.sample_modules.sample.OuterClass.InnerClass`` - ``automata.core.llm.foundation.LLMChatCompletionProvider.__init__`` -- ``automata.tests.conftest.MockRepositoryManager`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.tests.conftest.MockRepositoryClient`` +- ``automata.core.symbol.base.Symbol`` - ``automata.tests.unit.test_py_reader.getter`` -- ``automata.core.coding.py.module_loader.PyModuleLoader.__init__`` +- ``automata.core.singletons.module_loader.PyModuleLoader.__init__`` Example ------- @@ -29,7 +29,7 @@ ensure that only one instance of the class is created. .. code:: python import abc - from automata.core.base.singleton import Singleton + from automata.core.base.patterns.singleton import Singleton class MyClass(metaclass=Singleton): def __init__(self): diff --git a/automata/docs/core/base/task.rst b/automata/docs/core/base/task.rst index 333f3470..cf8102e5 100644 --- a/automata/docs/core/base/task.rst +++ b/automata/docs/core/base/task.rst @@ -22,9 +22,9 @@ hashable kwargs - Notifying observers when the task status changes Related Symbols --------------- -- ``automata.core.agent.task.task.AutomataTask`` -- ``automata.core.base.task.ITaskExecution.execute`` -- ``automata.core.base.task.ITaskExecution`` +- ``automata.core.tasks.tasks.AutomataTask`` +- ``automata.core.tasks.base.ITaskExecution.execute`` +- ``automata.core.tasks.base.ITaskExecution`` - ``automata.tests.unit.test_task_database.task`` Example @@ -36,7 +36,7 @@ The following is an example demonstrating how to create a custom .. code:: python import uuid - from automata.core.base.task import Task, TaskStatus + from automata.core.tasks.base import Task, TaskStatus class MyCustomTask(Task): def __init__(self, *args, **kwargs): diff --git a/automata/docs/core/base/task_environment.rst b/automata/docs/core/base/task_environment.rst index beacd690..afa53124 100644 --- a/automata/docs/core/base/task_environment.rst +++ b/automata/docs/core/base/task_environment.rst @@ -11,10 +11,10 @@ environment implementations. Related Symbols --------------- -- ``automata.core.agent.task.environment.AutomataTaskEnvironment`` +- ``automata.core.tasks.environment.AutomataTaskEnvironment`` - ``automata.tests.conftest.environment`` - ``automata.tests.unit.test_task_environment.test_commit_task`` -- ``automata.core.agent.task.task.AutomataTask`` +- ``automata.core.tasks.tasks.AutomataTask`` Example ------- @@ -24,7 +24,7 @@ implementation of the ``TaskEnvironment`` abstract base class. .. code:: python - from automata.core.base.task import TaskEnvironment + from automata.core.tasks.base import TaskEnvironment from typing import Any class CustomTaskEnvironment(TaskEnvironment): diff --git a/automata/docs/core/base/task_status.rst b/automata/docs/core/base/task_status.rst index 4b3c4265..596590f7 100644 --- a/automata/docs/core/base/task_status.rst +++ b/automata/docs/core/base/task_status.rst @@ -10,8 +10,8 @@ task as it progresses through different stages of execution. Related Symbols --------------- -- ``automata.core.base.task.Task`` -- ``automata.core.agent.task.task.AutomataTask`` +- ``automata.core.tasks.base.Task`` +- ``automata.core.tasks.tasks.AutomataTask`` - ``automata.tests.unit.test_task`` Example @@ -22,8 +22,8 @@ The following example demonstrates how to use ``TaskStatus`` with an .. code:: python - from automata.core.agent.task.task import AutomataTask - from automata.core.base.task import TaskStatus + from automata.core.tasks.tasks import AutomataTask + from automata.core.tasks.base import TaskStatus task = AutomataTask(instructions="example_instructions") print("Task initial status:", task.status) diff --git a/automata/docs/core/base/tool.rst b/automata/docs/core/base/tool.rst index 86eba141..e598ae82 100644 --- a/automata/docs/core/base/tool.rst +++ b/automata/docs/core/base/tool.rst @@ -27,9 +27,9 @@ Related Symbols - ``automata.tests.unit.test_tool.test_tool_instantiation`` - ``automata.core.llm.providers.openai.OpenAIAgentToolkit.can_handle`` - ``automata.tests.unit.test_tool.TestTool.run`` -- ``automata.core.base.agent.AgentToolkit.build`` +- ``automata.core.agent.agent.AgentToolkit.build`` - ``automata.tests.unit.test_symbol_search_tool.test_build`` -- ``automata.core.agent.tool.tool_utils.AgentToolFactory`` +- ``automata.core.tools.tool_utils.AgentToolFactory`` Example ------- @@ -39,7 +39,7 @@ subclass, called ``TestTool``. .. code:: python - from automata.core.base.tool import Tool + from automata.core.tools.tool import Tool from typing import Dict class TestTool(Tool): diff --git a/automata/docs/core/base/tool/config.rst b/automata/docs/core/base/tool/config.rst index f72da8db..c50e1b44 100644 --- a/automata/docs/core/base/tool/config.rst +++ b/automata/docs/core/base/tool/config.rst @@ -10,16 +10,16 @@ Overview -------- The ``Tool.Config`` class is part of the -``automata.core.base.tool.Tool`` class and helps to set up the +``automata.core.tools.tool.Tool`` class and helps to set up the configuration for the tool. Related Symbols --------------- -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.tool.Tool`` - ``automata.tests.unit.test_tool.test_tool`` - ``automata.tests.unit.test_tool.TestTool`` -- ``automata.core.base.tool.Tool.run`` +- ``automata.core.tools.tool.Tool.run`` - ``automata.core.llm.providers.openai.OpenAITool`` - ``automata.core.llm.providers.openai.OpenAIAgentToolkit.can_handle`` @@ -31,7 +31,7 @@ uses the ``Tool.Config`` and is able to run with some input. .. code:: python - from automata.core.base.tool import Tool + from automata.core.tools.tool import Tool from typing import Dict class TestTool(Tool): diff --git a/automata/docs/core/base/tool_not_found_error.rst b/automata/docs/core/base/tool_not_found_error.rst index f87c3fe4..441552e4 100644 --- a/automata/docs/core/base/tool_not_found_error.rst +++ b/automata/docs/core/base/tool_not_found_error.rst @@ -13,17 +13,17 @@ Related Symbols --------------- - ``automata.core.base.base_tool.BaseTool`` -- ``automata.core.agent.tools.tool_utils.ToolCreationError`` -- ``automata.core.agent.tools.tool_utils.UnknownToolError`` -- ``automata.core.coding.py_coding.writer.PyCodeWriter.ClassOrFunctionNotFound`` -- ``automata.core.base.tool.InvalidTool`` +- ``automata.core.toolss.tool_utils.ToolCreationError`` +- ``automata.core.toolss.tool_utils.UnknownToolError`` +- ``automata.core.code_handling.py_coding.writer.PyCodeWriter.ClassOrFunctionNotFound`` +- ``automata.core.tools.tool.InvalidTool`` Usage Example ------------- .. code:: python - from automata.core.base.tool import ToolNotFoundError + from automata.core.tools.tool import ToolNotFoundError from automata.tests.unit.test_tool import TestTool def find_tool(tool_name: str): diff --git a/automata/docs/core/base/toolkit.rst b/automata/docs/core/base/toolkit.rst index 58161579..c464af0a 100644 --- a/automata/docs/core/base/toolkit.rst +++ b/automata/docs/core/base/toolkit.rst @@ -19,9 +19,9 @@ Related Symbols --------------- - ``automata.core.base.base_tool.BaseTool`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.tool.Tool`` - ``automata.tests.unit.test_tool.TestTool`` -- ``automata.core.agent.tools.tool_utils.ToolkitType`` +- ``automata.core.toolss.tool_utils.ToolkitType`` - ``automata.core.agent.agent_enums.ToolField`` Example @@ -32,7 +32,7 @@ The following is an example demonstrating how to create an instance of .. code:: python - from automata.core.base.tool import Toolkit + from automata.core.tools.tool import Toolkit from automata.tests.unit.test_tool import TestTool test_tool = TestTool( diff --git a/automata/docs/core/base/toolkit_type.rst b/automata/docs/core/base/toolkit_type.rst index 0f4c40dc..30da5577 100644 --- a/automata/docs/core/base/toolkit_type.rst +++ b/automata/docs/core/base/toolkit_type.rst @@ -22,10 +22,10 @@ The current supported ``ToolkitType`` enumeration values include: Related Symbols --------------- -- ``automata.core.base.tool.Toolkit`` +- ``automata.core.tools.tool.Toolkit`` - ``automata.tests.unit.test_tool.TestTool`` - ``automata.core.base.base_tool.BaseTool`` -- ``automata.core.agent.tools.tool_utils.UnknownToolError`` +- ``automata.core.toolss.tool_utils.UnknownToolError`` Example ------- @@ -34,7 +34,7 @@ Here is an example of using ``ToolkitType``: .. code:: python - from automata.core.base.tool import ToolkitType + from automata.core.tools.tool import ToolkitType toolkit_type = ToolkitType.PY_RETRIEVER print(toolkit_type.name) diff --git a/automata/docs/core/coding/directory.rst b/automata/docs/core/coding/directory.rst index b088d95a..c44952f9 100644 --- a/automata/docs/core/coding/directory.rst +++ b/automata/docs/core/coding/directory.rst @@ -30,8 +30,8 @@ Import Statements Related Symbols --------------- -- ``automata.core.coding.directory.File`` -- ``automata.core.coding.directory.Node`` +- ``automata.core.navigation.directory.File`` +- ``automata.core.navigation.directory.Node`` - ``automata.core.base.database.vector.JSONEmbeddingVectorDatabase`` Example @@ -42,7 +42,7 @@ instance: .. code:: python - from automata.core.coding.directory import Directory + from automata.core.navigation.directory import Directory root_directory = Directory("root") child_directory = Directory("child", parent=root_directory) diff --git a/automata/docs/core/coding/directory_manager.rst b/automata/docs/core/coding/directory_manager.rst index efe1d792..fccbdd68 100644 --- a/automata/docs/core/coding/directory_manager.rst +++ b/automata/docs/core/coding/directory_manager.rst @@ -20,9 +20,9 @@ the ``Directory``, ``File``, and ``Node`` classes. Related Symbols --------------- -- ``automata.core.coding.directory.Directory`` -- ``automata.core.coding.directory.File`` -- ``automata.core.coding.directory.Node`` +- ``automata.core.navigation.directory.Directory`` +- ``automata.core.navigation.directory.File`` +- ``automata.core.navigation.directory.Node`` - ``automata.tests.unit.test_directory_manager`` Example @@ -34,7 +34,7 @@ structure. .. code:: python - from automata.core.coding.directory import DirectoryManager + from automata.core.navigation.directory import DirectoryManager import tempfile # Create a temporary directory diff --git a/automata/docs/core/coding/file.rst b/automata/docs/core/coding/file.rst index c4c5a219..781a11cb 100644 --- a/automata/docs/core/coding/file.rst +++ b/automata/docs/core/coding/file.rst @@ -19,16 +19,16 @@ trees and interacting with file tree data structures. Related Symbols --------------- -- ``automata.core.coding.directory.Node`` +- ``automata.core.navigation.directory.Node`` - ``automata.tests.unit.test_symbol_graph.test_get_all_files`` - ``automata.tests.unit.test_database_vector.test_save`` -- ``automata.core.base.symbol.SymbolFile`` +- ``automata.core.symbol.base.SymbolFile`` - ``automata.tests.unit.test_database_vector.test_init_vector`` - ``automata.core.base.database.vector.JSONEmbeddingVectorDatabase`` - ``automata.tests.unit.test_database_vector.test_load`` -- ``automata.core.base.symbol.SymbolFile.__eq__`` +- ``automata.core.symbol.base.SymbolFile.__eq__`` - ``automata.tests.unit.sample_modules.sample.EmptyClass`` -- ``automata.core.base.symbol.SymbolReference`` +- ``automata.core.symbol.base.SymbolReference`` - ``automata.tests.unit.test_task_environment.TestURL`` Usage Example @@ -39,7 +39,7 @@ The following example demonstrates how to create an instance of the .. code:: python - from automata.core.coding.directory import File, Node + from automata.core.navigation.directory import File, Node parent_node = Node("ParentNode") file_instance = File("File1", parent_node) diff --git a/automata/docs/core/coding/node.rst b/automata/docs/core/coding/node.rst index 6d4d6c57..94de6333 100644 --- a/automata/docs/core/coding/node.rst +++ b/automata/docs/core/coding/node.rst @@ -11,8 +11,8 @@ and files respectively within the tree. Related Symbols --------------- -- ``automata.core.coding.directory.File`` -- ``automata.core.coding.directory.Directory`` +- ``automata.core.navigation.directory.File`` +- ``automata.core.navigation.directory.Directory`` Example ------- @@ -23,7 +23,7 @@ file tree hierarchy. .. code:: python - from automata.core.coding.directory import Directory, File + from automata.core.navigation.directory import Directory, File # Create the root directory root = Directory("root") diff --git a/automata/docs/core/coding/py/py_doc_writer.rst b/automata/docs/core/coding/py/py_doc_writer.rst index badb1645..ebf1f5a3 100644 --- a/automata/docs/core/coding/py/py_doc_writer.rst +++ b/automata/docs/core/coding/py/py_doc_writer.rst @@ -22,10 +22,10 @@ camel case, and generating index files and summaries for the project. Related Symbols --------------- -- ``automata.core.coding.py.reader.PyReader`` -- ``automata.core.coding.directory.DirectoryManager`` -- ``automata.core.base.symbol.Symbol`` -- ``automata.core.base.symbol_embedding.SymbolDocEmbedding`` +- ``automata.core.code_handling.py.reader.PyReader`` +- ``automata.core.navigation.directory.DirectoryManager`` +- ``automata.core.symbol.base.Symbol`` +- ``automata.core.symbol_embedding.base.SymbolDocEmbedding`` - ``type: ignore`` Example @@ -36,7 +36,7 @@ generating documentation for Python modules. .. code:: python - from automata.core.coding.py.writer import PyDocWriter + from automata.core.code_handling.py.writer import PyDocWriter base_path = "path/to/project" docs_dir = "path/to/docs" diff --git a/automata/docs/core/coding/py/py_module_loader.rst b/automata/docs/core/coding/py/py_module_loader.rst index 86028aa9..e63a25de 100644 --- a/automata/docs/core/coding/py/py_module_loader.rst +++ b/automata/docs/core/coding/py/py_module_loader.rst @@ -19,9 +19,9 @@ ensuring that there is only one instance throughout the application. Related Symbols --------------- -- ``automata.core.base.singleton.Singleton`` -- ``automata.core.coding.py.reader.PyReader`` -- ``automata.core.coding.py.writer.PyWriter`` +- ``automata.core.base.patterns.singleton.Singleton`` +- ``automata.core.code_handling.py.reader.PyReader`` +- ``automata.core.code_handling.py.writer.PyWriter`` Example ------- @@ -31,7 +31,7 @@ The following example demonstrates how to initialize and use .. code:: python - from automata.core.coding.py.module_loader import PyModuleLoader + from automata.core.singletons.module_loader import PyModuleLoader from automata.core.utils import get_root_fpath, get_root_py_fpath # Initialize PyModuleLoader diff --git a/automata/docs/core/coding/py/py_reader.rst b/automata/docs/core/coding/py/py_reader.rst index 29ed95ba..53e54964 100644 --- a/automata/docs/core/coding/py/py_reader.rst +++ b/automata/docs/core/coding/py/py_reader.rst @@ -23,8 +23,8 @@ Overview Related Symbols --------------- -- ``automata.core.coding.py.navigation.find_syntax_tree_node`` -- ``automata.core.coding.py.module_loader.PyModuleLoader.fetch_module`` +- ``automata.core.navigation.py.navigation_utils.find_syntax_tree_node`` +- ``automata.core.singletons.module_loader.PyModuleLoader.fetch_module`` Example ------- @@ -34,7 +34,7 @@ retrieve the docstring of a specified function/method. .. code:: python - from automata.core.coding.py.reader import PyReader + from automata.core.code_handling.py.reader import PyReader module_dotpath = "os.path.join" object_path = None diff --git a/automata/docs/core/coding/py/py_writer.rst b/automata/docs/core/coding/py/py_writer.rst index d6e1e6de..fcf102be 100644 --- a/automata/docs/core/coding/py/py_writer.rst +++ b/automata/docs/core/coding/py/py_writer.rst @@ -20,11 +20,11 @@ processes or modifying existing Python code in a dynamic manner. Related Symbols --------------- -- ``automata.core.coding.py.reader.PyReader`` +- ``automata.core.code_handling.py.reader.PyReader`` - ``automata.tests.unit.test_py_writer.py_writer`` -- ``automata.core.agent.tool.tool_utils.DependencyFactory.create_py_writer`` +- ``automata.core.singletons.dependency_factory.create_py_writer`` - ``automata.tests.unit.test_py_writer_tool.PyWriterOpenAIToolkit`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterToolkit`` +- ``automata.core.tools.builders.py_writer.PyWriterToolkit`` Example ------- @@ -34,8 +34,8 @@ module using ``PyWriter``. .. code:: python - from automata.core.coding.py.reader import PyReader - from automata.core.coding.py.writer import PyWriter + from automata.core.code_handling.py.reader import PyReader + from automata.core.code_handling.py.writer import PyWriter # Initialize PyWriter with a PyReader instance py_reader = PyReader() diff --git a/automata/docs/core/coding/py/writer/class_or_function_not_found.rst b/automata/docs/core/coding/py/writer/class_or_function_not_found.rst index 082b3a09..74e11a93 100644 --- a/automata/docs/core/coding/py/writer/class_or_function_not_found.rst +++ b/automata/docs/core/coding/py/writer/class_or_function_not_found.rst @@ -20,10 +20,10 @@ also has utility methods to replace newline characters in input strings. Related Symbols --------------- -- ``automata.core.coding.py.reader.PyReader`` -- ``automata.core.agent.tool.tool_utils.DependencyFactory.create_py_writer`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterToolkit`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterOpenAIToolkit`` +- ``automata.core.code_handling.py.reader.PyReader`` +- ``automata.core.singletons.dependency_factory.create_py_writer`` +- ``automata.core.tools.builders.py_writer.PyWriterToolkit`` +- ``automata.core.tools.builders.py_writer.PyWriterOpenAIToolkit`` Example ------- @@ -34,8 +34,8 @@ updating, and deleting. .. code:: python - from automata.core.coding.py.reader import PyReader - from automata.core.coding.py.writer import PyWriter + from automata.core.code_handling.py.reader import PyReader + from automata.core.code_handling.py.writer import PyWriter # Initialize PyReader and PyWriter py_reader = PyReader() diff --git a/automata/docs/core/coding/py/writer/invalid_arguments.rst b/automata/docs/core/coding/py/writer/invalid_arguments.rst index 67598bf0..fa45d94e 100644 --- a/automata/docs/core/coding/py/writer/invalid_arguments.rst +++ b/automata/docs/core/coding/py/writer/invalid_arguments.rst @@ -12,11 +12,11 @@ scenarios where code modifications need to be done programmatically. Related Symbols --------------- -- ``automata.core.coding.py.reader.PyReader`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterToolkit`` +- ``automata.core.code_handling.py.reader.PyReader`` +- ``automata.core.tools.builders.py_writer.PyWriterToolkit`` - ``automata.tests.unit.test_py_writer_tool.test_init`` -- ``automata.core.agent.tool.tool_utils.DependencyFactory.create_py_writer`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterOpenAIToolkit`` +- ``automata.core.singletons.dependency_factory.create_py_writer`` +- ``automata.core.tools.builders.py_writer.PyWriterOpenAIToolkit`` Usage Example ------------- @@ -27,8 +27,8 @@ update a Python module by providing the ``source_code`` input. .. code:: python import os - from automata.core.coding.py.reader import PyReader - from automata.core.coding.py.writer import PyWriter + from automata.core.code_handling.py.reader import PyReader + from automata.core.code_handling.py.writer import PyWriter # Initialize the PyReader and PyWriter instances py_reader = PyReader() diff --git a/automata/docs/core/coding/py/writer/module_not_found.rst b/automata/docs/core/coding/py/writer/module_not_found.rst index 4f53cef5..65763236 100644 --- a/automata/docs/core/coding/py/writer/module_not_found.rst +++ b/automata/docs/core/coding/py/writer/module_not_found.rst @@ -21,11 +21,11 @@ or performing any operation. Related Symbols --------------- -- ``automata.core.coding.py.reader.PyReader`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterToolkit`` -- ``automata.core.coding.directory.DirectoryManager`` -- ``automata.core.coding.py.module_loader.py_module_loader`` -- ``automata.core.agent.tool.tool_utils.DependencyFactory.create_py_writer`` +- ``automata.core.code_handling.py.reader.PyReader`` +- ``automata.core.tools.builders.py_writer.PyWriterToolkit`` +- ``automata.core.navigation.directory.DirectoryManager`` +- ``automata.core.singletons.module_loader.py_module_loader`` +- ``automata.core.singletons.dependency_factory.create_py_writer`` Example ------- @@ -35,8 +35,8 @@ module using ``PyWriter``. .. code:: python - from automata.core.coding.py.reader import PyReader - from automata.core.coding.py.writer import PyWriter + from automata.core.code_handling.py.reader import PyReader + from automata.core.code_handling.py.writer import PyWriter # Create a PyWriter instance using a PyReader instance py_reader = PyReader() diff --git a/automata/docs/core/coding/py_coding/dot_path_map.rst b/automata/docs/core/coding/py_coding/dot_path_map.rst index 884d71d8..736355e0 100644 --- a/automata/docs/core/coding/py_coding/dot_path_map.rst +++ b/automata/docs/core/coding/py_coding/dot_path_map.rst @@ -29,9 +29,9 @@ directory. Related Symbols --------------- -- ``automata.core.coding.py_coding.module_tree.DotPathMap`` +- ``automata.core.code_handling.py_coding.module_tree.DotPathMap`` - ``automata.core.utils.root_fpath`` -- ``automata.core.coding.py_coding.py_utils.convert_fpath_to_module_dotpath`` +- ``automata.core.code_handling.py_coding.py_utils.convert_fpath_to_module_dotpath`` Example ------- @@ -41,7 +41,7 @@ The following is an example demonstrating how to create an instance of .. code:: python - from automata.core.coding.py_coding.module_tree import DotPathMap + from automata.core.code_handling.py_coding.module_tree import DotPathMap # Initialize the DotPathMap with the absolute path to the root of the module tree root_path = "/path/to/project/root" diff --git a/automata/docs/core/coding/py_coding/lazy_module_tree_map.rst b/automata/docs/core/coding/py_coding/lazy_module_tree_map.rst index a65c6be5..2ccc0f02 100644 --- a/automata/docs/core/coding/py_coding/lazy_module_tree_map.rst +++ b/automata/docs/core/coding/py_coding/lazy_module_tree_map.rst @@ -20,8 +20,8 @@ manage modules in the map with efficiency. Related Symbols --------------- -- ``automata.core.coding.py_coding.module_tree.DotPathMap`` -- ``automata.core.coding.py_coding.py_utils`` +- ``automata.core.code_handling.py_coding.module_tree.DotPathMap`` +- ``automata.core.code_handling.py_coding.py_utils`` - ``automata.tests.unit.test_py_code_retriever.module_map`` Example @@ -32,7 +32,7 @@ instance and access a module. .. code:: python - from automata.core.coding.py_coding.module_tree import LazyModuleTreeMap + from automata.core.code_handling.py_coding.module_tree import LazyModuleTreeMap from automata.core.utils import root_fpath root_path = root_fpath() diff --git a/automata/docs/core/coding/py_coding/py_code_retriever.rst b/automata/docs/core/coding/py_coding/py_code_retriever.rst index 3aa86744..d10c8643 100644 --- a/automata/docs/core/coding/py_coding/py_code_retriever.rst +++ b/automata/docs/core/coding/py_coding/py_code_retriever.rst @@ -20,9 +20,9 @@ source code without docstring contents. Related symbols --------------- -- ``automata.core.coding.py_coding.retriever.PyCodeRetriever`` -- ``automata.core.coding.py_coding.module_tree.LazyModuleTreeMap.cached_default`` -- ``automata.core.coding.py_coding.navigation.find_syntax_tree_node`` +- ``automata.core.code_handling.py_coding.retriever.PyCodeRetriever`` +- ``automata.core.code_handling.py_coding.module_tree.LazyModuleTreeMap.cached_default`` +- ``automata.core.code_handling.py_coding.navigation.find_syntax_tree_node`` - ``redbaron.ClassNode`` - ``redbaron.DefNode`` - ``redbaron.Node`` @@ -33,12 +33,12 @@ Examples .. code:: python - from automata.core.coding.py_coding.retriever import PyCodeRetriever - from automata.core.coding.py_coding.module_tree import LazyModuleTreeMap + from automata.core.code_handling.py_coding.retriever import PyCodeRetriever + from automata.core.code_handling.py_coding.module_tree import LazyModuleTreeMap module_tree_map = LazyModuleTreeMap.cached_default() code_retriever = PyCodeRetriever(module_tree_map) - module_dotpath = 'automata.core.agent.tools.py_code_retriever.PyCodeRetrieverTool' + module_dotpath = 'automata.core.toolss.py_code_retriever.PyCodeRetrieverTool' object_path = 'PyCodeRetrieverTool.__init__' source_code = code_retriever.get_source_code(module_dotpath, object_path) diff --git a/automata/docs/core/coding/py_coding/py_code_writer.rst b/automata/docs/core/coding/py_coding/py_code_writer.rst index d2b64b51..772dd4d5 100644 --- a/automata/docs/core/coding/py_coding/py_code_writer.rst +++ b/automata/docs/core/coding/py_coding/py_code_writer.rst @@ -6,7 +6,7 @@ Abstract Syntax Tree (AST) nodes. It provides methods to create new module objects from the source code, update existing modules by inserting new code or modifying existing code, and delete classes or functions from existing modules. It leverages -```PyCodeRetriever`` `__ +```PyCodeRetriever`` `__ to fetch Python code while providing methods to perform code modifications. @@ -22,9 +22,9 @@ existing ones, or delete code from modules. Related Symbols --------------- -- ``automata.core.coding.py_coding.retriever.PyCodeRetriever`` +- ``automata.core.code_handling.py_coding.retriever.PyCodeRetriever`` - ``automata.tests.unit.test_py_writer.py_writer`` -- ``automata.core.agent.tools.py_code_writer.PyCodeWriterTool`` +- ``automata.core.toolss.py_code_writer.PyCodeWriterTool`` - ``automata.tests.unit.test_python_writer_tool.python_writer_tool_builder`` Example @@ -36,9 +36,9 @@ function from the module: .. code:: python - from automata.core.coding.directory import DirectoryManager - from automata.core.coding.py_coding.retriever import PyCodeRetriever - from automata.core.coding.py_coding.writer import PyCodeWriter + from automata.core.navigation.directory import DirectoryManager + from automata.core.code_handling.py_coding.retriever import PyCodeRetriever + from automata.core.code_handling.py_coding.writer import PyCodeWriter directory_manager = DirectoryManager("path/to/project") retriever = PyCodeRetriever(directory_manager) diff --git a/automata/docs/core/coding/py_coding/py_doc_writer.rst b/automata/docs/core/coding/py_coding/py_doc_writer.rst index 7c049b12..d52f70ef 100644 --- a/automata/docs/core/coding/py_coding/py_doc_writer.rst +++ b/automata/docs/core/coding/py_coding/py_doc_writer.rst @@ -20,12 +20,12 @@ summary. Related Symbols --------------- -- ``automata.core.coding.py_coding.writer.PyDocWriter`` +- ``automata.core.code_handling.py_coding.writer.PyDocWriter`` - ``automata.tests.unit.sample_modules.sample.OuterClass`` - ``automata.tests.unit.sample_modules.sample.OuterClass.InnerClass`` -- ``automata.core.coding.py_coding.writer.PyCodeWriter`` -- ``automata.core.coding.py_coding.retriever.PyCodeRetriever`` -- ``automata.core.base.symbol_embedding.SymbolDocEmbedding`` +- ``automata.core.code_handling.py_coding.writer.PyCodeWriter`` +- ``automata.core.code_handling.py_coding.retriever.PyCodeRetriever`` +- ``automata.core.symbol_embedding.base.SymbolDocEmbedding`` Example ------- @@ -36,9 +36,9 @@ structure: .. code:: python - from automata.core.coding.py_coding.writer import PyDocWriter - from automata.core.base.symbol import Symbol - from automata.core.base.symbol_embedding import SymbolDocEmbedding + from automata.core.code_handling.py_coding.writer import PyDocWriter + from automata.core.symbol.base import Symbol + from automata.core.symbol_embedding.base import SymbolDocEmbedding # Assuming you have the documentation info in the following variables: # - docs: a dictionary containing the {Symbol: SymbolDocEmbedding} pairs diff --git a/automata/docs/core/coding/py_coding/writer/class_or_function_not_found.rst b/automata/docs/core/coding/py_coding/writer/class_or_function_not_found.rst index 107d46e2..abf5e420 100644 --- a/automata/docs/core/coding/py_coding/writer/class_or_function_not_found.rst +++ b/automata/docs/core/coding/py_coding/writer/class_or_function_not_found.rst @@ -9,13 +9,13 @@ modules, and deleting specific objects in a module. Related Symbols --------------- -- ``automata.core.coding.directory.DirectoryManager`` -- ``automata.core.coding.py_coding.navigation.find_all_function_and_class_syntax_tree_nodes`` -- ``automata.core.coding.py_coding.retriever.PyCodeRetriever`` -- ``automata.core.base.symbol.Symbol`` -- ``automata.core.agent.tools.py_code_writer.PyCodeWriterTool`` -- ``automata.core.agent.tools.py_code_retriever.PyCodeRetrieverTool`` -- ``automata.core.coding.py_coding.writer.PyDocWriter`` +- ``automata.core.navigation.directory.DirectoryManager`` +- ``automata.core.code_handling.py_coding.navigation.find_all_function_and_class_syntax_tree_nodes`` +- ``automata.core.code_handling.py_coding.retriever.PyCodeRetriever`` +- ``automata.core.symbol.base.Symbol`` +- ``automata.core.toolss.py_code_writer.PyCodeWriterTool`` +- ``automata.core.toolss.py_code_retriever.PyCodeRetrieverTool`` +- ``automata.core.code_handling.py_coding.writer.PyDocWriter`` Example ------- @@ -25,9 +25,9 @@ using ``PyCodeWriter``. .. code:: python - from automata.core.coding.directory import DirectoryManager - from automata.core.coding.py_coding.retriever import PyCodeRetriever - from automata.core.coding.py_coding.writer import PyCodeWriter + from automata.core.navigation.directory import DirectoryManager + from automata.core.code_handling.py_coding.retriever import PyCodeRetriever + from automata.core.code_handling.py_coding.writer import PyCodeWriter # Create PyCodeWriter instance directory_manager = DirectoryManager("path/to/your/project") diff --git a/automata/docs/core/coding/py_coding/writer/invalid_arguments.rst b/automata/docs/core/coding/py_coding/writer/invalid_arguments.rst index 1dcd2552..57a8c277 100644 --- a/automata/docs/core/coding/py_coding/writer/invalid_arguments.rst +++ b/automata/docs/core/coding/py_coding/writer/invalid_arguments.rst @@ -19,10 +19,10 @@ Related Symbols --------------- - ``automata.tests.unit.test_py_writer.py_writer`` -- ``automata.core.coding.py_coding.writer.PyCodeWriter`` -- ``automata.core.agent.tools.py_code_writer.PyCodeWriterTool`` -- ``automata.core.coding.py_coding.retriever.PyCodeRetriever`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.code_handling.py_coding.writer.PyCodeWriter`` +- ``automata.core.toolss.py_code_writer.PyCodeWriterTool`` +- ``automata.core.code_handling.py_coding.retriever.PyCodeRetriever`` +- ``automata.core.symbol.base.Symbol`` Example ------- @@ -33,8 +33,8 @@ code: .. code:: python - from automata.core.coding.py_coding.retriever import PyCodeRetriever - from automata.core.coding.py_coding.writer import PyCodeWriter + from automata.core.code_handling.py_coding.retriever import PyCodeRetriever + from automata.core.code_handling.py_coding.writer import PyCodeWriter retriever = PyCodeRetriever() code_writer = PyCodeWriter(retriever) diff --git a/automata/docs/core/coding/py_coding/writer/module_not_found.rst b/automata/docs/core/coding/py_coding/writer/module_not_found.rst index 27509b2e..87776fb9 100644 --- a/automata/docs/core/coding/py_coding/writer/module_not_found.rst +++ b/automata/docs/core/coding/py_coding/writer/module_not_found.rst @@ -11,11 +11,11 @@ manipulate a set of Python modules within a given project directory. Related Symbols --------------- -- ``automata.core.coding.py_coding.writer.PyCodeWriter.ModuleNotFound`` -- ``automata.core.coding.py_coding.retriever.PyCodeRetriever`` -- ``automata.core.coding.directory.DirectoryManager`` -- ``automata.core.agent.tools.py_code_writer.PyCodeWriterTool`` -- ``automata.core.agent.tools.py_code_retriever.PyCodeRetrieverTool`` +- ``automata.core.code_handling.py_coding.writer.PyCodeWriter.ModuleNotFound`` +- ``automata.core.code_handling.py_coding.retriever.PyCodeRetriever`` +- ``automata.core.navigation.directory.DirectoryManager`` +- ``automata.core.toolss.py_code_writer.PyCodeWriterTool`` +- ``automata.core.toolss.py_code_retriever.PyCodeRetrieverTool`` - ``automata.tests.unit.test_py_writer.py_writer`` Example @@ -26,8 +26,8 @@ with ``PyCodeWriter``: .. code:: python - from automata.core.coding.py_coding.retriever import PyCodeRetriever - from automata.core.coding.py_coding.writer import PyCodeWriter + from automata.core.code_handling.py_coding.retriever import PyCodeRetriever + from automata.core.code_handling.py_coding.writer import PyCodeWriter sample_dir = "path/to/sample_directory" module_map = LazyModuleTreeMap(sample_dir) diff --git a/automata/docs/core/context/py/py_context_retriever.rst b/automata/docs/core/context/py/py_context_retriever.rst index d189de22..d6b040ee 100644 --- a/automata/docs/core/context/py/py_context_retriever.rst +++ b/automata/docs/core/context/py/py_context_retriever.rst @@ -30,7 +30,7 @@ Related Symbols - ``automata.core.base.database.vector.VectorDatabaseProvider`` - ``automata.core.symbol.graph.SymbolGraph`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.core.symbol.symbol_utils.convert_to_fst_object`` - ``automata.core.symbol.symbol_utils.get_rankable_symbols`` @@ -43,8 +43,8 @@ retrieve the context of a symbol from a given Python project: .. code:: python from automata.core.symbol.graph import SymbolGraph - from automata.core.context.py.retriever import PyContextRetriever, PyContextRetrieverConfig - from automata.core.base.symbol import Symbol + from automata.core.retrievers.py.context import PyContextRetriever, PyContextRetrieverConfig + from automata.core.symbol.base import Symbol # Load a SymbolGraph for the Python project symbol_graph = SymbolGraph(index_path="path/to/index_proto") diff --git a/automata/docs/core/context/py/py_context_retriever_config.rst b/automata/docs/core/context/py/py_context_retriever_config.rst index d6081973..22c53968 100644 --- a/automata/docs/core/context/py/py_context_retriever_config.rst +++ b/automata/docs/core/context/py/py_context_retriever_config.rst @@ -20,12 +20,12 @@ offers an easy way to adjust the configuration of any Related Symbols --------------- -- ``automata.core.context.py.retriever.PyContextRetriever`` +- ``automata.core.retrievers.py.context.PyContextRetriever`` - ``automata.tests.unit.test_py_reader_tool.python_retriever_tool_builder`` - ``automata.tests.unit.test_py_writer.py_writer`` -- ``automata.core.agent.tool.tool_utils.DependencyFactory.create_py_context_retriever`` +- ``automata.core.singletons.dependency_factory.create_py_context_retriever`` - ``automata.tests.unit.test_py_reader.getter`` -- ``automata.core.coding.py.reader.PyReader`` +- ``automata.core.code_handling.py.reader.PyReader`` - ``automata.tests.unit.test_py_reader_tool.test_init`` - ``automata.tests.unit.test_py_reader_tool.test_tool_execution`` - ``automata.core.agent.instances.AutomataOpenAIAgentInstance.Config`` @@ -39,7 +39,7 @@ The following example demonstrates how to create an instance of .. code:: python - from automata.core.context.py.retriever import PyContextRetrieverConfig + from automata.core.retrievers.py.context import PyContextRetrieverConfig config = PyContextRetrieverConfig( spacer="\t", diff --git a/automata/docs/core/context/py_context/py_context_retriever.rst b/automata/docs/core/context/py_context/py_context_retriever.rst index f0804d2a..b14a1e64 100644 --- a/automata/docs/core/context/py_context/py_context_retriever.rst +++ b/automata/docs/core/context/py_context/py_context_retriever.rst @@ -18,10 +18,10 @@ Import Statements from contextlib import contextmanager from typing import List, Optional, Set from redbaron import RedBaron - from automata.core.coding.py_coding.retriever import PyCodeRetriever + from automata.core.code_handling.py_coding.retriever import PyCodeRetriever from automata.core.database.vector import VectorDatabaseProvider from automata.core.symbol.graph import SymbolGraph - from automata.core.base.symbol import Symbol + from automata.core.symbol.base import Symbol from automata.core.symbol.symbol_utils import ( convert_to_fst_object, get_rankable_symbols, @@ -40,10 +40,10 @@ a project. Related Symbols --------------- -- ``automata.core.coding.py_coding.retriever.PyCodeRetriever`` +- ``automata.core.code_handling.py_coding.retriever.PyCodeRetriever`` - ``automata.core.database.vector.VectorDatabaseProvider`` - ``automata.core.symbol.graph.SymbolGraph`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.core.symbol.symbol_utils`` - ``automata.core.utils.root_py_fpath`` @@ -57,7 +57,7 @@ demonstrates its basic functionality. from automata.core.context.py_context.retriever import PyContextRetriever from automata.core.symbol.graph import SymbolGraph - from automata.core.base.symbol import Symbol + from automata.core.symbol.base import Symbol graph = SymbolGraph() symbol = Symbol.from_string("some_string_representation_of_symbol") diff --git a/automata/docs/core/context/py_context/py_context_retriever_config.rst b/automata/docs/core/context/py_context/py_context_retriever_config.rst index fbec5c3f..da8fa85a 100644 --- a/automata/docs/core/context/py_context/py_context_retriever_config.rst +++ b/automata/docs/core/context/py_context/py_context_retriever_config.rst @@ -22,8 +22,8 @@ Related Symbols --------------- - ``automata.core.context.py_context.retriever.PyContextRetriever`` -- ``automata.core.agent.tools.tool_utils.DependencyFactory.create_py_context_retriever`` -- ``automata.core.coding.py_coding.retriever.PyCodeRetriever`` +- ``automata.core.toolss.tool_utils.DependencyFactory.create_py_context_retriever`` +- ``automata.core.code_handling.py_coding.retriever.PyCodeRetriever`` Example ------- diff --git a/automata/docs/core/database/json_vector_database.rst b/automata/docs/core/database/json_vector_database.rst index 0d741da3..642c84c2 100644 --- a/automata/docs/core/database/json_vector_database.rst +++ b/automata/docs/core/database/json_vector_database.rst @@ -15,7 +15,7 @@ Related Symbols - ``VectorDatabaseProvider`` - ``Symbol`` - ``SymbolEmbedding`` -- ``automata.core.base.symbol_embedding.SymbolEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolEmbedding`` Example ------- @@ -27,7 +27,7 @@ file. .. code:: python from automata.core.database.vector import JSONEmbeddingVectorDatabase - from automata.core.base.symbol import Symbol, SymbolEmbedding + from automata.core.symbol.base import Symbol, SymbolEmbedding # Create an instance of JSONEmbeddingVectorDatabase with a JSON file path file_path = "path/to/json_file.json" diff --git a/automata/docs/core/database/symbol_database_provider.rst b/automata/docs/core/database/symbol_database_provider.rst index 0cdb215b..64cd7431 100644 --- a/automata/docs/core/database/symbol_database_provider.rst +++ b/automata/docs/core/database/symbol_database_provider.rst @@ -12,7 +12,7 @@ Related Symbols --------------- - ``automata.tests.unit.test_symbol_search_tool.test_retrieve_source_code_by_symbol`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.tests.unit.test_symbol_search_tool.test_symbol_references`` - ``automata.tests.unit.test_symbol_embedding.test_get_embedding`` - ``automata.core.memory_store.symbol_code_embedding.SymbolCodeEmbeddingHandler`` @@ -21,7 +21,7 @@ Related Symbols - ``automata.tests.unit.test_symbol_search.test_process_queries`` - ``automata.core.database.vector.VectorDatabaseProvider`` - ``automata.tests.unit.test_database_vector.test_lookup_symbol`` -- ``automata.core.base.symbol_embedding.SymbolEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolEmbedding`` Example ------- @@ -34,7 +34,7 @@ implementing the required methods: import abc from typing import Any - from automata.core.base.symbol import Symbol, SymbolEmbedding + from automata.core.symbol.base import Symbol, SymbolEmbedding from automata.core.database.provider import SymbolDatabaseProvider class CustomSymbolDatabaseProvider(SymbolDatabaseProvider): diff --git a/automata/docs/core/database/vector_database_provider.rst b/automata/docs/core/database/vector_database_provider.rst index b6fa5123..a2866d7e 100644 --- a/automata/docs/core/database/vector_database_provider.rst +++ b/automata/docs/core/database/vector_database_provider.rst @@ -21,8 +21,8 @@ Related Symbols - ``automata.core.database.provider.SymbolDatabaseProvider`` - ``automata.core.database.vector.JSONEmbeddingVectorDatabase`` -- ``automata.core.base.symbol.Symbol`` -- ``automata.core.base.symbol_embedding.SymbolEmbedding`` +- ``automata.core.symbol.base.Symbol`` +- ``automata.core.symbol_embedding.base.SymbolEmbedding`` - ``automata.core.memory_store.embedding_types.SymbolEmbeddingHandler`` - ``automata.core.memory_store.symbol_code_embedding.SymbolCodeEmbeddingHandler`` @@ -37,7 +37,7 @@ base class. from automata.core.database.vector import VectorDatabaseProvider from typing import Dict, List - from automata.core.base.symbol import Symbol, SymbolEmbedding + from automata.core.symbol.base import Symbol, SymbolEmbedding class CustomVectorDatabaseProvider(VectorDatabaseProvider): def calculate_similarity(self, embedding: SymbolEmbedding) -> Dict[Symbol, float]: diff --git a/automata/docs/core/embedding/embedding_similarity.rst b/automata/docs/core/embedding/embedding_similarity.rst index 878c5266..c1019625 100644 --- a/automata/docs/core/embedding/embedding_similarity.rst +++ b/automata/docs/core/embedding/embedding_similarity.rst @@ -18,7 +18,7 @@ Related Symbols - ``automata.tests.unit.test_symbol_embedding.test_update_embeddings`` - ``automata.core.database.vector.JSONEmbeddingVectorDatabase.calculate_similarity`` - ``automata.tests.unit.test_symbol_embedding.test_add_new_embedding`` -- ``automata.core.base.symbol_embedding.SymbolEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolEmbedding`` Example ------- diff --git a/automata/docs/core/embedding/norm_type.rst b/automata/docs/core/embedding/norm_type.rst index 89c8c484..a97d8004 100644 --- a/automata/docs/core/embedding/norm_type.rst +++ b/automata/docs/core/embedding/norm_type.rst @@ -31,7 +31,7 @@ Here’s an example demonstrating how to create an instance of from automata.core.symbol_embedding.similarity import SymbolSimilarity from automata.core.memory_store.embedding_types import NormType - from automata.core.base.symbol import SymbolEmbeddingHandler + from automata.core.symbol.base import SymbolEmbeddingHandler symbol_embedding_manager = SymbolEmbeddingHandler() norm_type = NormType.L1 diff --git a/automata/docs/core/embedding/open_ai_embedding.rst b/automata/docs/core/embedding/open_ai_embedding.rst index 14f64d88..e56d663b 100644 --- a/automata/docs/core/embedding/open_ai_embedding.rst +++ b/automata/docs/core/embedding/open_ai_embedding.rst @@ -10,7 +10,7 @@ numpy array representing the symbol’s embedding. This class is closely related to ``automata.tests.conftest.mock_embedding``, ``automata.tests.unit.test_symbol_embedding.test_get_embedding``, and -``automata.core.base.symbol_embedding.SymbolEmbedding``. +``automata.core.symbol_embedding.base.SymbolEmbedding``. Overview -------- @@ -25,7 +25,7 @@ Related Symbols - ``automata.tests.conftest.mock_embedding`` - ``automata.tests.unit.test_symbol_embedding.test_get_embedding`` -- ``automata.core.base.symbol_embedding.SymbolEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolEmbedding`` - ``automata.core.memory_store.embedding_types.EmbeddingProvider`` Usage Example diff --git a/automata/docs/core/embedding/symbol_code_embedding_builder.rst b/automata/docs/core/embedding/symbol_code_embedding_builder.rst index 59736af3..a302970b 100644 --- a/automata/docs/core/embedding/symbol_code_embedding_builder.rst +++ b/automata/docs/core/embedding/symbol_code_embedding_builder.rst @@ -21,7 +21,7 @@ Related Symbols - ``automata.tests.unit.test_symbol_embedding.test_get_embedding`` - ``automata.tests.unit.test_database_vector.test_add_symbols`` -- ``automata.core.base.symbol_embedding.SymbolCodeEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolCodeEmbedding`` - ``automata.core.memory_store.symbol_doc_embedding.SymbolDocEmbeddingBuilder`` - ``automata.core.llm.core.SymbolEmbeddingBuilder`` - ``automata.core.memory_store.symbol_doc_embedding.SymbolDocEmbeddingHandler`` @@ -36,7 +36,7 @@ Below is an example demonstrating the use of the from automata.core.base.database.vector import VectorDatabaseProvider from automata.core.llm.core import EmbeddingProvider, SymbolCodeEmbeddingBuilder - from automata.core.base.symbol import Symbol, SymbolCodeEmbedding + from automata.core.symbol.base import Symbol, SymbolCodeEmbedding # create an instance of an embedding provider. embed_provider = EmbeddingProvider() diff --git a/automata/docs/core/embedding/symbol_code_embedding_handler.rst b/automata/docs/core/embedding/symbol_code_embedding_handler.rst index 956b1de6..415b938c 100644 --- a/automata/docs/core/embedding/symbol_code_embedding_handler.rst +++ b/automata/docs/core/embedding/symbol_code_embedding_handler.rst @@ -25,8 +25,8 @@ Related Symbols - ``automata.core.base.database.vector.VectorDatabaseProvider`` - ``automata.core.llm.core.EmbeddingProvider`` -- ``automata.core.base.symbol.Symbol`` -- ``automata.core.base.symbol_embedding.SymbolCodeEmbedding`` +- ``automata.core.symbol.base.Symbol`` +- ``automata.core.symbol_embedding.base.SymbolCodeEmbedding`` - ``automata.core.symbol.symbol_utils.convert_to_fst_object`` Example @@ -39,7 +39,7 @@ The following example demonstrates how to create an instance of from automata.core.base.database.vector import VectorDatabaseProvider from automata.core.llm.core import EmbeddingProvider, SymbolCodeEmbeddingHandler - from automata.core.base.symbol import Symbol + from automata.core.symbol.base import Symbol # Mocked objects for demonstration purposes mock_embedding_db = VectorDatabaseProvider() diff --git a/automata/docs/core/embedding/symbol_doc_embedding_builder.rst b/automata/docs/core/embedding/symbol_doc_embedding_builder.rst index 3c9db3ba..6d9c148a 100644 --- a/automata/docs/core/embedding/symbol_doc_embedding_builder.rst +++ b/automata/docs/core/embedding/symbol_doc_embedding_builder.rst @@ -16,16 +16,16 @@ Import Statements from jinja2 import Template from automata.config.prompt.doc_generation import DEFAULT_DOC_GENERATION_PROMPT from automata.core.base.database.vector import VectorDatabaseProvider - from automata.core.context.py.retriever import PyContextRetriever + from automata.core.retrievers.py.context import PyContextRetriever from automata.core.llm.foundation import LLMChatCompletionProvider from automata.core.llm.core import ( EmbeddingProvider, SymbolEmbeddingBuilder, SymbolEmbeddingHandler, ) - from automata.core.base.symbol import Symbol - from automata.core.base.symbol_embedding import SymbolDocEmbedding - from automata.core.symbol.search.symbol_search import SymbolSearch + from automata.core.symbol.base import Symbol + from automata.core.symbol_embedding.base import SymbolDocEmbedding + from automata.core.experimental.search.symbol_search import SymbolSearch Example ------- @@ -38,9 +38,9 @@ Here we will walk through an example of how to use the from automata.core.memory_store.symbol_doc_embedding import SymbolDocEmbeddingBuilder from automata.core.llm.core import EmbeddingProvider from automata.core.llm.foundation import LLMChatCompletionProvider - from automata.core.context.py.retriever import PyContextRetriever - from automata.core.symbol.search.symbol_search import SymbolSearch - from automata.core.base.symbol import Symbol + from automata.core.retrievers.py.context import PyContextRetriever + from automata.core.experimental.search.symbol_search import SymbolSearch + from automata.core.symbol.base import Symbol # create instances of the dependent classes embedding_provider = EmbeddingProvider() diff --git a/automata/docs/core/embedding/symbol_doc_embedding_handler.rst b/automata/docs/core/embedding/symbol_doc_embedding_handler.rst index d166d189..63327eba 100644 --- a/automata/docs/core/embedding/symbol_doc_embedding_handler.rst +++ b/automata/docs/core/embedding/symbol_doc_embedding_handler.rst @@ -32,8 +32,8 @@ Related Symbols - ``automata.core.base.database.vector.VectorDatabaseProvider`` - ``automata.core.llm.core.EmbeddingProvider`` - ``automata.core.llm.core.SymbolEmbeddingHandler`` -- ``automata.core.base.symbol.Symbol`` -- ``automata.core.base.symbol_embedding.SymbolDocEmbedding`` +- ``automata.core.symbol.base.Symbol`` +- ``automata.core.symbol_embedding.base.SymbolDocEmbedding`` Example ------- @@ -46,8 +46,8 @@ embeddings. from automata.core.memory_store.symbol_doc_embedding import SymbolDocEmbeddingHandler from automata.core.llm.foundation import LLMChatCompletionProvider - from automata.core.symbol.search.symbol_search import SymbolSearch - from automata.core.context.py.retriever import PyContextRetriever + from automata.core.experimental.search.symbol_search import SymbolSearch + from automata.core.retrievers.py.context import PyContextRetriever symbol = ... embedding_db = ... diff --git a/automata/docs/core/embedding/symbol_embedding_handler.rst b/automata/docs/core/embedding/symbol_embedding_handler.rst index 2561c00d..fdb5ce78 100644 --- a/automata/docs/core/embedding/symbol_embedding_handler.rst +++ b/automata/docs/core/embedding/symbol_embedding_handler.rst @@ -21,7 +21,7 @@ Related Symbols - ``automata.core.memory_store.symbol_code_embedding.SymbolCodeEmbeddingHandler`` - ``automata.core.memory_store.symbol_doc_embedding.SymbolDocEmbeddingHandler`` - ``automata.core.database.vector.VectorDatabaseProvider`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` Example ------- @@ -34,7 +34,7 @@ The following code snippet demonstrates the usage of from automata.core.database.vector import JSONEmbeddingVectorDatabase from automata.core.memory_store.embedding_types import EmbeddingProvider from automata.core.memory_store.symbol_code_embedding import SymbolCodeEmbeddingHandler - from automata.core.base.symbol import Symbol + from automata.core.symbol.base import Symbol # Define the embedding database and embedding provider embedding_db = JSONEmbeddingVectorDatabase(database_filepath) diff --git a/automata/docs/core/embedding/symbol_similarity.rst b/automata/docs/core/embedding/symbol_similarity.rst index a33741f2..6750b35d 100644 --- a/automata/docs/core/embedding/symbol_similarity.rst +++ b/automata/docs/core/embedding/symbol_similarity.rst @@ -26,7 +26,7 @@ Related Symbols - ``automata.core.llm.core.SymbolEmbeddingHandler`` - ``automata.core.llm.core.EmbeddingProvider`` - ``automata.core.llm.core.EmbeddingNormType`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` Example ------- @@ -44,7 +44,7 @@ given query text. EmbeddingNormType, SymbolSimilarity, ) - from automata.core.base.symbol import Symbol + from automata.core.symbol.base import Symbol # Create a mock SymbolEmbeddingHandler and EmbeddingProvider symbol_embedding_handler = SymbolEmbeddingHandler(...) diff --git a/automata/docs/core/embedding/symbol_similarity_calculator.rst b/automata/docs/core/embedding/symbol_similarity_calculator.rst index 9e3fae7c..66bf4c2f 100644 --- a/automata/docs/core/embedding/symbol_similarity_calculator.rst +++ b/automata/docs/core/embedding/symbol_similarity_calculator.rst @@ -21,12 +21,12 @@ Related Symbols - ``automata.tests.unit.test_context_oracle_tool.test_context_generator`` - ``automata.tests.unit.test_symbol_similarity.test_get_nearest_symbols_for_query`` -- ``automata.core.agent.tool.tool_utils.DependencyFactory.create_symbol_code_similarity`` +- ``automata.core.singletons.dependency_factory.create_symbol_code_similarity`` - ``automata.tests.unit.test_symbol_search_tool.test_symbol_rank_search`` - ``automata.tests.unit.test_symbol_search_tool.test_exact_search`` -- ``automata.core.agent.tool.tool_utils.DependencyFactory.create_symbol_doc_similarity`` +- ``automata.core.singletons.dependency_factory.create_symbol_doc_similarity`` - ``automata.tests.unit.test_symbol_search_tool.test_retrieve_source_code_by_symbol`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.tests.conftest.symbol_search`` - ``automata.core.llm.core.EmbeddingSimilarityCalculator`` @@ -42,7 +42,7 @@ Usage Example ) from typing import Dict, List, Optional, Set from ann_embed.synthetic_provider import SyntheticProvider - from automata.core.base.symbol import Symbol + from automata.core.symbol.base import Symbol from numpy import random from automata.core.symbol_embedding.similarity import SymbolSimilarityCalculator diff --git a/automata/docs/core/llm/embedding_norm_type.rst b/automata/docs/core/llm/embedding_norm_type.rst index 7329698b..1b3716c4 100644 --- a/automata/docs/core/llm/embedding_norm_type.rst +++ b/automata/docs/core/llm/embedding_norm_type.rst @@ -13,9 +13,9 @@ Related Symbols - ``automata.tests.unit.test_symbol_embedding.test_add_new_embedding`` - ``automata.core.symbol_embedding.similarity.SymbolSimilarity`` - ``automata.tests.conftest.mock_embedding`` -- ``automata.core.base.symbol_embedding.SymbolEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolEmbedding`` - ``automata.tests.unit.test_symbol_similarity.test_get_nearest_symbols_for_query`` -- ``automata.core.base.symbol_embedding.SymbolCodeEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolCodeEmbedding`` - ``automata.tests.unit.test_symbol_embedding.test_update_embedding`` Example @@ -26,7 +26,7 @@ The following example demonstrates how to use ``EmbeddingNormType`` with .. code:: python - from automata.core.base.symbol import SymbolEmbedding + from automata.core.symbol.base import SymbolEmbedding from automata.core.symbol_embedding.similarity import SymbolSimilarity # Create an instance of SymbolSimilarity class with L2 normalization diff --git a/automata/docs/core/llm/embedding_similarity.rst b/automata/docs/core/llm/embedding_similarity.rst index 2ec525d7..ce5807c7 100644 --- a/automata/docs/core/llm/embedding_similarity.rst +++ b/automata/docs/core/llm/embedding_similarity.rst @@ -12,7 +12,7 @@ Related Symbols --------------- - ``automata.core.base.database.vector.VectorDatabaseProvider`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.core.symbol_embedding.similarity.SymbolSimilarity`` - ``automata.tests.unit.test_symbol_similarity.test_get_nearest_symbols_for_query`` diff --git a/automata/docs/core/llm/embedding_similarity_calculator.rst b/automata/docs/core/llm/embedding_similarity_calculator.rst index 200a9034..66eab2e2 100644 --- a/automata/docs/core/llm/embedding_similarity_calculator.rst +++ b/automata/docs/core/llm/embedding_similarity_calculator.rst @@ -19,10 +19,10 @@ and the symbols. Related Symbols --------------- -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.tests.unit.test_symbol_similarity.test_get_nearest_symbols_for_query`` - ``automata.core.symbol_embedding.similarity.SymbolSimilarityCalculator`` -- ``automata.core.agent.tool.tool_utils.DependencyFactory.create_symbol_code_similarity`` +- ``automata.core.singletons.dependency_factory.create_symbol_code_similarity`` Example ------- @@ -34,7 +34,7 @@ EmbeddingSimilarityCalculator - from automata.core.llm.core import EmbeddingSimilarityCalculator from typing import Dict - from automata.core.base.symbol import Symbol + from automata.core.symbol.base import Symbol class MyEmbeddingSimilarityCalculator(EmbeddingSimilarityCalculator): def calculate_query_similarity_dict(self, query_text: str) -> Dict[Symbol, float]: diff --git a/automata/docs/core/llm/llm_conversation.rst b/automata/docs/core/llm/llm_conversation.rst index e3c38c89..2248e45f 100644 --- a/automata/docs/core/llm/llm_conversation.rst +++ b/automata/docs/core/llm/llm_conversation.rst @@ -23,7 +23,7 @@ Related Symbols - ``automata.core.llm.providers.openai.OpenAIConversation`` - ``automata.core.llm.foundation.LLMChatCompletionProvider`` - ``automata.core.llm.providers.openai.OpenAIChatMessage`` -- ``automata.core.base.observer.Observer`` +- ``automata.core.base.patterns.observer.Observer`` - ``automata.core.base.database.relational.SQLDatabase`` Example diff --git a/automata/docs/core/llm/providers/function_call.rst b/automata/docs/core/llm/providers/function_call.rst index fe53f8ef..8d0d4161 100644 --- a/automata/docs/core/llm/providers/function_call.rst +++ b/automata/docs/core/llm/providers/function_call.rst @@ -13,11 +13,11 @@ Related Symbols - ``automata.tests.unit.sample_modules.sample.Person`` - ``automata.tests.unit.sample_modules.sample.EmptyClass`` -- ``automata.core.base.task.ITaskExecution.execute`` +- ``automata.core.tasks.base.ITaskExecution.execute`` - ``automata.tests.unit.sample_modules.sample.Person.run`` - ``automata.core.llm.providers.openai.OpenAIChatMessage.__init__`` - ``automata.tests.unit.sample_modules.sample.sample_function`` -- ``automata.core.base.task.TaskStatus`` +- ``automata.core.tasks.base.TaskStatus`` - ``automata.tests.unit.test_task_environment.test_commit_task`` - ``automata.core.llm.foundation.LLMChatCompletionProvider.__init__`` - ``automata.tests.unit.sample_modules.sample.f`` diff --git a/automata/docs/core/llm/providers/open_ai_agent.rst b/automata/docs/core/llm/providers/open_ai_agent.rst index 824b4b6e..05aa4ee8 100644 --- a/automata/docs/core/llm/providers/open_ai_agent.rst +++ b/automata/docs/core/llm/providers/open_ai_agent.rst @@ -13,7 +13,7 @@ Import Statements .. code:: python import openai - from automata.core.base.agent import Agent + from automata.core.agent.agent import Agent from automata.core.llm.foundation import ( LLMChatCompletionProvider, LLMChatMessage, @@ -61,7 +61,7 @@ task. .. code:: python - from automata.core.base.agent import Agent + from automata.core.agent.agent import Agent from automata.core.llm.foundation import ( LLMChatCompletionProvider, LLMChatMessage, diff --git a/automata/docs/core/llm/providers/open_ai_agent_tool_builder.rst b/automata/docs/core/llm/providers/open_ai_agent_tool_builder.rst index ba9da284..c948280d 100644 --- a/automata/docs/core/llm/providers/open_ai_agent_tool_builder.rst +++ b/automata/docs/core/llm/providers/open_ai_agent_tool_builder.rst @@ -18,12 +18,12 @@ of ``OpenAITool`` instances, which are specialized versions of the Related Symbols --------------- -- ``automata.core.base.agent.AgentToolkit`` +- ``automata.core.agent.agent.AgentToolkit`` - ``automata.core.llm.providers.openai.OpenAITool`` -- ``automata.core.agent.tool.builder.context_oracle.ContextOracleOpenAIToolkit`` -- ``automata.core.agent.tool.builder.symbol_search.SymbolSearchOpenAIToolkit`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterOpenAIToolkit`` -- ``automata.core.agent.tool.builder.py_reader.PyReaderOpenAIToolkit`` +- ``automata.core.tools.builders.context_oracle.ContextOracleOpenAIToolkit`` +- ``automata.core.tools.builders.symbol_search.SymbolSearchOpenAIToolkit`` +- ``automata.core.tools.builders.py_writer.PyWriterOpenAIToolkit`` +- ``automata.core.tools.builders.py_reader.PyReaderOpenAIToolkit`` Example ------- diff --git a/automata/docs/core/llm/providers/open_ai_conversation.rst b/automata/docs/core/llm/providers/open_ai_conversation.rst index eb2dee6b..5747b226 100644 --- a/automata/docs/core/llm/providers/open_ai_conversation.rst +++ b/automata/docs/core/llm/providers/open_ai_conversation.rst @@ -24,7 +24,7 @@ Related Symbols - ``automata.core.llm.providers.openai.OpenAIChatCompletionProvider`` - ``automata.core.llm.foundation.LLMConversation`` -- ``automata.core.base.observer.Observer`` +- ``automata.core.base.patterns.observer.Observer`` - ``automata.core.llm.providers.openai.OpenAIChatMessage`` Example diff --git a/automata/docs/core/llm/providers/open_ai_tool.rst b/automata/docs/core/llm/providers/open_ai_tool.rst index 6f009c23..9ac6af72 100644 --- a/automata/docs/core/llm/providers/open_ai_tool.rst +++ b/automata/docs/core/llm/providers/open_ai_tool.rst @@ -23,10 +23,10 @@ returns the output of the ``function``. Related Symbols --------------- -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.tool.Tool`` - ``automata.core.llm.providers.openai.OpenAIFunction`` -- ``automata.core.agent.tool.builder.context_oracle.ContextOracleOpenAIToolkit`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterOpenAIToolkit`` +- ``automata.core.tools.builders.context_oracle.ContextOracleOpenAIToolkit`` +- ``automata.core.tools.builders.py_writer.PyWriterOpenAIToolkit`` Example ------- @@ -36,7 +36,7 @@ The following is an example demonstrating how to create an instance of .. code:: python - from automata.core.base.tool import OpenAITool + from automata.core.tools.tool import OpenAITool def example_function(tool_input): return f"Example tool response: {tool_input['input_text']}" diff --git a/automata/docs/core/llm/symbol_embedding_builder.rst b/automata/docs/core/llm/symbol_embedding_builder.rst index 081e2511..0b28a931 100644 --- a/automata/docs/core/llm/symbol_embedding_builder.rst +++ b/automata/docs/core/llm/symbol_embedding_builder.rst @@ -30,7 +30,7 @@ Related Symbols - ``automata.core.memory_store.symbol_doc_embedding.SymbolDocEmbeddingBuilder`` - ``automata.tests.unit.test_symbol_embedding.test_update_embedding`` - ``automata.tests.unit.test_symbol_embedding.test_update_embeddings`` -- ``automata.core.base.symbol_embedding.SymbolCodeEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolCodeEmbedding`` - ``automata.tests.unit.test_symbol_search_tool.symbol_search_tool_builder`` - ``automata.core.memory_store.symbol_code_embedding.SymbolCodeEmbeddingBuilder.build`` diff --git a/automata/docs/core/llm/symbol_embedding_handler.rst b/automata/docs/core/llm/symbol_embedding_handler.rst index 2e048dd5..78dbc122 100644 --- a/automata/docs/core/llm/symbol_embedding_handler.rst +++ b/automata/docs/core/llm/symbol_embedding_handler.rst @@ -23,7 +23,7 @@ Related Symbols - ``automata.core.memory_store.symbol_code_embedding.SymbolCodeEmbeddingHandler`` - ``automata.core.memory_store.symbol_doc_embedding.SymbolDocEmbeddingHandler`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.core.base.database.vector.VectorDatabaseProvider`` Example @@ -36,7 +36,7 @@ specific symbol. .. code:: python from automata.core.memory_store.symbol_code_embedding import SymbolCodeEmbeddingHandler - from automata.core.base.symbol import Symbol + from automata.core.symbol.base import Symbol from automata.core.base.database.vector import JSONEmbeddingVectorDatabase from automata.core.memory_store.embedding_provider import EmbeddingProvider @@ -50,7 +50,7 @@ specific symbol. ) # Sample symbol - symbol = Symbol.from_string("scip-python python automata .../`automata.core.base.tool`/ToolNotFoundError#__init__().") + symbol = Symbol.from_string("scip-python python automata .../`automata.core.tools.tool`/ToolNotFoundError#__init__().") # Get the embedding for the symbol symbol_embedding = code_embedding_handler.get_embedding(symbol) diff --git a/automata/docs/core/root_dict.rst b/automata/docs/core/root_dict.rst index fb2fd96d..1b28b537 100644 --- a/automata/docs/core/root_dict.rst +++ b/automata/docs/core/root_dict.rst @@ -11,13 +11,13 @@ Related Symbols --------------- - ``automata.tests.unit.sample_modules.sample.EmptyClass`` -- ``automata.tests.conftest.MockRepositoryManager`` +- ``automata.tests.conftest.MockRepositoryClient`` - ``automata.core.utils.LoggingConfig`` - ``automata.tests.unit.test_directory_manager.test_load_directory_structure`` - ``automata.core.utils.HandlerDict`` -- ``automata.core.coding.py.module_loader.PyModuleLoader`` +- ``automata.core.singletons.module_loader.PyModuleLoader`` - ``automata.tests.unit.test_task_environment.TestURL`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` Example ------- diff --git a/automata/docs/core/symbol/base/py_kind.rst b/automata/docs/core/symbol/base/py_kind.rst index 6fd2142f..1cd61c2f 100644 --- a/automata/docs/core/symbol/base/py_kind.rst +++ b/automata/docs/core/symbol/base/py_kind.rst @@ -13,7 +13,7 @@ Overview -------- ``SymbolDescriptor`` is primarily used in the context of -``automata.core.base.symbol.Symbol``, a class that represents a +``automata.core.symbol.base.Symbol``, a class that represents a standardized string representation for various programming elements such as packages, classes, methods, and more. By utilizing ``SymbolDescriptor``, it is possible to parse and store specific @@ -23,10 +23,10 @@ retrieval, or reference. Related Symbols --------------- -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.core.symbol.parser._SymbolParser`` -- ``automata.core.base.symbol.SymbolDescriptor.PyKind`` -- ``automata.core.base.scip_pb2.Descriptor`` +- ``automata.core.symbol.base.SymbolDescriptor.PyKind`` +- ``automata.core.symbol.scip_pb2.Descriptor`` Examples -------- @@ -35,8 +35,8 @@ Below are some examples using the ``SymbolDescriptor`` class: .. code:: python - from automata.core.base.symbol import SymbolDescriptor - from automata.core.base.scip_pb2 import Descriptor as DescriptorProto + from automata.core.symbol.base import SymbolDescriptor + from automata.core.symbol.scip_pb2 import Descriptor as DescriptorProto # Create a SymbolDescriptor object for a Python method descriptor = SymbolDescriptor( diff --git a/automata/docs/core/symbol/graph/sub_graph.rst b/automata/docs/core/symbol/graph/sub_graph.rst index f390cc6c..ac8d92aa 100644 --- a/automata/docs/core/symbol/graph/sub_graph.rst +++ b/automata/docs/core/symbol/graph/sub_graph.rst @@ -19,8 +19,8 @@ Related Symbols --------------- - ``automata.core.symbol.graph.SymbolGraph`` -- ``automata.core.base.symbol.Symbol`` -- ``automata.core.base.scip_pb2.Index`` +- ``automata.core.symbol.base.Symbol`` +- ``automata.core.symbol.scip_pb2.Index`` - ``automata.core.symbol.symbol_utils.get_rankable_symbols`` - ``automata.tests.unit.test_symbol_rank.test_get_ranks_small_graph`` diff --git a/automata/docs/core/symbol/graph_builder.rst b/automata/docs/core/symbol/graph_builder.rst index dddd1dd9..242ba9a7 100644 --- a/automata/docs/core/symbol/graph_builder.rst +++ b/automata/docs/core/symbol/graph_builder.rst @@ -22,7 +22,7 @@ Related Symbols - ``automata.core.symbol.graph._RelationshipManager`` - ``automata.core.symbol.graph._OccurrenceManager`` - ``automata.core.symbol.graph._CallerCalleeManager`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.core.symbol.graph.SymbolGraph`` Example @@ -34,7 +34,7 @@ build a graph from a given index. .. code:: python from automata.core.symbol.graph import GraphBuilder - from automata.core.base.scip_pb2 import Index + from automata.core.symbol.scip_pb2 import Index # Assuming a valid index object index = Index() diff --git a/automata/docs/core/symbol/graph_processor.rst b/automata/docs/core/symbol/graph_processor.rst index 8be6eb98..367fdea6 100644 --- a/automata/docs/core/symbol/graph_processor.rst +++ b/automata/docs/core/symbol/graph_processor.rst @@ -24,10 +24,10 @@ Import Statements: from google.protobuf.json_format import MessageToDict from tqdm import tqdm from automata.config import MAX_WORKERS - from automata.core.coding.py.module_loader import py_module_loader + from automata.core.singletons.module_loader import py_module_loader from automata.core.symbol.parser import parse_symbol - from automata.core.base.scip_pb2 import Index, SymbolRole - from automata.core.base.symbol import ( + from automata.core.symbol.scip_pb2 import Index, SymbolRole + from automata.core.symbol.base import ( Symbol, SymbolDescriptor, SymbolFile, @@ -69,7 +69,7 @@ Builds a ``SymbolGraph`` from a corresponding Index. This class is responsible for constructing the SymbolGraph object used by the ``GraphProcessor``. -``automata.core.base.symbol.Symbol`` +``automata.core.symbol.base.Symbol`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A class which contains associated logic for a Symbol. This class diff --git a/automata/docs/core/symbol/search/symbol_rank.rst b/automata/docs/core/symbol/search/symbol_rank.rst index 199e42a0..175156e8 100644 --- a/automata/docs/core/symbol/search/symbol_rank.rst +++ b/automata/docs/core/symbol/search/symbol_rank.rst @@ -22,9 +22,9 @@ Related Symbols --------------- - ``networkx.DiGraph`` -- ``automata.core.symbol.search.rank.SymbolRankConfig`` -- ``automata.core.base.symbol.Symbol`` -- ``automata.core.symbol.search.symbol_parser.parse_symbol`` +- ``automata.core.experimental.search.rank.SymbolRankConfig`` +- ``automata.core.symbol.base.Symbol`` +- ``automata.core.experimental.search.symbol_parser.parse_symbol`` Example ------- @@ -35,9 +35,9 @@ importance of symbols in a directed graph. .. code:: python import networkx as nx - from automata.core.symbol.search.rank import SymbolRank - from automata.core.symbol.search.rank import SymbolRankConfig - from automata.core.base.symbol import Symbol + from automata.core.experimental.search.rank import SymbolRank + from automata.core.experimental.search.rank import SymbolRankConfig + from automata.core.symbol.base import Symbol # create a directed graph G = nx.DiGraph() diff --git a/automata/docs/core/symbol/search/symbol_rank_config.rst b/automata/docs/core/symbol/search/symbol_rank_config.rst index 950c49cd..71362abf 100644 --- a/automata/docs/core/symbol/search/symbol_rank_config.rst +++ b/automata/docs/core/symbol/search/symbol_rank_config.rst @@ -23,10 +23,10 @@ acceptable range. Related Symbols --------------- -- ``automata.core.symbol.search.rank.SymbolRank`` +- ``automata.core.experimental.search.rank.SymbolRank`` - ``automata.tests.unit.test_symbol_rank.test_get_ranks`` - ``automata.tests.unit.test_symbol_rank.test_get_ranks_small_graph`` -- ``automata.core.agent.tool.tool_utils.DependencyFactory.create_symbol_search`` +- ``automata.core.singletons.dependency_factory.create_symbol_search`` Example ------- @@ -36,7 +36,7 @@ The following is an example demonstrating how to create an instance of .. code:: python - from automata.core.symbol.search.rank import SymbolRankConfig + from automata.core.experimental.search.rank import SymbolRankConfig config = SymbolRankConfig(alpha=0.25, max_iterations=100, tolerance=1.0e-6) SymbolRankConfig.validate_config(config) diff --git a/automata/docs/core/symbol/search/symbol_search.rst b/automata/docs/core/symbol/search/symbol_search.rst index f41b5f7e..be79407c 100644 --- a/automata/docs/core/symbol/search/symbol_search.rst +++ b/automata/docs/core/symbol/search/symbol_search.rst @@ -21,9 +21,9 @@ Related Symbols - ``automata.core.symbol.graph.SymbolGraph`` - ``automata.core.symbol_embedding.similarity.SymbolSimilarity`` -- ``automata.core.symbol.search.rank.SymbolRank`` -- ``automata.core.symbol.search.rank.SymbolRankConfig`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.experimental.search.rank.SymbolRank`` +- ``automata.core.experimental.search.rank.SymbolRankConfig`` +- ``automata.core.symbol.base.Symbol`` Example ------- @@ -35,8 +35,8 @@ The following example demonstrates how to create an instance of from automata.core.symbol.graph import SymbolGraph from automata.core.symbol_embedding.similarity import SymbolSimilarity - from automata.core.symbol.search.symbol_search import SymbolSearch, ExactSearchResult - from automata.core.symbol.search.rank import SymbolRankConfig + from automata.core.experimental.search.symbol_search import SymbolSearch, ExactSearchResult + from automata.core.experimental.search.rank import SymbolRankConfig # Create instances of SymbolGraph and SymbolSimilarity symbol_graph = SymbolGraph(...) diff --git a/automata/docs/core/symbol/symbol.rst b/automata/docs/core/symbol/symbol.rst index bc65ff4d..45d8606e 100644 --- a/automata/docs/core/symbol/symbol.rst +++ b/automata/docs/core/symbol/symbol.rst @@ -42,7 +42,7 @@ Example symbol_class = parse_symbol("scic-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `automata.core.agent.agent_enums`/ActionIndicator#") - symbol_method = parse_symbol("scic-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `automata.core.base.tool`/ToolNotFoundError#__init__().") + symbol_method = parse_symbol("scic-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `automata.core.tools.tool`/ToolNotFoundError#__init__().") Limitations ----------- diff --git a/automata/docs/core/symbol/symbol_code_embedding.rst b/automata/docs/core/symbol/symbol_code_embedding.rst index 73a66d3a..21082ade 100644 --- a/automata/docs/core/symbol/symbol_code_embedding.rst +++ b/automata/docs/core/symbol/symbol_code_embedding.rst @@ -18,9 +18,9 @@ and accessible way to store and manage symbol code embeddings. Related Symbols --------------- -- ``automata.core.base.symbol.Symbol`` -- ``automata.core.base.symbol_embedding.SymbolEmbedding`` -- ``automata.core.base.symbol_embedding.SymbolDocEmbedding`` +- ``automata.core.symbol.base.Symbol`` +- ``automata.core.symbol_embedding.base.SymbolEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolDocEmbedding`` - ``automata.core.memory_store.symbol_code_embedding.SymbolCodeEmbeddingHandler`` Usage Example @@ -33,7 +33,7 @@ embedded vector. .. code:: python import numpy as np - from automata.core.base.symbol import Symbol, SymbolCodeEmbedding + from automata.core.symbol.base import Symbol, SymbolCodeEmbedding symbol = Symbol.from_string("some_symbol") # The desired Symbol object source_code = "def function_example():\n pass" @@ -43,7 +43,7 @@ embedded vector. Note that this example assumes that the ``Symbol`` object already exists. For more information about working with ``Symbol`` objects, -consult the ``automata.core.base.symbol.Symbol`` class documentation. +consult the ``automata.core.symbol.base.Symbol`` class documentation. Limitations ----------- diff --git a/automata/docs/core/symbol/symbol_descriptor.rst b/automata/docs/core/symbol/symbol_descriptor.rst index ae3ce100..5eff03be 100644 --- a/automata/docs/core/symbol/symbol_descriptor.rst +++ b/automata/docs/core/symbol/symbol_descriptor.rst @@ -18,7 +18,7 @@ descriptor. Related Symbols --------------- -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.core.symbol.parser.parse_symbol`` - ``automata.tests.unit.test_symbol_search_tool.test_retrieve_source_code_by_symbol`` @@ -30,8 +30,8 @@ The following example demonstrates how to create an instance of .. code:: python - from automata.core.base.symbol import SymbolDescriptor - from automata.core.base.scip_pb2 import Descriptor as DescriptorProto + from automata.core.symbol.base import SymbolDescriptor + from automata.core.symbol.scip_pb2 import Descriptor as DescriptorProto name = "automata.core.agent.agent_enums.ActionIndicator" suffix = DescriptorProto.Type diff --git a/automata/docs/core/symbol/symbol_doc_embedding.rst b/automata/docs/core/symbol/symbol_doc_embedding.rst index 999fe40b..0812b08b 100644 --- a/automata/docs/core/symbol/symbol_doc_embedding.rst +++ b/automata/docs/core/symbol/symbol_doc_embedding.rst @@ -21,10 +21,10 @@ Related Symbols --------------- - ``automata.core.memory_store.symbol_doc_embedding.SymbolDocEmbeddingHandler`` -- ``automata.core.base.scip_pb2.Descriptor`` +- ``automata.core.symbol.scip_pb2.Descriptor`` - ``automata.core.symbol.parser.parse_symbol`` -- ``automata.core.base.symbol_embedding.SymbolCodeEmbedding`` -- ``automata.core.base.symbol_embedding.SymbolEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolCodeEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolEmbedding`` Example ------- @@ -36,7 +36,7 @@ The following example demonstrates how to create a import numpy as np from automata.core.symbol.parser import parse_symbol - from automata.core.base.symbol import SymbolDocEmbedding + from automata.core.symbol.base import SymbolDocEmbedding symbol_str = "scip-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `automata.core.agent.agent_enums`/ActionIndicator#" symbol = parse_symbol(symbol_str) diff --git a/automata/docs/core/symbol/symbol_embedding.rst b/automata/docs/core/symbol/symbol_embedding.rst index 2609766d..4da0968e 100644 --- a/automata/docs/core/symbol/symbol_embedding.rst +++ b/automata/docs/core/symbol/symbol_embedding.rst @@ -23,8 +23,8 @@ such as ``SymbolCodeEmbedding`` and ``SymbolDocEmbedding``. Related Symbols --------------- -- ``automata.core.base.symbol_embedding.SymbolCodeEmbedding`` -- ``automata.core.base.symbol_embedding.SymbolDocEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolCodeEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolDocEmbedding`` - ``automata.core.memory_store.symbol_code_embedding.SymbolCodeEmbeddingHandler`` Usage Example @@ -36,7 +36,7 @@ as well as a precomputed embedding array. .. code:: python import numpy as np - from automata.core.base.symbol import Symbol, SymbolCodeEmbedding + from automata.core.symbol.base import Symbol, SymbolCodeEmbedding symbol = Symbol( scheme="scip-python", diff --git a/automata/docs/core/symbol/symbol_file.rst b/automata/docs/core/symbol/symbol_file.rst index 823fb3b7..10ea354a 100644 --- a/automata/docs/core/symbol/symbol_file.rst +++ b/automata/docs/core/symbol/symbol_file.rst @@ -11,10 +11,10 @@ Related Symbols --------------- - ``automata.tests.unit.test_database_vector.test_lookup_symbol`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.tests.unit.test_symbol_graph.test_get_all_files`` - ``automata.tests.unit.test_symbol_search_tool.test_retrieve_source_code_by_symbol`` -- ``automata.core.base.symbol.SymbolReference`` +- ``automata.core.symbol.base.SymbolReference`` - ``automata.tests.unit.test_database_vector.test_add_symbol`` - ``automata.tests.unit.test_database_vector.test_add_symbols`` - ``automata.core.base.database.vector.JSONEmbeddingVectorDatabase`` @@ -29,7 +29,7 @@ The following example demonstrates how to create an instance of .. code:: python - from automata.core.base.symbol import SymbolFile + from automata.core.symbol.base import SymbolFile file_path = "path/to/symbol_file.txt" symbol_file = SymbolFile(file_path) diff --git a/automata/docs/core/symbol/symbol_graph.rst b/automata/docs/core/symbol/symbol_graph.rst index 56cad1c9..a3e13928 100644 --- a/automata/docs/core/symbol/symbol_graph.rst +++ b/automata/docs/core/symbol/symbol_graph.rst @@ -21,12 +21,12 @@ Related Symbols --------------- - ``automata.core.symbol.parser.parse_symbol`` -- ``automata.core.base.scip_pb2.Index`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.scip_pb2.Index`` +- ``automata.core.symbol.base.Symbol`` - ``automata.core.symbol.graph.GraphBuilder`` - ``automata.core.symbol.graph._SymbolGraphNavigator`` -- ``automata.core.agent.tool.tool_utils.DependencyFactory.create_symbol_graph`` -- ``automata.core.symbol.search.symbol_search.SymbolSearch`` +- ``automata.core.singletons.dependency_factory.create_symbol_graph`` +- ``automata.core.experimental.search.symbol_search.SymbolSearch`` Example ------- diff --git a/automata/docs/core/symbol/symbol_package.rst b/automata/docs/core/symbol/symbol_package.rst index 6ff90070..16775406 100644 --- a/automata/docs/core/symbol/symbol_package.rst +++ b/automata/docs/core/symbol/symbol_package.rst @@ -8,9 +8,9 @@ from URI string format. Related Symbols --------------- -- ``automata.core.base.scip_pb2.Descriptor`` +- ``automata.core.symbol.scip_pb2.Descriptor`` - ``automata.core.symbol.parser.parse_symbol`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.tests.unit.test_symbol_parser.test_parse_symbol`` Methods diff --git a/automata/docs/core/symbol/symbol_parser.rst b/automata/docs/core/symbol/symbol_parser.rst index 4382b1b2..0a8fbd54 100644 --- a/automata/docs/core/symbol/symbol_parser.rst +++ b/automata/docs/core/symbol/symbol_parser.rst @@ -16,10 +16,10 @@ descriptor suffixes. Related Symbols --------------- -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.core.symbol.parser.parse_symbol`` - ``automata.core.symbol.graph.SymbolGraph`` -- ``automata.core.base.symbol.SymbolDescriptor`` +- ``automata.core.symbol.base.SymbolDescriptor`` - ``automata.core.memory_store.symbol_code_embedding.SymbolCodeEmbeddingHandler`` - ``automata.core.context.py_context.retriever.PyContextRetriever`` @@ -38,7 +38,7 @@ function to create a ``Symbol`` object from a symbol URI string. ) symbol_method = parse_symbol( - "scip-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `automata.core.base.tool`/ToolNotFoundError#__init__()." + "scip-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `automata.core.tools.tool`/ToolNotFoundError#__init__()." ) Limitations diff --git a/automata/docs/core/symbol/symbol_reference.rst b/automata/docs/core/symbol/symbol_reference.rst index cf5b9164..31b929b6 100644 --- a/automata/docs/core/symbol/symbol_reference.rst +++ b/automata/docs/core/symbol/symbol_reference.rst @@ -19,19 +19,19 @@ comparison of symbol reference objects, even across different files. Related Symbols --------------- -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.core.symbol.graph._SymbolGraphNavigator._get_symbol_references_in_scope`` - ``automata.tests.unit.test_symbol_search.tool.test_symbol_references`` - ``automata.tests.unit.test_symbol_search_tool.test_retrieve_source_code_by_symbol`` - ``automata.tests.unit.test_database_vector.test_lookup_symbol`` -- ``automata.core.base.symbol_embedding.SymbolDocEmbedding`` +- ``automata.core.symbol_embedding.base.SymbolDocEmbedding`` Example ------- .. code:: python - from automata.core.base.symbol import Symbol, SymbolReference + from automata.core.symbol.base import Symbol, SymbolReference # Create two Symbol objects symbol_1 = Symbol.from_string("scip-python python automata 0.1.0 AutomataNamespace/ClassName#") diff --git a/automata/docs/core/symbol/symbol_types/py_kind.rst b/automata/docs/core/symbol/symbol_types/py_kind.rst index 6fd2142f..1cd61c2f 100644 --- a/automata/docs/core/symbol/symbol_types/py_kind.rst +++ b/automata/docs/core/symbol/symbol_types/py_kind.rst @@ -13,7 +13,7 @@ Overview -------- ``SymbolDescriptor`` is primarily used in the context of -``automata.core.base.symbol.Symbol``, a class that represents a +``automata.core.symbol.base.Symbol``, a class that represents a standardized string representation for various programming elements such as packages, classes, methods, and more. By utilizing ``SymbolDescriptor``, it is possible to parse and store specific @@ -23,10 +23,10 @@ retrieval, or reference. Related Symbols --------------- -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.core.symbol.parser._SymbolParser`` -- ``automata.core.base.symbol.SymbolDescriptor.PyKind`` -- ``automata.core.base.scip_pb2.Descriptor`` +- ``automata.core.symbol.base.SymbolDescriptor.PyKind`` +- ``automata.core.symbol.scip_pb2.Descriptor`` Examples -------- @@ -35,8 +35,8 @@ Below are some examples using the ``SymbolDescriptor`` class: .. code:: python - from automata.core.base.symbol import SymbolDescriptor - from automata.core.base.scip_pb2 import Descriptor as DescriptorProto + from automata.core.symbol.base import SymbolDescriptor + from automata.core.symbol.scip_pb2 import Descriptor as DescriptorProto # Create a SymbolDescriptor object for a Python method descriptor = SymbolDescriptor( diff --git a/automata/docs/tests/mock_repository_manager.rst b/automata/docs/tests/mock_repository_manager.rst index 2ba4c51d..8af6bbe5 100644 --- a/automata/docs/tests/mock_repository_manager.rst +++ b/automata/docs/tests/mock_repository_manager.rst @@ -1,23 +1,23 @@ -MockRepositoryManager +MockRepositoryClient ===================== -``MockRepositoryManager`` is a mock implementation of the -``RepositoryManager`` class used for testing purposes. It derives from -the ``RepositoryManager`` class and provides empty implementations for +``MockRepositoryClient`` is a mock implementation of the +``RepositoryClient`` class used for testing purposes. It derives from +the ``RepositoryClient`` class and provides empty implementations for the various methods. This allows for simplified testing of classes and -methods that rely on a ``RepositoryManager`` without needing an actual +methods that rely on a ``RepositoryClient`` without needing an actual working implementation. Related Symbols --------------- -- ``automata.core.base.github_manager.RepositoryManager`` -- ``automata.core.base.github_manager.GitHubManager`` +- ``automata.core.base.github_management.client.RepositoryClient`` +- ``automata.core.base.github_management.client.GitHubClient`` Overview -------- -``MockRepositoryManager`` provides empty implementations for the +``MockRepositoryClient`` provides empty implementations for the following methods: - ``clone_repository(local_path: str)`` @@ -33,18 +33,18 @@ Example ------- The following example demonstrates how to use the -``MockRepositoryManager`` in a test case. +``MockRepositoryClient`` in a test case. .. code:: python - from automata.tests.conftest import MockRepositoryManager - from automata.core.agent.task import AutomataTask + from automata.tests.conftest import MockRepositoryClient + from automata.core.tasks.tasks import AutomataTask from config.config_enums import AgentConfigName - # Create a MockRepositoryManager instance - repo_manager = MockRepositoryManager() + # Create a MockRepositoryClient instance + repo_manager = MockRepositoryClient() - # Instantiate an AutomataTask using the MockRepositoryManager + # Instantiate an AutomataTask using the MockRepositoryClient task = AutomataTask( repo_manager, main_config_name=AgentConfigName.TEST.value, @@ -55,15 +55,15 @@ The following example demonstrates how to use the Limitations ----------- -``MockRepositoryManager`` is designed to be used in test cases and not +``MockRepositoryClient`` is designed to be used in test cases and not in actual production code. As a result, providing it as -``RepositoryManager`` in production code will not provide any actual +``RepositoryClient`` in production code will not provide any actual functionality. Follow-up Questions: -------------------- -- Are there any methods in ``MockRepositoryManager`` that need +- Are there any methods in ``MockRepositoryClient`` that need additional mock implementations for better testing coverage? -- Can the ``MockRepositoryManager`` class be further improved to +- Can the ``MockRepositoryClient`` class be further improved to provide better support for test cases? diff --git a/automata/docs/tests/unit/mock_code_generator.rst b/automata/docs/tests/unit/mock_code_generator.rst index e56d617f..97c9d2fb 100644 --- a/automata/docs/tests/unit/mock_code_generator.rst +++ b/automata/docs/tests/unit/mock_code_generator.rst @@ -23,11 +23,11 @@ generates random strings of specified length. Related Symbols --------------- -- ``automata.core.coding.py.reader.PyReader`` -- ``automata.core.coding.py.writer.PyWriter`` +- ``automata.core.code_handling.py.reader.PyReader`` +- ``automata.core.code_handling.py.writer.PyWriter`` - ``automata.core.memory_store.symbol_code_embedding.SymbolCodeEmbeddingHandler`` -- ``automata.core.base.tool.Tool`` -- ``automata.core.agent.tool.builder.py_writer.PyWriterOpenAIToolkit`` +- ``automata.core.tools.tool.Tool`` +- ``automata.core.tools.builders.py_writer.PyWriterOpenAIToolkit`` Example ------- diff --git a/automata/docs/tests/unit/mock_tool.rst b/automata/docs/tests/unit/mock_tool.rst index a54f7971..77560f28 100644 --- a/automata/docs/tests/unit/mock_tool.rst +++ b/automata/docs/tests/unit/mock_tool.rst @@ -21,10 +21,10 @@ Related Symbols --------------- - ``automata.core.base.base_tool.BaseTool`` -- ``automata.core.base.tool.Tool`` -- ``automata.core.base.tool.InvalidTool`` -- ``automata.core.base.tool.Toolkit`` -- ``automata.core.base.tool.tool`` +- ``automata.core.tools.tool.Tool`` +- ``automata.core.tools.tool.InvalidTool`` +- ``automata.core.tools.tool.Toolkit`` +- ``automata.core.tools.tool.tool`` Example ------- diff --git a/automata/docs/tests/unit/test_execute_behavior.rst b/automata/docs/tests/unit/test_execute_behavior.rst index 29e71b35..bc50b181 100644 --- a/automata/docs/tests/unit/test_execute_behavior.rst +++ b/automata/docs/tests/unit/test_execute_behavior.rst @@ -20,15 +20,15 @@ execution process. Related Symbols --------------- -- ``automata.core.base.task.ITaskExecution`` +- ``automata.core.tasks.base.ITaskExecution`` - ``automata.tests.unit.test_task_executor.test_execute_automata_task_success`` -- ``automata.core.agent.task.executor.AutomataTaskExecutor.__init__`` +- ``automata.core.tasks.executor.AutomataTaskExecutor.__init__`` - ``automata.tests.unit.test_task_executor.test_execute_automata_task_fail`` -- ``automata.core.base.task.TaskStatus`` +- ``automata.core.tasks.base.TaskStatus`` - ``automata.tests.unit.test_tool.test_tool_run`` -- ``automata.core.agent.task.executor.AutomataTaskExecutor`` +- ``automata.core.tasks.executor.AutomataTaskExecutor`` - ``automata.tests.unit.test_tool.test_tool`` -- ``automata.core.agent.task.task.AutomataTask`` +- ``automata.core.tasks.tasks.AutomataTask`` - ``automata.tests.unit.test_task_environment.TestURL`` Usage Example @@ -40,7 +40,7 @@ for executing a test task: .. code:: python from automata.tests.unit.test_task_executor import TestExecuteBehavior - from automata.core.base.task import Task + from automata.core.tasks.base import Task # Create a sample Task instance task = Task() diff --git a/automata/docs/tests/unit/test_tool.rst b/automata/docs/tests/unit/test_tool.rst index c43d3966..b4893b0e 100644 --- a/automata/docs/tests/unit/test_tool.rst +++ b/automata/docs/tests/unit/test_tool.rst @@ -21,7 +21,7 @@ provides an example of how to use the tool with related symbols like Related Symbols --------------- -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.tool.Tool`` - ``automata.tests.unit.test_tool.test_tool`` - ``automata.tests.unit.test_tool.test_tool_run`` - ``automata.tests.unit.test_tool.test_tool_instantiation`` diff --git a/automata/docs/tests/unit/test_url.rst b/automata/docs/tests/unit/test_url.rst index 0b8a005c..a98ffbda 100644 --- a/automata/docs/tests/unit/test_url.rst +++ b/automata/docs/tests/unit/test_url.rst @@ -11,15 +11,15 @@ task. Related Symbols --------------- -- ``automata.core.base.task.TaskStatus`` +- ``automata.core.tasks.base.TaskStatus`` - ``automata.tests.unit.test_task_environment.test_commit_task`` -- ``automata.core.base.tool.Tool`` +- ``automata.core.tools.tool.Tool`` - ``automata.tests.unit.test_tool.test_tool_run`` -- ``automata.core.agent.task.task.AutomataTask`` +- ``automata.core.tasks.tasks.AutomataTask`` - ``automata.tests.unit.test_tool.test_tool`` -- ``automata.core.base.symbol.Symbol`` +- ``automata.core.symbol.base.Symbol`` - ``automata.tests.unit.test_tool.TestTool`` -- ``automata.core.coding.py.reader.PyReader`` +- ``automata.core.code_handling.py.reader.PyReader`` - ``automata.tests.unit.test_symbol_search_tool.test_retrieve_source_code_by_symbol`` Example diff --git a/automata/tests/conftest.py b/automata/tests/conftest.py index 64c3efaf..f686dc15 100644 --- a/automata/tests/conftest.py +++ b/automata/tests/conftest.py @@ -8,19 +8,20 @@ from automata.config.base import AgentConfigName from automata.config.openai_agent import AutomataOpenAIAgentConfigBuilder +from automata.core.agent.agent import AgentToolkitNames from automata.core.agent.providers import OpenAIAutomataAgent -from automata.core.agent.task.environment import AutomataTaskEnvironment -from automata.core.agent.task.registry import AutomataTaskRegistry -from automata.core.agent.task.task import AutomataTask -from automata.core.agent.tool.tool_utils import AgentToolFactory, dependency_factory -from automata.core.base.agent import AgentToolkitNames -from automata.core.base.github_manager import GitHubManager, RepositoryManager +from automata.core.experimental.search.rank import SymbolRankConfig +from automata.core.experimental.search.symbol_search import SymbolSearch +from automata.core.github_management.client import GitHubClient, RepositoryClient from automata.core.memory_store.symbol_code_embedding import SymbolCodeEmbeddingHandler +from automata.core.singletons.dependency_factory import dependency_factory from automata.core.symbol.graph import SymbolGraph from automata.core.symbol.parser import parse_symbol -from automata.core.symbol.search.rank import SymbolRankConfig -from automata.core.symbol.search.symbol_search import SymbolSearch from automata.core.symbol_embedding.similarity import SymbolSimilarityCalculator +from automata.core.tasks.agent_database import AutomataTaskRegistry +from automata.core.tasks.environment import AutomataTaskEnvironment +from automata.core.tasks.tasks import AutomataTask +from automata.core.tools.factory import AgentToolFactory @pytest.fixture @@ -73,7 +74,7 @@ def symbols(): ), # Init parse_symbol( - "scip-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `core.base.tool`/ToolNotFoundError#__init__()." + "scip-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `core.tools.base`/ToolNotFoundError#__init__()." ), ] @@ -139,8 +140,6 @@ def automata_agent_config_builder(): # Otherwise, the dependency factory will attempt to actually instantiate the dependencies import unittest.mock - from automata.core.agent.tool.tool_utils import dependency_factory - dependency_factory.get = unittest.mock.MagicMock(return_value=None) return AutomataOpenAIAgentConfigBuilder.from_name(config_name) @@ -173,7 +172,7 @@ def automata_agent(mocker, automata_agent_config_builder): ) -class MockRepositoryManager(RepositoryManager): +class MockRepositoryClient(RepositoryClient): def clone_repository(self, local_path: str): pass @@ -201,7 +200,7 @@ def fetch_issue(self, issue_number: int) -> Any: @pytest.fixture def task(): - repo_manager = MockRepositoryManager() + repo_manager = MockRepositoryClient() return AutomataTask( repo_manager, config_to_load=AgentConfigName.TEST.value, @@ -212,7 +211,7 @@ def task(): @pytest.fixture def environment(): - github_mock = MagicMock(spec=GitHubManager) + github_mock = MagicMock(spec=GitHubClient) return AutomataTaskEnvironment(github_mock) diff --git a/automata/tests/regression/test_symbol_searcher_regression.py b/automata/tests/regression/test_symbol_searcher_regression.py index d0f8b36e..9ac70b46 100644 --- a/automata/tests/regression/test_symbol_searcher_regression.py +++ b/automata/tests/regression/test_symbol_searcher_regression.py @@ -89,10 +89,10 @@ def test_symbol_rank_search_on_symbol(symbol_search_live): # noqa "automata.config.agent_config_builder", ], "SymbolRank": [ - "automata.core.symbol.search.symbol_search", - "automata.core.symbol.search.rank", - "automata.core.agent.tools.symbol_search", - "automata.core.agent.tools.tool_utils", + "automata.core.experimental.search.symbol_search", + "automata.core.experimental.search.rank", + "automata.core.toolss.symbol_search", + "automata.core.toolss.factory", ], } diff --git a/automata/tests/unit/sample_modules/sample2.py b/automata/tests/unit/sample_modules/sample2.py index 2273b4ca..b9105c18 100644 --- a/automata/tests/unit/sample_modules/sample2.py +++ b/automata/tests/unit/sample_modules/sample2.py @@ -2,7 +2,7 @@ from tools.python_tools.python_agent import PythonAgent -from automata.core.base.tool import Tool +from automata.core.tools.base import Tool class PythonAgentToolkit: diff --git a/automata/tests/unit/test_automata_agent_builder.py b/automata/tests/unit/test_automata_agent_builder.py index 45a769c4..eea8f750 100644 --- a/automata/tests/unit/test_automata_agent_builder.py +++ b/automata/tests/unit/test_automata_agent_builder.py @@ -4,7 +4,7 @@ from automata.config.base import AgentConfigName from automata.config.openai_agent import AutomataOpenAIAgentConfig -from automata.core.agent.tool.tool_utils import AgentToolFactory +from automata.core.tools.factory import AgentToolFactory def test_automata_agent_init(automata_agent): @@ -47,8 +47,8 @@ def test_builder_provided_parameters_override_defaults(automata_agent_config_bui def test_builder_accepts_all_fields(automata_agent_config_builder): toolkit_list = ["py-reader", "py-writer"] - from automata.core.coding.py.reader import PyReader - from automata.core.coding.py.writer import PyWriter + from automata.core.code_handling.py.reader import PyReader + from automata.core.code_handling.py.writer import PyWriter tools = AgentToolFactory.build_tools( toolkit_list, diff --git a/automata/tests/unit/test_context_oracle_tool.py b/automata/tests/unit/test_context_oracle_tool.py index 591130cc..a35863fd 100644 --- a/automata/tests/unit/test_context_oracle_tool.py +++ b/automata/tests/unit/test_context_oracle_tool.py @@ -2,8 +2,8 @@ import pytest -from automata.core.agent.tool.builder.context_oracle import ContextOracleToolkit -from automata.core.base.tool import Tool +from automata.core.tools.base import Tool +from automata.core.tools.builders.context_oracle import ContextOracleToolkit @pytest.fixture diff --git a/automata/tests/unit/test_database_vector.py b/automata/tests/unit/test_database_vector.py index fed3cc67..0c91962c 100644 --- a/automata/tests/unit/test_database_vector.py +++ b/automata/tests/unit/test_database_vector.py @@ -1,6 +1,6 @@ import pytest -from automata.core.base.symbol_embedding import ( +from automata.core.symbol_embedding.base import ( JSONSymbolEmbeddingVectorDatabase, SymbolCodeEmbedding, ) diff --git a/automata/tests/unit/test_directory_manager.py b/automata/tests/unit/test_directory_manager.py index 945a9d59..610e07c2 100644 --- a/automata/tests/unit/test_directory_manager.py +++ b/automata/tests/unit/test_directory_manager.py @@ -1,4 +1,4 @@ -from automata.core.coding.directory import DirectoryManager +from automata.core.navigation.directory import DirectoryManager def create_test_dir_structure(tmp_path): diff --git a/automata/tests/unit/test_py_reader.py b/automata/tests/unit/test_py_reader.py index 66017704..626fcfa6 100644 --- a/automata/tests/unit/test_py_reader.py +++ b/automata/tests/unit/test_py_reader.py @@ -2,8 +2,8 @@ import pytest -from automata.core.coding.py.module_loader import py_module_loader -from automata.core.coding.py.reader import PyReader +from automata.core.code_handling.py.reader import PyReader +from automata.core.singletons.module_loader import py_module_loader @pytest.fixture(autouse=True) diff --git a/automata/tests/unit/test_py_reader_tool.py b/automata/tests/unit/test_py_reader_tool.py index 3e3cc07e..ba422b30 100644 --- a/automata/tests/unit/test_py_reader_tool.py +++ b/automata/tests/unit/test_py_reader_tool.py @@ -3,10 +3,10 @@ import pytest -from automata.core.agent.tool.builder.py_reader import PyReaderToolkit -from automata.core.base.tool import Tool -from automata.core.coding.py.module_loader import py_module_loader -from automata.core.coding.py.reader import PyReader +from automata.core.code_handling.py.reader import PyReader +from automata.core.singletons.module_loader import py_module_loader +from automata.core.tools.base import Tool +from automata.core.tools.builders.py_reader import PyReaderToolkit from automata.core.utils import get_root_py_fpath diff --git a/automata/tests/unit/test_py_writer.py b/automata/tests/unit/test_py_writer.py index bb4696c9..10085f04 100644 --- a/automata/tests/unit/test_py_writer.py +++ b/automata/tests/unit/test_py_writer.py @@ -14,10 +14,10 @@ StringNode, ) -from automata.core.coding.py.module_loader import py_module_loader -from automata.core.coding.py.navigation import find_syntax_tree_node -from automata.core.coding.py.reader import PyReader -from automata.core.coding.py.writer import PyWriter +from automata.core.code_handling.py.reader import PyReader +from automata.core.code_handling.py.writer import PyWriter +from automata.core.navigation.py.navigation_utils import find_syntax_tree_node +from automata.core.singletons.module_loader import py_module_loader class MockCodeGenerator: diff --git a/automata/tests/unit/test_py_writer_tool.py b/automata/tests/unit/test_py_writer_tool.py index fa61d319..8e3d27fe 100644 --- a/automata/tests/unit/test_py_writer_tool.py +++ b/automata/tests/unit/test_py_writer_tool.py @@ -4,11 +4,11 @@ import pytest -from automata.core.agent.tool.builder.py_writer import PyWriterToolkit -from automata.core.base.tool import Tool -from automata.core.coding.py.module_loader import py_module_loader -from automata.core.coding.py.reader import PyReader -from automata.core.coding.py.writer import PyWriter +from automata.core.code_handling.py.reader import PyReader +from automata.core.code_handling.py.writer import PyWriter +from automata.core.singletons.module_loader import py_module_loader +from automata.core.tools.base import Tool +from automata.core.tools.builders.py_writer import PyWriterToolkit from automata.core.utils import get_root_py_fpath @@ -136,7 +136,7 @@ def test_extend_module_with_documented_new_class(python_writer_tool_builder): '''from typing import List -from automata.core.base.tool import Tool +from automata.core.tools.base import Tool from automata.tools.python_tools.python_agent import PythonAgent @@ -206,7 +206,7 @@ def test_extend_module_with_documented_new_module(python_writer_tool_builder): module_str = textwrap.dedent( """from typing import List, Optional from automata.buffer import PassThroughBuffer -from automata.tools.tool import Tool +from automata.tools.base import Tool from automata.tools.python_tools.python_agent import PythonAgent class PythonAgentToolkit: diff --git a/automata/tests/unit/test_symbol_embedding.py b/automata/tests/unit/test_symbol_embedding.py index 046b309f..df89a416 100644 --- a/automata/tests/unit/test_symbol_embedding.py +++ b/automata/tests/unit/test_symbol_embedding.py @@ -2,12 +2,12 @@ import numpy as np -from automata.core.base.symbol_embedding import ( +from automata.core.memory_store.symbol_code_embedding import SymbolCodeEmbeddingHandler +from automata.core.symbol_embedding.base import ( JSONSymbolEmbeddingVectorDatabase, SymbolCodeEmbedding, SymbolEmbeddingBuilder, ) -from automata.core.memory_store.symbol_code_embedding import SymbolCodeEmbeddingHandler def test_update_embeddings( diff --git a/automata/tests/unit/test_symbol_graph.py b/automata/tests/unit/test_symbol_graph.py index 1ba4d15a..a6280654 100644 --- a/automata/tests/unit/test_symbol_graph.py +++ b/automata/tests/unit/test_symbol_graph.py @@ -1,4 +1,4 @@ -from automata.core.base.symbol import Symbol, SymbolFile +from automata.core.symbol.base import Symbol, SymbolFile from automata.tests.utils.factories import symbol_graph_static_test # noqa: F401 diff --git a/automata/tests/unit/test_symbol_rank.py b/automata/tests/unit/test_symbol_rank.py index 1fed8a30..843929cd 100644 --- a/automata/tests/unit/test_symbol_rank.py +++ b/automata/tests/unit/test_symbol_rank.py @@ -4,7 +4,7 @@ import pytest from networkx import DiGraph -from automata.core.symbol.search.rank import SymbolRank, SymbolRankConfig +from automata.core.experimental.search.rank import SymbolRank, SymbolRankConfig def generate_random_graph(nodes, edges): diff --git a/automata/tests/unit/test_symbol_search.py b/automata/tests/unit/test_symbol_search.py index 34d3a388..9fdedd6b 100644 --- a/automata/tests/unit/test_symbol_search.py +++ b/automata/tests/unit/test_symbol_search.py @@ -7,7 +7,7 @@ def test_retrieve_source_code_by_symbol(symbols, symbol_search): with patch( - "automata.core.symbol.search.symbol_search.convert_to_fst_object", + "automata.core.experimental.search.symbol_search.convert_to_fst_object", return_value="module1", ) as mock_method: result = symbol_search.retrieve_source_code_by_symbol(symbols[0].uri) @@ -26,7 +26,7 @@ def test_symbol_references(symbols, symbol_search, symbol_graph_mock): def test_exact_search(symbol_search): with patch( - "automata.core.symbol.search.symbol_search.SymbolSearch._find_pattern_in_modules", + "automata.core.experimental.search.symbol_search.SymbolSearch._find_pattern_in_modules", return_value=["file1", "file2"], ): result = symbol_search.exact_search("pattern1") diff --git a/automata/tests/unit/test_symbol_search_tool.py b/automata/tests/unit/test_symbol_search_tool.py index 183dce4f..7b9a4d5e 100644 --- a/automata/tests/unit/test_symbol_search_tool.py +++ b/automata/tests/unit/test_symbol_search_tool.py @@ -2,8 +2,8 @@ import pytest -from automata.core.agent.tool.builder.symbol_search import SymbolSearchToolkit -from automata.core.base.tool import Tool +from automata.core.tools.base import Tool +from automata.core.tools.builders.symbol_search import SymbolSearchToolkit @pytest.fixture diff --git a/automata/tests/unit/test_symbol_similarity.py b/automata/tests/unit/test_symbol_similarity.py index 61669603..4cbaea05 100644 --- a/automata/tests/unit/test_symbol_similarity.py +++ b/automata/tests/unit/test_symbol_similarity.py @@ -2,13 +2,13 @@ import numpy as np -from automata.core.base.embedding import EmbeddingProvider -from automata.core.base.symbol_embedding import ( +from automata.core.embedding.base import EmbeddingProvider +from automata.core.memory_store.symbol_code_embedding import SymbolCodeEmbeddingHandler +from automata.core.symbol_embedding.base import ( JSONSymbolEmbeddingVectorDatabase, SymbolCodeEmbedding, SymbolEmbeddingBuilder, ) -from automata.core.memory_store.symbol_code_embedding import SymbolCodeEmbeddingHandler from automata.core.symbol_embedding.similarity import SymbolSimilarityCalculator diff --git a/automata/tests/unit/test_task.py b/automata/tests/unit/test_task.py index f60b4774..c4e85212 100644 --- a/automata/tests/unit/test_task.py +++ b/automata/tests/unit/test_task.py @@ -4,10 +4,10 @@ import pytest from automata.config.base import AgentConfigName -from automata.core.agent.task.task import AutomataTask -from automata.core.base.task import TaskStatus +from automata.core.tasks.base import TaskStatus +from automata.core.tasks.tasks import AutomataTask -from ..conftest import MockRepositoryManager +from ..conftest import MockRepositoryClient @patch("logging.config.dictConfig", return_value=None) @@ -98,7 +98,7 @@ def test_deterministic_task_id(automata_agent_config_builder): def test_deterministic_vs_non_deterministic_task_id(): task_1 = AutomataTask( - MockRepositoryManager(), + MockRepositoryClient(), test1="arg1", test2="arg2", priority=5, @@ -108,7 +108,7 @@ def test_deterministic_vs_non_deterministic_task_id(): ) task_2 = AutomataTask( - MockRepositoryManager(), + MockRepositoryClient(), test1="arg1", test2="arg2", priority=5, diff --git a/automata/tests/unit/test_task_database.py b/automata/tests/unit/test_task_database.py index 4a77b292..1655efe9 100644 --- a/automata/tests/unit/test_task_database.py +++ b/automata/tests/unit/test_task_database.py @@ -2,15 +2,15 @@ import pytest -from automata.core.agent.task.registry import AutomataTaskDatabase -from automata.core.agent.task.task import AutomataTask -from automata.core.base.task import TaskStatus +from automata.core.tasks.agent_database import AutomataAgentTaskDatabase +from automata.core.tasks.base import TaskStatus +from automata.core.tasks.tasks import AutomataTask @pytest.fixture(scope="module") def db(tmpdir_factory): db_file = tmpdir_factory.mktemp("data").join("test.db") - db = AutomataTaskDatabase(str(db_file)) + db = AutomataAgentTaskDatabase(str(db_file)) yield db db.close() os.remove(str(db_file)) diff --git a/automata/tests/unit/test_task_environment.py b/automata/tests/unit/test_task_environment.py index be2a8360..e31cbf63 100644 --- a/automata/tests/unit/test_task_environment.py +++ b/automata/tests/unit/test_task_environment.py @@ -1,7 +1,7 @@ import os from unittest.mock import MagicMock -from automata.core.base.task import TaskStatus +from automata.core.tasks.base import TaskStatus class TestURL: diff --git a/automata/tests/unit/test_task_executor.py b/automata/tests/unit/test_task_executor.py index 12e78c3e..51e8b200 100644 --- a/automata/tests/unit/test_task_executor.py +++ b/automata/tests/unit/test_task_executor.py @@ -2,11 +2,11 @@ import pytest -from automata.core.agent.task.executor import AutomataTaskExecutor, ITaskExecution -from automata.core.base.task import Task, TaskStatus -from automata.core.coding.py.module_loader import py_module_loader -from automata.core.coding.py.reader import PyReader -from automata.core.coding.py.writer import PyWriter +from automata.core.code_handling.py.reader import PyReader +from automata.core.code_handling.py.writer import PyWriter +from automata.core.singletons.module_loader import py_module_loader +from automata.core.tasks.base import Task, TaskStatus +from automata.core.tasks.executor import AutomataTaskExecutor, ITaskExecution from automata.core.utils import get_root_py_fpath diff --git a/automata/tests/unit/test_tool.py b/automata/tests/unit/test_tool.py index 74aa52aa..93da84ac 100644 --- a/automata/tests/unit/test_tool.py +++ b/automata/tests/unit/test_tool.py @@ -2,7 +2,7 @@ import pytest -from automata.core.base.tool import Tool +from automata.core.tools.base import Tool class TestTool(Tool): diff --git a/automata/tests/utils/factories.py b/automata/tests/utils/factories.py index 035da49a..d1f65aaa 100644 --- a/automata/tests/utils/factories.py +++ b/automata/tests/utils/factories.py @@ -3,12 +3,12 @@ import pytest from automata.config.base import ConfigCategory -from automata.core.base.symbol_embedding import JSONSymbolEmbeddingVectorDatabase +from automata.core.experimental.search.rank import SymbolRankConfig +from automata.core.experimental.search.symbol_search import SymbolSearch from automata.core.llm.providers.openai import OpenAIEmbeddingProvider from automata.core.memory_store.symbol_code_embedding import SymbolCodeEmbeddingHandler from automata.core.symbol.graph import SymbolGraph -from automata.core.symbol.search.rank import SymbolRankConfig -from automata.core.symbol.search.symbol_search import SymbolSearch +from automata.core.symbol_embedding.base import JSONSymbolEmbeddingVectorDatabase from automata.core.symbol_embedding.builders import SymbolCodeEmbeddingBuilder from automata.core.symbol_embedding.similarity import SymbolSimilarityCalculator from automata.core.utils import get_config_fpath