autobyteus 1.1.1__tar.gz → 1.1.2__tar.gz

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.
Files changed (312) hide show
  1. {autobyteus-1.1.1 → autobyteus-1.1.2}/PKG-INFO +3 -2
  2. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/runtime/agent_runtime.py +1 -4
  3. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/runtime/agent_worker.py +61 -18
  4. autobyteus-1.1.2/autobyteus/llm/api/deepseek_llm.py +26 -0
  5. autobyteus-1.1.2/autobyteus/llm/api/grok_llm.py +26 -0
  6. autobyteus-1.1.2/autobyteus/llm/api/kimi_llm.py +24 -0
  7. autobyteus-1.1.1/autobyteus/llm/api/deepseek_llm.py → autobyteus-1.1.2/autobyteus/llm/api/openai_compatible_llm.py +39 -34
  8. autobyteus-1.1.2/autobyteus/llm/api/openai_llm.py +26 -0
  9. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/llm_factory.py +62 -0
  10. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/providers.py +1 -0
  11. autobyteus-1.1.2/autobyteus/llm/token_counter/kimi_token_counter.py +24 -0
  12. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/token_counter/token_counter_factory.py +3 -0
  13. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/utils/messages.py +3 -3
  14. autobyteus-1.1.2/autobyteus/tools/usage/parsers/_json_extractor.py +99 -0
  15. autobyteus-1.1.2/autobyteus/tools/usage/parsers/default_json_tool_usage_parser.py +75 -0
  16. autobyteus-1.1.2/autobyteus/tools/usage/parsers/default_xml_tool_usage_parser.py +126 -0
  17. autobyteus-1.1.2/autobyteus/tools/usage/parsers/gemini_json_tool_usage_parser.py +58 -0
  18. autobyteus-1.1.2/autobyteus/tools/usage/parsers/openai_json_tool_usage_parser.py +146 -0
  19. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus.egg-info/PKG-INFO +3 -2
  20. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus.egg-info/SOURCES.txt +4 -0
  21. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus.egg-info/requires.txt +2 -1
  22. {autobyteus-1.1.1 → autobyteus-1.1.2}/setup.py +3 -2
  23. autobyteus-1.1.1/autobyteus/llm/api/grok_llm.py +0 -187
  24. autobyteus-1.1.1/autobyteus/llm/api/openai_llm.py +0 -154
  25. autobyteus-1.1.1/autobyteus/tools/usage/parsers/default_json_tool_usage_parser.py +0 -106
  26. autobyteus-1.1.1/autobyteus/tools/usage/parsers/default_xml_tool_usage_parser.py +0 -136
  27. autobyteus-1.1.1/autobyteus/tools/usage/parsers/gemini_json_tool_usage_parser.py +0 -66
  28. autobyteus-1.1.1/autobyteus/tools/usage/parsers/openai_json_tool_usage_parser.py +0 -196
  29. {autobyteus-1.1.1 → autobyteus-1.1.2}/LICENSE +0 -0
  30. {autobyteus-1.1.1 → autobyteus-1.1.2}/README.md +0 -0
  31. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/__init__.py +0 -0
  32. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/__init__.py +0 -0
  33. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/agent.py +0 -0
  34. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/bootstrap_steps/__init__.py +0 -0
  35. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/bootstrap_steps/agent_bootstrapper.py +0 -0
  36. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/bootstrap_steps/agent_runtime_queue_initialization_step.py +0 -0
  37. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/bootstrap_steps/base_bootstrap_step.py +0 -0
  38. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/bootstrap_steps/system_prompt_processing_step.py +0 -0
  39. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/bootstrap_steps/workspace_context_initialization_step.py +0 -0
  40. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/context/__init__.py +0 -0
  41. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/context/agent_config.py +0 -0
  42. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/context/agent_context.py +0 -0
  43. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/context/agent_phase_manager.py +0 -0
  44. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/context/agent_runtime_state.py +0 -0
  45. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/context/phases.py +0 -0
  46. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/events/__init__.py +0 -0
  47. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/events/agent_events.py +0 -0
  48. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/events/agent_input_event_queue_manager.py +0 -0
  49. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/events/notifiers.py +0 -0
  50. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/events/worker_event_dispatcher.py +0 -0
  51. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/exceptions.py +0 -0
  52. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/factory/__init__.py +0 -0
  53. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/factory/agent_factory.py +0 -0
  54. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/group/__init__.py +0 -0
  55. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/group/agent_group.py +0 -0
  56. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/group/agent_group_context.py +0 -0
  57. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/__init__.py +0 -0
  58. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/approved_tool_invocation_event_handler.py +0 -0
  59. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/base_event_handler.py +0 -0
  60. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/event_handler_registry.py +0 -0
  61. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/generic_event_handler.py +0 -0
  62. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/inter_agent_message_event_handler.py +0 -0
  63. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/lifecycle_event_logger.py +0 -0
  64. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/llm_complete_response_received_event_handler.py +0 -0
  65. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/llm_user_message_ready_event_handler.py +0 -0
  66. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/tool_execution_approval_event_handler.py +0 -0
  67. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/tool_invocation_request_event_handler.py +0 -0
  68. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/tool_result_event_handler.py +0 -0
  69. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/handlers/user_input_message_event_handler.py +0 -0
  70. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/hooks/__init__.py +0 -0
  71. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/hooks/base_phase_hook.py +0 -0
  72. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/hooks/hook_definition.py +0 -0
  73. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/hooks/hook_meta.py +0 -0
  74. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/hooks/hook_registry.py +0 -0
  75. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/input_processor/__init__.py +0 -0
  76. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/input_processor/base_user_input_processor.py +0 -0
  77. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/input_processor/content_prefixing_input_processor.py +0 -0
  78. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/input_processor/metadata_appending_input_processor.py +0 -0
  79. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/input_processor/passthrough_input_processor.py +0 -0
  80. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/input_processor/processor_definition.py +0 -0
  81. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/input_processor/processor_meta.py +0 -0
  82. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/input_processor/processor_registry.py +0 -0
  83. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/llm_response_processor/__init__.py +0 -0
  84. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/llm_response_processor/base_processor.py +0 -0
  85. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/llm_response_processor/processor_definition.py +0 -0
  86. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/llm_response_processor/processor_meta.py +0 -0
  87. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/llm_response_processor/processor_registry.py +0 -0
  88. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/llm_response_processor/provider_aware_tool_usage_processor.py +0 -0
  89. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/message/__init__.py +0 -0
  90. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/message/agent_input_user_message.py +0 -0
  91. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/message/context_file.py +0 -0
  92. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/message/context_file_type.py +0 -0
  93. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/message/inter_agent_message.py +0 -0
  94. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/message/inter_agent_message_type.py +0 -0
  95. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/message/send_message_to.py +0 -0
  96. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/phases/__init__.py +0 -0
  97. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/phases/discover.py +0 -0
  98. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/phases/manager.py +0 -0
  99. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/phases/phase_enum.py +0 -0
  100. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/phases/transition_decorator.py +0 -0
  101. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/phases/transition_info.py +0 -0
  102. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/remote_agent.py +0 -0
  103. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/runtime/__init__.py +0 -0
  104. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/runtime/agent_thread_pool_manager.py +0 -0
  105. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/streaming/__init__.py +0 -0
  106. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/streaming/agent_event_stream.py +0 -0
  107. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/streaming/queue_streamer.py +0 -0
  108. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/streaming/stream_event_payloads.py +0 -0
  109. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/streaming/stream_events.py +0 -0
  110. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/system_prompt_processor/__init__.py +0 -0
  111. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/system_prompt_processor/base_processor.py +0 -0
  112. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/system_prompt_processor/processor_definition.py +0 -0
  113. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/system_prompt_processor/processor_meta.py +0 -0
  114. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/system_prompt_processor/processor_registry.py +0 -0
  115. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/system_prompt_processor/tool_manifest_injector_processor.py +0 -0
  116. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/tool_invocation.py +0 -0
  117. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/utils/__init__.py +0 -0
  118. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/utils/wait_for_idle.py +0 -0
  119. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/workflow/__init__.py +0 -0
  120. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/workflow/agentic_workflow.py +0 -0
  121. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/workflow/base_agentic_workflow.py +0 -0
  122. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/workspace/__init__.py +0 -0
  123. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/workspace/base_workspace.py +0 -0
  124. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/workspace/workspace_config.py +0 -0
  125. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/workspace/workspace_definition.py +0 -0
  126. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/workspace/workspace_meta.py +0 -0
  127. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/agent/workspace/workspace_registry.py +0 -0
  128. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/check_requirements.py +0 -0
  129. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/cli/__init__.py +0 -0
  130. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/cli/agent_cli.py +0 -0
  131. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/cli/cli_display.py +0 -0
  132. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/events/__init__.py +0 -0
  133. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/events/event_emitter.py +0 -0
  134. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/events/event_manager.py +0 -0
  135. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/events/event_types.py +0 -0
  136. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/__init__.py +0 -0
  137. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/api/__init__.py +0 -0
  138. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/api/autobyteus_llm.py +0 -0
  139. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/api/bedrock_llm.py +0 -0
  140. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/api/claude_llm.py +0 -0
  141. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/api/gemini_llm.py +0 -0
  142. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/api/groq_llm.py +0 -0
  143. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/api/mistral_llm.py +0 -0
  144. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/api/nvidia_llm.py +0 -0
  145. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/api/ollama_llm.py +0 -0
  146. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/autobyteus_provider.py +0 -0
  147. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/base_llm.py +0 -0
  148. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/extensions/__init__.py +0 -0
  149. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/extensions/base_extension.py +0 -0
  150. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/extensions/extension_registry.py +0 -0
  151. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/extensions/token_usage_tracking_extension.py +0 -0
  152. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/models.py +0 -0
  153. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/ollama_provider.py +0 -0
  154. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/ollama_provider_resolver.py +0 -0
  155. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/token_counter/__init__.py +0 -0
  156. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/token_counter/base_token_counter.py +0 -0
  157. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/token_counter/claude_token_counter.py +0 -0
  158. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/token_counter/deepseek_token_counter.py +0 -0
  159. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/token_counter/mistral_token_counter.py +0 -0
  160. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/token_counter/openai_token_counter.py +0 -0
  161. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/user_message.py +0 -0
  162. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/utils/__init__.py +0 -0
  163. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/utils/image_payload_formatter.py +0 -0
  164. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/utils/llm_config.py +0 -0
  165. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/utils/rate_limiter.py +0 -0
  166. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/utils/response_types.py +0 -0
  167. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/utils/token_pricing_config.py +0 -0
  168. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/utils/token_usage.py +0 -0
  169. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/llm/utils/token_usage_tracker.py +0 -0
  170. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/person/__init__.py +0 -0
  171. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/person/examples/__init__.py +0 -0
  172. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/person/examples/sample_persons.py +0 -0
  173. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/person/examples/sample_roles.py +0 -0
  174. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/person/person.py +0 -0
  175. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/person/role.py +0 -0
  176. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/prompt/__init__.py +0 -0
  177. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/prompt/prompt_builder.py +0 -0
  178. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/prompt/prompt_template.py +0 -0
  179. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/__init__.py +0 -0
  180. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/client/__init__.py +0 -0
  181. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/client/abstract_client_connection.py +0 -0
  182. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/client/client_connection_manager.py +0 -0
  183. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/client/sse_client_connection.py +0 -0
  184. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/client/stdio_client_connection.py +0 -0
  185. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/config/__init__.py +0 -0
  186. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/config/agent_server_config.py +0 -0
  187. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/config/agent_server_registry.py +0 -0
  188. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/hosting.py +0 -0
  189. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/protocol.py +0 -0
  190. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/server/__init__.py +0 -0
  191. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/server/agent_server_endpoint.py +0 -0
  192. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/server/base_method_handler.py +0 -0
  193. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/server/method_handlers.py +0 -0
  194. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/server/sse_server_handler.py +0 -0
  195. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/server/stdio_server_handler.py +0 -0
  196. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/server_main.py +0 -0
  197. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/rpc/transport_type.py +0 -0
  198. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/__init__.py +0 -0
  199. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/ask_user_input.py +0 -0
  200. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/base_tool.py +0 -0
  201. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/bash/__init__.py +0 -0
  202. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/bash/bash_executor.py +0 -0
  203. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/__init__.py +0 -0
  204. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/__init__.py +0 -0
  205. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/browser_session_aware_navigate_to.py +0 -0
  206. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/browser_session_aware_tool.py +0 -0
  207. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/browser_session_aware_web_element_trigger.py +0 -0
  208. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/browser_session_aware_webpage_reader.py +0 -0
  209. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/browser_session_aware_webpage_screenshot_taker.py +0 -0
  210. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/factory/__init__.py +0 -0
  211. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/factory/browser_session_aware_web_element_trigger_factory.py +0 -0
  212. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/factory/browser_session_aware_webpage_reader_factory.py +0 -0
  213. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/factory/browser_session_aware_webpage_screenshot_taker_factory.py +0 -0
  214. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/shared_browser_session.py +0 -0
  215. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/shared_browser_session_manager.py +0 -0
  216. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/session_aware/web_element_action.py +0 -0
  217. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/standalone/__init__.py +0 -0
  218. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/standalone/factory/__init__.py +0 -0
  219. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/standalone/factory/google_search_factory.py +0 -0
  220. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/standalone/factory/webpage_reader_factory.py +0 -0
  221. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/standalone/factory/webpage_screenshot_taker_factory.py +0 -0
  222. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/standalone/google_search_ui.py +0 -0
  223. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/standalone/navigate_to.py +0 -0
  224. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/standalone/web_page_pdf_generator.py +0 -0
  225. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/standalone/webpage_image_downloader.py +0 -0
  226. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/standalone/webpage_reader.py +0 -0
  227. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/browser/standalone/webpage_screenshot_taker.py +0 -0
  228. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/factory/__init__.py +0 -0
  229. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/factory/tool_factory.py +0 -0
  230. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/file/__init__.py +0 -0
  231. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/file/file_reader.py +0 -0
  232. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/file/file_writer.py +0 -0
  233. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/functional_tool.py +0 -0
  234. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/handlers/__init__.py +0 -0
  235. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/handlers/shell_handler.py +0 -0
  236. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/image_downloader.py +0 -0
  237. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/mcp/__init__.py +0 -0
  238. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/mcp/call_handlers/__init__.py +0 -0
  239. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/mcp/call_handlers/base_handler.py +0 -0
  240. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/mcp/call_handlers/sse_handler.py +0 -0
  241. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/mcp/call_handlers/stdio_handler.py +0 -0
  242. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/mcp/call_handlers/streamable_http_handler.py +0 -0
  243. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/mcp/config_service.py +0 -0
  244. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/mcp/factory.py +0 -0
  245. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/mcp/registrar.py +0 -0
  246. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/mcp/schema_mapper.py +0 -0
  247. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/mcp/tool.py +0 -0
  248. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/mcp/types.py +0 -0
  249. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/operation/__init__.py +0 -0
  250. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/operation/file_operation.py +0 -0
  251. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/operation/file_rename_operation.py +0 -0
  252. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/operation/operation.py +0 -0
  253. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/operation/shell_operation.py +0 -0
  254. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/parameter_schema.py +0 -0
  255. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/pdf_downloader.py +0 -0
  256. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/registry/__init__.py +0 -0
  257. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/registry/tool_definition.py +0 -0
  258. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/registry/tool_registry.py +0 -0
  259. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/timer.py +0 -0
  260. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/tool_category.py +0 -0
  261. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/tool_config.py +0 -0
  262. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/tool_meta.py +0 -0
  263. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/tool_state.py +0 -0
  264. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/__init__.py +0 -0
  265. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/__init__.py +0 -0
  266. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/anthropic_json_example_formatter.py +0 -0
  267. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/anthropic_json_schema_formatter.py +0 -0
  268. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/base_formatter.py +0 -0
  269. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/default_json_example_formatter.py +0 -0
  270. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/default_json_schema_formatter.py +0 -0
  271. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/default_xml_example_formatter.py +0 -0
  272. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/default_xml_schema_formatter.py +0 -0
  273. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/gemini_json_example_formatter.py +0 -0
  274. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/gemini_json_schema_formatter.py +0 -0
  275. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/google_json_example_formatter.py +0 -0
  276. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/google_json_schema_formatter.py +0 -0
  277. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/openai_json_example_formatter.py +0 -0
  278. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/formatters/openai_json_schema_formatter.py +0 -0
  279. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/parsers/__init__.py +0 -0
  280. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/parsers/anthropic_xml_tool_usage_parser.py +0 -0
  281. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/parsers/base_parser.py +0 -0
  282. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/parsers/exceptions.py +0 -0
  283. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/parsers/provider_aware_tool_usage_parser.py +0 -0
  284. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/providers/__init__.py +0 -0
  285. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/providers/json_example_provider.py +0 -0
  286. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/providers/json_schema_provider.py +0 -0
  287. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/providers/json_tool_usage_parser_provider.py +0 -0
  288. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/providers/tool_manifest_provider.py +0 -0
  289. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/providers/xml_example_provider.py +0 -0
  290. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/providers/xml_schema_provider.py +0 -0
  291. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/providers/xml_tool_usage_parser_provider.py +0 -0
  292. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/registries/__init__.py +0 -0
  293. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/registries/json_example_formatter_registry.py +0 -0
  294. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/registries/json_schema_formatter_registry.py +0 -0
  295. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/registries/json_tool_usage_parser_registry.py +0 -0
  296. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/registries/xml_example_formatter_registry.py +0 -0
  297. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/registries/xml_schema_formatter_registry.py +0 -0
  298. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/usage/registries/xml_tool_usage_parser_registry.py +0 -0
  299. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/tools/utils.py +0 -0
  300. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/utils/__init__.py +0 -0
  301. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/utils/dynamic_enum.py +0 -0
  302. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/utils/file_utils.py +0 -0
  303. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/utils/html_cleaner.py +0 -0
  304. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/utils/singleton.py +0 -0
  305. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/workflow/__init__.py +0 -0
  306. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/workflow/simple_task.py +0 -0
  307. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/workflow/task.py +0 -0
  308. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus/workflow/workflow.py +0 -0
  309. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus.egg-info/dependency_links.txt +0 -0
  310. {autobyteus-1.1.1 → autobyteus-1.1.2}/autobyteus.egg-info/top_level.txt +0 -0
  311. {autobyteus-1.1.1 → autobyteus-1.1.2}/pyproject.toml +0 -0
  312. {autobyteus-1.1.1 → autobyteus-1.1.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autobyteus
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Multi-Agent framework
5
5
  Home-page: https://github.com/AutoByteus/autobyteus
6
6
  Author: Ryan Zheng
@@ -26,7 +26,8 @@ Requires-Dist: botocore
26
26
  Requires-Dist: anthropic==0.37.1
27
27
  Requires-Dist: Jinja2
28
28
  Requires-Dist: ollama
29
- Requires-Dist: mistral_common
29
+ Requires-Dist: mistral_common==1.6.3
30
+ Requires-Dist: mistralai==1.5.2
30
31
  Requires-Dist: certifi==2025.4.26
31
32
  Requires-Dist: numpy==2.2.5
32
33
  Requires-Dist: aiohttp
@@ -120,10 +120,7 @@ class AgentRuntime:
120
120
  await self.phase_manager.notify_shutdown_initiated()
121
121
  await self._worker.stop(timeout=timeout)
122
122
 
123
- if self.context.llm_instance and hasattr(self.context.llm_instance, 'cleanup'):
124
- cleanup_func = self.context.llm_instance.cleanup
125
- if asyncio.iscoroutinefunction(cleanup_func): await cleanup_func()
126
- else: cleanup_func()
123
+ # LLM instance cleanup is now handled by the AgentWorker before its loop closes.
127
124
 
128
125
  await self.phase_manager.notify_final_shutdown_complete()
129
126
  logger.info(f"AgentRuntime for '{agent_id}' stop() method completed.")
@@ -140,19 +140,19 @@ class AgentWorker:
140
140
 
141
141
  async def async_run(self) -> None:
142
142
  agent_id = self.context.agent_id
143
- logger.info(f"AgentWorker '{agent_id}' async_run(): Starting.")
144
-
145
- # --- Direct Initialization ---
146
- initialization_successful = await self._initialize()
147
- if not initialization_successful:
148
- logger.critical(f"AgentWorker '{agent_id}' failed to initialize. Worker is shutting down.")
149
- if self._async_stop_event and not self._async_stop_event.is_set():
150
- self._async_stop_event.set()
151
- return
152
-
153
- # --- Main Event Loop ---
154
- logger.info(f"AgentWorker '{agent_id}' initialized successfully. Entering main event loop.")
155
143
  try:
144
+ logger.info(f"AgentWorker '{agent_id}' async_run(): Starting.")
145
+
146
+ # --- Direct Initialization ---
147
+ initialization_successful = await self._initialize()
148
+ if not initialization_successful:
149
+ logger.critical(f"AgentWorker '{agent_id}' failed to initialize. Worker is shutting down.")
150
+ if self._async_stop_event and not self._async_stop_event.is_set():
151
+ self._async_stop_event.set()
152
+ return
153
+
154
+ # --- Main Event Loop ---
155
+ logger.info(f"AgentWorker '{agent_id}' initialized successfully. Entering main event loop.")
156
156
  while not self._async_stop_event.is_set():
157
157
  try:
158
158
  queue_event_tuple = await asyncio.wait_for(
@@ -183,18 +183,61 @@ class AgentWorker:
183
183
  if self.context.state.input_event_queues:
184
184
  await self.context.state.input_event_queues.enqueue_internal_system_event(AgentStoppedEvent())
185
185
 
186
+ async def _shutdown_sequence(self):
187
+ """
188
+ The explicit, ordered shutdown sequence for the worker, executed on its own event loop.
189
+ """
190
+ agent_id = self.context.agent_id
191
+ logger.info(f"AgentWorker '{agent_id}': Running shutdown sequence on worker loop.")
192
+
193
+ # 1. Clean up resources like the LLM instance.
194
+ if self.context.llm_instance and hasattr(self.context.llm_instance, 'cleanup'):
195
+ logger.info(f"AgentWorker '{agent_id}': Running LLM instance cleanup.")
196
+ try:
197
+ cleanup_func = self.context.llm_instance.cleanup
198
+ if asyncio.iscoroutinefunction(cleanup_func):
199
+ await cleanup_func()
200
+ else:
201
+ cleanup_func()
202
+ logger.info(f"AgentWorker '{agent_id}': LLM instance cleanup completed.")
203
+ except Exception as e:
204
+ logger.error(f"AgentWorker '{agent_id}': Error during LLM instance cleanup: {e}", exc_info=True)
205
+
206
+ # 2. Signal the main event loop to stop.
207
+ await self._signal_internal_stop()
208
+ logger.info(f"AgentWorker '{agent_id}': Shutdown sequence completed.")
209
+
186
210
  async def stop(self, timeout: float = 10.0) -> None:
211
+ """
212
+ Gracefully stops the worker by scheduling a final shutdown sequence on its
213
+ event loop, then waiting for the thread to terminate.
214
+ """
187
215
  if not self._is_active or self._stop_initiated:
188
216
  return
217
+
218
+ agent_id = self.context.agent_id
219
+ logger.info(f"AgentWorker '{agent_id}': Stop requested.")
189
220
  self._stop_initiated = True
190
- if self.get_worker_loop() and self._async_stop_event:
191
- future = asyncio.run_coroutine_threadsafe(self._signal_internal_stop(), self.get_worker_loop())
192
- try: future.result(timeout=1.0)
193
- except Exception: pass
221
+
222
+ # Schedule the explicit shutdown sequence on the worker's loop.
223
+ if self.get_worker_loop():
224
+ future = self.schedule_coroutine_on_worker_loop(self._shutdown_sequence)
225
+ try:
226
+ # Wait for the cleanup and stop signal to be processed.
227
+ future.result(timeout=max(1.0, timeout-1))
228
+ except Exception as e:
229
+ logger.error(f"AgentWorker '{agent_id}': Error during scheduled shutdown sequence: {e}", exc_info=True)
230
+
231
+ # Wait for the main thread future to complete.
194
232
  if self._thread_future:
195
- try: await asyncio.wait_for(asyncio.wrap_future(self._thread_future), timeout=timeout)
196
- except asyncio.TimeoutError: logger.warning(f"Timeout waiting for worker thread of '{self.context.agent_id}'.")
233
+ try:
234
+ await asyncio.wait_for(asyncio.wrap_future(self._thread_future), timeout=timeout)
235
+ logger.info(f"AgentWorker '{agent_id}': Worker thread has terminated.")
236
+ except asyncio.TimeoutError:
237
+ logger.warning(f"AgentWorker '{agent_id}': Timeout waiting for worker thread to terminate.")
238
+
197
239
  self._is_active = False
198
240
 
241
+
199
242
  def is_alive(self) -> bool:
200
243
  return self._thread_future is not None and not self._thread_future.done()
@@ -0,0 +1,26 @@
1
+ import logging
2
+ from typing import Optional
3
+ from autobyteus.llm.models import LLMModel
4
+ from autobyteus.llm.utils.llm_config import LLMConfig
5
+ from autobyteus.llm.api.openai_compatible_llm import OpenAICompatibleLLM
6
+
7
+ logger = logging.getLogger(__name__)
8
+
9
+ class DeepSeekLLM(OpenAICompatibleLLM):
10
+ def __init__(self, model: LLMModel = None, llm_config: LLMConfig = None):
11
+ # Provide defaults if not specified
12
+ if model is None:
13
+ model = LLMModel['deepseek-chat']
14
+ if llm_config is None:
15
+ llm_config = LLMConfig()
16
+
17
+ super().__init__(
18
+ model=model,
19
+ llm_config=llm_config,
20
+ api_key_env_var="DEEPSEEK_API_KEY",
21
+ base_url="https://api.deepseek.com"
22
+ )
23
+ logger.info(f"DeepSeekLLM initialized with model: {self.model}")
24
+
25
+ async def cleanup(self):
26
+ await super().cleanup()
@@ -0,0 +1,26 @@
1
+ import logging
2
+ from typing import Optional
3
+ from autobyteus.llm.models import LLMModel
4
+ from autobyteus.llm.utils.llm_config import LLMConfig
5
+ from autobyteus.llm.api.openai_compatible_llm import OpenAICompatibleLLM
6
+
7
+ logger = logging.getLogger(__name__)
8
+
9
+ class GrokLLM(OpenAICompatibleLLM):
10
+ def __init__(self, model: LLMModel = None, llm_config: LLMConfig = None):
11
+ # Provide defaults if not specified
12
+ if model is None:
13
+ model = LLMModel['grok-2-1212']
14
+ if llm_config is None:
15
+ llm_config = LLMConfig()
16
+
17
+ super().__init__(
18
+ model=model,
19
+ llm_config=llm_config,
20
+ api_key_env_var="GROK_API_KEY",
21
+ base_url="https://api.x.ai/v1"
22
+ )
23
+ logger.info(f"GrokLLM initialized with model: {self.model}")
24
+
25
+ async def cleanup(self):
26
+ await super().cleanup()
@@ -0,0 +1,24 @@
1
+ import logging
2
+ from typing import Optional
3
+ from autobyteus.llm.models import LLMModel
4
+ from autobyteus.llm.utils.llm_config import LLMConfig
5
+ from autobyteus.llm.api.openai_compatible_llm import OpenAICompatibleLLM
6
+
7
+ logger = logging.getLogger(__name__)
8
+
9
+ class KimiLLM(OpenAICompatibleLLM):
10
+ def __init__(self, model: LLMModel = None, llm_config: LLMConfig = None):
11
+ # Provide defaults if not specified
12
+ if model is None:
13
+ # Setting a default Kimi model from the factory ones
14
+ model = LLMModel['kimi-latest']
15
+ if llm_config is None:
16
+ llm_config = LLMConfig()
17
+
18
+ super().__init__(
19
+ model=model,
20
+ llm_config=llm_config,
21
+ api_key_env_var="KIMI_API_KEY",
22
+ base_url="https://api.moonshot.cn/v1"
23
+ )
24
+ logger.info(f"KimiLLM initialized with model: {self.model}")
@@ -1,37 +1,38 @@
1
1
  import logging
2
2
  import os
3
+ from abc import ABC
3
4
  from typing import Optional, List, AsyncGenerator
4
5
  from openai import OpenAI
5
6
  from openai.types.completion_usage import CompletionUsage
6
7
  from openai.types.chat import ChatCompletionChunk
8
+
7
9
  from autobyteus.llm.base_llm import BaseLLM
8
10
  from autobyteus.llm.models import LLMModel
9
11
  from autobyteus.llm.utils.llm_config import LLMConfig
10
- from autobyteus.llm.utils.messages import MessageRole
11
12
  from autobyteus.llm.utils.image_payload_formatter import process_image
12
13
  from autobyteus.llm.utils.token_usage import TokenUsage
13
14
  from autobyteus.llm.utils.response_types import CompleteResponse, ChunkResponse
14
15
 
15
16
  logger = logging.getLogger(__name__)
16
17
 
17
- class DeepSeekLLM(BaseLLM):
18
- def __init__(self, model: LLMModel = None, llm_config: LLMConfig = None):
19
- deepseek_api_key = os.getenv("DEEPSEEK_API_KEY")
20
- if not deepseek_api_key:
21
- logger.error("DEEPSEEK_API_KEY environment variable is not set.")
22
- raise ValueError("DEEPSEEK_API_KEY environment variable is not set.")
23
-
24
- self.client = OpenAI(api_key=deepseek_api_key, base_url="https://api.deepseek.com")
25
- logger.info("DeepSeek API key and base URL set successfully")
26
-
27
- # Provide defaults if not specified
28
- if model is None:
29
- model = LLMModel.deepseek_chat
30
- if llm_config is None:
31
- llm_config = LLMConfig()
32
-
18
+ class OpenAICompatibleLLM(BaseLLM, ABC):
19
+ def __init__(
20
+ self,
21
+ model: LLMModel,
22
+ llm_config: LLMConfig,
23
+ api_key_env_var: str,
24
+ base_url: str
25
+ ):
26
+ api_key = os.getenv(api_key_env_var)
27
+ if not api_key:
28
+ logger.error(f"{api_key_env_var} environment variable is not set.")
29
+ raise ValueError(f"{api_key_env_var} environment variable is not set.")
30
+
31
+ self.client = OpenAI(api_key=api_key, base_url=base_url)
32
+ logger.info(f"Initialized OpenAI compatible client with base_url: {base_url}")
33
+
33
34
  super().__init__(model=model, llm_config=llm_config)
34
- self.max_tokens = 8000
35
+ self.max_tokens = 8000 # A default, can be overridden by subclass or config
35
36
 
36
37
  def _create_token_usage(self, usage_data: Optional[CompletionUsage]) -> Optional[TokenUsage]:
37
38
  """Convert usage data to TokenUsage format."""
@@ -48,7 +49,7 @@ class DeepSeekLLM(BaseLLM):
48
49
  self, user_message: str, image_urls: Optional[List[str]] = None, **kwargs
49
50
  ) -> CompleteResponse:
50
51
  """
51
- Sends a non-streaming request to the DeepSeek API.
52
+ Sends a non-streaming request to an OpenAI-compatible API.
52
53
  Supports optional reasoning content if provided in the response.
53
54
  """
54
55
  content = []
@@ -70,13 +71,13 @@ class DeepSeekLLM(BaseLLM):
70
71
  logger.debug(f"Prepared message content: {content}")
71
72
 
72
73
  try:
73
- logger.info("Sending request to DeepSeek API")
74
+ logger.info(f"Sending request to {self.model.provider.value} API")
74
75
  response = self.client.chat.completions.create(
75
76
  model=self.model.value,
76
77
  messages=[msg.to_dict() for msg in self.messages],
77
78
  max_tokens=self.max_tokens,
78
79
  )
79
- full_message = response.choices.message
80
+ full_message = response.choices[0].message
80
81
 
81
82
  # Extract reasoning_content if present
82
83
  reasoning = None
@@ -95,7 +96,7 @@ class DeepSeekLLM(BaseLLM):
95
96
  self.add_assistant_message(main_content, reasoning_content=reasoning)
96
97
 
97
98
  token_usage = self._create_token_usage(response.usage)
98
- logger.info("Received response from DeepSeek API with usage data")
99
+ logger.info(f"Received response from {self.model.provider.value} API with usage data")
99
100
 
100
101
  return CompleteResponse(
101
102
  content=main_content,
@@ -103,14 +104,14 @@ class DeepSeekLLM(BaseLLM):
103
104
  usage=token_usage
104
105
  )
105
106
  except Exception as e:
106
- logger.error(f"Error in DeepSeek API request: {str(e)}")
107
- raise ValueError(f"Error in DeepSeek API request: {str(e)}")
108
-
107
+ logger.error(f"Error in {self.model.provider.value} API request: {str(e)}")
108
+ raise ValueError(f"Error in {self.model.provider.value} API request: {str(e)}")
109
+
109
110
  async def _stream_user_message_to_llm(
110
111
  self, user_message: str, image_urls: Optional[List[str]] = None, **kwargs
111
112
  ) -> AsyncGenerator[ChunkResponse, None]:
112
113
  """
113
- Streams the response from the DeepSeek API.
114
+ Streams the response from an OpenAI-compatible API.
114
115
  Yields reasoning and content in separate chunks.
115
116
  """
116
117
  content = []
@@ -136,7 +137,7 @@ class DeepSeekLLM(BaseLLM):
136
137
  accumulated_content = ""
137
138
 
138
139
  try:
139
- logger.info("Starting streaming request to DeepSeek API")
140
+ logger.info(f"Starting streaming request to {self.model.provider.value} API")
140
141
  stream = self.client.chat.completions.create(
141
142
  model=self.model.value,
142
143
  messages=[msg.to_dict() for msg in self.messages],
@@ -147,9 +148,13 @@ class DeepSeekLLM(BaseLLM):
147
148
 
148
149
  for chunk in stream:
149
150
  chunk: ChatCompletionChunk
151
+ if not chunk.choices:
152
+ continue
153
+
154
+ delta = chunk.choices[0].delta
150
155
 
151
- # Process reasoning tokens
152
- reasoning_chunk = getattr(chunk.choices.delta, "reasoning_content", None)
156
+ # Process reasoning tokens (if supported by model)
157
+ reasoning_chunk = getattr(delta, "reasoning_content", None)
153
158
  if reasoning_chunk:
154
159
  accumulated_reasoning += reasoning_chunk
155
160
  yield ChunkResponse(
@@ -158,7 +163,7 @@ class DeepSeekLLM(BaseLLM):
158
163
  )
159
164
 
160
165
  # Process main content tokens
161
- main_token = chunk.choices.delta.content
166
+ main_token = delta.content
162
167
  if main_token:
163
168
  accumulated_content += main_token
164
169
  yield ChunkResponse(
@@ -178,11 +183,11 @@ class DeepSeekLLM(BaseLLM):
178
183
 
179
184
  # After streaming, add the fully accumulated assistant message to history
180
185
  self.add_assistant_message(accumulated_content, reasoning_content=accumulated_reasoning)
181
- logger.info("Completed streaming response from DeepSeek API")
186
+ logger.info(f"Completed streaming response from {self.model.provider.value} API")
182
187
 
183
188
  except Exception as e:
184
- logger.error(f"Error in DeepSeek API streaming: {str(e)}")
185
- raise ValueError(f"Error in DeepSeek API streaming: {str(e)}")
186
-
189
+ logger.error(f"Error in {self.model.provider.value} API streaming: {str(e)}")
190
+ raise ValueError(f"Error in {self.model.provider.value} API streaming: {str(e)}")
191
+
187
192
  async def cleanup(self):
188
193
  await super().cleanup()
@@ -0,0 +1,26 @@
1
+ import logging
2
+ from typing import Optional
3
+ from autobyteus.llm.models import LLMModel
4
+ from autobyteus.llm.utils.llm_config import LLMConfig
5
+ from autobyteus.llm.api.openai_compatible_llm import OpenAICompatibleLLM
6
+
7
+ logger = logging.getLogger(__name__)
8
+
9
+ class OpenAILLM(OpenAICompatibleLLM):
10
+ def __init__(self, model: LLMModel = None, llm_config: LLMConfig = None):
11
+ # Provide defaults if not specified
12
+ if model is None:
13
+ model = LLMModel['gpt-4o'] # Use factory access
14
+ if llm_config is None:
15
+ llm_config = LLMConfig()
16
+
17
+ super().__init__(
18
+ model=model,
19
+ llm_config=llm_config,
20
+ api_key_env_var="OPENAI_API_KEY",
21
+ base_url="https://api.openai.com/v1"
22
+ )
23
+ logger.info(f"OpenAILLM initialized with model: {self.model}")
24
+
25
+ async def cleanup(self):
26
+ await super().cleanup()
@@ -14,6 +14,7 @@ from autobyteus.llm.api.openai_llm import OpenAILLM
14
14
  from autobyteus.llm.api.ollama_llm import OllamaLLM
15
15
  from autobyteus.llm.api.deepseek_llm import DeepSeekLLM
16
16
  from autobyteus.llm.api.grok_llm import GrokLLM
17
+ from autobyteus.llm.api.kimi_llm import KimiLLM
17
18
  from autobyteus.llm.ollama_provider import OllamaModelProvider
18
19
  from autobyteus.utils.singleton import SingletonMeta
19
20
 
@@ -239,6 +240,67 @@ class LLMFactory(metaclass=SingletonMeta):
239
240
  pricing_config=TokenPricingConfig(2.0, 6.0)
240
241
  )
241
242
  ),
243
+ # KIMI Provider Models
244
+ LLMModel(
245
+ name="kimi-latest",
246
+ value="kimi-latest",
247
+ provider=LLMProvider.KIMI,
248
+ llm_class=KimiLLM,
249
+ canonical_name="kimi-latest",
250
+ default_config=LLMConfig(
251
+ pricing_config=TokenPricingConfig(1.38, 4.14)
252
+ )
253
+ ),
254
+ LLMModel(
255
+ name="moonshot-v1-8k",
256
+ value="moonshot-v1-8k",
257
+ provider=LLMProvider.KIMI,
258
+ llm_class=KimiLLM,
259
+ canonical_name="moonshot-v1-8k",
260
+ default_config=LLMConfig(
261
+ pricing_config=TokenPricingConfig(0.28, 1.38)
262
+ )
263
+ ),
264
+ LLMModel(
265
+ name="moonshot-v1-32k",
266
+ value="moonshot-v1-32k",
267
+ provider=LLMProvider.KIMI,
268
+ llm_class=KimiLLM,
269
+ canonical_name="moonshot-v1-32k",
270
+ default_config=LLMConfig(
271
+ pricing_config=TokenPricingConfig(0.69, 2.76)
272
+ )
273
+ ),
274
+ LLMModel(
275
+ name="moonshot-v1-128k",
276
+ value="moonshot-v1-128k",
277
+ provider=LLMProvider.KIMI,
278
+ llm_class=KimiLLM,
279
+ canonical_name="moonshot-v1-128k",
280
+ default_config=LLMConfig(
281
+ pricing_config=TokenPricingConfig(1.38, 4.14)
282
+ )
283
+ ),
284
+ LLMModel(
285
+ name="kimi-k2-0711-preview",
286
+ value="kimi-k2-0711-preview",
287
+ provider=LLMProvider.KIMI,
288
+ llm_class=KimiLLM,
289
+ canonical_name="kimi-k2-0711-preview",
290
+ default_config=LLMConfig(
291
+ pricing_config=TokenPricingConfig(0.55, 2.21)
292
+ )
293
+ ),
294
+ LLMModel(
295
+ name="kimi-thinking-preview",
296
+ value="kimi-thinking-preview",
297
+ provider=LLMProvider.KIMI,
298
+ llm_class=KimiLLM,
299
+ canonical_name="kimi-thinking-preview",
300
+ default_config=LLMConfig(
301
+ pricing_config=TokenPricingConfig(27.59, 27.59)
302
+ )
303
+ ),
242
304
  ]
