autobyteus 1.0.6__py3-none-any.whl → 1.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- autobyteus/agent/agent.py +97 -222
- autobyteus/agent/bootstrap_steps/__init__.py +19 -0
- autobyteus/agent/bootstrap_steps/agent_bootstrapper.py +88 -0
- autobyteus/agent/bootstrap_steps/agent_runtime_queue_initialization_step.py +57 -0
- autobyteus/agent/bootstrap_steps/base_bootstrap_step.py +38 -0
- autobyteus/agent/bootstrap_steps/system_prompt_processing_step.py +93 -0
- autobyteus/agent/bootstrap_steps/workspace_context_initialization_step.py +47 -0
- autobyteus/agent/context/__init__.py +13 -0
- autobyteus/agent/context/agent_config.py +84 -0
- autobyteus/agent/context/agent_context.py +129 -0
- autobyteus/agent/context/agent_phase_manager.py +264 -0
- autobyteus/agent/context/agent_runtime_state.py +89 -0
- autobyteus/agent/context/phases.py +49 -0
- autobyteus/agent/events/__init__.py +52 -0
- autobyteus/agent/events/agent_events.py +110 -0
- autobyteus/agent/events/agent_input_event_queue_manager.py +174 -0
- autobyteus/agent/events/notifiers.py +122 -0
- autobyteus/agent/events/worker_event_dispatcher.py +118 -0
- autobyteus/agent/factory/__init__.py +9 -0
- autobyteus/agent/factory/agent_factory.py +145 -0
- autobyteus/agent/group/agent_group.py +164 -0
- autobyteus/agent/group/agent_group_context.py +81 -0
- autobyteus/agent/handlers/__init__.py +36 -0
- autobyteus/agent/handlers/approved_tool_invocation_event_handler.py +148 -0
- autobyteus/agent/handlers/base_event_handler.py +36 -0
- autobyteus/agent/handlers/event_handler_registry.py +76 -0
- autobyteus/agent/handlers/generic_event_handler.py +46 -0
- autobyteus/agent/handlers/inter_agent_message_event_handler.py +76 -0
- autobyteus/agent/handlers/lifecycle_event_logger.py +64 -0
- autobyteus/agent/handlers/llm_complete_response_received_event_handler.py +138 -0
- autobyteus/agent/handlers/llm_user_message_ready_event_handler.py +140 -0
- autobyteus/agent/handlers/tool_execution_approval_event_handler.py +85 -0
- autobyteus/agent/handlers/tool_invocation_request_event_handler.py +211 -0
- autobyteus/agent/handlers/tool_result_event_handler.py +101 -0
- autobyteus/agent/handlers/user_input_message_event_handler.py +77 -0
- autobyteus/agent/hooks/__init__.py +16 -0
- autobyteus/agent/hooks/base_phase_hook.py +61 -0
- autobyteus/agent/hooks/hook_definition.py +36 -0
- autobyteus/agent/hooks/hook_meta.py +37 -0
- autobyteus/agent/hooks/hook_registry.py +118 -0
- autobyteus/agent/input_processor/__init__.py +18 -0
- autobyteus/agent/input_processor/base_user_input_processor.py +54 -0
- autobyteus/agent/input_processor/content_prefixing_input_processor.py +41 -0
- autobyteus/agent/input_processor/metadata_appending_input_processor.py +34 -0
- autobyteus/agent/input_processor/passthrough_input_processor.py +33 -0
- autobyteus/agent/input_processor/processor_definition.py +42 -0
- autobyteus/agent/input_processor/processor_meta.py +46 -0
- autobyteus/agent/input_processor/processor_registry.py +117 -0
- autobyteus/agent/llm_response_processor/__init__.py +16 -0
- autobyteus/agent/llm_response_processor/base_processor.py +53 -0
- autobyteus/agent/llm_response_processor/processor_definition.py +36 -0
- autobyteus/agent/llm_response_processor/processor_meta.py +37 -0
- autobyteus/agent/llm_response_processor/processor_registry.py +113 -0
- autobyteus/agent/llm_response_processor/provider_aware_tool_usage_processor.py +54 -0
- autobyteus/agent/message/__init__.py +20 -0
- autobyteus/agent/message/agent_input_user_message.py +96 -0
- autobyteus/agent/message/context_file.py +82 -0
- autobyteus/agent/message/context_file_type.py +63 -0
- autobyteus/agent/message/{message.py → inter_agent_message.py} +12 -12
- autobyteus/agent/message/{message_types.py → inter_agent_message_type.py} +8 -6
- autobyteus/agent/message/send_message_to.py +142 -36
- autobyteus/agent/phases/__init__.py +18 -0
- autobyteus/agent/phases/discover.py +52 -0
- autobyteus/agent/phases/manager.py +265 -0
- autobyteus/agent/phases/phase_enum.py +49 -0
- autobyteus/agent/phases/transition_decorator.py +40 -0
- autobyteus/agent/phases/transition_info.py +33 -0
- autobyteus/agent/remote_agent.py +244 -0
- autobyteus/agent/runtime/__init__.py +15 -0
- autobyteus/agent/runtime/agent_runtime.py +137 -0
- autobyteus/agent/runtime/agent_thread_pool_manager.py +88 -0
- autobyteus/agent/runtime/agent_worker.py +200 -0
- autobyteus/agent/streaming/__init__.py +15 -0
- autobyteus/agent/streaming/agent_event_stream.py +173 -0
- autobyteus/agent/streaming/queue_streamer.py +58 -0
- autobyteus/agent/streaming/stream_event_payloads.py +167 -0
- autobyteus/agent/streaming/stream_events.py +126 -0
- autobyteus/agent/system_prompt_processor/__init__.py +14 -0
- autobyteus/agent/system_prompt_processor/base_processor.py +48 -0
- autobyteus/agent/system_prompt_processor/processor_definition.py +40 -0
- autobyteus/agent/system_prompt_processor/processor_meta.py +47 -0
- autobyteus/agent/system_prompt_processor/processor_registry.py +119 -0
- autobyteus/agent/system_prompt_processor/tool_manifest_injector_processor.py +79 -0
- autobyteus/agent/tool_invocation.py +54 -5
- autobyteus/agent/utils/__init__.py +9 -0
- autobyteus/agent/utils/wait_for_idle.py +59 -0
- autobyteus/agent/workflow/__init__.py +11 -0
- autobyteus/agent/workflow/agentic_workflow.py +89 -0
- autobyteus/agent/workflow/base_agentic_workflow.py +98 -0
- autobyteus/agent/workspace/__init__.py +11 -0
- autobyteus/agent/workspace/base_workspace.py +77 -0
- autobyteus/agent/workspace/workspace_config.py +160 -0
- autobyteus/agent/workspace/workspace_definition.py +36 -0
- autobyteus/agent/workspace/workspace_meta.py +37 -0
- autobyteus/agent/workspace/workspace_registry.py +72 -0
- autobyteus/cli/__init__.py +11 -0
- autobyteus/cli/agent_cli.py +117 -0
- autobyteus/cli/cli_display.py +205 -0
- autobyteus/events/event_emitter.py +33 -56
- autobyteus/events/event_manager.py +134 -66
- autobyteus/events/event_types.py +43 -14
- autobyteus/llm/api/autobyteus_llm.py +13 -25
- autobyteus/llm/api/bedrock_llm.py +9 -3
- autobyteus/llm/api/claude_llm.py +10 -5
- autobyteus/llm/api/deepseek_llm.py +55 -93
- autobyteus/llm/api/gemini_llm.py +10 -4
- autobyteus/llm/api/grok_llm.py +55 -79
- autobyteus/llm/api/groq_llm.py +10 -5
- autobyteus/llm/api/mistral_llm.py +13 -8
- autobyteus/llm/api/nvidia_llm.py +9 -4
- autobyteus/llm/api/ollama_llm.py +58 -50
- autobyteus/llm/api/openai_llm.py +20 -14
- autobyteus/llm/base_llm.py +95 -34
- autobyteus/llm/extensions/base_extension.py +3 -4
- autobyteus/llm/extensions/token_usage_tracking_extension.py +13 -4
- autobyteus/llm/llm_factory.py +116 -53
- autobyteus/llm/models.py +92 -17
- autobyteus/llm/ollama_provider.py +6 -2
- autobyteus/llm/ollama_provider_resolver.py +44 -0
- autobyteus/llm/user_message.py +73 -0
- autobyteus/llm/utils/llm_config.py +124 -27
- autobyteus/llm/utils/response_types.py +3 -2
- autobyteus/llm/utils/token_usage.py +7 -4
- autobyteus/rpc/__init__.py +73 -0
- autobyteus/rpc/client/__init__.py +17 -0
- autobyteus/rpc/client/abstract_client_connection.py +124 -0
- autobyteus/rpc/client/client_connection_manager.py +153 -0
- autobyteus/rpc/client/sse_client_connection.py +306 -0
- autobyteus/rpc/client/stdio_client_connection.py +280 -0
- autobyteus/rpc/config/__init__.py +13 -0
- autobyteus/rpc/config/agent_server_config.py +153 -0
- autobyteus/rpc/config/agent_server_registry.py +152 -0
- autobyteus/rpc/hosting.py +244 -0
- autobyteus/rpc/protocol.py +244 -0
- autobyteus/rpc/server/__init__.py +20 -0
- autobyteus/rpc/server/agent_server_endpoint.py +181 -0
- autobyteus/rpc/server/base_method_handler.py +40 -0
- autobyteus/rpc/server/method_handlers.py +259 -0
- autobyteus/rpc/server/sse_server_handler.py +182 -0
- autobyteus/rpc/server/stdio_server_handler.py +151 -0
- autobyteus/rpc/server_main.py +198 -0
- autobyteus/rpc/transport_type.py +13 -0
- autobyteus/tools/__init__.py +77 -0
- autobyteus/tools/ask_user_input.py +34 -77
- autobyteus/tools/base_tool.py +73 -38
- autobyteus/tools/bash/__init__.py +2 -0
- autobyteus/tools/bash/bash_executor.py +42 -79
- autobyteus/tools/browser/__init__.py +2 -0
- autobyteus/tools/browser/session_aware/browser_session_aware_navigate_to.py +50 -42
- autobyteus/tools/browser/session_aware/browser_session_aware_tool.py +7 -4
- autobyteus/tools/browser/session_aware/browser_session_aware_web_element_trigger.py +117 -125
- autobyteus/tools/browser/session_aware/browser_session_aware_webpage_reader.py +75 -22
- autobyteus/tools/browser/session_aware/browser_session_aware_webpage_screenshot_taker.py +94 -28
- autobyteus/tools/browser/session_aware/factory/browser_session_aware_web_element_trigger_factory.py +10 -2
- autobyteus/tools/browser/session_aware/factory/browser_session_aware_webpage_reader_factory.py +18 -2
- autobyteus/tools/browser/session_aware/factory/browser_session_aware_webpage_screenshot_taker_factory.py +10 -2
- autobyteus/tools/browser/session_aware/shared_browser_session_manager.py +4 -3
- autobyteus/tools/browser/standalone/__init__.py +7 -0
- autobyteus/tools/browser/standalone/factory/google_search_factory.py +17 -2
- autobyteus/tools/browser/standalone/factory/webpage_reader_factory.py +17 -2
- autobyteus/tools/browser/standalone/factory/webpage_screenshot_taker_factory.py +10 -2
- autobyteus/tools/browser/standalone/google_search_ui.py +104 -67
- autobyteus/tools/browser/standalone/navigate_to.py +52 -28
- autobyteus/tools/browser/standalone/web_page_pdf_generator.py +94 -0
- autobyteus/tools/browser/standalone/webpage_image_downloader.py +146 -61
- autobyteus/tools/browser/standalone/webpage_reader.py +80 -61
- autobyteus/tools/browser/standalone/webpage_screenshot_taker.py +91 -45
- autobyteus/tools/factory/__init__.py +9 -0
- autobyteus/tools/factory/tool_factory.py +25 -4
- autobyteus/tools/file/file_reader.py +22 -51
- autobyteus/tools/file/file_writer.py +25 -56
- autobyteus/tools/functional_tool.py +249 -0
- autobyteus/tools/image_downloader.py +49 -71
- autobyteus/tools/mcp/__init__.py +47 -0
- autobyteus/tools/mcp/call_handlers/__init__.py +18 -0
- autobyteus/tools/mcp/call_handlers/base_handler.py +40 -0
- autobyteus/tools/mcp/call_handlers/sse_handler.py +22 -0
- autobyteus/tools/mcp/call_handlers/stdio_handler.py +76 -0
- autobyteus/tools/mcp/call_handlers/streamable_http_handler.py +55 -0
- autobyteus/tools/mcp/config_service.py +237 -0
- autobyteus/tools/mcp/factory.py +70 -0
- autobyteus/tools/mcp/registrar.py +323 -0
- autobyteus/tools/mcp/schema_mapper.py +131 -0
- autobyteus/tools/mcp/tool.py +101 -0
- autobyteus/tools/mcp/types.py +98 -0
- autobyteus/tools/parameter_schema.py +268 -0
- autobyteus/tools/pdf_downloader.py +78 -79
- autobyteus/tools/registry/__init__.py +0 -2
- autobyteus/tools/registry/tool_definition.py +113 -34
- autobyteus/tools/registry/tool_registry.py +64 -22
- autobyteus/tools/timer.py +150 -102
- autobyteus/tools/tool_category.py +11 -0
- autobyteus/tools/tool_config.py +117 -0
- autobyteus/tools/tool_meta.py +50 -26
- autobyteus/tools/tool_state.py +20 -0
- autobyteus/tools/usage/__init__.py +6 -0
- autobyteus/tools/usage/formatters/__init__.py +31 -0
- autobyteus/tools/usage/formatters/anthropic_json_example_formatter.py +18 -0
- autobyteus/tools/usage/formatters/anthropic_json_schema_formatter.py +25 -0
- autobyteus/tools/usage/formatters/base_formatter.py +42 -0
- autobyteus/tools/usage/formatters/default_json_example_formatter.py +42 -0
- autobyteus/tools/usage/formatters/default_json_schema_formatter.py +28 -0
- autobyteus/tools/usage/formatters/default_xml_example_formatter.py +55 -0
- autobyteus/tools/usage/formatters/default_xml_schema_formatter.py +46 -0
- autobyteus/tools/usage/formatters/gemini_json_example_formatter.py +34 -0
- autobyteus/tools/usage/formatters/gemini_json_schema_formatter.py +25 -0
- autobyteus/tools/usage/formatters/google_json_example_formatter.py +34 -0
- autobyteus/tools/usage/formatters/google_json_schema_formatter.py +25 -0
- autobyteus/tools/usage/formatters/openai_json_example_formatter.py +49 -0
- autobyteus/tools/usage/formatters/openai_json_schema_formatter.py +28 -0
- autobyteus/tools/usage/parsers/__init__.py +22 -0
- autobyteus/tools/usage/parsers/anthropic_xml_tool_usage_parser.py +10 -0
- autobyteus/tools/usage/parsers/base_parser.py +41 -0
- autobyteus/tools/usage/parsers/default_json_tool_usage_parser.py +106 -0
- autobyteus/tools/usage/parsers/default_xml_tool_usage_parser.py +136 -0
- autobyteus/tools/usage/parsers/exceptions.py +13 -0
- autobyteus/tools/usage/parsers/gemini_json_tool_usage_parser.py +66 -0
- autobyteus/tools/usage/parsers/openai_json_tool_usage_parser.py +196 -0
- autobyteus/tools/usage/parsers/provider_aware_tool_usage_parser.py +67 -0
- autobyteus/tools/usage/providers/__init__.py +22 -0
- autobyteus/tools/usage/providers/json_example_provider.py +32 -0
- autobyteus/tools/usage/providers/json_schema_provider.py +35 -0
- autobyteus/tools/usage/providers/json_tool_usage_parser_provider.py +28 -0
- autobyteus/tools/usage/providers/tool_manifest_provider.py +68 -0
- autobyteus/tools/usage/providers/xml_example_provider.py +28 -0
- autobyteus/tools/usage/providers/xml_schema_provider.py +29 -0
- autobyteus/tools/usage/providers/xml_tool_usage_parser_provider.py +26 -0
- autobyteus/tools/usage/registries/__init__.py +20 -0
- autobyteus/tools/usage/registries/json_example_formatter_registry.py +51 -0
- autobyteus/tools/usage/registries/json_schema_formatter_registry.py +51 -0
- autobyteus/tools/usage/registries/json_tool_usage_parser_registry.py +42 -0
- autobyteus/tools/usage/registries/xml_example_formatter_registry.py +30 -0
- autobyteus/tools/usage/registries/xml_schema_formatter_registry.py +33 -0
- autobyteus/tools/usage/registries/xml_tool_usage_parser_registry.py +30 -0
- {autobyteus-1.0.6.dist-info → autobyteus-1.1.1.dist-info}/METADATA +23 -5
- autobyteus-1.1.1.dist-info/RECORD +296 -0
- {autobyteus-1.0.6.dist-info → autobyteus-1.1.1.dist-info}/WHEEL +1 -1
- autobyteus/agent/async_agent.py +0 -175
- autobyteus/agent/async_group_aware_agent.py +0 -136
- autobyteus/agent/group/async_group_aware_agent.py +0 -122
- autobyteus/agent/group/coordinator_agent.py +0 -36
- autobyteus/agent/group/group_aware_agent.py +0 -121
- autobyteus/agent/orchestrator/__init__.py +0 -0
- autobyteus/agent/orchestrator/base_agent_orchestrator.py +0 -82
- autobyteus/agent/orchestrator/multi_replica_agent_orchestrator.py +0 -72
- autobyteus/agent/orchestrator/single_replica_agent_orchestrator.py +0 -43
- autobyteus/agent/response_parser/__init__.py +0 -0
- autobyteus/agent/response_parser/tool_usage_command_parser.py +0 -100
- autobyteus/agent/status.py +0 -12
- autobyteus/conversation/__init__.py +0 -0
- autobyteus/conversation/conversation.py +0 -54
- autobyteus/conversation/user_message.py +0 -59
- autobyteus/events/decorators.py +0 -29
- autobyteus/prompt/prompt_version_manager.py +0 -58
- autobyteus/prompt/storage/__init__.py +0 -0
- autobyteus/prompt/storage/prompt_version_model.py +0 -29
- autobyteus/prompt/storage/prompt_version_repository.py +0 -83
- autobyteus/tools/bash/factory/__init__.py +0 -0
- autobyteus/tools/bash/factory/bash_executor_factory.py +0 -6
- autobyteus/tools/factory/ask_user_input_factory.py +0 -6
- autobyteus/tools/factory/image_downloader_factory.py +0 -9
- autobyteus/tools/factory/pdf_downloader_factory.py +0 -9
- autobyteus/tools/factory/webpage_image_downloader_factory.py +0 -6
- autobyteus/tools/file/factory/__init__.py +0 -0
- autobyteus/tools/file/factory/file_reader_factory.py +0 -6
- autobyteus/tools/file/factory/file_writer_factory.py +0 -6
- autobyteus/tools/web_page_pdf_generator.py +0 -90
- autobyteus-1.0.6.dist-info/RECORD +0 -157
- {autobyteus-1.0.6.dist-info → autobyteus-1.1.1.dist-info}/licenses/LICENSE +0 -0
- {autobyteus-1.0.6.dist-info → autobyteus-1.1.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/tools/usage/providers/json_tool_usage_parser_provider.py
|
|
2
|
+
from typing import Optional, TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
from autobyteus.llm.providers import LLMProvider
|
|
5
|
+
from autobyteus.tools.usage.registries.json_tool_usage_parser_registry import JsonToolUsageParserRegistry
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from autobyteus.tools.usage.parsers.base_parser import BaseToolUsageParser
|
|
9
|
+
|
|
10
|
+
class JsonToolUsageParserProvider:
|
|
11
|
+
"""Provides a tool usage parser for JSON-based responses, specific to an LLM provider."""
|
|
12
|
+
|
|
13
|
+
def __init__(self):
|
|
14
|
+
self._registry = JsonToolUsageParserRegistry()
|
|
15
|
+
|
|
16
|
+
def provide(self, llm_provider: Optional[LLMProvider] = None) -> 'BaseToolUsageParser':
|
|
17
|
+
"""
|
|
18
|
+
Gets the appropriate parser from the registry.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
llm_provider: The LLMProvider for which to get a parser.
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
An instance of a class derived from BaseToolUsageParser.
|
|
25
|
+
"""
|
|
26
|
+
if llm_provider:
|
|
27
|
+
return self._registry.get_parser(llm_provider)
|
|
28
|
+
return self._registry.get_default_parser()
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/tools/usage/providers/tool_manifest_provider.py
|
|
2
|
+
import logging
|
|
3
|
+
import json
|
|
4
|
+
from typing import TYPE_CHECKING, List, Optional
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from autobyteus.tools.registry import ToolDefinition
|
|
8
|
+
|
|
9
|
+
logger = logging.getLogger(__name__)
|
|
10
|
+
|
|
11
|
+
class ToolManifestProvider:
|
|
12
|
+
"""
|
|
13
|
+
Generates a complete tool manifest string, which includes the schema
|
|
14
|
+
and an example for each provided tool. This is suitable for injection
|
|
15
|
+
into a system prompt.
|
|
16
|
+
"""
|
|
17
|
+
SCHEMA_HEADER = "## Tool Definition:"
|
|
18
|
+
EXAMPLE_HEADER = "## Example Usage:"
|
|
19
|
+
JSON_EXAMPLE_HEADER = "To use this tool, you MUST output a JSON object in the following format:"
|
|
20
|
+
|
|
21
|
+
def provide(self,
|
|
22
|
+
tool_definitions: List['ToolDefinition'],
|
|
23
|
+
use_xml: bool,
|
|
24
|
+
provider: Optional[str] = None) -> str:
|
|
25
|
+
"""
|
|
26
|
+
Generates the manifest string for a list of tools.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
tool_definitions: A list of ToolDefinition objects.
|
|
30
|
+
use_xml: If True, generate in XML format. Otherwise, use JSON.
|
|
31
|
+
provider: The LLM provider name, for provider-specific formatting.
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
A single string containing the formatted manifest.
|
|
35
|
+
"""
|
|
36
|
+
tool_blocks = []
|
|
37
|
+
|
|
38
|
+
for td in tool_definitions:
|
|
39
|
+
try:
|
|
40
|
+
if use_xml:
|
|
41
|
+
schema = td.get_usage_xml(provider=provider)
|
|
42
|
+
example = td.get_usage_xml_example(provider=provider)
|
|
43
|
+
if schema and example:
|
|
44
|
+
tool_blocks.append(f"{self.SCHEMA_HEADER}\n{schema}\n\n{self.EXAMPLE_HEADER}\n{example}")
|
|
45
|
+
else:
|
|
46
|
+
logger.warning(f"Could not generate schema or example for XML tool '{td.name}'.")
|
|
47
|
+
else: # JSON format
|
|
48
|
+
schema = td.get_usage_json(provider=provider)
|
|
49
|
+
example = td.get_usage_json_example(provider=provider)
|
|
50
|
+
if schema and example:
|
|
51
|
+
# Per user feedback, wrap schema in a 'tool' key.
|
|
52
|
+
schema_wrapped = {"tool": schema}
|
|
53
|
+
schema_str = json.dumps(schema_wrapped, indent=2)
|
|
54
|
+
|
|
55
|
+
# Example is already formatted correctly by the example formatter.
|
|
56
|
+
example_str = json.dumps(example, indent=2)
|
|
57
|
+
|
|
58
|
+
tool_blocks.append(f"{self.SCHEMA_HEADER}\n{schema_str}\n\n{self.JSON_EXAMPLE_HEADER}\n{example_str}")
|
|
59
|
+
else:
|
|
60
|
+
logger.warning(f"Could not generate schema or example for JSON tool '{td.name}'.")
|
|
61
|
+
|
|
62
|
+
except Exception as e:
|
|
63
|
+
logger.error(f"Failed to generate manifest block for tool '{td.name}': {e}", exc_info=True)
|
|
64
|
+
|
|
65
|
+
if use_xml:
|
|
66
|
+
return "\n\n---\n\n".join(tool_blocks)
|
|
67
|
+
else:
|
|
68
|
+
return "[\n" + ",\n".join(tool_blocks) + "\n]"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/tools/usage/providers/xml_example_provider.py
|
|
2
|
+
from typing import Optional, TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
from autobyteus.llm.providers import LLMProvider
|
|
5
|
+
from autobyteus.tools.usage.registries.xml_example_formatter_registry import XmlExampleFormatterRegistry
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from autobyteus.tools.registry import ToolDefinition
|
|
9
|
+
|
|
10
|
+
class XmlExampleProvider:
|
|
11
|
+
"""Provides a tool usage example formatted as a single XML string."""
|
|
12
|
+
|
|
13
|
+
def __init__(self):
|
|
14
|
+
self._registry = XmlExampleFormatterRegistry()
|
|
15
|
+
|
|
16
|
+
def provide(self, tool_definition: 'ToolDefinition', llm_provider: Optional[LLMProvider] = None) -> str:
|
|
17
|
+
"""
|
|
18
|
+
Generates a single XML string for a tool usage example.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
tool_definition: A ToolDefinition object.
|
|
22
|
+
llm_provider: Ignored, for API consistency.
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
A string containing the XML tool usage example.
|
|
26
|
+
"""
|
|
27
|
+
formatter = self._registry.get_formatter(llm_provider)
|
|
28
|
+
return formatter.provide(tool_definition)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/tools/usage/providers/xml_schema_provider.py
|
|
2
|
+
from typing import Optional, TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
from autobyteus.llm.providers import LLMProvider
|
|
5
|
+
from autobyteus.tools.usage.registries.xml_schema_formatter_registry import XmlSchemaFormatterRegistry
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from autobyteus.tools.registry import ToolDefinition
|
|
9
|
+
|
|
10
|
+
class XmlSchemaProvider:
|
|
11
|
+
"""
|
|
12
|
+
Provides the schema for a single tool formatted as an XML string.
|
|
13
|
+
"""
|
|
14
|
+
def __init__(self):
|
|
15
|
+
self._registry = XmlSchemaFormatterRegistry()
|
|
16
|
+
|
|
17
|
+
def provide(self, tool_definition: 'ToolDefinition', llm_provider: Optional[LLMProvider] = None) -> str:
|
|
18
|
+
"""
|
|
19
|
+
Generates an XML string for a single tool's schema.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
tool_definition: A ToolDefinition object.
|
|
23
|
+
llm_provider: This argument is passed to the registry for API consistency.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
A string containing the XML tool schema.
|
|
27
|
+
"""
|
|
28
|
+
formatter = self._registry.get_formatter(llm_provider)
|
|
29
|
+
return formatter.provide(tool_definition)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/tools/usage/providers/xml_tool_usage_parser_provider.py
|
|
2
|
+
from typing import Optional, TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
from autobyteus.llm.providers import LLMProvider
|
|
5
|
+
from autobyteus.tools.usage.registries.xml_tool_usage_parser_registry import XmlToolUsageParserRegistry
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from autobyteus.tools.usage.parsers.base_parser import BaseToolUsageParser
|
|
9
|
+
|
|
10
|
+
class XmlToolUsageParserProvider:
|
|
11
|
+
"""Provides a tool usage parser for XML-based responses."""
|
|
12
|
+
|
|
13
|
+
def __init__(self):
|
|
14
|
+
self._registry = XmlToolUsageParserRegistry()
|
|
15
|
+
|
|
16
|
+
def provide(self, llm_provider: Optional[LLMProvider] = None) -> 'BaseToolUsageParser':
|
|
17
|
+
"""
|
|
18
|
+
Gets the appropriate parser from the registry.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
llm_provider: Ignored, for API consistency.
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
An instance of a class derived from BaseToolUsageParser.
|
|
25
|
+
"""
|
|
26
|
+
return self._registry.get_parser(llm_provider)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/tools/usage/registries/__init__.py
|
|
2
|
+
"""
|
|
3
|
+
This package contains registries for schema/example formatters and parsers,
|
|
4
|
+
allowing for easy retrieval of the correct component based on the LLM provider.
|
|
5
|
+
"""
|
|
6
|
+
from .json_schema_formatter_registry import JsonSchemaFormatterRegistry
|
|
7
|
+
from .xml_schema_formatter_registry import XmlSchemaFormatterRegistry
|
|
8
|
+
from .json_example_formatter_registry import JsonExampleFormatterRegistry
|
|
9
|
+
from .xml_example_formatter_registry import XmlExampleFormatterRegistry
|
|
10
|
+
from .xml_tool_usage_parser_registry import XmlToolUsageParserRegistry
|
|
11
|
+
from .json_tool_usage_parser_registry import JsonToolUsageParserRegistry
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"JsonSchemaFormatterRegistry",
|
|
15
|
+
"XmlSchemaFormatterRegistry",
|
|
16
|
+
"JsonExampleFormatterRegistry",
|
|
17
|
+
"XmlExampleFormatterRegistry",
|
|
18
|
+
"XmlToolUsageParserRegistry",
|
|
19
|
+
"JsonToolUsageParserRegistry",
|
|
20
|
+
]
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/tools/usage/registries/json_example_formatter_registry.py
|
|
2
|
+
import logging
|
|
3
|
+
from typing import Dict
|
|
4
|
+
|
|
5
|
+
from autobyteus.llm.providers import LLMProvider
|
|
6
|
+
from autobyteus.tools.usage.formatters.base_formatter import BaseExampleFormatter
|
|
7
|
+
from autobyteus.tools.usage.formatters.default_json_example_formatter import DefaultJsonExampleFormatter
|
|
8
|
+
from autobyteus.tools.usage.formatters.openai_json_example_formatter import OpenAiJsonExampleFormatter
|
|
9
|
+
from autobyteus.tools.usage.formatters.anthropic_json_example_formatter import AnthropicJsonExampleFormatter
|
|
10
|
+
from autobyteus.tools.usage.formatters.gemini_json_example_formatter import GeminiJsonExampleFormatter
|
|
11
|
+
from autobyteus.utils.singleton import SingletonMeta
|
|
12
|
+
|
|
13
|
+
logger = logging.getLogger(__name__)
|
|
14
|
+
|
|
15
|
+
class JsonExampleFormatterRegistry(metaclass=SingletonMeta):
|
|
16
|
+
"""A singleton registry for retrieving JSON example formatters based on LLM provider."""
|
|
17
|
+
|
|
18
|
+
def __init__(self):
|
|
19
|
+
self._formatters: Dict[LLMProvider, BaseExampleFormatter] = {
|
|
20
|
+
LLMProvider.OPENAI: OpenAiJsonExampleFormatter(),
|
|
21
|
+
LLMProvider.MISTRAL: OpenAiJsonExampleFormatter(),
|
|
22
|
+
LLMProvider.DEEPSEEK: OpenAiJsonExampleFormatter(),
|
|
23
|
+
LLMProvider.GROK: OpenAiJsonExampleFormatter(),
|
|
24
|
+
LLMProvider.ANTHROPIC: AnthropicJsonExampleFormatter(),
|
|
25
|
+
LLMProvider.GEMINI: GeminiJsonExampleFormatter(),
|
|
26
|
+
}
|
|
27
|
+
self._default_formatter = DefaultJsonExampleFormatter()
|
|
28
|
+
logger.info("JsonExampleFormatterRegistry initialized.")
|
|
29
|
+
|
|
30
|
+
def get_formatter(self, provider: LLMProvider) -> BaseExampleFormatter:
|
|
31
|
+
"""
|
|
32
|
+
Retrieves the appropriate example formatter for a given LLM provider.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
provider: The LLMProvider enum member.
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
An instance of a class derived from BaseExampleFormatter.
|
|
39
|
+
"""
|
|
40
|
+
formatter = self._formatters.get(provider)
|
|
41
|
+
if formatter:
|
|
42
|
+
logger.debug(f"Found specific example formatter for provider {provider.name}: {formatter.__class__.__name__}")
|
|
43
|
+
return formatter
|
|
44
|
+
|
|
45
|
+
logger.debug(f"No specific example formatter for provider {provider.name}. "
|
|
46
|
+
f"Returning default: {self._default_formatter.__class__.__name__}")
|
|
47
|
+
return self._default_formatter
|
|
48
|
+
|
|
49
|
+
def get_default_formatter(self) -> BaseExampleFormatter:
|
|
50
|
+
"""Explicitly returns the default formatter."""
|
|
51
|
+
return self._default_formatter
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/tools/usage/registries/json_schema_formatter_registry.py
|
|
2
|
+
import logging
|
|
3
|
+
from typing import Dict
|
|
4
|
+
|
|
5
|
+
from autobyteus.llm.providers import LLMProvider
|
|
6
|
+
from autobyteus.tools.usage.formatters.base_formatter import BaseSchemaFormatter
|
|
7
|
+
from autobyteus.tools.usage.formatters.default_json_schema_formatter import DefaultJsonSchemaFormatter
|
|
8
|
+
from autobyteus.tools.usage.formatters.openai_json_schema_formatter import OpenAiJsonSchemaFormatter
|
|
9
|
+
from autobyteus.tools.usage.formatters.anthropic_json_schema_formatter import AnthropicJsonSchemaFormatter
|
|
10
|
+
from autobyteus.tools.usage.formatters.gemini_json_schema_formatter import GeminiJsonSchemaFormatter
|
|
11
|
+
from autobyteus.utils.singleton import SingletonMeta
|
|
12
|
+
|
|
13
|
+
logger = logging.getLogger(__name__)
|
|
14
|
+
|
|
15
|
+
class JsonSchemaFormatterRegistry(metaclass=SingletonMeta):
|
|
16
|
+
"""A singleton registry for retrieving JSON schema formatters based on LLM provider."""
|
|
17
|
+
|
|
18
|
+
def __init__(self):
|
|
19
|
+
self._formatters: Dict[LLMProvider, BaseSchemaFormatter] = {
|
|
20
|
+
LLMProvider.OPENAI: OpenAiJsonSchemaFormatter(),
|
|
21
|
+
LLMProvider.MISTRAL: OpenAiJsonSchemaFormatter(),
|
|
22
|
+
LLMProvider.DEEPSEEK: OpenAiJsonSchemaFormatter(),
|
|
23
|
+
LLMProvider.GROK: OpenAiJsonSchemaFormatter(),
|
|
24
|
+
LLMProvider.ANTHROPIC: AnthropicJsonSchemaFormatter(),
|
|
25
|
+
LLMProvider.GEMINI: GeminiJsonSchemaFormatter(),
|
|
26
|
+
}
|
|
27
|
+
self._default_formatter = DefaultJsonSchemaFormatter()
|
|
28
|
+
logger.info("JsonSchemaFormatterRegistry initialized.")
|
|
29
|
+
|
|
30
|
+
def get_formatter(self, provider: LLMProvider) -> BaseSchemaFormatter:
|
|
31
|
+
"""
|
|
32
|
+
Retrieves the appropriate schema formatter for a given LLM provider.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
provider: The LLMProvider enum member.
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
An instance of a class derived from BaseSchemaFormatter.
|
|
39
|
+
"""
|
|
40
|
+
formatter = self._formatters.get(provider)
|
|
41
|
+
if formatter:
|
|
42
|
+
logger.debug(f"Found specific schema formatter for provider {provider.name}: {formatter.__class__.__name__}")
|
|
43
|
+
return formatter
|
|
44
|
+
|
|
45
|
+
logger.debug(f"No specific schema formatter for provider {provider.name}. "
|
|
46
|
+
f"Returning default: {self._default_formatter.__class__.__name__}")
|
|
47
|
+
return self._default_formatter
|
|
48
|
+
|
|
49
|
+
def get_default_formatter(self) -> BaseSchemaFormatter:
|
|
50
|
+
"""Explicitly returns the default formatter."""
|
|
51
|
+
return self._default_formatter
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/tools/usage/registries/json_tool_usage_parser_registry.py
|
|
2
|
+
import logging
|
|
3
|
+
from typing import Dict
|
|
4
|
+
|
|
5
|
+
from autobyteus.llm.providers import LLMProvider
|
|
6
|
+
from autobyteus.tools.usage.parsers.base_parser import BaseToolUsageParser
|
|
7
|
+
from autobyteus.tools.usage.parsers.default_json_tool_usage_parser import DefaultJsonToolUsageParser
|
|
8
|
+
from autobyteus.tools.usage.parsers.openai_json_tool_usage_parser import OpenAiJsonToolUsageParser
|
|
9
|
+
from autobyteus.tools.usage.parsers.gemini_json_tool_usage_parser import GeminiJsonToolUsageParser
|
|
10
|
+
from autobyteus.utils.singleton import SingletonMeta
|
|
11
|
+
|
|
12
|
+
logger = logging.getLogger(__name__)
|
|
13
|
+
|
|
14
|
+
class JsonToolUsageParserRegistry(metaclass=SingletonMeta):
|
|
15
|
+
"""A singleton registry for retrieving JSON-based tool usage parsers."""
|
|
16
|
+
|
|
17
|
+
def __init__(self):
|
|
18
|
+
self._parsers: Dict[LLMProvider, BaseToolUsageParser] = {
|
|
19
|
+
LLMProvider.OPENAI: OpenAiJsonToolUsageParser(),
|
|
20
|
+
LLMProvider.MISTRAL: OpenAiJsonToolUsageParser(),
|
|
21
|
+
LLMProvider.DEEPSEEK: OpenAiJsonToolUsageParser(),
|
|
22
|
+
LLMProvider.GROK: OpenAiJsonToolUsageParser(),
|
|
23
|
+
LLMProvider.GEMINI: GeminiJsonToolUsageParser(),
|
|
24
|
+
}
|
|
25
|
+
self._default_parser = DefaultJsonToolUsageParser()
|
|
26
|
+
logger.info("JsonToolUsageParserRegistry initialized.")
|
|
27
|
+
|
|
28
|
+
def get_parser(self, provider: LLMProvider) -> BaseToolUsageParser:
|
|
29
|
+
"""
|
|
30
|
+
Retrieves the appropriate parser for a given LLM provider.
|
|
31
|
+
"""
|
|
32
|
+
parser = self._parsers.get(provider)
|
|
33
|
+
if parser:
|
|
34
|
+
logger.debug(f"Found specific tool usage parser for provider {provider.name}: {parser.get_name()}")
|
|
35
|
+
return parser
|
|
36
|
+
|
|
37
|
+
logger.debug(f"No specific tool usage parser for provider {provider.name}. Returning default: {self._default_parser.get_name()}")
|
|
38
|
+
return self._default_parser
|
|
39
|
+
|
|
40
|
+
def get_default_parser(self) -> BaseToolUsageParser:
|
|
41
|
+
"""Explicitly returns the default parser."""
|
|
42
|
+
return self._default_parser
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/tools/usage/registries/xml_example_formatter_registry.py
|
|
2
|
+
import logging
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from autobyteus.llm.providers import LLMProvider
|
|
6
|
+
from autobyteus.tools.usage.formatters.base_formatter import BaseExampleFormatter
|
|
7
|
+
from autobyteus.tools.usage.formatters.default_xml_example_formatter import DefaultXmlExampleFormatter
|
|
8
|
+
from autobyteus.utils.singleton import SingletonMeta
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
class XmlExampleFormatterRegistry(metaclass=SingletonMeta):
|
|
13
|
+
"""A singleton registry for retrieving XML example formatters."""
|
|
14
|
+
|
|
15
|
+
def __init__(self):
|
|
16
|
+
self._default_formatter = DefaultXmlExampleFormatter()
|
|
17
|
+
logger.info("XmlExampleFormatterRegistry initialized.")
|
|
18
|
+
|
|
19
|
+
def get_formatter(self, provider: Optional[LLMProvider] = None) -> BaseExampleFormatter:
|
|
20
|
+
"""
|
|
21
|
+
Retrieves the appropriate XML example formatter.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
provider: The LLMProvider enum member. This is currently ignored
|
|
25
|
+
but is kept for API consistency and future expansion.
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
An instance of the DefaultXmlExampleFormatter.
|
|
29
|
+
"""
|
|
30
|
+
return self._default_formatter
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/tools/usage/registries/xml_schema_formatter_registry.py
|
|
2
|
+
import logging
|
|
3
|
+
from typing import Dict, Optional
|
|
4
|
+
|
|
5
|
+
from autobyteus.llm.providers import LLMProvider
|
|
6
|
+
from autobyteus.tools.usage.formatters.base_formatter import BaseSchemaFormatter
|
|
7
|
+
from autobyteus.tools.usage.formatters.default_xml_schema_formatter import DefaultXmlSchemaFormatter
|
|
8
|
+
from autobyteus.utils.singleton import SingletonMeta
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
class XmlSchemaFormatterRegistry(metaclass=SingletonMeta):
|
|
13
|
+
"""A singleton registry for retrieving XML schema formatters based on LLM provider."""
|
|
14
|
+
|
|
15
|
+
def __init__(self):
|
|
16
|
+
# Currently, there is only one XML format, so all providers map to it.
|
|
17
|
+
# This structure allows for future expansion if providers diverge.
|
|
18
|
+
self._default_formatter = DefaultXmlSchemaFormatter()
|
|
19
|
+
logger.info("XmlSchemaFormatterRegistry initialized.")
|
|
20
|
+
|
|
21
|
+
def get_formatter(self, provider: Optional[LLMProvider] = None) -> BaseSchemaFormatter:
|
|
22
|
+
"""
|
|
23
|
+
Retrieves the appropriate XML schema formatter.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
provider: The LLMProvider enum member. This is currently ignored
|
|
27
|
+
but is kept for API consistency and future expansion.
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
An instance of the DefaultXmlSchemaFormatter.
|
|
31
|
+
"""
|
|
32
|
+
# For now, we only have one XML formatter. This always returns it.
|
|
33
|
+
return self._default_formatter
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/tools/usage/registries/xml_tool_usage_parser_registry.py
|
|
2
|
+
import logging
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from autobyteus.llm.providers import LLMProvider
|
|
6
|
+
from autobyteus.tools.usage.parsers.base_parser import BaseToolUsageParser
|
|
7
|
+
from autobyteus.tools.usage.parsers.default_xml_tool_usage_parser import DefaultXmlToolUsageParser
|
|
8
|
+
from autobyteus.utils.singleton import SingletonMeta
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
class XmlToolUsageParserRegistry(metaclass=SingletonMeta):
|
|
13
|
+
"""A singleton registry for retrieving XML-based tool usage parsers."""
|
|
14
|
+
|
|
15
|
+
def __init__(self):
|
|
16
|
+
self._default_parser = DefaultXmlToolUsageParser()
|
|
17
|
+
logger.info("XmlToolUsageParserRegistry initialized.")
|
|
18
|
+
|
|
19
|
+
def get_parser(self, provider: Optional[LLMProvider] = None) -> BaseToolUsageParser:
|
|
20
|
+
"""
|
|
21
|
+
Retrieves the appropriate XML parser.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
provider: The LLMProvider enum member. Currently ignored but kept for API consistency.
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
An instance of a class derived from BaseToolUsageParser.
|
|
28
|
+
"""
|
|
29
|
+
# For now, there's only one XML format, so always return the default.
|
|
30
|
+
return self._default_parser
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autobyteus
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: Multi-Agent framework
|
|
5
5
|
Home-page: https://github.com/AutoByteus/autobyteus
|
|
6
6
|
Author: Ryan Zheng
|
|
@@ -25,10 +25,12 @@ Requires-Dist: boto3
|
|
|
25
25
|
Requires-Dist: botocore
|
|
26
26
|
Requires-Dist: anthropic==0.37.1
|
|
27
27
|
Requires-Dist: Jinja2
|
|
28
|
-
Requires-Dist: ollama
|
|
28
|
+
Requires-Dist: ollama
|
|
29
29
|
Requires-Dist: mistral_common
|
|
30
|
+
Requires-Dist: certifi==2025.4.26
|
|
31
|
+
Requires-Dist: numpy==2.2.5
|
|
30
32
|
Requires-Dist: aiohttp
|
|
31
|
-
Requires-Dist: autobyteus-llm-client==1.1.
|
|
33
|
+
Requires-Dist: autobyteus-llm-client==1.1.1
|
|
32
34
|
Requires-Dist: brui-core==1.0.8
|
|
33
35
|
Provides-Extra: dev
|
|
34
36
|
Requires-Dist: coverage; extra == "dev"
|
|
@@ -64,7 +66,19 @@ Dynamic: summary
|
|
|
64
66
|
|
|
65
67
|
# Autobyteus
|
|
66
68
|
|
|
67
|
-
Autobyteus is an open-source
|
|
69
|
+
Autobyteus is an open-source, application-first agentic framework for Python. It is designed to help developers build, test, and deploy complex, stateful, and extensible AI agents by providing a robust architecture and a powerful set of tools.
|
|
70
|
+
|
|
71
|
+
## Architecture
|
|
72
|
+
|
|
73
|
+
Autobyteus is built with a modular, event-driven architecture designed for extensibility and clear separation of concerns. The key components are:
|
|
74
|
+
|
|
75
|
+
- **Agent Core**: The heart of the system. Each agent is a stateful, autonomous entity that runs as a background process in its own thread, managed by a dedicated `AgentWorker`. This design makes every agent a truly independent entity capable of handling long-running tasks.
|
|
76
|
+
- **Context & Configuration**: Agent behavior is defined through a static configuration (`AgentConfig`) and its dynamic state is managed in `AgentRuntimeState`. These are bundled into a comprehensive `AgentContext` that is passed to all components, providing a single source of truth.
|
|
77
|
+
- **Event-Driven System**: Agents operate on an internal `asyncio` event loop. User messages, tool results, and internal signals are handled as events, which are processed by dedicated `EventHandlers`. This decouples logic and makes the system highly extensible.
|
|
78
|
+
- **Pluggable Processors & Hooks**: The framework provides extension points to inject custom logic. `InputProcessors` and `LLMResponseProcessors` modify data in the main processing pipeline, while `PhaseHooks` allow custom code to run on specific agent lifecycle transitions (e.g., from `BOOTSTRAPPING` to `IDLE`).
|
|
79
|
+
- **Context-Aware Tooling**: Tools are first-class citizens that receive the agent's full `AgentContext` during execution. This allows tools to be deeply integrated with the agent's state, configuration, and workspace, enabling more intelligent and powerful actions.
|
|
80
|
+
- **Tool Approval Flow**: The framework has native support for human-in-the-loop workflows. By setting `auto_execute_tools=False` in the agent's configuration, the agent will pause before executing a tool, emit an event requesting permission, and wait for external approval before proceeding.
|
|
81
|
+
- **MCP Integration**: The framework has native support for the Model Context Protocol (MCP). This allows agents to discover and use tools from external, language-agnostic tool servers, making the ecosystem extremely flexible and ready for enterprise integration.
|
|
68
82
|
|
|
69
83
|
## Features
|
|
70
84
|
|
|
@@ -74,7 +88,11 @@ Autobyteus is an open-source coding assistance tool designed to enhance the soft
|
|
|
74
88
|
|
|
75
89
|
## Knowledge Base
|
|
76
90
|
|
|
77
|
-
A significant part of
|
|
91
|
+
A significant part of Autobyteus is our custom-designed knowledge base focused on software and application development. The knowledge base is structured to support the entire development process, with particular emphasis on requirement engineering, which is crucial for successful project outcomes.
|
|
92
|
+
|
|
93
|
+
## Requirements
|
|
94
|
+
|
|
95
|
+
- **Python Version**: Python 3.11 is the recommended and tested version for this project. Using newer versions of Python may result in dependency conflicts when installing the required packages. For a stable and tested environment, please use Python 3.11.
|
|
78
96
|
|
|
79
97
|
## Getting Started
|
|
80
98
|
|