oneshot-python 0.14.0__tar.gz → 0.15.0__tar.gz

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.
Files changed (20) hide show
  1. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/PKG-INFO +1 -1
  2. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/oneshot/client.py +28 -13
  3. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/pyproject.toml +1 -1
  4. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/.gitignore +0 -0
  5. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/README.md +0 -0
  6. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/oneshot/__init__.py +0 -0
  7. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/oneshot/_errors.py +0 -0
  8. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/oneshot/_types.py +0 -0
  9. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/oneshot/x402.py +0 -0
  10. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/tests/__init__.py +0 -0
  11. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/tests/test_balance.py +0 -0
  12. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/tests/test_compute.py +0 -0
  13. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/tests/test_email_payload.py +0 -0
  14. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/tests/test_emergency_error.py +0 -0
  15. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/tests/test_max_cost_header.py +0 -0
  16. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/tests/test_phones_pending.py +0 -0
  17. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/tests/test_request_id.py +0 -0
  18. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/tests/test_tag_receipt_value.py +0 -0
  19. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/tests/test_x402.py +0 -0
  20. {oneshot_python-0.14.0 → oneshot_python-0.15.0}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oneshot-python
3
- Version: 0.14.0
3
+ Version: 0.15.0
4
4
  Summary: Core Python SDK for the OneShot API — HTTP client with x402 payment handling
5
5
  License-Expression: MIT
6
6
  Requires-Python: >=3.10
@@ -38,7 +38,7 @@ try:
38
38
 
39
39
  SDK_VERSION = _pkg_version("oneshot-python")
40
40
  except Exception: # pragma: no cover - editable/source runs without dist metadata
41
- SDK_VERSION = "0.12.1"
41
+ SDK_VERSION = "0.15.0"
42
42
 
43
43
  # ---------------------------------------------------------------------------
44
44
  # Environment configuration
@@ -968,21 +968,27 @@ class OneShotClient:
968
968
  value_tag: Optional[dict[str, Any]] = None,
969
969
  *,
970
970
  request_id: Optional[str] = None,
971
+ goal_id: Optional[str] = None,
971
972
  ) -> dict:
972
- """Tag a receipt with a value for RoCS computation. Blocking.
973
+ """Tag business value for RoCS computation. Blocking.
973
974
 
974
- Identify the receipt by ``receipt_id`` (``rcpt_…``) or, equivalently, by
975
- the ``request_id`` returned from the originating tool call the API
976
- resolves a ``request_id`` via the receipt's ``job_id``, so you can tag
977
- value without a prior receipts lookup.
975
+ Address the value three ways: by ``receipt_id`` (``rcpt_…``); by the
976
+ ``request_id`` returned from the originating tool call (the API resolves
977
+ it via the receipt's ``job_id``); or by ``goal_id`` — a correlation key
978
+ that attributes a whole *cadence's* outcome (a closed deal across the
979
+ intro email + follow-ups + find/verify/enrich calls sharing
980
+ ``decisionContext.goalId``) in one call. Read goal-level rollups back via
981
+ ``rocs_by_goal``.
978
982
 
979
983
  ``value_tag`` shape: ``{"type": ..., "amount": ..., "label": ...}``.
980
984
  ``type`` must be one of ``revenue``, ``lead``, ``conversion``,
981
- ``savings``, ``engagement``. Tags are stored as ``pending`` until a
982
- judge service confirms them against inbound signals.
985
+ ``savings``, ``engagement``. Stored as ``pending`` until a judge service
986
+ confirms them against inbound signals.
983
987
  """
984
988
  return asyncio.get_event_loop().run_until_complete(
985
- self.atag_receipt_value(receipt_id, value_tag, request_id=request_id)
989
+ self.atag_receipt_value(
990
+ receipt_id, value_tag, request_id=request_id, goal_id=goal_id
991
+ )
986
992
  )
987
993
 
988
994
  async def atag_receipt_value(
@@ -991,15 +997,24 @@ class OneShotClient:
991
997
  value_tag: Optional[dict[str, Any]] = None,
992
998
  *,
993
999
  request_id: Optional[str] = None,
1000
+ goal_id: Optional[str] = None,
994
1001
  ) -> dict:
995
- """Tag a receipt with a value for RoCS computation. Async."""
1002
+ """Tag business value for RoCS computation. Async."""
1003
+ if not isinstance(value_tag, dict) or not value_tag.get("type"):
1004
+ raise ValidationError("value_tag.type is required", "value_tag.type")
1005
+
1006
+ # Cadence-level: route to the outcome ledger by correlation key.
1007
+ if goal_id and not receipt_id and not request_id:
1008
+ return await self.acall_free_post(
1009
+ "/v1/analytics/outcomes",
1010
+ {"goal_id": goal_id, **value_tag},
1011
+ )
1012
+
996
1013
  target = receipt_id or request_id
997
1014
  if not target:
998
1015
  raise ValidationError(
999
- "receipt_id or request_id is required", "receipt_id"
1016
+ "receipt_id, request_id, or goal_id is required", "receipt_id"
1000
1017
  )
1001
- if not isinstance(value_tag, dict) or not value_tag.get("type"):
1002
- raise ValidationError("value_tag.type is required", "value_tag.type")
1003
1018
  return await self.acall_free_patch(
1004
1019
  f"/v1/analytics/receipts/{target}/value",
1005
1020
  value_tag,
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "oneshot-python"
3
- version = "0.14.0"
3
+ version = "0.15.0"
4
4
  description = "Core Python SDK for the OneShot API — HTTP client with x402 payment handling"
5
5
  readme = {text = "Core Python SDK for the OneShot API", content-type = "text/plain"}
6
6
  license = "MIT"
File without changes