243
305
  for model in supported_models:
244
306
  LLMFactory.register_model(model)
@@ -12,3 +12,4 @@ class LLMProvider(Enum):
12
12
  DEEPSEEK = "deepseek"
13
13
  GROK = "grok"
14
14
  AUTOBYTEUS = "autobyteus"
15
+ KIMI = "kimi"
@@ -0,0 +1,24 @@
1
+ from typing import TYPE_CHECKING
2
+ from autobyteus.llm.token_counter.openai_token_counter import OpenAITokenCounter
3
+ from autobyteus.llm.models import LLMModel
4
+
5
+ if TYPE_CHECKING:
6
+ from autobyteus.llm.base_llm import BaseLLM
7
+
8
+ class KimiTokenCounter(OpenAITokenCounter):
9
+ """
10
+ Token counter for Kimi (Moonshot AI) models. Uses the same token counting implementation as OpenAI.
11
+
12
+ This implementation inherits from OpenAITokenCounter as Kimi uses the same tokenization
13
+ approach as OpenAI's models.
14
+ """
15
+
16
+ def __init__(self, model: LLMModel, llm: 'BaseLLM' = None):
17
+ """
18
+ Initialize the Kimi token counter.
19
+
20
+ Args:
21
+ model (LLMModel): The Kimi model to count tokens for.
22
+ llm (BaseLLM, optional): The LLM instance. Defaults to None.
23
+ """
24
+ super().__init__(model, llm)
@@ -3,6 +3,7 @@ from autobyteus.llm.token_counter.openai_token_counter import OpenAITokenCounter
3
3
  from autobyteus.llm.token_counter.claude_token_counter import ClaudeTokenCounter
