agent-runtime-core 0.1.5__py3-none-any.whl → 0.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.
- {agent_runtime → agent_runtime_core}/__init__.py +59 -7
- {agent_runtime → agent_runtime_core}/config.py +1 -1
- {agent_runtime → agent_runtime_core}/events/__init__.py +5 -5
- {agent_runtime → agent_runtime_core}/events/memory.py +1 -1
- {agent_runtime → agent_runtime_core}/events/redis.py +1 -1
- {agent_runtime → agent_runtime_core}/events/sqlite.py +1 -1
- {agent_runtime → agent_runtime_core}/llm/__init__.py +6 -6
- {agent_runtime → agent_runtime_core}/llm/anthropic.py +4 -4
- {agent_runtime → agent_runtime_core}/llm/litellm_client.py +2 -2
- {agent_runtime → agent_runtime_core}/llm/openai.py +4 -4
- agent_runtime_core/persistence/__init__.py +88 -0
- agent_runtime_core/persistence/base.py +332 -0
- agent_runtime_core/persistence/file.py +507 -0
- agent_runtime_core/persistence/manager.py +266 -0
- {agent_runtime → agent_runtime_core}/queue/__init__.py +5 -5
- {agent_runtime → agent_runtime_core}/queue/memory.py +1 -1
- {agent_runtime → agent_runtime_core}/queue/redis.py +1 -1
- {agent_runtime → agent_runtime_core}/queue/sqlite.py +1 -1
- {agent_runtime → agent_runtime_core}/registry.py +1 -1
- {agent_runtime → agent_runtime_core}/runner.py +6 -6
- {agent_runtime → agent_runtime_core}/state/__init__.py +5 -5
- {agent_runtime → agent_runtime_core}/state/memory.py +1 -1
- {agent_runtime → agent_runtime_core}/state/redis.py +1 -1
- {agent_runtime → agent_runtime_core}/state/sqlite.py +1 -1
- {agent_runtime → agent_runtime_core}/testing.py +1 -1
- {agent_runtime → agent_runtime_core}/tracing/__init__.py +4 -4
- {agent_runtime → agent_runtime_core}/tracing/langfuse.py +1 -1
- {agent_runtime → agent_runtime_core}/tracing/noop.py +1 -1
- {agent_runtime_core-0.1.5.dist-info → agent_runtime_core-0.3.0.dist-info}/METADATA +1 -1
- agent_runtime_core-0.3.0.dist-info/RECORD +36 -0
- agent_runtime_core-0.1.5.dist-info/RECORD +0 -32
- {agent_runtime → agent_runtime_core}/events/base.py +0 -0
- {agent_runtime → agent_runtime_core}/interfaces.py +0 -0
- {agent_runtime → agent_runtime_core}/queue/base.py +0 -0
- {agent_runtime → agent_runtime_core}/state/base.py +0 -0
- {agent_runtime_core-0.1.5.dist-info → agent_runtime_core-0.3.0.dist-info}/WHEEL +0 -0
- {agent_runtime_core-0.1.5.dist-info → agent_runtime_core-0.3.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Persistence manager for coordinating storage backends.
|
|
3
|
+
|
|
4
|
+
The PersistenceManager provides a unified interface for accessing
|
|
5
|
+
all persistence stores with configurable backends.
|
|
6
|
+
|
|
7
|
+
For Django integration, you can either:
|
|
8
|
+
1. Pass pre-instantiated store instances
|
|
9
|
+
2. Pass store classes with appropriate kwargs
|
|
10
|
+
3. Use factory functions for request-scoped stores
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from dataclasses import dataclass, field
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
from typing import Any, Callable, Optional, Type, Union
|
|
16
|
+
|
|
17
|
+
from agent_runtime_core.persistence.base import (
|
|
18
|
+
MemoryStore,
|
|
19
|
+
ConversationStore,
|
|
20
|
+
TaskStore,
|
|
21
|
+
PreferencesStore,
|
|
22
|
+
Scope,
|
|
23
|
+
)
|
|
24
|
+
from agent_runtime_core.persistence.file import (
|
|
25
|
+
FileMemoryStore,
|
|
26
|
+
FileConversationStore,
|
|
27
|
+
FileTaskStore,
|
|
28
|
+
FilePreferencesStore,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# Type aliases for store factories
|
|
33
|
+
MemoryStoreFactory = Callable[[], MemoryStore]
|
|
34
|
+
ConversationStoreFactory = Callable[[], ConversationStore]
|
|
35
|
+
TaskStoreFactory = Callable[[], TaskStore]
|
|
36
|
+
PreferencesStoreFactory = Callable[[], PreferencesStore]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@dataclass
|
|
40
|
+
class PersistenceConfig:
|
|
41
|
+
"""
|
|
42
|
+
Configuration for persistence backends.
|
|
43
|
+
|
|
44
|
+
Each store can be configured as:
|
|
45
|
+
- A class (will be instantiated with store_kwargs)
|
|
46
|
+
- A pre-instantiated store instance
|
|
47
|
+
- A factory function that returns a store instance
|
|
48
|
+
|
|
49
|
+
Example for Django:
|
|
50
|
+
from myapp.stores import DjangoMemoryStore, DjangoConversationStore
|
|
51
|
+
|
|
52
|
+
# Option 1: Pass classes with kwargs
|
|
53
|
+
config = PersistenceConfig(
|
|
54
|
+
memory_store_class=DjangoMemoryStore,
|
|
55
|
+
memory_store_kwargs={"user": request.user},
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
# Option 2: Pass pre-instantiated stores
|
|
59
|
+
config = PersistenceConfig(
|
|
60
|
+
memory_store=DjangoMemoryStore(user=request.user),
|
|
61
|
+
conversation_store=DjangoConversationStore(user=request.user),
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
# Option 3: Pass factory functions
|
|
65
|
+
config = PersistenceConfig(
|
|
66
|
+
memory_store_factory=lambda: DjangoMemoryStore(user=get_current_user()),
|
|
67
|
+
)
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
# Backend classes (can be swapped for custom implementations)
|
|
71
|
+
memory_store_class: Type[MemoryStore] = FileMemoryStore
|
|
72
|
+
conversation_store_class: Type[ConversationStore] = FileConversationStore
|
|
73
|
+
task_store_class: Type[TaskStore] = FileTaskStore
|
|
74
|
+
preferences_store_class: Type[PreferencesStore] = FilePreferencesStore
|
|
75
|
+
|
|
76
|
+
# Pre-instantiated store instances (takes precedence over classes)
|
|
77
|
+
memory_store: Optional[MemoryStore] = None
|
|
78
|
+
conversation_store: Optional[ConversationStore] = None
|
|
79
|
+
task_store: Optional[TaskStore] = None
|
|
80
|
+
preferences_store: Optional[PreferencesStore] = None
|
|
81
|
+
|
|
82
|
+
# Factory functions (takes precedence over classes, but not instances)
|
|
83
|
+
memory_store_factory: Optional[MemoryStoreFactory] = None
|
|
84
|
+
conversation_store_factory: Optional[ConversationStoreFactory] = None
|
|
85
|
+
task_store_factory: Optional[TaskStoreFactory] = None
|
|
86
|
+
preferences_store_factory: Optional[PreferencesStoreFactory] = None
|
|
87
|
+
|
|
88
|
+
# Kwargs passed to store class constructors (only used with classes)
|
|
89
|
+
memory_store_kwargs: dict = field(default_factory=dict)
|
|
90
|
+
conversation_store_kwargs: dict = field(default_factory=dict)
|
|
91
|
+
task_store_kwargs: dict = field(default_factory=dict)
|
|
92
|
+
preferences_store_kwargs: dict = field(default_factory=dict)
|
|
93
|
+
|
|
94
|
+
# Project directory (convenience for file-based stores)
|
|
95
|
+
# Only used if store_kwargs doesn't already have project_dir
|
|
96
|
+
project_dir: Optional[Path] = None
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class PersistenceManager:
|
|
100
|
+
"""
|
|
101
|
+
Unified manager for all persistence stores.
|
|
102
|
+
|
|
103
|
+
Provides access to memory, conversations, tasks, and preferences
|
|
104
|
+
with pluggable backends.
|
|
105
|
+
|
|
106
|
+
Example:
|
|
107
|
+
# Use default file-based storage
|
|
108
|
+
manager = PersistenceManager()
|
|
109
|
+
|
|
110
|
+
# Store global memory
|
|
111
|
+
await manager.memory.set("user_name", "Alice", scope=Scope.GLOBAL)
|
|
112
|
+
|
|
113
|
+
# Store project-specific memory
|
|
114
|
+
await manager.memory.set("project_type", "python", scope=Scope.PROJECT)
|
|
115
|
+
|
|
116
|
+
# Save a conversation
|
|
117
|
+
await manager.conversations.save(conversation)
|
|
118
|
+
|
|
119
|
+
# Use custom backends (Django example)
|
|
120
|
+
config = PersistenceConfig(
|
|
121
|
+
memory_store=DjangoMemoryStore(user=request.user),
|
|
122
|
+
conversation_store=DjangoConversationStore(user=request.user),
|
|
123
|
+
)
|
|
124
|
+
manager = PersistenceManager(config)
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
def __init__(self, config: Optional[PersistenceConfig] = None):
|
|
128
|
+
self._config = config or PersistenceConfig()
|
|
129
|
+
self._memory: Optional[MemoryStore] = None
|
|
130
|
+
self._conversations: Optional[ConversationStore] = None
|
|
131
|
+
self._tasks: Optional[TaskStore] = None
|
|
132
|
+
self._preferences: Optional[PreferencesStore] = None
|
|
133
|
+
|
|
134
|
+
def _build_kwargs(self, store_kwargs: dict) -> dict:
|
|
135
|
+
"""Build kwargs for store instantiation."""
|
|
136
|
+
kwargs = {}
|
|
137
|
+
# Only add project_dir if not already in store_kwargs
|
|
138
|
+
if self._config.project_dir and "project_dir" not in store_kwargs:
|
|
139
|
+
kwargs["project_dir"] = self._config.project_dir
|
|
140
|
+
kwargs.update(store_kwargs)
|
|
141
|
+
return kwargs
|
|
142
|
+
|
|
143
|
+
@property
|
|
144
|
+
def memory(self) -> MemoryStore:
|
|
145
|
+
"""Get the memory store."""
|
|
146
|
+
if self._memory is None:
|
|
147
|
+
# Priority: instance > factory > class
|
|
148
|
+
if self._config.memory_store is not None:
|
|
149
|
+
self._memory = self._config.memory_store
|
|
150
|
+
elif self._config.memory_store_factory is not None:
|
|
151
|
+
self._memory = self._config.memory_store_factory()
|
|
152
|
+
else:
|
|
153
|
+
kwargs = self._build_kwargs(self._config.memory_store_kwargs)
|
|
154
|
+
self._memory = self._config.memory_store_class(**kwargs)
|
|
155
|
+
return self._memory
|
|
156
|
+
|
|
157
|
+
@property
|
|
158
|
+
def conversations(self) -> ConversationStore:
|
|
159
|
+
"""Get the conversation store."""
|
|
160
|
+
if self._conversations is None:
|
|
161
|
+
if self._config.conversation_store is not None:
|
|
162
|
+
self._conversations = self._config.conversation_store
|
|
163
|
+
elif self._config.conversation_store_factory is not None:
|
|
164
|
+
self._conversations = self._config.conversation_store_factory()
|
|
165
|
+
else:
|
|
166
|
+
kwargs = self._build_kwargs(self._config.conversation_store_kwargs)
|
|
167
|
+
self._conversations = self._config.conversation_store_class(**kwargs)
|
|
168
|
+
return self._conversations
|
|
169
|
+
|
|
170
|
+
@property
|
|
171
|
+
def tasks(self) -> TaskStore:
|
|
172
|
+
"""Get the task store."""
|
|
173
|
+
if self._tasks is None:
|
|
174
|
+
if self._config.task_store is not None:
|
|
175
|
+
self._tasks = self._config.task_store
|
|
176
|
+
elif self._config.task_store_factory is not None:
|
|
177
|
+
self._tasks = self._config.task_store_factory()
|
|
178
|
+
else:
|
|
179
|
+
kwargs = self._build_kwargs(self._config.task_store_kwargs)
|
|
180
|
+
self._tasks = self._config.task_store_class(**kwargs)
|
|
181
|
+
return self._tasks
|
|
182
|
+
|
|
183
|
+
@property
|
|
184
|
+
def preferences(self) -> PreferencesStore:
|
|
185
|
+
"""Get the preferences store."""
|
|
186
|
+
if self._preferences is None:
|
|
187
|
+
if self._config.preferences_store is not None:
|
|
188
|
+
self._preferences = self._config.preferences_store
|
|
189
|
+
elif self._config.preferences_store_factory is not None:
|
|
190
|
+
self._preferences = self._config.preferences_store_factory()
|
|
191
|
+
else:
|
|
192
|
+
kwargs = self._build_kwargs(self._config.preferences_store_kwargs)
|
|
193
|
+
self._preferences = self._config.preferences_store_class(**kwargs)
|
|
194
|
+
return self._preferences
|
|
195
|
+
|
|
196
|
+
async def close(self) -> None:
|
|
197
|
+
"""Close all stores."""
|
|
198
|
+
if self._memory:
|
|
199
|
+
await self._memory.close()
|
|
200
|
+
if self._conversations:
|
|
201
|
+
await self._conversations.close()
|
|
202
|
+
if self._tasks:
|
|
203
|
+
await self._tasks.close()
|
|
204
|
+
if self._preferences:
|
|
205
|
+
await self._preferences.close()
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
# Global manager instance
|
|
209
|
+
_manager: Optional[PersistenceManager] = None
|
|
210
|
+
_config: Optional[PersistenceConfig] = None
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def configure_persistence(
|
|
214
|
+
memory_store_class: Optional[Type[MemoryStore]] = None,
|
|
215
|
+
conversation_store_class: Optional[Type[ConversationStore]] = None,
|
|
216
|
+
task_store_class: Optional[Type[TaskStore]] = None,
|
|
217
|
+
preferences_store_class: Optional[Type[PreferencesStore]] = None,
|
|
218
|
+
project_dir: Optional[Path] = None,
|
|
219
|
+
**kwargs,
|
|
220
|
+
) -> PersistenceConfig:
|
|
221
|
+
"""
|
|
222
|
+
Configure the global persistence manager.
|
|
223
|
+
|
|
224
|
+
Args:
|
|
225
|
+
memory_store_class: Custom memory store implementation
|
|
226
|
+
conversation_store_class: Custom conversation store implementation
|
|
227
|
+
task_store_class: Custom task store implementation
|
|
228
|
+
preferences_store_class: Custom preferences store implementation
|
|
229
|
+
project_dir: Project directory for PROJECT scope
|
|
230
|
+
**kwargs: Additional store-specific configuration
|
|
231
|
+
|
|
232
|
+
Returns:
|
|
233
|
+
The configured PersistenceConfig
|
|
234
|
+
"""
|
|
235
|
+
global _config, _manager
|
|
236
|
+
|
|
237
|
+
config = PersistenceConfig(project_dir=project_dir)
|
|
238
|
+
|
|
239
|
+
if memory_store_class:
|
|
240
|
+
config.memory_store_class = memory_store_class
|
|
241
|
+
if conversation_store_class:
|
|
242
|
+
config.conversation_store_class = conversation_store_class
|
|
243
|
+
if task_store_class:
|
|
244
|
+
config.task_store_class = task_store_class
|
|
245
|
+
if preferences_store_class:
|
|
246
|
+
config.preferences_store_class = preferences_store_class
|
|
247
|
+
|
|
248
|
+
_config = config
|
|
249
|
+
_manager = None # Reset manager to use new config
|
|
250
|
+
|
|
251
|
+
return config
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
def get_persistence_manager() -> PersistenceManager:
|
|
255
|
+
"""
|
|
256
|
+
Get the global persistence manager.
|
|
257
|
+
|
|
258
|
+
Creates a new manager with default config if not configured.
|
|
259
|
+
"""
|
|
260
|
+
global _manager
|
|
261
|
+
|
|
262
|
+
if _manager is None:
|
|
263
|
+
_manager = PersistenceManager(_config)
|
|
264
|
+
|
|
265
|
+
return _manager
|
|
266
|
+
|
|
@@ -9,8 +9,8 @@ Provides:
|
|
|
9
9
|
- SQLiteQueue: For persistent local storage
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
-
from
|
|
13
|
-
from
|
|
12
|
+
from agent_runtime_core.queue.base import RunQueue, QueuedRun
|
|
13
|
+
from agent_runtime_core.queue.memory import InMemoryQueue
|
|
14
14
|
|
|
15
15
|
__all__ = [
|
|
16
16
|
"RunQueue",
|
|
@@ -31,7 +31,7 @@ def get_queue(backend: str = None, **kwargs) -> RunQueue:
|
|
|
31
31
|
Returns:
|
|
32
32
|
RunQueue instance
|
|
33
33
|
"""
|
|
34
|
-
from
|
|
34
|
+
from agent_runtime_core.config import get_config
|
|
35
35
|
|
|
36
36
|
config = get_config()
|
|
37
37
|
backend = backend or config.queue_backend
|
|
@@ -40,14 +40,14 @@ def get_queue(backend: str = None, **kwargs) -> RunQueue:
|
|
|
40
40
|
return InMemoryQueue()
|
|
41
41
|
|
|
42
42
|
elif backend == "redis":
|
|
43
|
-
from
|
|
43
|
+
from agent_runtime_core.queue.redis import RedisQueue
|
|
44
44
|
url = kwargs.get("url") or config.redis_url
|
|
45
45
|
if not url:
|
|
46
46
|
raise ValueError("redis_url is required for redis queue backend")
|
|
47
47
|
return RedisQueue(url=url)
|
|
48
48
|
|
|
49
49
|
elif backend == "sqlite":
|
|
50
|
-
from
|
|
50
|
+
from agent_runtime_core.queue.sqlite import SQLiteQueue
|
|
51
51
|
path = kwargs.get("path") or config.sqlite_path or "agent_runtime.db"
|
|
52
52
|
return SQLiteQueue(path=path)
|
|
53
53
|
|
|
@@ -12,7 +12,7 @@ from datetime import datetime, timedelta, timezone
|
|
|
12
12
|
from typing import Optional
|
|
13
13
|
from uuid import UUID
|
|
14
14
|
|
|
15
|
-
from
|
|
15
|
+
from agent_runtime_core.queue.base import RunQueue, QueuedRun, RunStatus
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class RedisQueue(RunQueue):
|
|
@@ -14,7 +14,7 @@ from datetime import datetime, timedelta, timezone
|
|
|
14
14
|
from typing import Optional
|
|
15
15
|
from uuid import UUID
|
|
16
16
|
|
|
17
|
-
from
|
|
17
|
+
from agent_runtime_core.queue.base import RunQueue, QueuedRun, RunStatus
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
class SQLiteQueue(RunQueue):
|
|
@@ -17,9 +17,9 @@ from datetime import datetime, timezone
|
|
|
17
17
|
from typing import Optional
|
|
18
18
|
from uuid import UUID
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
20
|
+
from agent_runtime_core.config import get_config
|
|
21
|
+
from agent_runtime_core.events.base import EventBus
|
|
22
|
+
from agent_runtime_core.interfaces import (
|
|
23
23
|
AgentRuntime,
|
|
24
24
|
EventType,
|
|
25
25
|
ErrorInfo,
|
|
@@ -27,9 +27,9 @@ from agent_runtime.interfaces import (
|
|
|
27
27
|
RunResult,
|
|
28
28
|
ToolRegistry,
|
|
29
29
|
)
|
|
30
|
-
from
|
|
31
|
-
from
|
|
32
|
-
from
|
|
30
|
+
from agent_runtime_core.queue.base import RunQueue, QueuedRun
|
|
31
|
+
from agent_runtime_core.registry import get_runtime
|
|
32
|
+
from agent_runtime_core.state.base import StateStore
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
@dataclass
|
|
@@ -8,8 +8,8 @@ Provides:
|
|
|
8
8
|
- SQLiteStateStore: For persistent local storage
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
|
-
from
|
|
12
|
-
from
|
|
11
|
+
from agent_runtime_core.state.base import StateStore
|
|
12
|
+
from agent_runtime_core.state.memory import InMemoryStateStore
|
|
13
13
|
|
|
14
14
|
__all__ = [
|
|
15
15
|
"StateStore",
|
|
@@ -29,7 +29,7 @@ def get_state_store(backend: str = None, **kwargs) -> StateStore:
|
|
|
29
29
|
Returns:
|
|
30
30
|
StateStore instance
|
|
31
31
|
"""
|
|
32
|
-
from
|
|
32
|
+
from agent_runtime_core.config import get_config
|
|
33
33
|
|
|
34
34
|
config = get_config()
|
|
35
35
|
backend = backend or config.state_store_backend
|
|
@@ -38,14 +38,14 @@ def get_state_store(backend: str = None, **kwargs) -> StateStore:
|
|
|
38
38
|
return InMemoryStateStore()
|
|
39
39
|
|
|
40
40
|
elif backend == "redis":
|
|
41
|
-
from
|
|
41
|
+
from agent_runtime_core.state.redis import RedisStateStore
|
|
42
42
|
url = kwargs.get("url") or config.redis_url
|
|
43
43
|
if not url:
|
|
44
44
|
raise ValueError("redis_url is required for redis state store backend")
|
|
45
45
|
return RedisStateStore(url=url)
|
|
46
46
|
|
|
47
47
|
elif backend == "sqlite":
|
|
48
|
-
from
|
|
48
|
+
from agent_runtime_core.state.sqlite import SQLiteStateStore
|
|
49
49
|
path = kwargs.get("path") or config.sqlite_path or "agent_runtime.db"
|
|
50
50
|
return SQLiteStateStore(path=path)
|
|
51
51
|
|
|
@@ -12,7 +12,7 @@ from datetime import datetime
|
|
|
12
12
|
from typing import Optional
|
|
13
13
|
from uuid import UUID
|
|
14
14
|
|
|
15
|
-
from
|
|
15
|
+
from agent_runtime_core.state.base import StateStore, Checkpoint
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class RedisStateStore(StateStore):
|
|
@@ -8,7 +8,7 @@ This module provides tools for testing agent implementations:
|
|
|
8
8
|
- LLMEvaluator: Use LLM to evaluate agent responses
|
|
9
9
|
|
|
10
10
|
Example usage:
|
|
11
|
-
from
|
|
11
|
+
from agent_runtime_core.testing import MockRunContext, MockLLMClient, AgentTestCase
|
|
12
12
|
|
|
13
13
|
class TestMyAgent(AgentTestCase):
|
|
14
14
|
async def test_agent_responds(self):
|
|
@@ -7,7 +7,7 @@ Provides:
|
|
|
7
7
|
- LangfuseTraceSink: Langfuse integration
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
from
|
|
10
|
+
from agent_runtime_core.tracing.noop import NoopTraceSink
|
|
11
11
|
|
|
12
12
|
__all__ = [
|
|
13
13
|
"NoopTraceSink",
|
|
@@ -26,8 +26,8 @@ def get_trace_sink(backend: str = None, **kwargs):
|
|
|
26
26
|
Returns:
|
|
27
27
|
TraceSink instance
|
|
28
28
|
"""
|
|
29
|
-
from
|
|
30
|
-
from
|
|
29
|
+
from agent_runtime_core.config import get_config
|
|
30
|
+
from agent_runtime_core.interfaces import TraceSink
|
|
31
31
|
|
|
32
32
|
config = get_config()
|
|
33
33
|
backend = backend or config.tracing_backend or "noop"
|
|
@@ -36,7 +36,7 @@ def get_trace_sink(backend: str = None, **kwargs):
|
|
|
36
36
|
return NoopTraceSink()
|
|
37
37
|
|
|
38
38
|
elif backend == "langfuse":
|
|
39
|
-
from
|
|
39
|
+
from agent_runtime_core.tracing.langfuse import LangfuseTraceSink
|
|
40
40
|
return LangfuseTraceSink(
|
|
41
41
|
public_key=kwargs.get("public_key") or config.langfuse_public_key,
|
|
42
42
|
secret_key=kwargs.get("secret_key") or config.langfuse_secret_key,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-runtime-core
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Framework-agnostic Python library for executing AI agents with consistent patterns
|
|
5
5
|
Project-URL: Homepage, https://github.com/colstrom/agent_runtime_core
|
|
6
6
|
Project-URL: Repository, https://github.com/colstrom/agent_runtime_core
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
agent_runtime_core/__init__.py,sha256=Z3OrJpoY9vrf-2hX3ulTqVRwA7YN0cF5mi-xTg5o3kg,3626
|
|
2
|
+
agent_runtime_core/config.py,sha256=e3_uB5brAuQcWU36sOhWF9R6RoJrngtCS-xEB3n2fas,4986
|
|
3
|
+
agent_runtime_core/interfaces.py,sha256=-VGZJHUkyF8kdO-BDkURyc-sLbObIHErIFw1Hzn3n14,10434
|
|
4
|
+
agent_runtime_core/registry.py,sha256=hrbEdNNdqEz7-uN-82qofsXFTZBRDxZ2Ht9qwmp1qkw,1476
|
|
5
|
+
agent_runtime_core/runner.py,sha256=M3It72UhfmLt17jVnSvObiSfQ1_RN4JVUIJsjnRd2Ps,12771
|
|
6
|
+
agent_runtime_core/testing.py,sha256=ordECGprBappLBMWxlETvuf2AoIPNomJFeSedXaY30E,11131
|
|
7
|
+
agent_runtime_core/events/__init__.py,sha256=Gg7cMQHWfLTQ4Xik09KSg7cWbQDmW_MuF5_jl-yZkHU,1575
|
|
8
|
+
agent_runtime_core/events/base.py,sha256=NfHYyoczxr40Er5emROi_aY_07m5hDrKsn31pdWY2DY,1950
|
|
9
|
+
agent_runtime_core/events/memory.py,sha256=9z4tY8XB8xDg3ybHsIwilOcRo7HY-vB-8vxiz6O54BE,2491
|
|
10
|
+
agent_runtime_core/events/redis.py,sha256=7PsUO2-iqrdGCJZUOq1IdzwDdNhqT5mwEnH5xy2Fklo,5874
|
|
11
|
+
agent_runtime_core/events/sqlite.py,sha256=ZpGgeuQujYT8pkDsiXDoFXTcBf2KqzoWX4D4J9xkmeE,5097
|
|
12
|
+
agent_runtime_core/llm/__init__.py,sha256=LyFFDtk4HhvUXct0nTeKuYuWzVmVqLDSVRpnPArbGqY,2461
|
|
13
|
+
agent_runtime_core/llm/anthropic.py,sha256=pt9QAjrv2dIPSAY3Pv6N_BzxL1tbhL-kPWsQ-DcHMLI,7516
|
|
14
|
+
agent_runtime_core/llm/litellm_client.py,sha256=c-O-lE08cT3ne0xSOvSDezPL6hCiA69p3HnB451Ipe4,5193
|
|
15
|
+
agent_runtime_core/llm/openai.py,sha256=qBZkkndDgYQ6LG-9bHS2za5KJTGSgL-c_7h0bD3_5lg,6862
|
|
16
|
+
agent_runtime_core/persistence/__init__.py,sha256=u3sYJSu4mTnszkt01qxN3Cn7_bMWvzFtgXDRK26LblM,2029
|
|
17
|
+
agent_runtime_core/persistence/base.py,sha256=7p9HYWYY4pjmDvQgLh11Fie_XmMnkimkCG7tUQt0zUQ,9444
|
|
18
|
+
agent_runtime_core/persistence/file.py,sha256=oDB4_ZQkwHTCT1uoqpw5jOleK69YXCQwlTPsW86Yb-I,17785
|
|
19
|
+
agent_runtime_core/persistence/manager.py,sha256=wXwOX9fa3EoDcXi-rz9QRX8uA1BLw-mvM6LMIS2Jr44,9692
|
|
20
|
+
agent_runtime_core/queue/__init__.py,sha256=m8gapXACPGApLj0RIDpVe5cQYuvKq1QsY2_mXzZcULQ,1527
|
|
21
|
+
agent_runtime_core/queue/base.py,sha256=QW1eWbwBX_tmVD8yJobFJtlxLd_RtUWHTuXGessuxy8,3959
|
|
22
|
+
agent_runtime_core/queue/memory.py,sha256=G65NJ2QU8sB2WQ7myHXc8LzSFowEzBXtCt78WmhvxO8,5416
|
|
23
|
+
agent_runtime_core/queue/redis.py,sha256=x9BEoeh6cVcWdaziFSQZHUvq_bHN1WYHWw17HIEWi5o,15622
|
|
24
|
+
agent_runtime_core/queue/sqlite.py,sha256=3YwkU0QOcmAxYBpbfEB9xk8f-e2C3QcHK_RnPZvdick,14338
|
|
25
|
+
agent_runtime_core/state/__init__.py,sha256=RK16Sj1QPW0SNxtmESlLRMpFBY_hZbMGGNnvcLbdcWw,1564
|
|
26
|
+
agent_runtime_core/state/base.py,sha256=NqE3B0ySa-U2jkelgmkBbkmkaIQxfu4pDryoxkZTMrc,1593
|
|
27
|
+
agent_runtime_core/state/memory.py,sha256=yEGwoR25zWcoxL79_gEu38P_dHvjJOTGij2wxqZ7X9A,1566
|
|
28
|
+
agent_runtime_core/state/redis.py,sha256=VXY6ULEphehHVq4zSw5Y4AMCibm9Ghvzk7PqCrgStDg,3430
|
|
29
|
+
agent_runtime_core/state/sqlite.py,sha256=HKZwDiC_7F1W8Z_Pz8roEs91XhQ9rUHfGpuQ7WWt_NQ,4873
|
|
30
|
+
agent_runtime_core/tracing/__init__.py,sha256=u1QicGc39e30gWyQD4cQWxGGjITnkwoOPUhNrG6aNyI,1266
|
|
31
|
+
agent_runtime_core/tracing/langfuse.py,sha256=Rj2sUlatk5sFro0y68tw5X6fQcSwWxcBOSOjB0F7JTU,3660
|
|
32
|
+
agent_runtime_core/tracing/noop.py,sha256=SpsbpsUcNG6C3xZG3uyiNPUHY8etloISx3w56Q8D3KE,751
|
|
33
|
+
agent_runtime_core-0.3.0.dist-info/METADATA,sha256=5F-OYNqSvqmwMQGbf0jfLayLw8Vs34AMSEjGEHxkr88,12488
|
|
34
|
+
agent_runtime_core-0.3.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
35
|
+
agent_runtime_core-0.3.0.dist-info/licenses/LICENSE,sha256=PcOO8aiOZ4H2MWYeKIis3o6xTCT1hNkDyCxHZhh1NeM,1070
|
|
36
|
+
agent_runtime_core-0.3.0.dist-info/RECORD,,
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
agent_runtime/__init__.py,sha256=ZeKUVQKq7kxQlV9KmbJQJ-TH9WvHJPt6Iiox2NZcAdA,2430
|
|
2
|
-
agent_runtime/config.py,sha256=ZRjpILjsjeh_kl7873DtV2g_zaTrfdkb3NgdQ6ndb5Y,4981
|
|
3
|
-
agent_runtime/interfaces.py,sha256=-VGZJHUkyF8kdO-BDkURyc-sLbObIHErIFw1Hzn3n14,10434
|
|
4
|
-
agent_runtime/registry.py,sha256=sa0speDFxFCZlXoCge8cPNqWYUeWHyazs6tBer5Jg1w,1471
|
|
5
|
-
agent_runtime/runner.py,sha256=Sb2FfSJvATaL7ideQZy2JhVZp0sSYGVIov93E-gxODU,12741
|
|
6
|
-
agent_runtime/testing.py,sha256=aqN67RdbTdYf_rJfp5pEpn2s_tkeU-3oSpzTdADxH5g,11126
|
|
7
|
-
agent_runtime/events/__init__.py,sha256=JNH-D40O6yz2evIf1_r2o3w7OQjLt4Yebn-sBNLzzh8,1550
|
|
8
|
-
agent_runtime/events/base.py,sha256=NfHYyoczxr40Er5emROi_aY_07m5hDrKsn31pdWY2DY,1950
|
|
9
|
-
agent_runtime/events/memory.py,sha256=7qseR6RtdaP833FxEHwyPw5TC7l4brJHr8uEx0mLc1Y,2486
|
|
10
|
-
agent_runtime/events/redis.py,sha256=Z6WEvp_6jcIPi4ZgkGk5J61qxgGqllwk7jqJM4jcTXk,5869
|
|
11
|
-
agent_runtime/events/sqlite.py,sha256=EiX1BMOqeS7BelmD8A6cvhz3fE4w7vJ2Wg4pFu1V2u0,5092
|
|
12
|
-
agent_runtime/llm/__init__.py,sha256=JEk1Q2H6U9_Uid48YVm1wYR1W7po0vtjfjf2TTmQe_A,2431
|
|
13
|
-
agent_runtime/llm/anthropic.py,sha256=ho3psMYAARpXyzqejgA1dx6Nk8io0TwCKb0mp_wsGyM,7496
|
|
14
|
-
agent_runtime/llm/litellm_client.py,sha256=Pic3N4CHVoqzdHUbKlizBcuPP0xCKoeY6U2ZjsZIgWg,5183
|
|
15
|
-
agent_runtime/llm/openai.py,sha256=cRk4WBpiVknqsy_cgPAGdC8Zj250nasqo1dNQN0uxlw,6842
|
|
16
|
-
agent_runtime/queue/__init__.py,sha256=78k29iEl8brp71LrOnmTHhQzPMHkzGre-Xqdl1NlNr0,1502
|
|
17
|
-
agent_runtime/queue/base.py,sha256=QW1eWbwBX_tmVD8yJobFJtlxLd_RtUWHTuXGessuxy8,3959
|
|
18
|
-
agent_runtime/queue/memory.py,sha256=n7kiE0Fw_BFUdzMyoO1QPO0ATzz8zBYaMQex7GdceZw,5411
|
|
19
|
-
agent_runtime/queue/redis.py,sha256=buTCgqNz77q7ae_eNIRRUEyhx_jCgJ0Q3Bqe1Hz5G-s,15617
|
|
20
|
-
agent_runtime/queue/sqlite.py,sha256=DyV2h3C5WuI9d_FjOmleeYvL7BbttMHN1E9XcK-X15w,14333
|
|
21
|
-
agent_runtime/state/__init__.py,sha256=W9juyZD8N0zj5ERkWroW7O0SLWnoYFcLjGuR4tfFKs4,1539
|
|
22
|
-
agent_runtime/state/base.py,sha256=NqE3B0ySa-U2jkelgmkBbkmkaIQxfu4pDryoxkZTMrc,1593
|
|
23
|
-
agent_runtime/state/memory.py,sha256=xOnlqM3ArXDKAdPx3PxdS9IGgJDSM-EKp_S1Hsit180,1561
|
|
24
|
-
agent_runtime/state/redis.py,sha256=-lPi_2xKm7Bc4DVMJfSEAF7wJHctLV3ZMM9AYBeQKZU,3425
|
|
25
|
-
agent_runtime/state/sqlite.py,sha256=NwuiTBXELb2tyOoH91MZqRJaCk9h8PskyY2VUc5EMr0,4868
|
|
26
|
-
agent_runtime/tracing/__init__.py,sha256=m4WzfgJpnV5XCCoMpBYZdJU_JTkAdhEhl7M7tpf62RY,1246
|
|
27
|
-
agent_runtime/tracing/langfuse.py,sha256=Z-2eEUHlxCC82JtXOAaoi-1zI6tQwEOWdpJgfCXcZH0,3655
|
|
28
|
-
agent_runtime/tracing/noop.py,sha256=MOm5eTrnf3d4WhiWrwVU5Kd3GmJ1903V0U7U3Qwho7U,746
|
|
29
|
-
agent_runtime_core-0.1.5.dist-info/METADATA,sha256=VzMdfsT_MU2wqmL6hqEQoIOqE352X4LlTrD7EMVTHvg,12488
|
|
30
|
-
agent_runtime_core-0.1.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
31
|
-
agent_runtime_core-0.1.5.dist-info/licenses/LICENSE,sha256=PcOO8aiOZ4H2MWYeKIis3o6xTCT1hNkDyCxHZhh1NeM,1070
|
|
32
|
-
agent_runtime_core-0.1.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|