assistant-runtime-sdk 1.7.0__tar.gz → 1.7.1__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.7.0
3
+ Version: 1.7.1
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.7.0"
56
+ __version__ = "1.7.1"
57
57
  __author__ = "Paul Clinton"
58
58
  __license__ = "AGPL-3.0"
59
59
 
@@ -826,6 +826,14 @@ class AsyncAssistantRuntimeClient(BaseAssistantRuntimeClient):
826
826
  user_id, preference_id, status)
827
827
  return await self._request_post_json(endpoint, payload)
828
828
 
829
+ async def set_routing_preference_mode(
830
+ self, user_id: str, preference_id: str, rule_mode: str,
831
+ ) -> Optional[Dict[str, Any]]:
832
+ """Async version of AssistantRuntimeClient.set_routing_preference_mode."""
833
+ endpoint, payload = self._prepare_set_routing_preference_mode(
834
+ user_id, preference_id, rule_mode)
835
+ return await self._request_post_json(endpoint, payload)
836
+
829
837
  async def delete_routing_preference(
830
838
  self, user_id: str, preference_id: str,
831
839
  ) -> Optional[Dict[str, Any]]:
@@ -883,6 +883,16 @@ class BaseAssistantRuntimeClient:
883
883
  "status": status,
884
884
  }
885
885
 
886
+ def _prepare_set_routing_preference_mode(
887
+ self, user_id: str, preference_id: str, rule_mode: str,
888
+ ) -> tuple:
889
+ return "routing_preferences.set_routing_preference_mode", {
890
+ "tenant_id": self.tenant_id,
891
+ "user_id": user_id,
892
+ "preference_id": preference_id,
893
+ "rule_mode": rule_mode,
894
+ }
895
+
886
896
  def _prepare_delete_routing_preference(
887
897
  self, user_id: str, preference_id: str,
888
898
  ) -> tuple:
@@ -1189,6 +1189,28 @@ class AssistantRuntimeClient(BaseAssistantRuntimeClient):
1189
1189
  user_id, preference_id, status)
1190
1190
  return self._request_post_json(endpoint, payload)
1191
1191
 
1192
+ def set_routing_preference_mode(
1193
+ self, user_id: str, preference_id: str, rule_mode: str,
1194
+ ) -> Optional[Dict[str, Any]]:
1195
+ """Finish a rule's trial, or send it back to one.
1196
+
1197
+ Every rule carries its own mode, so this changes nothing about any
1198
+ other rule. Platform defaults are not reachable here — they are
1199
+ managed in AR Admin.
1200
+
1201
+ Args:
1202
+ user_id: User identifier
1203
+ preference_id: the rule
1204
+ rule_mode: "shadow" (matched and recorded, never applied) or
1205
+ "on" (applied)
1206
+
1207
+ Returns:
1208
+ {"preference_id": ..., "rule_mode": ...}
1209
+ """
1210
+ endpoint, payload = self._prepare_set_routing_preference_mode(
1211
+ user_id, preference_id, rule_mode)
1212
+ return self._request_post_json(endpoint, payload)
1213
+
1192
1214
  def delete_routing_preference(
1193
1215
  self, user_id: str, preference_id: str,
1194
1216
  ) -> Optional[Dict[str, Any]]:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "assistant_runtime_sdk"
3
- version = "1.7.0"
3
+ version = "1.7.1"
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"}