4
4
  from autobyteus.llm.token_counter.mistral_token_counter import MistralTokenCounter
5
5
  from autobyteus.llm.token_counter.deepseek_token_counter import DeepSeekTokenCounter
6
+ from autobyteus.llm.token_counter.kimi_token_counter import KimiTokenCounter
6
7
  from autobyteus.llm.token_counter.base_token_counter import BaseTokenCounter
7
8
  from autobyteus.llm.models import LLMModel
8
9
  from autobyteus.llm.providers import LLMProvider
@@ -31,6 +32,8 @@ def get_token_counter(model: LLMModel, llm: 'BaseLLM') -> BaseTokenCounter:
31
32
  return DeepSeekTokenCounter(model, llm)
32
33
  elif model.provider == LLMProvider.GROK:
33
34
  return DeepSeekTokenCounter(model, llm)
35
+ elif model.provider == LLMProvider.KIMI:
36
+ return KimiTokenCounter(model, llm)
34
37
  elif model.provider == LLMProvider.OLLAMA:
35
38
  return OpenAITokenCounter(model, llm)
36
39
  elif model.provider == LLMProvider.GEMINI:
@@ -20,9 +20,9 @@ class Message:
20
20
  self.content = content
21
21
  self.reasoning_content = reasoning_content # Optional field for reasoning content
