assistant-runtime-sdk 1.4.0__tar.gz → 1.5.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: assistant_runtime_sdk
3
- Version: 1.4.0
3
+ Version: 1.5.0
4
4
  Summary: Python SDK for FAC Cloud - the Assistant Runtime AI assistant backend
5
5
  Keywords: frappe,ai,assistant,llm,mcp,anthropic,openai,streaming
6
6
  Author: Paul Clinton
@@ -53,7 +53,7 @@ Standalone Functions:
53
53
 
54
54
  """
55
55
 
56
- __version__ = "1.4.0"
56
+ __version__ = "1.5.0"
57
57
  __author__ = "Paul Clinton"
58
58
  __license__ = "AGPL-3.0"
59
59
 
@@ -1489,10 +1489,11 @@ class AsyncAssistantRuntimeClient(BaseAssistantRuntimeClient):
1489
1489
  input_data: Dict[str, Any],
1490
1490
  user_id: str,
1491
1491
  trigger_id: str,
1492
+ workflow_docname: Optional[str] = None,
1492
1493
  ) -> Optional[Dict[str, Any]]:
1493
1494
  """Async version of AssistantRuntimeClient.execute_workflow_from_event."""
1494
1495
  endpoint, payload = self._prepare_execute_workflow_from_event(
1495
- workflow_name, input_data, user_id, trigger_id,
1496
+ workflow_name, input_data, user_id, trigger_id, workflow_docname,
1496
1497
  )
1497
1498
  return await self._request_post_json(endpoint, payload, api_base=self.workflows_api_base)
1498
1499
 
@@ -1617,14 +1617,20 @@ class BaseAssistantRuntimeClient:
1617
1617
  input_data: Dict[str, Any],
1618
1618
  user_id: str,
1619
1619
  trigger_id: str,
1620
+ workflow_docname: Optional[str] = None,
1620
1621
  ) -> tuple:
1621
- return "workflows.execute_from_event", {
1622
+ payload = {
1622
1623
  "tenant_id": self.tenant_id,
1623
1624
  "workflow_name": workflow_name,
1624
1625
  "input_data": input_data,
1625
1626
  "user_id": user_id,
1626
1627
  "trigger_id": trigger_id,
1627
1628
  }
1629
+ # The docname is the stable binding; workflow_name is a mutable display
1630
+ # label a rename can invalidate. Both travel so an older AR keeps working.
1631
+ if workflow_docname:
1632
+ payload["workflow_docname"] = workflow_docname
1633
+ return "workflows.execute_from_event", payload
1628
1634
 
1629
1635
  def _prepare_cancel_workflow_run(self, run_name: str) -> tuple:
1630
1636
  return "workflows.cancel_run", {
@@ -2193,21 +2193,24 @@ class AssistantRuntimeClient(BaseAssistantRuntimeClient):
2193
2193
  input_data: Dict[str, Any],
2194
2194
  user_id: str,
2195
2195
  trigger_id: str,
2196
+ workflow_docname: Optional[str] = None,
2196
2197
  ) -> Optional[Dict[str, Any]]:
2197
2198
  """
2198
- Trigger workflow execution from a FACO-side doc event.
2199
+ Trigger workflow execution from a FAC-side doc event.
2199
2200
 
2200
2201
  Args:
2201
- workflow_name: AR Workflow.workflow_name (human identifier)
2202
+ workflow_name: AR Workflow.workflow_name (mutable display label)
2202
2203
  input_data: Structured payload {trigger, doc, changed_fields}
2203
2204
  user_id: User on the customer bench who saved the doc
2204
- trigger_id: FACO AR Workflow Trigger name (for traceability)
2205
+ trigger_id: FAC Workflow Trigger name (for traceability)
2206
+ workflow_docname: AR Workflow docname (WF-#####). Preferred — a
2207
+ rename cannot invalidate it. Falls back to workflow_name.
2205
2208
 
2206
2209
  Returns:
2207
2210
  {"status": "queued", "run_name": str, "run_id": str, ...}
2208
2211
  """
2209
2212
  endpoint, payload = self._prepare_execute_workflow_from_event(
2210
- workflow_name, input_data, user_id, trigger_id,
2213
+ workflow_name, input_data, user_id, trigger_id, workflow_docname,
2211
2214
  )
2212
2215
  return self._request_post_json(endpoint, payload, api_base=self.workflows_api_base)
2213
2216
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "assistant_runtime_sdk"
3
- version = "1.4.0"
3
+ version = "1.5.0"
4
4
  description = "Python SDK for FAC Cloud - the Assistant Runtime AI assistant backend"
5
5
  readme = "README.md"
6
6
  license = {text = "AGPL-3.0"}