autobyteus 1.2.3__py3-none-any.whl → 1.3.0__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/bootstrap_steps/__init__.py +2 -0
- autobyteus/agent/bootstrap_steps/agent_bootstrapper.py +2 -0
- autobyteus/agent/bootstrap_steps/working_context_snapshot_restore_step.py +38 -0
- autobyteus/agent/context/agent_config.py +5 -1
- autobyteus/agent/context/agent_runtime_state.py +2 -0
- autobyteus/agent/factory/agent_factory.py +38 -13
- autobyteus/agent/input_processor/memory_ingest_input_processor.py +4 -0
- autobyteus/agent/llm_request_assembler.py +5 -5
- autobyteus/agent/streaming/segments/segment_events.py +1 -0
- autobyteus/memory/__init__.py +3 -0
- autobyteus/memory/memory_manager.py +32 -10
- autobyteus/memory/path_resolver.py +27 -0
- autobyteus/memory/restore/__init__.py +1 -0
- autobyteus/memory/restore/working_context_snapshot_bootstrapper.py +61 -0
- autobyteus/memory/store/__init__.py +2 -0
- autobyteus/memory/store/working_context_snapshot_store.py +28 -0
- autobyteus/memory/{active_transcript.py → working_context_snapshot.py} +1 -1
- autobyteus/memory/working_context_snapshot_serializer.py +135 -0
- autobyteus/multimedia/audio/api/gemini_audio_client.py +2 -1
- autobyteus/multimedia/image/api/gemini_image_client.py +2 -1
- autobyteus/utils/gemini_helper.py +16 -8
- {autobyteus-1.2.3.dist-info → autobyteus-1.3.0.dist-info}/METADATA +2 -2
- {autobyteus-1.2.3.dist-info → autobyteus-1.3.0.dist-info}/RECORD +26 -20
- {autobyteus-1.2.3.dist-info → autobyteus-1.3.0.dist-info}/WHEEL +0 -0
- {autobyteus-1.2.3.dist-info → autobyteus-1.3.0.dist-info}/licenses/LICENSE +0 -0
- {autobyteus-1.2.3.dist-info → autobyteus-1.3.0.dist-info}/top_level.txt +0 -0
|
@@ -9,6 +9,7 @@ from .workspace_context_initialization_step import WorkspaceContextInitializatio
|
|
|
9
9
|
# ToolInitializationStep is no longer a bootstrap step.
|
|
10
10
|
from .system_prompt_processing_step import SystemPromptProcessingStep
|
|
11
11
|
from .mcp_server_prewarming_step import McpServerPrewarmingStep
|
|
12
|
+
from .working_context_snapshot_restore_step import WorkingContextSnapshotRestoreStep
|
|
12
13
|
# LLMConfigFinalizationStep and LLMInstanceCreationStep removed.
|
|
13
14
|
|
|
14
15
|
__all__ = [
|
|
@@ -16,4 +17,5 @@ __all__ = [
|
|
|
16
17
|
"WorkspaceContextInitializationStep",
|
|
17
18
|
"SystemPromptProcessingStep",
|
|
18
19
|
"McpServerPrewarmingStep",
|
|
20
|
+
"WorkingContextSnapshotRestoreStep",
|
|
19
21
|
]
|
|
@@ -5,6 +5,7 @@ from typing import List, Optional
|
|
|
5
5
|
from .base_bootstrap_step import BaseBootstrapStep
|
|
6
6
|
from .workspace_context_initialization_step import WorkspaceContextInitializationStep
|
|
7
7
|
from .system_prompt_processing_step import SystemPromptProcessingStep
|
|
8
|
+
from .working_context_snapshot_restore_step import WorkingContextSnapshotRestoreStep
|
|
8
9
|
from .mcp_server_prewarming_step import McpServerPrewarmingStep
|
|
9
10
|
|
|
10
11
|
logger = logging.getLogger(__name__)
|
|
@@ -27,6 +28,7 @@ class AgentBootstrapper:
|
|
|
27
28
|
WorkspaceContextInitializationStep(),
|
|
28
29
|
McpServerPrewarmingStep(),
|
|
29
30
|
SystemPromptProcessingStep(),
|
|
31
|
+
WorkingContextSnapshotRestoreStep(),
|
|
30
32
|
]
|
|
31
33
|
logger.debug("AgentBootstrapper initialized with default steps.")
|
|
32
34
|
else:
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
from .base_bootstrap_step import BaseBootstrapStep
|
|
5
|
+
from autobyteus.memory.restore.working_context_snapshot_bootstrapper import WorkingContextSnapshotBootstrapper
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from autobyteus.agent.context import AgentContext
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class WorkingContextSnapshotRestoreStep(BaseBootstrapStep):
|
|
14
|
+
def __init__(self, bootstrapper: WorkingContextSnapshotBootstrapper | None = None) -> None:
|
|
15
|
+
self._bootstrapper = bootstrapper or WorkingContextSnapshotBootstrapper()
|
|
16
|
+
logger.debug("WorkingContextSnapshotRestoreStep initialized.")
|
|
17
|
+
|
|
18
|
+
async def execute(self, context: "AgentContext") -> bool:
|
|
19
|
+
restore_options = getattr(context.state, "restore_options", None)
|
|
20
|
+
if not restore_options:
|
|
21
|
+
return True
|
|
22
|
+
|
|
23
|
+
memory_manager = getattr(context.state, "memory_manager", None)
|
|
24
|
+
if not memory_manager:
|
|
25
|
+
logger.error("WorkingContextSnapshotRestoreStep requires a memory manager to restore working context snapshot.")
|
|
26
|
+
return False
|
|
27
|
+
|
|
28
|
+
system_prompt = context.state.processed_system_prompt
|
|
29
|
+
if not system_prompt:
|
|
30
|
+
llm_instance = context.llm_instance
|
|
31
|
+
system_prompt = llm_instance.config.system_message if llm_instance else ""
|
|
32
|
+
|
|
33
|
+
try:
|
|
34
|
+
self._bootstrapper.bootstrap(memory_manager, system_prompt, restore_options)
|
|
35
|
+
return True
|
|
36
|
+
except Exception as exc: # pragma: no cover - defensive
|
|
37
|
+
logger.error("WorkingContextSnapshotRestoreStep failed: %s", exc, exc_info=True)
|
|
38
|
+
return False
|
|
@@ -48,7 +48,8 @@ class AgentConfig:
|
|
|
48
48
|
workspace: Optional['BaseAgentWorkspace'] = None,
|
|
49
49
|
lifecycle_processors: Optional[List['BaseLifecycleEventProcessor']] = None,
|
|
50
50
|
initial_custom_data: Optional[Dict[str, Any]] = None,
|
|
51
|
-
skills: Optional[List[str]] = None
|
|
51
|
+
skills: Optional[List[str]] = None,
|
|
52
|
+
memory_dir: Optional[str] = None):
|
|
52
53
|
"""
|
|
53
54
|
Initializes the AgentConfig.
|
|
54
55
|
|
|
@@ -71,6 +72,7 @@ class AgentConfig:
|
|
|
71
72
|
initial_custom_data: An optional dictionary of data to pre-populate
|
|
72
73
|
the agent's runtime state `custom_data`.
|
|
73
74
|
skills: An optional list of skill names or paths to be preloaded for this agent.
|
|
75
|
+
memory_dir: Optional override for the agent memory base directory.
|
|
74
76
|
"""
|
|
75
77
|
self.name = name
|
|
76
78
|
self.role = role
|
|
@@ -91,6 +93,7 @@ class AgentConfig:
|
|
|
91
93
|
self.lifecycle_processors = lifecycle_processors or []
|
|
92
94
|
self.initial_custom_data = initial_custom_data
|
|
93
95
|
self.skills = skills or []
|
|
96
|
+
self.memory_dir = memory_dir
|
|
94
97
|
|
|
95
98
|
# Filter out ToolManifestInjectorProcessor if in API_TOOL_CALL mode
|
|
96
99
|
tool_call_format = resolve_tool_call_format()
|
|
@@ -133,6 +136,7 @@ class AgentConfig:
|
|
|
133
136
|
lifecycle_processors=self.lifecycle_processors.copy(), # Shallow copy the list
|
|
134
137
|
initial_custom_data=copy.deepcopy(self.initial_custom_data), # Deep copy for simple data
|
|
135
138
|
skills=self.skills.copy(), # Shallow copy the list
|
|
139
|
+
memory_dir=self.memory_dir,
|
|
136
140
|
)
|
|
137
141
|
|
|
138
142
|
def __repr__(self) -> str:
|
|
@@ -21,6 +21,7 @@ if TYPE_CHECKING:
|
|
|
21
21
|
from autobyteus.tools.base_tool import BaseTool
|
|
22
22
|
from autobyteus.agent.tool_invocation import ToolInvocationTurn
|
|
23
23
|
from autobyteus.memory.memory_manager import MemoryManager
|
|
24
|
+
from autobyteus.memory.restore.working_context_snapshot_bootstrapper import WorkingContextSnapshotBootstrapOptions
|
|
24
25
|
|
|
25
26
|
logger = logging.getLogger(__name__)
|
|
26
27
|
|
|
@@ -62,6 +63,7 @@ class AgentRuntimeState:
|
|
|
62
63
|
# NEW: Memory manager and active turn tracking
|
|
63
64
|
self.memory_manager: Optional["MemoryManager"] = None
|
|
64
65
|
self.active_turn_id: Optional[str] = None
|
|
66
|
+
self.restore_options: Optional["WorkingContextSnapshotBootstrapOptions"] = None
|
|
65
67
|
|
|
66
68
|
self.processed_system_prompt: Optional[str] = None
|
|
67
69
|
# self.final_llm_config_for_creation removed
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# file: autobyteus/autobyteus/agent/factory/agent_factory.py
|
|
2
2
|
import logging
|
|
3
3
|
import random
|
|
4
|
-
import os
|
|
5
|
-
from pathlib import Path
|
|
6
4
|
from typing import Optional, TYPE_CHECKING, Dict, List
|
|
7
5
|
|
|
8
6
|
# LLMFactory is no longer needed here.
|
|
@@ -15,7 +13,9 @@ from autobyteus.agent.workspace.base_workspace import BaseAgentWorkspace
|
|
|
15
13
|
from autobyteus.agent.handlers import *
|
|
16
14
|
from autobyteus.utils.singleton import SingletonMeta
|
|
17
15
|
from autobyteus.tools.base_tool import BaseTool
|
|
18
|
-
from autobyteus.memory import FileMemoryStore, MemoryManager
|
|
16
|
+
from autobyteus.memory import FileMemoryStore, MemoryManager, resolve_memory_base_dir
|
|
17
|
+
from autobyteus.memory.store.working_context_snapshot_store import WorkingContextSnapshotStore
|
|
18
|
+
from autobyteus.memory.restore.working_context_snapshot_bootstrapper import WorkingContextSnapshotBootstrapOptions
|
|
19
19
|
from autobyteus.agent.input_processor.memory_ingest_input_processor import MemoryIngestInputProcessor
|
|
20
20
|
from autobyteus.agent.tool_execution_result_processor.memory_ingest_tool_result_processor import (
|
|
21
21
|
MemoryIngestToolResultProcessor,
|
|
@@ -105,10 +105,12 @@ class AgentFactory(metaclass=SingletonMeta):
|
|
|
105
105
|
|
|
106
106
|
config.skills = updated_skills
|
|
107
107
|
|
|
108
|
-
def
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
def _create_runtime_with_id(self,
|
|
109
|
+
agent_id: str,
|
|
110
|
+
config: AgentConfig,
|
|
111
|
+
memory_dir_override: Optional[str] = None,
|
|
112
|
+
restore_options: Optional[WorkingContextSnapshotBootstrapOptions] = None
|
|
113
|
+
) -> 'AgentRuntime':
|
|
112
114
|
from autobyteus.agent.runtime.agent_runtime import AgentRuntime
|
|
113
115
|
|
|
114
116
|
# Prepare skills (resolve paths to names and register them)
|
|
@@ -122,11 +124,11 @@ class AgentFactory(metaclass=SingletonMeta):
|
|
|
122
124
|
)
|
|
123
125
|
|
|
124
126
|
# Memory manager (file-backed) initialization
|
|
125
|
-
memory_dir =
|
|
126
|
-
if memory_dir is None:
|
|
127
|
-
memory_dir = str(Path.cwd() / "memory")
|
|
127
|
+
memory_dir = resolve_memory_base_dir(override_dir=memory_dir_override or config.memory_dir)
|
|
128
128
|
memory_store = FileMemoryStore(base_dir=memory_dir, agent_id=agent_id)
|
|
129
|
-
|
|
129
|
+
working_context_snapshot_store = WorkingContextSnapshotStore(base_dir=memory_dir, agent_id=agent_id)
|
|
130
|
+
runtime_state.memory_manager = MemoryManager(store=memory_store, working_context_snapshot_store=working_context_snapshot_store)
|
|
131
|
+
runtime_state.restore_options = restore_options
|
|
130
132
|
|
|
131
133
|
# Ensure memory ingest processors are present
|
|
132
134
|
if not any(isinstance(p, MemoryIngestInputProcessor) for p in config.input_processors):
|
|
@@ -146,7 +148,7 @@ class AgentFactory(metaclass=SingletonMeta):
|
|
|
146
148
|
logger.info(f"Instantiating AgentRuntime for agent_id: '{agent_id}' with config: '{config.name}'.")
|
|
147
149
|
|
|
148
150
|
return AgentRuntime(
|
|
149
|
-
context=context,
|
|
151
|
+
context=context,
|
|
150
152
|
event_handler_registry=event_handler_registry
|
|
151
153
|
)
|
|
152
154
|
|
|
@@ -166,7 +168,7 @@ class AgentFactory(metaclass=SingletonMeta):
|
|
|
166
168
|
while agent_id in self._active_agents:
|
|
167
169
|
agent_id = f"{config.name}_{config.role}_{random.randint(1000, 9999)}"
|
|
168
170
|
|
|
169
|
-
runtime = self.
|
|
171
|
+
runtime = self._create_runtime_with_id(
|
|
170
172
|
agent_id=agent_id,
|
|
171
173
|
config=config,
|
|
172
174
|
)
|
|
@@ -176,6 +178,29 @@ class AgentFactory(metaclass=SingletonMeta):
|
|
|
176
178
|
logger.info(f"Agent '{agent_id}' created and stored successfully.")
|
|
177
179
|
return agent
|
|
178
180
|
|
|
181
|
+
def restore_agent(
|
|
182
|
+
self,
|
|
183
|
+
agent_id: str,
|
|
184
|
+
config: AgentConfig,
|
|
185
|
+
memory_dir: Optional[str] = None,
|
|
186
|
+
) -> Agent:
|
|
187
|
+
if not agent_id or not isinstance(agent_id, str):
|
|
188
|
+
raise ValueError("restore_agent requires a non-empty string agent_id.")
|
|
189
|
+
if agent_id in self._active_agents:
|
|
190
|
+
raise ValueError(f"Agent '{agent_id}' is already active.")
|
|
191
|
+
|
|
192
|
+
restore_options = WorkingContextSnapshotBootstrapOptions()
|
|
193
|
+
runtime = self._create_runtime_with_id(
|
|
194
|
+
agent_id=agent_id,
|
|
195
|
+
config=config,
|
|
196
|
+
memory_dir_override=memory_dir,
|
|
197
|
+
restore_options=restore_options,
|
|
198
|
+
)
|
|
199
|
+
agent = Agent(runtime=runtime)
|
|
200
|
+
self._active_agents[agent_id] = agent
|
|
201
|
+
logger.info(f"Agent '{agent_id}' restored and stored successfully.")
|
|
202
|
+
return agent
|
|
203
|
+
|
|
179
204
|
def get_agent(self, agent_id: str) -> Optional[Agent]:
|
|
180
205
|
"""Retrieves an active agent instance by its ID."""
|
|
181
206
|
return self._active_agents.get(agent_id)
|
|
@@ -3,6 +3,7 @@ from typing import TYPE_CHECKING
|
|
|
3
3
|
|
|
4
4
|
from autobyteus.agent.input_processor.base_user_input_processor import BaseAgentUserInputMessageProcessor
|
|
5
5
|
from autobyteus.agent.message.multimodal_message_builder import build_llm_user_message
|
|
6
|
+
from autobyteus.agent.sender_type import SenderType
|
|
6
7
|
|
|
7
8
|
if TYPE_CHECKING:
|
|
8
9
|
from autobyteus.agent.message.agent_input_user_message import AgentInputUserMessage
|
|
@@ -26,6 +27,9 @@ class MemoryIngestInputProcessor(BaseAgentUserInputMessageProcessor):
|
|
|
26
27
|
memory_manager = getattr(context.state, "memory_manager", None)
|
|
27
28
|
if not memory_manager:
|
|
28
29
|
return message
|
|
30
|
+
if message.sender_type == SenderType.TOOL:
|
|
31
|
+
logger.debug("MemoryIngestInputProcessor skipping TOOL-originated message to avoid duplicate tool results.")
|
|
32
|
+
return message
|
|
29
33
|
|
|
30
34
|
turn_id = memory_manager.start_turn()
|
|
31
35
|
context.state.active_turn_id = turn_id
|
|
@@ -60,12 +60,12 @@ class LLMRequestAssembler:
|
|
|
60
60
|
bundle=bundle,
|
|
61
61
|
raw_tail=raw_tail,
|
|
62
62
|
)
|
|
63
|
-
self.memory_manager.
|
|
63
|
+
self.memory_manager.reset_working_context_snapshot(snapshot_messages)
|
|
64
64
|
self.memory_manager.clear_compaction_request()
|
|
65
65
|
did_compact = True
|
|
66
66
|
|
|
67
|
-
self.memory_manager.
|
|
68
|
-
final_messages = self.memory_manager.
|
|
67
|
+
self.memory_manager.working_context_snapshot.append_message(user_message)
|
|
68
|
+
final_messages = self.memory_manager.get_working_context_messages()
|
|
69
69
|
rendered_payload = await self.render_payload(final_messages)
|
|
70
70
|
|
|
71
71
|
return RequestPackage(
|
|
@@ -91,8 +91,8 @@ class LLMRequestAssembler:
|
|
|
91
91
|
def _ensure_system_prompt(self, system_prompt: Optional[str]) -> None:
|
|
92
92
|
if not system_prompt:
|
|
93
93
|
return
|
|
94
|
-
existing = self.memory_manager.
|
|
94
|
+
existing = self.memory_manager.get_working_context_messages()
|
|
95
95
|
if not existing:
|
|
96
|
-
self.memory_manager.
|
|
96
|
+
self.memory_manager.working_context_snapshot.append_message(
|
|
97
97
|
Message(role=MessageRole.SYSTEM, content=system_prompt)
|
|
98
98
|
)
|
autobyteus/memory/__init__.py
CHANGED
|
@@ -12,6 +12,7 @@ from autobyteus.memory.compaction.compaction_result import CompactionResult
|
|
|
12
12
|
from autobyteus.memory.compaction.summarizer import Summarizer
|
|
13
13
|
from autobyteus.memory.retrieval.memory_bundle import MemoryBundle
|
|
14
14
|
from autobyteus.memory.retrieval.retriever import Retriever
|
|
15
|
+
from autobyteus.memory.path_resolver import resolve_memory_base_dir, resolve_agent_memory_dir
|
|
15
16
|
|
|
16
17
|
__all__ = [
|
|
17
18
|
"MemoryType",
|
|
@@ -29,4 +30,6 @@ __all__ = [
|
|
|
29
30
|
"Summarizer",
|
|
30
31
|
"MemoryBundle",
|
|
31
32
|
"Retriever",
|
|
33
|
+
"resolve_memory_base_dir",
|
|
34
|
+
"resolve_agent_memory_dir",
|
|
32
35
|
]
|
|
@@ -13,8 +13,10 @@ from autobyteus.memory.compaction.compactor import Compactor
|
|
|
13
13
|
from autobyteus.memory.retrieval.retriever import Retriever
|
|
14
14
|
from autobyteus.memory.store.base_store import MemoryStore
|
|
15
15
|
from autobyteus.memory.turn_tracker import TurnTracker
|
|
16
|
-
from autobyteus.memory.
|
|
16
|
+
from autobyteus.memory.working_context_snapshot import WorkingContextSnapshot
|
|
17
17
|
from autobyteus.memory.tool_interaction_builder import build_tool_interactions
|
|
18
|
+
from autobyteus.memory.working_context_snapshot_serializer import WorkingContextSnapshotSerializer
|
|
19
|
+
from autobyteus.memory.store.working_context_snapshot_store import WorkingContextSnapshotStore
|
|
18
20
|
|
|
19
21
|
|
|
20
22
|
class MemoryManager:
|
|
@@ -25,7 +27,8 @@ class MemoryManager:
|
|
|
25
27
|
compaction_policy: Optional[CompactionPolicy] = None,
|
|
26
28
|
compactor: Optional[Compactor] = None,
|
|
27
29
|
retriever: Optional[Retriever] = None,
|
|
28
|
-
|
|
30
|
+
working_context_snapshot: Optional[WorkingContextSnapshot] = None,
|
|
31
|
+
working_context_snapshot_store: Optional[WorkingContextSnapshotStore] = None,
|
|
29
32
|
):
|
|
30
33
|
self.store = store
|
|
31
34
|
self.turn_tracker = turn_tracker or TurnTracker()
|
|
@@ -34,8 +37,9 @@ class MemoryManager:
|
|
|
34
37
|
self.retriever = retriever or Retriever(store=store)
|
|
35
38
|
self.memory_types = MemoryType
|
|
36
39
|
self._seq_by_turn: dict[str, int] = {}
|
|
37
|
-
self.
|
|
40
|
+
self.working_context_snapshot = working_context_snapshot or WorkingContextSnapshot()
|
|
38
41
|
self.compaction_required: bool = False
|
|
42
|
+
self.working_context_snapshot_store = working_context_snapshot_store
|
|
39
43
|
|
|
40
44
|
def start_turn(self) -> str:
|
|
41
45
|
return self.turn_tracker.next_turn_id()
|
|
@@ -86,7 +90,7 @@ class MemoryManager:
|
|
|
86
90
|
tool_args=tool_invocation.arguments,
|
|
87
91
|
)
|
|
88
92
|
self.store.add([trace])
|
|
89
|
-
self.
|
|
93
|
+
self.working_context_snapshot.append_tool_calls(
|
|
90
94
|
[ToolCallSpec(id=tool_invocation.id, name=tool_invocation.name, arguments=tool_invocation.arguments)]
|
|
91
95
|
)
|
|
92
96
|
|
|
@@ -109,7 +113,7 @@ class MemoryManager:
|
|
|
109
113
|
tool_error=event.error,
|
|
110
114
|
)
|
|
111
115
|
self.store.add([trace])
|
|
112
|
-
self.
|
|
116
|
+
self.working_context_snapshot.append_tool_result(
|
|
113
117
|
tool_call_id=event.tool_invocation_id or "",
|
|
114
118
|
tool_name=event.tool_name,
|
|
115
119
|
tool_result=event.result,
|
|
@@ -129,10 +133,11 @@ class MemoryManager:
|
|
|
129
133
|
)
|
|
130
134
|
self.store.add([trace])
|
|
131
135
|
if response.content or response.reasoning:
|
|
132
|
-
self.
|
|
136
|
+
self.working_context_snapshot.append_assistant(
|
|
133
137
|
content=response.content,
|
|
134
138
|
reasoning=response.reasoning,
|
|
135
139
|
)
|
|
140
|
+
self.persist_working_context_snapshot()
|
|
136
141
|
|
|
137
142
|
def _get_raw_tail(self, tail_turns: int, exclude_turn_id: Optional[str] = None) -> List[RawTraceItem]:
|
|
138
143
|
raw_items = self.store.list(MemoryType.RAW_TRACE)
|
|
@@ -167,11 +172,28 @@ class MemoryManager:
|
|
|
167
172
|
def get_raw_tail(self, tail_turns: int, exclude_turn_id: Optional[str] = None) -> List[RawTraceItem]:
|
|
168
173
|
return self._get_raw_tail(tail_turns, exclude_turn_id=exclude_turn_id)
|
|
169
174
|
|
|
170
|
-
def
|
|
171
|
-
return self.
|
|
175
|
+
def get_working_context_messages(self):
|
|
176
|
+
return self.working_context_snapshot.build_messages()
|
|
177
|
+
|
|
178
|
+
def reset_working_context_snapshot(self, snapshot_messages):
|
|
179
|
+
self.working_context_snapshot.reset(snapshot_messages)
|
|
180
|
+
self.persist_working_context_snapshot()
|
|
181
|
+
|
|
182
|
+
def persist_working_context_snapshot(self) -> None:
|
|
183
|
+
if not self.working_context_snapshot_store:
|
|
184
|
+
return
|
|
185
|
+
agent_id = getattr(self.working_context_snapshot_store, "agent_id", None) or getattr(self.store, "agent_id", None)
|
|
186
|
+
if not agent_id:
|
|
187
|
+
return
|
|
188
|
+
metadata = {
|
|
189
|
+
"schema_version": 1,
|
|
190
|
+
"agent_id": agent_id,
|
|
191
|
+
"epoch_id": self.working_context_snapshot.epoch_id,
|
|
192
|
+
"last_compaction_ts": self.working_context_snapshot.last_compaction_ts,
|
|
193
|
+
}
|
|
194
|
+
payload = WorkingContextSnapshotSerializer.serialize(self.working_context_snapshot, metadata)
|
|
195
|
+
self.working_context_snapshot_store.write(agent_id, payload)
|
|
172
196
|
|
|
173
|
-
def reset_transcript(self, snapshot_messages):
|
|
174
|
-
self.active_transcript.reset(snapshot_messages)
|
|
175
197
|
|
|
176
198
|
def get_tool_interactions(self, turn_id: Optional[str] = None):
|
|
177
199
|
raw_items = self.store.list(MemoryType.RAW_TRACE)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Mapping, Optional, Union
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def resolve_memory_base_dir(
|
|
7
|
+
override_dir: Optional[str] = None,
|
|
8
|
+
env: Optional[Mapping[str, str]] = None,
|
|
9
|
+
fallback_dir: Optional[Union[str, Path]] = None,
|
|
10
|
+
) -> str:
|
|
11
|
+
override_value = override_dir.strip() if override_dir else ""
|
|
12
|
+
if override_value:
|
|
13
|
+
return override_value
|
|
14
|
+
|
|
15
|
+
env_values = env if env is not None else os.environ
|
|
16
|
+
env_value = env_values.get("AUTOBYTEUS_MEMORY_DIR", "").strip()
|
|
17
|
+
if env_value:
|
|
18
|
+
return env_value
|
|
19
|
+
|
|
20
|
+
if fallback_dir is not None:
|
|
21
|
+
return str(fallback_dir)
|
|
22
|
+
|
|
23
|
+
return str(Path.cwd() / "memory")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def resolve_agent_memory_dir(base_dir: Union[str, Path], agent_id: str) -> str:
|
|
27
|
+
return str(Path(base_dir) / "agents" / agent_id)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# restore package
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
from autobyteus.memory.working_context_snapshot_serializer import WorkingContextSnapshotSerializer
|
|
5
|
+
from autobyteus.memory.compaction_snapshot_builder import CompactionSnapshotBuilder
|
|
6
|
+
from autobyteus.memory.store.working_context_snapshot_store import WorkingContextSnapshotStore
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class WorkingContextSnapshotBootstrapOptions:
|
|
11
|
+
max_episodic: int = 3
|
|
12
|
+
max_semantic: int = 20
|
|
13
|
+
raw_tail_turns: Optional[int] = None
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class WorkingContextSnapshotBootstrapper:
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
working_context_snapshot_store: Optional[WorkingContextSnapshotStore] = None,
|
|
20
|
+
snapshot_builder: Optional[CompactionSnapshotBuilder] = None,
|
|
21
|
+
) -> None:
|
|
22
|
+
self.working_context_snapshot_store = working_context_snapshot_store
|
|
23
|
+
self.snapshot_builder = snapshot_builder or CompactionSnapshotBuilder()
|
|
24
|
+
|
|
25
|
+
def bootstrap(self, memory_manager, system_prompt: str, options: WorkingContextSnapshotBootstrapOptions) -> None:
|
|
26
|
+
store = self._resolve_store(memory_manager)
|
|
27
|
+
agent_id = self._resolve_agent_id(memory_manager, store)
|
|
28
|
+
|
|
29
|
+
if store and agent_id and store.exists(agent_id):
|
|
30
|
+
payload = store.read(agent_id)
|
|
31
|
+
if payload and WorkingContextSnapshotSerializer.validate(payload):
|
|
32
|
+
snapshot, _meta = WorkingContextSnapshotSerializer.deserialize(payload)
|
|
33
|
+
memory_manager.reset_working_context_snapshot(snapshot.build_messages())
|
|
34
|
+
return
|
|
35
|
+
|
|
36
|
+
bundle = memory_manager.retriever.retrieve(
|
|
37
|
+
max_episodic=options.max_episodic,
|
|
38
|
+
max_semantic=options.max_semantic,
|
|
39
|
+
)
|
|
40
|
+
tail_turns = options.raw_tail_turns
|
|
41
|
+
if tail_turns is None:
|
|
42
|
+
policy = getattr(memory_manager, "compaction_policy", None)
|
|
43
|
+
tail_turns = getattr(policy, "raw_tail_turns", 0) if policy else 0
|
|
44
|
+
raw_tail = memory_manager.get_raw_tail(tail_turns or 0, exclude_turn_id=None)
|
|
45
|
+
snapshot_messages = self.snapshot_builder.build(
|
|
46
|
+
system_prompt=system_prompt,
|
|
47
|
+
bundle=bundle,
|
|
48
|
+
raw_tail=raw_tail,
|
|
49
|
+
)
|
|
50
|
+
memory_manager.reset_working_context_snapshot(snapshot_messages)
|
|
51
|
+
|
|
52
|
+
def _resolve_store(self, memory_manager) -> Optional[WorkingContextSnapshotStore]:
|
|
53
|
+
if self.working_context_snapshot_store is not None:
|
|
54
|
+
return self.working_context_snapshot_store
|
|
55
|
+
return getattr(memory_manager, "working_context_snapshot_store", None)
|
|
56
|
+
|
|
57
|
+
def _resolve_agent_id(self, memory_manager, store: Optional[WorkingContextSnapshotStore]) -> Optional[str]:
|
|
58
|
+
if store and getattr(store, "agent_id", None):
|
|
59
|
+
return store.agent_id
|
|
60
|
+
store_obj = getattr(memory_manager, "store", None)
|
|
61
|
+
return getattr(store_obj, "agent_id", None)
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
from autobyteus.memory.store.base_store import MemoryStore
|
|
2
2
|
from autobyteus.memory.store.file_store import FileMemoryStore
|
|
3
|
+
from autobyteus.memory.store.working_context_snapshot_store import WorkingContextSnapshotStore
|
|
3
4
|
|
|
4
5
|
__all__ = [
|
|
5
6
|
"MemoryStore",
|
|
6
7
|
"FileMemoryStore",
|
|
8
|
+
"WorkingContextSnapshotStore",
|
|
7
9
|
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Optional, Union, Dict, Any
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class WorkingContextSnapshotStore:
|
|
7
|
+
def __init__(self, base_dir: Union[str, Path], agent_id: str) -> None:
|
|
8
|
+
self.base_dir = Path(base_dir)
|
|
9
|
+
self.agent_id = agent_id
|
|
10
|
+
|
|
11
|
+
def exists(self, agent_id: str) -> bool:
|
|
12
|
+
return self._get_path(agent_id).exists()
|
|
13
|
+
|
|
14
|
+
def read(self, agent_id: str) -> Optional[Dict[str, Any]]:
|
|
15
|
+
path = self._get_path(agent_id)
|
|
16
|
+
if not path.exists():
|
|
17
|
+
return None
|
|
18
|
+
with path.open("r", encoding="utf-8") as handle:
|
|
19
|
+
return json.load(handle)
|
|
20
|
+
|
|
21
|
+
def write(self, agent_id: str, payload: Dict[str, Any]) -> None:
|
|
22
|
+
path = self._get_path(agent_id)
|
|
23
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
24
|
+
with path.open("w", encoding="utf-8") as handle:
|
|
25
|
+
json.dump(payload, handle)
|
|
26
|
+
|
|
27
|
+
def _get_path(self, agent_id: str) -> Path:
|
|
28
|
+
return self.base_dir / "agents" / agent_id / "working_context_snapshot.json"
|
|
@@ -10,7 +10,7 @@ from autobyteus.llm.utils.messages import (
|
|
|
10
10
|
)
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class
|
|
13
|
+
class WorkingContextSnapshot:
|
|
14
14
|
def __init__(self, initial_messages: Optional[Iterable[Message]] = None):
|
|
15
15
|
self._messages: List[Message] = list(initial_messages) if initial_messages else []
|
|
16
16
|
self.epoch_id: int = 1
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Any, Dict, Iterable, List, Optional, Tuple
|
|
3
|
+
|
|
4
|
+
from autobyteus.llm.utils.messages import (
|
|
5
|
+
Message,
|
|
6
|
+
MessageRole,
|
|
7
|
+
ToolCallPayload,
|
|
8
|
+
ToolCallSpec,
|
|
9
|
+
ToolResultPayload,
|
|
10
|
+
)
|
|
11
|
+
from autobyteus.memory.working_context_snapshot import WorkingContextSnapshot
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class WorkingContextSnapshotSerializer:
|
|
15
|
+
@staticmethod
|
|
16
|
+
def serialize(working_context_snapshot: WorkingContextSnapshot, metadata: Dict[str, Any]) -> Dict[str, Any]:
|
|
17
|
+
payload = {
|
|
18
|
+
"schema_version": metadata.get("schema_version", 1),
|
|
19
|
+
"agent_id": metadata.get("agent_id"),
|
|
20
|
+
"epoch_id": metadata.get("epoch_id", working_context_snapshot.epoch_id),
|
|
21
|
+
"last_compaction_ts": metadata.get("last_compaction_ts", working_context_snapshot.last_compaction_ts),
|
|
22
|
+
"messages": [WorkingContextSnapshotSerializer._serialize_message(msg) for msg in working_context_snapshot.build_messages()],
|
|
23
|
+
}
|
|
24
|
+
return payload
|
|
25
|
+
|
|
26
|
+
@staticmethod
|
|
27
|
+
def deserialize(payload: Dict[str, Any]) -> Tuple[WorkingContextSnapshot, Dict[str, Any]]:
|
|
28
|
+
messages = [
|
|
29
|
+
WorkingContextSnapshotSerializer._deserialize_message(msg)
|
|
30
|
+
for msg in payload.get("messages", [])
|
|
31
|
+
if isinstance(msg, dict)
|
|
32
|
+
]
|
|
33
|
+
snapshot = WorkingContextSnapshot(initial_messages=messages)
|
|
34
|
+
metadata = {
|
|
35
|
+
"schema_version": payload.get("schema_version"),
|
|
36
|
+
"agent_id": payload.get("agent_id"),
|
|
37
|
+
"epoch_id": payload.get("epoch_id"),
|
|
38
|
+
"last_compaction_ts": payload.get("last_compaction_ts"),
|
|
39
|
+
}
|
|
40
|
+
if isinstance(metadata["epoch_id"], int):
|
|
41
|
+
snapshot.epoch_id = metadata["epoch_id"]
|
|
42
|
+
if metadata["last_compaction_ts"] is not None:
|
|
43
|
+
snapshot.last_compaction_ts = metadata["last_compaction_ts"]
|
|
44
|
+
return snapshot, metadata
|
|
45
|
+
|
|
46
|
+
@staticmethod
|
|
47
|
+
def validate(payload: Dict[str, Any]) -> bool:
|
|
48
|
+
if not isinstance(payload, dict):
|
|
49
|
+
return False
|
|
50
|
+
if not isinstance(payload.get("schema_version"), int):
|
|
51
|
+
return False
|
|
52
|
+
if not isinstance(payload.get("agent_id"), str):
|
|
53
|
+
return False
|
|
54
|
+
messages = payload.get("messages")
|
|
55
|
+
if not isinstance(messages, list):
|
|
56
|
+
return False
|
|
57
|
+
for msg in messages:
|
|
58
|
+
if not isinstance(msg, dict):
|
|
59
|
+
return False
|
|
60
|
+
if not isinstance(msg.get("role"), str):
|
|
61
|
+
return False
|
|
62
|
+
return True
|
|
63
|
+
|
|
64
|
+
@staticmethod
|
|
65
|
+
def _serialize_message(message: Message) -> Dict[str, Any]:
|
|
66
|
+
base = message.to_dict()
|
|
67
|
+
if base.get("tool_payload"):
|
|
68
|
+
base["tool_payload"] = WorkingContextSnapshotSerializer._normalize_tool_payload(base["tool_payload"])
|
|
69
|
+
return base
|
|
70
|
+
|
|
71
|
+
@staticmethod
|
|
72
|
+
def _deserialize_message(data: Dict[str, Any]) -> Message:
|
|
73
|
+
role = MessageRole(data.get("role"))
|
|
74
|
+
tool_payload = WorkingContextSnapshotSerializer._deserialize_tool_payload(data.get("tool_payload"))
|
|
75
|
+
return Message(
|
|
76
|
+
role=role,
|
|
77
|
+
content=data.get("content"),
|
|
78
|
+
reasoning_content=data.get("reasoning_content"),
|
|
79
|
+
image_urls=data.get("image_urls") or [],
|
|
80
|
+
audio_urls=data.get("audio_urls") or [],
|
|
81
|
+
video_urls=data.get("video_urls") or [],
|
|
82
|
+
tool_payload=tool_payload,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
@staticmethod
|
|
86
|
+
def _normalize_tool_payload(payload: Dict[str, Any]) -> Dict[str, Any]:
|
|
87
|
+
if "tool_calls" in payload:
|
|
88
|
+
return {
|
|
89
|
+
"tool_calls": [
|
|
90
|
+
{
|
|
91
|
+
"id": call.get("id"),
|
|
92
|
+
"name": call.get("name"),
|
|
93
|
+
"arguments": WorkingContextSnapshotSerializer._safe_json_value(call.get("arguments")),
|
|
94
|
+
}
|
|
95
|
+
for call in payload.get("tool_calls", [])
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
"tool_call_id": payload.get("tool_call_id"),
|
|
100
|
+
"tool_name": payload.get("tool_name"),
|
|
101
|
+
"tool_result": WorkingContextSnapshotSerializer._safe_json_value(payload.get("tool_result")),
|
|
102
|
+
"tool_error": payload.get("tool_error"),
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@staticmethod
|
|
106
|
+
def _deserialize_tool_payload(payload: Optional[Dict[str, Any]]) -> Optional[Any]:
|
|
107
|
+
if not payload:
|
|
108
|
+
return None
|
|
109
|
+
if "tool_calls" in payload:
|
|
110
|
+
calls = []
|
|
111
|
+
for call in payload.get("tool_calls", []) or []:
|
|
112
|
+
calls.append(
|
|
113
|
+
ToolCallSpec(
|
|
114
|
+
id=str(call.get("id")),
|
|
115
|
+
name=str(call.get("name")),
|
|
116
|
+
arguments=call.get("arguments") or {},
|
|
117
|
+
)
|
|
118
|
+
)
|
|
119
|
+
return ToolCallPayload(tool_calls=calls)
|
|
120
|
+
if "tool_call_id" in payload:
|
|
121
|
+
return ToolResultPayload(
|
|
122
|
+
tool_call_id=str(payload.get("tool_call_id")),
|
|
123
|
+
tool_name=str(payload.get("tool_name")),
|
|
124
|
+
tool_result=payload.get("tool_result"),
|
|
125
|
+
tool_error=payload.get("tool_error"),
|
|
126
|
+
)
|
|
127
|
+
return None
|
|
128
|
+
|
|
129
|
+
@staticmethod
|
|
130
|
+
def _safe_json_value(value: Any) -> Any:
|
|
131
|
+
try:
|
|
132
|
+
json.dumps(value)
|
|
133
|
+
return value
|
|
134
|
+
except TypeError:
|
|
135
|
+
return str(value)
|
|
@@ -96,8 +96,9 @@ class GeminiAudioClient(BaseAudioClient):
|
|
|
96
96
|
An audio client that uses Google's Gemini models for audio tasks.
|
|
97
97
|
|
|
98
98
|
**Setup Requirements:**
|
|
99
|
-
1. **AI
|
|
99
|
+
1. **Vertex AI Express Mode:** Set `VERTEX_AI_API_KEY`.
|
|
100
100
|
2. **Vertex AI Mode:** Set `VERTEX_AI_PROJECT` and `VERTEX_AI_LOCATION`.
|
|
101
|
+
3. **AI Studio Mode:** Set `GEMINI_API_KEY`.
|
|
101
102
|
"""
|
|
102
103
|
|
|
103
104
|
def __init__(self, model: "AudioModel", config: "MultimediaConfig"):
|
|
@@ -20,8 +20,9 @@ class GeminiImageClient(BaseImageClient):
|
|
|
20
20
|
An image client that uses Google's Gemini models for image generation tasks.
|
|
21
21
|
|
|
22
22
|
**Setup Requirements:**
|
|
23
|
-
1. **AI
|
|
23
|
+
1. **Vertex AI Express Mode:** Set `VERTEX_AI_API_KEY`.
|
|
24
24
|
2. **Vertex AI Mode:** Set `VERTEX_AI_PROJECT` and `VERTEX_AI_LOCATION`.
|
|
25
|
+
3. **AI Studio Mode:** Set `GEMINI_API_KEY`.
|
|
25
26
|
"""
|
|
26
27
|
|
|
27
28
|
def __init__(self, model: "ImageModel", config: "MultimediaConfig"):
|
|
@@ -15,11 +15,12 @@ class GeminiRuntimeInfo:
|
|
|
15
15
|
def initialize_gemini_client_with_runtime() -> tuple[genai.Client, GeminiRuntimeInfo]:
|
|
16
16
|
"""
|
|
17
17
|
Initializes the Google GenAI Client based on available environment variables.
|
|
18
|
-
Supports
|
|
18
|
+
Supports Vertex AI (GCP), Vertex AI Express (API Key), and AI Studio (API Key) modes.
|
|
19
19
|
|
|
20
20
|
Priority:
|
|
21
|
-
1. Vertex AI (requires
|
|
22
|
-
2. AI
|
|
21
|
+
1. Vertex AI Express (requires VERTEX_AI_API_KEY)
|
|
22
|
+
2. Vertex AI (requires VERTEX_AI_PROJECT and VERTEX_AI_LOCATION)
|
|
23
|
+
3. AI Studio (requires GEMINI_API_KEY)
|
|
23
24
|
|
|
24
25
|
Returns:
|
|
25
26
|
(client, runtime_info)
|
|
@@ -27,7 +28,14 @@ def initialize_gemini_client_with_runtime() -> tuple[genai.Client, GeminiRuntime
|
|
|
27
28
|
Raises:
|
|
28
29
|
ValueError: If neither configuration set is found.
|
|
29
30
|
"""
|
|
30
|
-
# 1. Try Vertex AI Configuration
|
|
31
|
+
# 1. Try Vertex AI Express Configuration (API Key)
|
|
32
|
+
vertex_api_key = os.environ.get("VERTEX_AI_API_KEY")
|
|
33
|
+
if vertex_api_key:
|
|
34
|
+
logger.info("Initializing Gemini Client in Vertex AI Express mode (API key).")
|
|
35
|
+
client = genai.Client(vertexai=True, api_key=vertex_api_key)
|
|
36
|
+
return client, GeminiRuntimeInfo(runtime="vertex", project=None, location=None)
|
|
37
|
+
|
|
38
|
+
# 2. Try Vertex AI Configuration (Project/Location + ADC)
|
|
31
39
|
project = os.environ.get("VERTEX_AI_PROJECT")
|
|
32
40
|
location = os.environ.get("VERTEX_AI_LOCATION")
|
|
33
41
|
|
|
@@ -38,7 +46,7 @@ def initialize_gemini_client_with_runtime() -> tuple[genai.Client, GeminiRuntime
|
|
|
38
46
|
client = genai.Client(vertexai=True, project=project, location=location)
|
|
39
47
|
return client, GeminiRuntimeInfo(runtime="vertex", project=project, location=location)
|
|
40
48
|
|
|
41
|
-
#
|
|
49
|
+
# 3. Try AI Studio Configuration (API Key)
|
|
42
50
|
api_key = os.environ.get("GEMINI_API_KEY")
|
|
43
51
|
if api_key:
|
|
44
52
|
logger.info("Initializing Gemini Client in AI Studio mode.")
|
|
@@ -48,9 +56,9 @@ def initialize_gemini_client_with_runtime() -> tuple[genai.Client, GeminiRuntime
|
|
|
48
56
|
# 3. Fallback / Error
|
|
49
57
|
error_msg = (
|
|
50
58
|
"Failed to initialize Gemini Client: Missing configuration. "
|
|
51
|
-
"Please set '
|
|
52
|
-
"'VERTEX_AI_PROJECT' and 'VERTEX_AI_LOCATION' for Vertex AI mode
|
|
59
|
+
"Please set 'VERTEX_AI_API_KEY' for Vertex AI Express mode, OR set both "
|
|
60
|
+
"'VERTEX_AI_PROJECT' and 'VERTEX_AI_LOCATION' for Vertex AI mode, OR set "
|
|
61
|
+
"'GEMINI_API_KEY' for AI Studio mode."
|
|
53
62
|
)
|
|
54
63
|
logger.error(error_msg)
|
|
55
64
|
raise ValueError(error_msg)
|
|
56
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autobyteus
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: Multi-Agent framework
|
|
5
5
|
Author-email: Ryan Zheng <ryan.zheng.work@gmail.com>
|
|
6
6
|
License: MIT License with Additional Terms for Commercial Use
|
|
@@ -34,7 +34,7 @@ Requires-Dist: botocore
|
|
|
34
34
|
Requires-Dist: certifi==2025.4.26
|
|
35
35
|
Requires-Dist: cryptography
|
|
36
36
|
Requires-Dist: google-api-python-client
|
|
37
|
-
Requires-Dist: google-genai
|
|
37
|
+
Requires-Dist: google-genai
|
|
38
38
|
Requires-Dist: httpx
|
|
39
39
|
Requires-Dist: Jinja2
|
|
40
40
|
Requires-Dist: mcp[cli]
|
|
@@ -3,22 +3,23 @@ autobyteus/check_requirements.py,sha256=nLWmqMlGiAToQuub68IpL2EhRxFZ1CyCwRCMi2C5
|
|
|
3
3
|
autobyteus/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
autobyteus/agent/agent.py,sha256=-xTkRSXjW1CChqSkgdlYrGEBok-4wjJhnM4f-7_faJ0,5211
|
|
5
5
|
autobyteus/agent/exceptions.py,sha256=tfXvey5SkT70X6kcu29o8YO91KB0hI9_uLrba91_G2s,237
|
|
6
|
-
autobyteus/agent/llm_request_assembler.py,sha256=
|
|
6
|
+
autobyteus/agent/llm_request_assembler.py,sha256=RB-mBAIE02uNa3kAH-ejlP56M7WZUjoLj7q2SP9omaY,3984
|
|
7
7
|
autobyteus/agent/processor_option.py,sha256=kQhrp2AfwTWMVYPwq0Dg_vvlPDGBdcmO12IecCw4rEI,472
|
|
8
8
|
autobyteus/agent/sender_type.py,sha256=kCtm9BnJoXv3Ab6wBOToFliqGHQy9HEkIhP0GsXhyZI,641
|
|
9
9
|
autobyteus/agent/token_budget.py,sha256=_enFEGTDjVif0l99ztqqLHnH6NzAOmBq8jj8J5xR9x8,1786
|
|
10
10
|
autobyteus/agent/tool_invocation.py,sha256=D9HT0spLLmstzT-gtGCMK9BANdUywL9oDd6aR1Ilg70,2093
|
|
11
|
-
autobyteus/agent/bootstrap_steps/__init__.py,sha256=
|
|
12
|
-
autobyteus/agent/bootstrap_steps/agent_bootstrapper.py,sha256=
|
|
11
|
+
autobyteus/agent/bootstrap_steps/__init__.py,sha256=Mg3Nu11TmnpBYTUhCPJBlhqyo0mmwyrt-rBrWFGCHL8,875
|
|
12
|
+
autobyteus/agent/bootstrap_steps/agent_bootstrapper.py,sha256=zsGiFhnULL6i-vjORdU7bWSoF7R2I1ygzosrzlrT5UU,1484
|
|
13
13
|
autobyteus/agent/bootstrap_steps/base_bootstrap_step.py,sha256=7tZVk1S4IqWAxs25eNxRA4wIElEHSFz6-rlIT39ejxs,1147
|
|
14
14
|
autobyteus/agent/bootstrap_steps/mcp_server_prewarming_step.py,sha256=MK-WXZ2966TrVAtmAbMdLLAsAlMryoEW2SunRPpP3BI,3316
|
|
15
15
|
autobyteus/agent/bootstrap_steps/system_prompt_processing_step.py,sha256=r7NRlX7SnVjHO5YgJ8GQ-AkVkqva2CBOhDxafpUMsrM,5933
|
|
16
|
+
autobyteus/agent/bootstrap_steps/working_context_snapshot_restore_step.py,sha256=YXYBwbdRGLF27E9PvbTgiOUqZHfcIimpTYPhOepNx7k,1618
|
|
16
17
|
autobyteus/agent/bootstrap_steps/workspace_context_initialization_step.py,sha256=csrBDoUu5qYfYRI5xCJkto0ifluVMRd9gkv1s5nr7BI,1997
|
|
17
18
|
autobyteus/agent/context/__init__.py,sha256=1an2L4sKJ1tYbJKAhCLSw-oYzt5_lmUwh1SYClA5c3M,447
|
|
18
|
-
autobyteus/agent/context/agent_config.py,sha256=
|
|
19
|
+
autobyteus/agent/context/agent_config.py,sha256=lRoSCtXbrRGVVXqXpFOt71kv9QP_tNNwDYxqZv4-bJc,7962
|
|
19
20
|
autobyteus/agent/context/agent_context.py,sha256=j9h7ytxlNvYCZSsdmRBGMSyfw-D7zYnuKlctfyn9nAU,5833
|
|
20
21
|
autobyteus/agent/context/agent_context_registry.py,sha256=GqwKn0EKKTRv6Vwwrb5kMRrwD9uH5NCh_Nvtmw82QTo,2748
|
|
21
|
-
autobyteus/agent/context/agent_runtime_state.py,sha256=
|
|
22
|
+
autobyteus/agent/context/agent_runtime_state.py,sha256=7Cps1ZIf0n9B5uews5ZQlSTPxlGRPJidc9yCKcudmgI,5745
|
|
22
23
|
autobyteus/agent/events/__init__.py,sha256=zqWRWijkNPc_MyTEu8V74DxQS0M5tGve_DsquQxJUIM,1960
|
|
23
24
|
autobyteus/agent/events/agent_events.py,sha256=5li1ZB9jGcofkCzVaebvhYyoG22kpgzM1k_4XZYLe-k,5022
|
|
24
25
|
autobyteus/agent/events/agent_input_event_queue_manager.py,sha256=cgUNvZs71otaGWMFkeeNxYehkZue2aP0QDXIMjcvBhs,12485
|
|
@@ -26,7 +27,7 @@ autobyteus/agent/events/event_store.py,sha256=cDOAQK8R5Mk8cS9_sE_RcL780iOQN1Gjkr
|
|
|
26
27
|
autobyteus/agent/events/notifiers.py,sha256=x5YmRKSKOs1F5WUzzzYK20wRyiu5QJOZgDQHqoUj0QQ,7368
|
|
27
28
|
autobyteus/agent/events/worker_event_dispatcher.py,sha256=f1lHfem02xY9yCPGFdJkZZEuuZVAxl-mfGkPeh-tQaA,3574
|
|
28
29
|
autobyteus/agent/factory/__init__.py,sha256=4_PxMM-S_BRuYoQBHIffY6bXpBdEv-zFyuB6YaK93Yw,204
|
|
29
|
-
autobyteus/agent/factory/agent_factory.py,sha256=
|
|
30
|
+
autobyteus/agent/factory/agent_factory.py,sha256=PFKzJSjr9S3ZErc4jkYEy2T0BMv3GnC8XU8eTeJDy7M,10783
|
|
30
31
|
autobyteus/agent/handlers/__init__.py,sha256=YIupwVsl_fIHLWdjn_dgrNziZYrvaOr3F8D3hhRbdS4,1598
|
|
31
32
|
autobyteus/agent/handlers/approved_tool_invocation_event_handler.py,sha256=s_D4v1FrvgCZJQR9n0bA_1tH61qIkWEU8DsRg0PU8D4,8505
|
|
32
33
|
autobyteus/agent/handlers/base_event_handler.py,sha256=G2vtFJT_vyObWTgrgwIgRwOssBQ-6A3gxHtc7S4SEuQ,1264
|
|
@@ -43,7 +44,7 @@ autobyteus/agent/handlers/tool_result_event_handler.py,sha256=U5rYPpGN2evffVYDK5
|
|
|
43
44
|
autobyteus/agent/handlers/user_input_message_event_handler.py,sha256=BlnsOAcMSk_7bYuRymE1vEnwbmlROwOTVjS9b0faB8Q,5926
|
|
44
45
|
autobyteus/agent/input_processor/__init__.py,sha256=uyxNlVWQXkHshNFp-9MkjRjMK0f7Ve0Mjx_d-q8C8Ic,330
|
|
45
46
|
autobyteus/agent/input_processor/base_user_input_processor.py,sha256=7y11eGo4gT25nt1F-c3cNqkyBQwq1sCOkDkQ5SPhg2A,2650
|
|
46
|
-
autobyteus/agent/input_processor/memory_ingest_input_processor.py,sha256=
|
|
47
|
+
autobyteus/agent/input_processor/memory_ingest_input_processor.py,sha256=Shcnp8dm6qjk5b1DJe9sA2v7HAh8VCP1PNp2Gc3OSg8,1674
|
|
47
48
|
autobyteus/agent/input_processor/processor_definition.py,sha256=ISRHvjbBhlG2DYdgSK4hN3i8w1DJkgPOvCDY06TuslQ,2101
|
|
48
49
|
autobyteus/agent/input_processor/processor_meta.py,sha256=Ns_VcPbK4-xLlpbdFIC_xWfgoXDHVduVTNN7EUCUPgU,2241
|
|
49
50
|
autobyteus/agent/input_processor/processor_registry.py,sha256=GMTw-XAeHvNaHcWEOpSQ9mCDeb4iT94slQa-pNH44M0,4651
|
|
@@ -148,7 +149,7 @@ autobyteus/agent/streaming/parser/strategies/registry.py,sha256=PtfuG63fFIH8QZUN
|
|
|
148
149
|
autobyteus/agent/streaming/parser/strategies/sentinel_strategy.py,sha256=wLT8_6t19kLPe1dI_k4sPQvV7aopBYCio1YPcxxJHbY,672
|
|
149
150
|
autobyteus/agent/streaming/parser/strategies/xml_tag_strategy.py,sha256=Szn__0LajOlkbfcxokK1QEbdnF9d_cENM8tjiQ-_4_E,640
|
|
150
151
|
autobyteus/agent/streaming/segments/__init__.py,sha256=BmTIdAoPz5nslRfmgB46BDbrOjSHP9vCTK45rFVm6gc,183
|
|
151
|
-
autobyteus/agent/streaming/segments/segment_events.py,sha256=
|
|
152
|
+
autobyteus/agent/streaming/segments/segment_events.py,sha256=U8l7tG5jTsrZEzJuuusa0fWHtgDaVRgHJy4cCBFLImI,2654
|
|
152
153
|
autobyteus/agent/streaming/streams/__init__.py,sha256=BYIZoE3wHPk4aot4Sa8Zmf8_ndAnvxGYn-gP17EwP_M,129
|
|
153
154
|
autobyteus/agent/streaming/streams/agent_event_stream.py,sha256=JcXPRDib77dB7VqdBwchqlOoNziaMi6yAPdFya-Y9EY,11110
|
|
154
155
|
autobyteus/agent/streaming/utils/__init__.py,sha256=nYG9HyjmMltHYtUhWXafa_wR5bHuQBEVZ4Im0gJZw-I,109
|
|
@@ -334,12 +335,14 @@ autobyteus/llm/utils/response_types.py,sha256=WXVAJCb1wKBp3IvNaNGth_gEyEyejV92mj
|
|
|
334
335
|
autobyteus/llm/utils/token_usage.py,sha256=C8YJH_-sYKJHVcE47hwwk-p0VTAFF0ezFGjSbc0mbzI,601
|
|
335
336
|
autobyteus/llm/utils/token_usage_tracker.py,sha256=RC4zL5k343-wLm0jXc-rwAOMhpxs_1klnrh-xi2J7W8,4220
|
|
336
337
|
autobyteus/llm/utils/tool_call_delta.py,sha256=9kzf_fl9Jozs2UupZgNP003CHNtaYS_J2KZJt_MIDaE,1123
|
|
337
|
-
autobyteus/memory/__init__.py,sha256=
|
|
338
|
-
autobyteus/memory/active_transcript.py,sha256=CCNbr7Mej6WkD9gipAReN6NqmOvEo_bMXnNlysfHuHY,2237
|
|
338
|
+
autobyteus/memory/__init__.py,sha256=_IFapdlcEVllmoYfpEXDPxSTPE5ndeM8TCkp2mm9ckY,1410
|
|
339
339
|
autobyteus/memory/compaction_snapshot_builder.py,sha256=FqRdNjtZV3QobUbutBQZb57524fMSA-4phPNc-0cRNY,3461
|
|
340
|
-
autobyteus/memory/memory_manager.py,sha256=
|
|
340
|
+
autobyteus/memory/memory_manager.py,sha256=oVAp6pwzgkFG2VS2F6mHMqD8gAPMAR0qdnxNS2oAsO8,8654
|
|
341
|
+
autobyteus/memory/path_resolver.py,sha256=Cl9e-0pzJ2mbPBM1qX4xnuCfIhUuo-9cubi42S7oMEs,786
|
|
341
342
|
autobyteus/memory/tool_interaction_builder.py,sha256=nGmzx6h_9BxD22CLxF_gFxlwt_du8fa0WXKRK8EuX0U,1737
|
|
342
343
|
autobyteus/memory/turn_tracker.py,sha256=Gf_7vXfz6ZQ48AIOdHNgb6zifhgAwQD88N9_i3MUy14,272
|
|
344
|
+
autobyteus/memory/working_context_snapshot.py,sha256=tX40sjmsL6Rw--TLRvSPWNlMEFZpXhJD4swMvNZW5fg,2243
|
|
345
|
+
autobyteus/memory/working_context_snapshot_serializer.py,sha256=I8G8RdqsYP2GjhBNZPjuirhZ_MdqTIzamgNlsaSHJlw,5310
|
|
343
346
|
autobyteus/memory/compaction/__init__.py,sha256=2Huatvj1mbKZYj_U7Xle5tnIE4IZ0WA5oxUib0KeLGM,274
|
|
344
347
|
autobyteus/memory/compaction/compaction_result.py,sha256=25prRrghtExjmtHgN0cMfOafyDGq1_wwM2KxUtD4ERE,210
|
|
345
348
|
autobyteus/memory/compaction/compactor.py,sha256=cY3Riwyd5Ya2VYUPg-7mE8ZeUKSoNmxjD7a2v-3he40,3315
|
|
@@ -352,12 +355,15 @@ autobyteus/memory/models/semantic_item.py,sha256=Vy2tpUYPiJFPBGCf2a4sRcj-gnhnPyR
|
|
|
352
355
|
autobyteus/memory/models/tool_interaction.py,sha256=8SKN0vOzuf1_wPF6jRIf4YVI_cJArPzdmz3Oy156K5g,439
|
|
353
356
|
autobyteus/memory/policies/__init__.py,sha256=mCBbjgFFWzsw2bqkL4uLk7goHIfZQL7SPcmTFKAjpu4,113
|
|
354
357
|
autobyteus/memory/policies/compaction_policy.py,sha256=WYk9VIu_oUNkLjUvgoBJ6dhcE9Cm3BFQMaxpFvpRr0E,466
|
|
358
|
+
autobyteus/memory/restore/__init__.py,sha256=Kob-S-xqEm8PhHhhw35fJVaxEbhCd4TlJGAao0enpMI,18
|
|
359
|
+
autobyteus/memory/restore/working_context_snapshot_bootstrapper.py,sha256=Ps3LX6Xjb3i0K9RQCW-WNvtfwls2-a91klpszv2YhQ0,2818
|
|
355
360
|
autobyteus/memory/retrieval/__init__.py,sha256=phIGpifCU6wmURstz2H_ZMFziNRyEvI1nXf5D-Kn3oQ,179
|
|
356
361
|
autobyteus/memory/retrieval/memory_bundle.py,sha256=P6g9FPWevsHmqLldojqi5qiv2ZUXwWdedvfruMmL_gw,353
|
|
357
362
|
autobyteus/memory/retrieval/retriever.py,sha256=n0-FnSTlEWP8W7dfBdQv9Y3y0jzETM7eJgbRZDUg4cI,574
|
|
358
|
-
autobyteus/memory/store/__init__.py,sha256=
|
|
363
|
+
autobyteus/memory/store/__init__.py,sha256=mhQBJHpOkuNJ3uLsfnXX6aEsI2aGP8dbz1VAb36WzPw,309
|
|
359
364
|
autobyteus/memory/store/base_store.py,sha256=eUGpTdOgPISa3hFIvX0OK5YYagauknXcd-20ghoS4vM,419
|
|
360
365
|
autobyteus/memory/store/file_store.py,sha256=Ay60DkLMkZdtbNRYj5tncXn6zXpGA8aWDRyzypxZ1g4,4128
|
|
366
|
+
autobyteus/memory/store/working_context_snapshot_store.py,sha256=62PSwJ3NGWPDLWcftq6GY7Z_nwuQhILhfrVD92iyGGc,1009
|
|
361
367
|
autobyteus/multimedia/__init__.py,sha256=8sssScdnrek2-1-s7wStlOc37ZilLTf0cJzMqVzW4Zw,589
|
|
362
368
|
autobyteus/multimedia/providers.py,sha256=AUlct_V9SGtmrMpKXmzaB8b2luvxRO2_QSP0NNO3ce8,147
|
|
363
369
|
autobyteus/multimedia/runtimes.py,sha256=mgmA06Ng7Gh6UW6YNi0O5CmwV6oDw3kX2qxLssUqG0o,180
|
|
@@ -368,7 +374,7 @@ autobyteus/multimedia/audio/autobyteus_audio_provider.py,sha256=p4vfp8orsKiYGtrt
|
|
|
368
374
|
autobyteus/multimedia/audio/base_audio_client.py,sha256=zl12JZrvDUmKEnNhEtdY7jXK0TYmil9rUgIkU_VWbL0,1498
|
|
369
375
|
autobyteus/multimedia/audio/api/__init__.py,sha256=M6A3fmXx5nn3R_0wozcph4ANTA25RGG4L4-a-M4OAoc,240
|
|
370
376
|
autobyteus/multimedia/audio/api/autobyteus_audio_client.py,sha256=QoVgVTRklmLGtcOKkrYe_nBJXB2OVwlz_LUuPjkDggo,3313
|
|
371
|
-
autobyteus/multimedia/audio/api/gemini_audio_client.py,sha256=
|
|
377
|
+
autobyteus/multimedia/audio/api/gemini_audio_client.py,sha256=40Xa8ixZA_NII1B3J7c5B1DL_y9PdsuJxhVaWcy_iGo,10161
|
|
372
378
|
autobyteus/multimedia/audio/api/openai_audio_client.py,sha256=wNuNBgD1CdTjs7IV-bOD6wBeqf_NYR5YO4vz_QyeVIA,4017
|
|
373
379
|
autobyteus/multimedia/image/__init__.py,sha256=YWwPtRgbTtPoZBgAmjt87P-pTREOZEpJzDbKhD9jSRg,287
|
|
374
380
|
autobyteus/multimedia/image/autobyteus_image_provider.py,sha256=aCukfKyk4E3Xf1s0nFK69kwzTOGMf6uej648HhvO5PY,5115
|
|
@@ -377,7 +383,7 @@ autobyteus/multimedia/image/image_client_factory.py,sha256=8yu1KnXIAyioSgXIGUcue
|
|
|
377
383
|
autobyteus/multimedia/image/image_model.py,sha256=850haQxRbKnt0ST7pVS-3q4IEnB7f8MnTSoQBh0ZplY,4225
|
|
378
384
|
autobyteus/multimedia/image/api/__init__.py,sha256=Vh_FC_6rxcPhJqFpAvgv3yBqHYVmxrzjyVSSrCM7rww,255
|
|
379
385
|
autobyteus/multimedia/image/api/autobyteus_image_client.py,sha256=LW6hi5DxtPYoKx8freb9YK5wnpcjhxFbeo-jBwlC1ks,4894
|
|
380
|
-
autobyteus/multimedia/image/api/gemini_image_client.py,sha256=
|
|
386
|
+
autobyteus/multimedia/image/api/gemini_image_client.py,sha256=23kHGs9HrsnLID9KzAnLRuBZ9LTjWGIJopk23IZN_Ws,7173
|
|
381
387
|
autobyteus/multimedia/image/api/openai_image_client.py,sha256=EKntmL66XauILnFwLnppN0oCPQcNrbYHzvF0O6d5YoU,9589
|
|
382
388
|
autobyteus/multimedia/utils/__init__.py,sha256=pH2c5CB2V-QXVl6SgL6N70KKH0VShByhZHS8m7L9TCg,298
|
|
383
389
|
autobyteus/multimedia/utils/api_utils.py,sha256=dbrIQzRnoz66CwaZOIG4353h5ccbTEIvUPUSRfgIWOQ,613
|
|
@@ -533,7 +539,7 @@ autobyteus/utils/diff_utils.py,sha256=YMP1GI64L_YH6ezEcY8st09lO3ecb2IGIPvGxDUpdV
|
|
|
533
539
|
autobyteus/utils/download_utils.py,sha256=9KftlNZ9p8ktHOksc9ghXnnknCpV67jaAEOTYDY9SnU,4225
|
|
534
540
|
autobyteus/utils/dynamic_enum.py,sha256=c_mgKtKrjb958LlCWeAApl1LMvVB7U_0SWl-8XFhRag,1339
|
|
535
541
|
autobyteus/utils/file_utils.py,sha256=5tJQT4LdFS6BmRyQwCaL7g2hiK4G2vMCbdX9l3EETCg,2253
|
|
536
|
-
autobyteus/utils/gemini_helper.py,sha256=
|
|
542
|
+
autobyteus/utils/gemini_helper.py,sha256=KnpQDDNg6sNeHJLEZ_mXNuhBsgsPypJlkK91xA1O9CQ,2431
|
|
537
543
|
autobyteus/utils/gemini_model_mapping.py,sha256=2BsJwb-Vd48DXNvBISJvV19vAXqigPuBRyzsi_eTXYU,2496
|
|
538
544
|
autobyteus/utils/html_cleaner.py,sha256=mI2V83yFRfQe8NnN6fr6Ujpa0bPlq25NW5tTKaz2WGk,8672
|
|
539
545
|
autobyteus/utils/llm_output_formatter.py,sha256=QwWP8VltDx0n0ssL2DsOMaik8NzYpB6Odj1ofS6bO9w,3035
|
|
@@ -593,8 +599,8 @@ autobyteus/workflow/streaming/workflow_stream_event_payloads.py,sha256=NVaC4Ak84
|
|
|
593
599
|
autobyteus/workflow/streaming/workflow_stream_events.py,sha256=j3uKwdV6Xl7JW0Qgawusk8L10atDfP8h5TsC-4IF8B0,2212
|
|
594
600
|
autobyteus/workflow/utils/__init__.py,sha256=SzaMZHnJBIJKcT_r-HOeyIcuxzRu2bGeFkOcMLJaalk,222
|
|
595
601
|
autobyteus/workflow/utils/wait_for_idle.py,sha256=EYko8MLjzFYLHijIG1qOMRmh6kVqZfNCI5Q3zA0qPCg,1953
|
|
596
|
-
autobyteus-1.
|
|
597
|
-
autobyteus-1.
|
|
598
|
-
autobyteus-1.
|
|
599
|
-
autobyteus-1.
|
|
600
|
-
autobyteus-1.
|
|
602
|
+
autobyteus-1.3.0.dist-info/licenses/LICENSE,sha256=Ompok_c8HRsXRwmax-pGR9OZRRxZC9RPp4JB6eTJd0M,1360
|
|
603
|
+
autobyteus-1.3.0.dist-info/METADATA,sha256=Y6LbGRSNAEEqfwGH9kbSI07G1_FCaQNUImWHmi7mlbc,14875
|
|
604
|
+
autobyteus-1.3.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
605
|
+
autobyteus-1.3.0.dist-info/top_level.txt,sha256=OeVeFlKcnysp6uMGe8TDaoFeuh4NUK4wZIfNjXCWKTE,11
|
|
606
|
+
autobyteus-1.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|