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 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
- from synth_ai.lm.core.main import LM # Moved from zyk to lm for better organization
9
- from synth_ai.lm.provider_support.anthropic import Anthropic, AsyncAnthropic
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
- from synth_ai.lm.provider_support.openai import AsyncOpenAI, OpenAI
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
- # Tracing exports - moved from synth-sdk (deprecated v1)
15
- from synth_ai.tracing_v1 import * # noqa
16
- import synth_ai.tracing_v1 as tracing # expose module name for __all__
17
- from synth_ai.tracing_v1.abstractions import (
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.5"
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
- # v1 tracing legacy API re-exports
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-dev-fastapi-app.modal.run",
17
- "prod": "https://synth-laboratories-prod--learning-v2-service-prod-fastapi-app.modal.run",
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
 
@@ -1,3 +1,4 @@
1
+ from __future__ import annotations
1
2
  """Async-aware decorators for tracing v3.
2
3
 
3
4
  This module provides decorators and context management utilities for the tracing
@@ -1,3 +1,4 @@
1
+ from __future__ import annotations
1
2
  """Hook system for extending tracing functionality.
2
3
 
3
4
  The hook system provides a flexible way to extend the tracing system without
@@ -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
- return await self.db.insert_outcome_reward(
437
- self._current_trace.session_id,
438
- total_reward=total_reward,
439
- achievements_count=achievements_count,
440
- total_steps=total_steps,
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"),
@@ -1,3 +1,4 @@
1
+ from __future__ import annotations
1
2
  """Utility functions for tracing v3."""
2
3
 
3
4
  import hashlib
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synth-ai
3
- Version: 0.2.5
4
- Summary: Software for aiding the best and multiplying the will - Core AI functionality and tracing
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=7l4obY2aQlcZEIxfKJqXCMOhfgdRzoWsG4f5KxJcbSs,1349
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=g9DQw3LqaDiVEcr-B49yg21M5Mus1HHId5-wMgJoK9Y,15636
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=p8iXlNw7bIRC8-uG9doWMkDQiuJK5KSCm_awiifMjJw,13262
355
- synth_ai/tracing_v3/hooks.py,sha256=iUKYY_I0abTSH_-Xe6Dfja7ff8xAhBVOU8AP2BEEcmA,7923
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=_pNmKmoqUsnH410L5zDzC9_f804j_fOzTFSUTh782d0,16718
361
- synth_ai/tracing_v3/utils.py,sha256=8fmysb6iHVaKtd7-ybFYC_hk2EnFh-wrywtHmdgx0ik,3409
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=klWc5RHh5N_EGMse8yQCWjhY82lw87XKPq78QD8IBP8,31248
373
- synth_ai/tracing_v3/turso/models.py,sha256=z_6UIq01RMpo1fHxbDrRQYU78tulWUPYSyp2edq9Q7M,16186
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.5.dist-info/licenses/LICENSE,sha256=ynhjRQUfqA_RdGRATApfFA_fBAy9cno04sLtLUqxVFM,1069
412
- synth_ai-0.2.5.dist-info/METADATA,sha256=layjilLCIDa_4Rz2c1Y9jAXKcSpl_HbN6o0feGXfaD0,4009
413
- synth_ai-0.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
414
- synth_ai-0.2.5.dist-info/entry_points.txt,sha256=Neq-3bT7TAijjgOIR77pKL-WYg6TWBDeO8pp_nL4vGY,91
415
- synth_ai-0.2.5.dist-info/top_level.txt,sha256=fBmtZyVHuKaGa29oHBaaUkrUIWTqSpoVMPiVdCDP3k8,9
416
- synth_ai-0.2.5.dist-info/RECORD,,
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,,