trodo-python 2.18.0__py3-none-any.whl → 2.18.1__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.
- trodo/__init__.py +14 -1
- trodo/client.py +4 -0
- {trodo_python-2.18.0.dist-info → trodo_python-2.18.1.dist-info}/METADATA +1 -1
- {trodo_python-2.18.0.dist-info → trodo_python-2.18.1.dist-info}/RECORD +6 -6
- {trodo_python-2.18.0.dist-info → trodo_python-2.18.1.dist-info}/WHEEL +0 -0
- {trodo_python-2.18.0.dist-info → trodo_python-2.18.1.dist-info}/top_level.txt +0 -0
trodo/__init__.py
CHANGED
|
@@ -524,14 +524,21 @@ def wrap_agent(
|
|
|
524
524
|
conversation_id: Optional[str] = None,
|
|
525
525
|
parent_run_id: Optional[str] = None,
|
|
526
526
|
metadata: Optional[Dict[str, Any]] = None,
|
|
527
|
+
user: Optional[Dict[str, Any]] = None,
|
|
527
528
|
) -> _wrap_agent_ctx:
|
|
528
|
-
"""Wrap a block as an agent run — returns a context manager yielding RunHandle.
|
|
529
|
+
"""Wrap a block as an agent run — returns a context manager yielding RunHandle.
|
|
530
|
+
|
|
531
|
+
``user`` carries profile traits alongside the run — ``{"properties": ...,
|
|
532
|
+
"set_once": ..., "fixed_properties": ...}`` — so a request handler can
|
|
533
|
+
attribute the run and enrich the profile in one round trip.
|
|
534
|
+
"""
|
|
529
535
|
return _get_client().wrap_agent(
|
|
530
536
|
agent_name,
|
|
531
537
|
distinct_id=distinct_id,
|
|
532
538
|
conversation_id=conversation_id,
|
|
533
539
|
parent_run_id=parent_run_id,
|
|
534
540
|
metadata=metadata,
|
|
541
|
+
user=user,
|
|
535
542
|
)
|
|
536
543
|
|
|
537
544
|
|
|
@@ -540,14 +547,18 @@ def agent(
|
|
|
540
547
|
*,
|
|
541
548
|
distinct_id: Optional[str] = None,
|
|
542
549
|
conversation_id: Optional[str] = None,
|
|
550
|
+
parent_run_id: Optional[str] = None,
|
|
543
551
|
metadata: Optional[Dict[str, Any]] = None,
|
|
552
|
+
user: Optional[Dict[str, Any]] = None,
|
|
544
553
|
) -> Callable[[Callable[..., Any]], Callable[..., Any]]:
|
|
545
554
|
"""Decorator form of wrap_agent."""
|
|
546
555
|
return _get_client().agent(
|
|
547
556
|
agent_name,
|
|
548
557
|
distinct_id=distinct_id,
|
|
549
558
|
conversation_id=conversation_id,
|
|
559
|
+
parent_run_id=parent_run_id,
|
|
550
560
|
metadata=metadata,
|
|
561
|
+
user=user,
|
|
551
562
|
)
|
|
552
563
|
|
|
553
564
|
|
|
@@ -591,6 +602,7 @@ def start_run(
|
|
|
591
602
|
parent_run_id: Optional[str] = None,
|
|
592
603
|
metadata: Optional[Dict[str, Any]] = None,
|
|
593
604
|
input: Any = None,
|
|
605
|
+
user: Optional[Dict[str, Any]] = None,
|
|
594
606
|
) -> str:
|
|
595
607
|
"""Open a Run record without a context manager.
|
|
596
608
|
|
|
@@ -607,6 +619,7 @@ def start_run(
|
|
|
607
619
|
parent_run_id=parent_run_id,
|
|
608
620
|
metadata=metadata,
|
|
609
621
|
input=input,
|
|
622
|
+
user=user,
|
|
610
623
|
)
|
|
611
624
|
|
|
612
625
|
|
trodo/client.py
CHANGED
|
@@ -357,7 +357,9 @@ class TrodoClient:
|
|
|
357
357
|
*,
|
|
358
358
|
distinct_id: Optional[str] = None,
|
|
359
359
|
conversation_id: Optional[str] = None,
|
|
360
|
+
parent_run_id: Optional[str] = None,
|
|
360
361
|
metadata: Optional[Dict[str, Any]] = None,
|
|
362
|
+
user: Optional[Dict[str, Any]] = None,
|
|
361
363
|
) -> Callable[[Callable[..., Any]], Callable[..., Any]]:
|
|
362
364
|
"""Decorator form of wrap_agent."""
|
|
363
365
|
|
|
@@ -368,7 +370,9 @@ class TrodoClient:
|
|
|
368
370
|
agent_name,
|
|
369
371
|
distinct_id=distinct_id,
|
|
370
372
|
conversation_id=conversation_id,
|
|
373
|
+
parent_run_id=parent_run_id,
|
|
371
374
|
metadata=metadata,
|
|
375
|
+
user=user,
|
|
372
376
|
) as run:
|
|
373
377
|
result = fn(*args, **kwargs)
|
|
374
378
|
run.set_output(result)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
trodo/__init__.py,sha256=
|
|
2
|
-
trodo/client.py,sha256=
|
|
1
|
+
trodo/__init__.py,sha256=ZDRoY4LQW3mIN0G7YmfdF_KGoYwUBWIY-T7Dji-7-yQ,26734
|
|
2
|
+
trodo/client.py,sha256=9UYaHZtWPMYdlG2xWVf77PQJ9DfFgN-zobTh60i8_Cc,22453
|
|
3
3
|
trodo/types.py,sha256=eySgUvCXROG2TxtxgiU0MNr5iH0DEcduK8bmYtTKG44,3138
|
|
4
4
|
trodo/user_context.py,sha256=uHCI2WYoOI3cNwdIUEuZdX4VYSu14pzm348ksn6hn_c,8195
|
|
5
5
|
trodo/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -36,7 +36,7 @@ trodo/session/server_session.py,sha256=McsudEiq33XDq3nqxgzBcUvIjQxCMscwEuAPnYXrT
|
|
|
36
36
|
trodo/session/session_manager.py,sha256=7ht5LeeZX1HLLfPeNV_a8NkXGbHl3up0CRtCGr3EzjQ,2995
|
|
37
37
|
trodo/util/__init__.py,sha256=Z9c4rPPdKg06Kk3byKheDqksSgR4WNvS475oQ5sNljc,54
|
|
38
38
|
trodo/util/lru.py,sha256=QIsM7s6J_E9ZjiXatSyReZIEeGypTAcgrPWWy8YsRa4,2465
|
|
39
|
-
trodo_python-2.18.
|
|
40
|
-
trodo_python-2.18.
|
|
41
|
-
trodo_python-2.18.
|
|
42
|
-
trodo_python-2.18.
|
|
39
|
+
trodo_python-2.18.1.dist-info/METADATA,sha256=_pIbEb_guFZ6iH5xI0AyhiPuvVoGTlwgLVKsSqNub5E,25308
|
|
40
|
+
trodo_python-2.18.1.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
41
|
+
trodo_python-2.18.1.dist-info/top_level.txt,sha256=VCQu1CJWFmNsqTs1YxMcw4Mq35Tc3z3uI9RwHEXAayQ,6
|
|
42
|
+
trodo_python-2.18.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|