synth-ai 0.2.5__py3-none-any.whl → 0.2.6.dev1__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.
Potentially problematic release.
This version of synth-ai might be problematic. Click here for more details.
- synth_ai/__init__.py +18 -25
- synth_ai/experimental/synth_oss.py +2 -2
- synth_ai/tracing_v3/decorators.py +1 -0
- synth_ai/tracing_v3/hooks.py +1 -0
- synth_ai/tracing_v3/session_tracer.py +18 -7
- synth_ai/tracing_v3/turso/manager.py +3 -1
- synth_ai/tracing_v3/turso/models.py +3 -0
- synth_ai/tracing_v3/utils.py +1 -0
- {synth_ai-0.2.5.dist-info → synth_ai-0.2.6.dev1.dist-info}/METADATA +2 -2
- {synth_ai-0.2.5.dist-info → synth_ai-0.2.6.dev1.dist-info}/RECORD +14 -14
- {synth_ai-0.2.5.dist-info → synth_ai-0.2.6.dev1.dist-info}/WHEEL +0 -0
- {synth_ai-0.2.5.dist-info → synth_ai-0.2.6.dev1.dist-info}/entry_points.txt +0 -0
- {synth_ai-0.2.5.dist-info → synth_ai-0.2.6.dev1.dist-info}/licenses/LICENSE +0 -0
- {synth_ai-0.2.5.dist-info → synth_ai-0.2.6.dev1.dist-info}/top_level.txt +0 -0
synth_ai/__init__.py
CHANGED
|
@@ -5,39 +5,32 @@ Synth AI - Software for aiding the best and multiplying the will.
|
|
|
5
5
|
# Environment exports - moved from synth-env
|
|
6
6
|
from synth_ai.environments import * # noqa
|
|
7
7
|
import synth_ai.environments as environments # expose module name for __all__
|
|
8
|
-
|
|
9
|
-
from synth_ai.lm.
|
|
8
|
+
try:
|
|
9
|
+
from synth_ai.lm.core.main import LM # Moved from zyk to lm for better organization
|
|
10
|
+
except Exception: # allow minimal imports (e.g., tracing) without LM stack
|
|
11
|
+
LM = None # type: ignore
|
|
12
|
+
try:
|
|
13
|
+
from synth_ai.lm.provider_support.anthropic import Anthropic, AsyncAnthropic
|
|
14
|
+
except Exception: # optional in minimal environments
|
|
15
|
+
Anthropic = AsyncAnthropic = None # type: ignore
|
|
10
16
|
|
|
11
17
|
# Provider support exports - moved from synth-sdk to synth_ai/lm
|
|
12
|
-
|
|
18
|
+
try:
|
|
19
|
+
from synth_ai.lm.provider_support.openai import AsyncOpenAI, OpenAI
|
|
20
|
+
except Exception:
|
|
21
|
+
AsyncOpenAI = OpenAI = None # type: ignore
|
|
13
22
|
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
EventPartitionElement,
|
|
19
|
-
RewardSignal,
|
|
20
|
-
SystemTrace,
|
|
21
|
-
TrainingQuestion,
|
|
22
|
-
)
|
|
23
|
-
from synth_ai.tracing_v1.decorators import trace_event_async, trace_event_sync
|
|
24
|
-
from synth_ai.tracing_v1.upload import upload
|
|
23
|
+
# Legacy tracing v1 is not required for v3 usage and can be unavailable in minimal envs.
|
|
24
|
+
tracing = None # type: ignore
|
|
25
|
+
EventPartitionElement = RewardSignal = SystemTrace = TrainingQuestion = None # type: ignore
|
|
26
|
+
trace_event_async = trace_event_sync = upload = None # type: ignore
|
|
25
27
|
|
|
26
|
-
__version__ = "0.2.
|
|
28
|
+
__version__ = "0.2.6.dev1"
|
|
27
29
|
__all__ = [
|
|
28
30
|
"LM",
|
|
29
|
-
"tracing",
|
|
30
31
|
"OpenAI",
|
|
31
32
|
"AsyncOpenAI",
|
|
32
33
|
"Anthropic",
|
|
33
34
|
"AsyncAnthropic",
|
|
34
35
|
"environments",
|
|
35
|
-
|
|
36
|
-
"EventPartitionElement",
|
|
37
|
-
"RewardSignal",
|
|
38
|
-
"SystemTrace",
|
|
39
|
-
"TrainingQuestion",
|
|
40
|
-
"trace_event_async",
|
|
41
|
-
"trace_event_sync",
|
|
42
|
-
"upload",
|
|
43
|
-
] # Explicitly define public API
|
|
36
|
+
] # Explicitly define public API (v1 tracing omitted in minimal env)
|
|
@@ -13,8 +13,8 @@ SYNTH_BACKEND_URL = ""
|
|
|
13
13
|
|
|
14
14
|
# Learning V2 Modal Service URLs
|
|
15
15
|
LEARNING_V2_URLS = {
|
|
16
|
-
"dev": "https://synth-laboratories-dev--learning-v2-service-
|
|
17
|
-
"prod": "https://synth-laboratories-prod--learning-v2-service-
|
|
16
|
+
"dev": "https://synth-laboratories-dev--learning-v2-service-fastapi-app.modal.run",
|
|
17
|
+
"prod": "https://synth-laboratories-prod--learning-v2-service-fastapi-app.modal.run",
|
|
18
18
|
"main": "https://synth-laboratories--learning-v2-service-fastapi-app.modal.run"
|
|
19
19
|
}
|
|
20
20
|
|
synth_ai/tracing_v3/hooks.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
"""Main SessionTracer class for tracing v3."""
|
|
2
3
|
|
|
3
4
|
import asyncio
|
|
@@ -426,19 +427,29 @@ class SessionTracer:
|
|
|
426
427
|
# Reward recording helpers
|
|
427
428
|
# -------------------------------
|
|
428
429
|
|
|
429
|
-
async def record_outcome_reward(self, *, total_reward: int, achievements_count: int, total_steps: int) -> int | None:
|
|
430
|
+
async def record_outcome_reward(self, *, total_reward: int, achievements_count: int, total_steps: int, reward_metadata: dict[str, Any] | None = None) -> int | None:
|
|
430
431
|
"""Record an episode-level outcome reward for the current session."""
|
|
431
432
|
if self._current_trace is None:
|
|
432
433
|
raise RuntimeError("No active session")
|
|
433
434
|
if self.db is None:
|
|
434
435
|
await self.initialize()
|
|
435
436
|
if self.db:
|
|
436
|
-
|
|
437
|
-
self.
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
437
|
+
try:
|
|
438
|
+
return await self.db.insert_outcome_reward(
|
|
439
|
+
self._current_trace.session_id,
|
|
440
|
+
total_reward=total_reward,
|
|
441
|
+
achievements_count=achievements_count,
|
|
442
|
+
total_steps=total_steps,
|
|
443
|
+
reward_metadata=reward_metadata or {},
|
|
444
|
+
)
|
|
445
|
+
except TypeError:
|
|
446
|
+
# Backward-compat: older manager without reward_metadata param
|
|
447
|
+
return await self.db.insert_outcome_reward(
|
|
448
|
+
self._current_trace.session_id,
|
|
449
|
+
total_reward=total_reward,
|
|
450
|
+
achievements_count=achievements_count,
|
|
451
|
+
total_steps=total_steps,
|
|
452
|
+
)
|
|
442
453
|
return None
|
|
443
454
|
|
|
444
455
|
# StepMetrics removed in favor of event_rewards; use record_event_reward for per-turn shaped values
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
"""Async SQLAlchemy-based trace manager for Turso/sqld.
|
|
2
3
|
|
|
3
4
|
This module provides the database interface for the tracing system using
|
|
@@ -703,13 +704,14 @@ class AsyncSQLTraceManager:
|
|
|
703
704
|
# Reward helpers
|
|
704
705
|
# -------------------------------
|
|
705
706
|
|
|
706
|
-
async def insert_outcome_reward(self, session_id: str, *, total_reward: int, achievements_count: int, total_steps: int) -> int:
|
|
707
|
+
async def insert_outcome_reward(self, session_id: str, *, total_reward: int, achievements_count: int, total_steps: int, reward_metadata: dict | None = None) -> int:
|
|
707
708
|
async with self.session() as sess:
|
|
708
709
|
row = DBOutcomeReward(
|
|
709
710
|
session_id=session_id,
|
|
710
711
|
total_reward=total_reward,
|
|
711
712
|
achievements_count=achievements_count,
|
|
712
713
|
total_steps=total_steps,
|
|
714
|
+
reward_metadata=reward_metadata or {},
|
|
713
715
|
)
|
|
714
716
|
sess.add(row)
|
|
715
717
|
await sess.flush()
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
"""SQLAlchemy declarative models for tracing v3."""
|
|
2
3
|
|
|
3
4
|
import json
|
|
@@ -428,6 +429,8 @@ class OutcomeReward(Base):
|
|
|
428
429
|
achievements_count = Column(Integer, nullable=False, default=0)
|
|
429
430
|
total_steps = Column(Integer, nullable=False, default=0)
|
|
430
431
|
created_at = Column(DateTime, default=func.current_timestamp(), nullable=False)
|
|
432
|
+
# Store additional structured metadata about the outcome (e.g., achievements list)
|
|
433
|
+
reward_metadata = Column(JSONText)
|
|
431
434
|
|
|
432
435
|
__table_args__ = (
|
|
433
436
|
Index("idx_outcome_rewards_session", "session_id"),
|
synth_ai/tracing_v3/utils.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: synth-ai
|
|
3
|
-
Version: 0.2.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.2.6.dev1
|
|
4
|
+
Summary: RL as a service SDK - Core AI functionality and tracing
|
|
5
5
|
Author-email: Synth AI <josh@usesynth.ai>
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/synth-laboratories/synth-ai
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
synth_ai/__init__.py,sha256=
|
|
1
|
+
synth_ai/__init__.py,sha256=1mIN_hDsscPcKTV1ciH5N12pONnczGV-RmR8EqroksI,1341
|
|
2
2
|
synth_ai/__main__.py,sha256=Kh1xBKkTE5Vs2qNMtDuuOXerHUptMcOiF3YziOpC6DA,146
|
|
3
3
|
synth_ai/http.py,sha256=aKIGsGwMBi7S0Tg57Q1Nxdoxjh2sn9xzNziLYhfSA3c,4427
|
|
4
4
|
synth_ai/install_sqld.sh,sha256=AMBhlfq661PxeTTc6D4K_Nei_qwMvA84ei4NhQzmUUk,928
|
|
@@ -250,7 +250,7 @@ synth_ai/environments/tasks/utils.py,sha256=ZyDCQmj9jVcVBCrxFR2es1o5eLr7SLJK8k2E
|
|
|
250
250
|
synth_ai/environments/v0_observability/history.py,sha256=gW0SozHmxeL6PFNaTAQ7em8BNUlObsRpP4_MJ3drMBE,54
|
|
251
251
|
synth_ai/environments/v0_observability/log.py,sha256=B4LvbPh0a1_E5dki2PlKAVHESB8oCQz0CmDBvC0GwdQ,38
|
|
252
252
|
synth_ai/evals/base.py,sha256=EFupWBUxKIwvTvr4H29jX-LHWwAyIvNhzexHmG9w6QU,355
|
|
253
|
-
synth_ai/experimental/synth_oss.py,sha256=
|
|
253
|
+
synth_ai/experimental/synth_oss.py,sha256=EgvU-iI2BG8DyVm2gDq1lzM6yTzOCHhDdZbP24ryOgA,15627
|
|
254
254
|
synth_ai/inference/__init__.py,sha256=FMLFiLMfhZJlQERJCj641TtPqpiiJpaJQxxPFaFZ5jA,76
|
|
255
255
|
synth_ai/inference/client.py,sha256=zg2OXGxkURZihLONcm4jGTndlde7YDrORlE9uwGLFm8,711
|
|
256
256
|
synth_ai/jobs/client.py,sha256=wSSqzvIY_vmwG-CHeQYGoSsb-uOr0hDmE8ylNqNoQQQ,9498
|
|
@@ -351,14 +351,14 @@ synth_ai/tracing_v3/__init__.py,sha256=9lKM-blbXo6Sk1oBpyYayjMVU43f9Y_35M1OvRynW
|
|
|
351
351
|
synth_ai/tracing_v3/abstractions.py,sha256=FmVxWpRZAq5UmEmM-PjG-lFAT-1qgao7JGNh7AkU6b8,12368
|
|
352
352
|
synth_ai/tracing_v3/config.py,sha256=mPX2P4ILv1ktoI8oGKO_LyLc0O6Lnr2jbHA3QE-y6N0,3241
|
|
353
353
|
synth_ai/tracing_v3/db_config.py,sha256=9tG-0OC22bmpNHH4bz6pdb5a5JHgFzhav6p14POAqAQ,5827
|
|
354
|
-
synth_ai/tracing_v3/decorators.py,sha256=
|
|
355
|
-
synth_ai/tracing_v3/hooks.py,sha256=
|
|
354
|
+
synth_ai/tracing_v3/decorators.py,sha256=1YtWXb331F8-Jf-c0Tr9UwpEhJJFGC6w9Q_7oYp5bwk,13297
|
|
355
|
+
synth_ai/tracing_v3/hooks.py,sha256=LumG3hRmbRXl3ml0UhGYxwVpWRaCxrVPkD2lR7N8XVQ,7958
|
|
356
356
|
synth_ai/tracing_v3/llm_call_record_helpers.py,sha256=mqSQStFC02z9b7uoTO7FjgJfd8Kq1FWcBLi3k2lqRWs,12181
|
|
357
357
|
synth_ai/tracing_v3/lm_call_record_abstractions.py,sha256=j2RGuXVaV_EXmIosuXRDjptJSlrDXwb8x06k2fF6lqo,9195
|
|
358
358
|
synth_ai/tracing_v3/migration_helper.py,sha256=izm7SNHtG3VDv_5ZmMk_mmwKitmShxUK3joNFOArZIY,4177
|
|
359
359
|
synth_ai/tracing_v3/replica_sync.py,sha256=MoJRcMp6rZVC1QZF9EH2oUV70C7Br0N8DhEUZ9PeWks,8670
|
|
360
|
-
synth_ai/tracing_v3/session_tracer.py,sha256=
|
|
361
|
-
synth_ai/tracing_v3/utils.py,sha256=
|
|
360
|
+
synth_ai/tracing_v3/session_tracer.py,sha256=olgRSIhkH-UNPdNPYv9DYc4_poPiMnLEkbIrE68UrWI,17290
|
|
361
|
+
synth_ai/tracing_v3/utils.py,sha256=7HQptlq6B1nlmkv6M-lsNdmRisYJk3KNTTditr7dhB8,3444
|
|
362
362
|
synth_ai/tracing_v3/examples/basic_usage.py,sha256=wNpn8t0s0-2wusamBjn8WyyDUM_5Qz5_7TJuK4tSA98,7196
|
|
363
363
|
synth_ai/tracing_v3/storage/__init__.py,sha256=VPjBh180bcSPz1HsbqaqfnvguwqwomaEYKxkrhfGABY,332
|
|
364
364
|
synth_ai/tracing_v3/storage/base.py,sha256=6gzMy0wHnkPRK1gPWRQWZk5Q1EFhWtdcXHfuUP_F12E,3587
|
|
@@ -369,8 +369,8 @@ synth_ai/tracing_v3/storage/types.py,sha256=LevN8M12ilZ0EaiQ6Y3yONSMuLGEhSKNt0ir
|
|
|
369
369
|
synth_ai/tracing_v3/storage/utils.py,sha256=GTc0AYzuaCAwci6sg7UCgtMnluNIIUDbrBOJcP8LvmE,6056
|
|
370
370
|
synth_ai/tracing_v3/turso/__init__.py,sha256=MSvWojb9unyfLeTSaiVfw5T3dK72MzNQbvoCEZB9zag,414
|
|
371
371
|
synth_ai/tracing_v3/turso/daemon.py,sha256=RHcwab3pe3rbD8Ccl10_61KWgaieBv0fHVOsn9NkFfk,4334
|
|
372
|
-
synth_ai/tracing_v3/turso/manager.py,sha256=
|
|
373
|
-
synth_ai/tracing_v3/turso/models.py,sha256=
|
|
372
|
+
synth_ai/tracing_v3/turso/manager.py,sha256=ktPuq9Md7XuVsvnKNSQirArVzwb06fo1QRH4Xu-i5-c,31375
|
|
373
|
+
synth_ai/tracing_v3/turso/models.py,sha256=XPt_pF1QsLFdyfWcRhPx71fpWJKNFzVV0sfN4owJi_U,16347
|
|
374
374
|
synth_ai/v0/tracing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
375
375
|
synth_ai/v0/tracing/abstractions.py,sha256=pL9XCf9UEWdX4IRizzRK9XUNBtDeBYfkVD51F8UOB0s,6898
|
|
376
376
|
synth_ai/v0/tracing/base_client.py,sha256=IZpyuM-GIClvBBFA9iv4tpOjzY1QHF1m7vkNCYk7xLo,2931
|
|
@@ -408,9 +408,9 @@ synth_ai/v0/tracing_v1/events/manage.py,sha256=ZDXXP-ZwLH9LCsmw7Ru9o55d7bl_diPtJ
|
|
|
408
408
|
synth_ai/v0/tracing_v1/events/scope.py,sha256=BuBkhSpVHUJt8iGT9HJZF82rbb88mQcd2vM2shg-w2I,2550
|
|
409
409
|
synth_ai/v0/tracing_v1/events/store.py,sha256=0342lvAcalyJbVEIzQFaPuMQGgwiFm7M5rE6gr-G0E8,9041
|
|
410
410
|
synth_ai/zyk/__init__.py,sha256=htVLnzTYQ5rxzYpzSYBm7_o6uNKZ3pB_PrqkBrgTRS4,771
|
|
411
|
-
synth_ai-0.2.
|
|
412
|
-
synth_ai-0.2.
|
|
413
|
-
synth_ai-0.2.
|
|
414
|
-
synth_ai-0.2.
|
|
415
|
-
synth_ai-0.2.
|
|
416
|
-
synth_ai-0.2.
|
|
411
|
+
synth_ai-0.2.6.dev1.dist-info/licenses/LICENSE,sha256=ynhjRQUfqA_RdGRATApfFA_fBAy9cno04sLtLUqxVFM,1069
|
|
412
|
+
synth_ai-0.2.6.dev1.dist-info/METADATA,sha256=1tLa4AfGbb3RBUBWAZ7f8x36dqeZuAGumXp-dQnMZEo,3980
|
|
413
|
+
synth_ai-0.2.6.dev1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
414
|
+
synth_ai-0.2.6.dev1.dist-info/entry_points.txt,sha256=Neq-3bT7TAijjgOIR77pKL-WYg6TWBDeO8pp_nL4vGY,91
|
|
415
|
+
synth_ai-0.2.6.dev1.dist-info/top_level.txt,sha256=fBmtZyVHuKaGa29oHBaaUkrUIWTqSpoVMPiVdCDP3k8,9
|
|
416
|
+
synth_ai-0.2.6.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|