22
22
 
23
- def to_dict(self) -> Dict[str, Union[str, None]]:
24
- result = {"role": self.role.value, "content": self.content}
25
- if self.reasoning_content is not None:
23
+ def to_dict(self) -> Dict[str, Union[str, List[Dict]]]:
24
+ result: Dict[str, Union[str, List[Dict]]] = {"role": self.role.value, "content": self.content}
25
+ if self.reasoning_content:
26
26
  result["reasoning_content"] = self.reasoning_content
27
27
  return result
28
28
 
@@ -0,0 +1,99 @@
1
+ import re
2
+ import logging
3
+ from typing import List
4
+
5
+ logger = logging.getLogger(__name__)
6
+
7
+ def _find_json_blobs(text: str) -> List[str]:
8
+ """
9
+ Robustly finds and extracts all top-level JSON objects or arrays from a string,
10
+ maintaining their original order of appearance. It handles JSON within
11
+ markdown-style code blocks (```json ... ```) and inline JSON.
12
+
13
+ Args:
14
+ text: The string to search for JSON in.
15
+
16
+ Returns:
17
+ A list of strings, where each string is a valid-looking JSON blob,
18
+ ordered as they appeared in the input text.
19
+ """
20
+ found_blobs = []
21
+
22
+ # 1. Find all markdown blobs first and store them with their start positions.
23
+ markdown_matches = list(re.finditer(r"```(?:json)?\s*([\s\S]+?)\s*```", text))
24
+ for match in markdown_matches:
25
+ content = match.group(1).strip()
26
+ found_blobs.append((match.start(), content))
27
+
28
+ # 2. Create a "masked" version of the text by replacing markdown blocks with spaces.
29
+ # This prevents the inline scanner from finding JSON inside them, while preserving indices.
30
+ masked_text_list = list(text)
31
+ for match in markdown_matches:
32
+ for i in range(match.start(), match.end()):
33
+ masked_text_list[i] = ' '
34
+ masked_text = "".join(masked_text_list)
35
+
36
+ # 3. Scan the masked text for any other JSON using a single pass brace-counter.
37
+ idx = 0
38
+ while idx < len(masked_text):
39
+ start_idx = -1
40
+
41
+ # Find the next opening brace or bracket
42
+ next_brace = masked_text.find('{', idx)
43
+ next_bracket = masked_text.find('[', idx)
44
+
45
+ if next_brace == -1 and next_bracket == -1:
46
+ break # No more JSON starts
47
+
48
+ if next_brace != -1 and (next_bracket == -1 or next_brace < next_bracket):
49
+ start_idx = next_brace
50
+ start_char, end_char = '{', '}'
51
+ else:
52
+ start_idx = next_bracket
53
+ start_char, end_char = '[', ']'
54
+
55
+ brace_count = 1
56
+ in_string = False
57
+ is_escaped = False
58
+ end_idx = -1
59
+
60
+ for i in range(start_idx + 1, len(masked_text)):
61
+ char = masked_text[i]
62
+
63
+ if in_string:
64
+ if is_escaped:
65
+ is_escaped = False
66
+ elif char == '\\':
67
+ is_escaped = True
68
+ elif char == '"':
69
+ in_string = False
70
+ else:
71
+ if char == '"':
72
+ in_string = True
73
+ is_escaped = False
74
+ elif char == '{' or char == '[':
75
+ brace_count += 1
76
+ elif char == '}' or char == ']':
77
+ brace_count -= 1
78
+
79
+ if brace_count == 0:
80
+ if (start_char == '{' and char == '}') or \
81
+ (start_char == '[' and char == ']'):
82
+ end_idx = i
83
+ break
84
+
85
+ if end_idx != -1:
86
+ # We found a blob in the masked text, so its indices are correct
87
+ # for the original text. Extract the blob from the original text.
88
+ blob = text[start_idx : end_idx + 1]
89
+ found_blobs.append((start_idx, blob))
90
+ idx = end_idx + 1
91
+ else:
92
+ # No matching end brace found, move on from the start character.
93
+ idx = start_idx + 1
94
+
95
+ # 4. Sort all found blobs by their start position to ensure correct order
96
+ found_blobs.sort(key=lambda item: item[0])
97
+
98
+ # 5. Return only the content of the blobs
99
+ return [content for _, content in found_blobs]