assistant-runtime-sdk 1.14.0__tar.gz → 1.16.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.
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/PKG-INFO +2 -2
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/README.md +1 -1
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/__init__.py +1 -1
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/async_client.py +34 -7
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/base.py +44 -2
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/client.py +34 -7
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/pyproject.toml +1 -1
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/LICENSE +0 -0
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/auth.py +0 -0
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/exceptions.py +0 -0
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/skills.py +0 -0
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/streaming.py +0 -0
- {assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: assistant_runtime_sdk
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.16.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
|
|
@@ -175,7 +175,7 @@ surface. A representative selection:
|
|
|
175
175
|
`list_workflow_runs()`, `set_workflow_schedule()`
|
|
176
176
|
|
|
177
177
|
**Support & feedback** — `create_ticket()`, `list_tickets()`, `get_ticket_thread()`,
|
|
178
|
-
`reply_to_ticket()`, `upload_ticket_attachment()`, `submit_feedback()`,
|
|
178
|
+
`reply_to_ticket()`, `upload_ticket_attachment()`, `submit_feedback()`, `rate_answer()`, `withdraw_answer_feedback()`, `get_answer_ratings()`,
|
|
179
179
|
`list_feedback(user_id)`
|
|
180
180
|
|
|
181
181
|
**Prompts** — `list_prompts(user_id)`, `get_prompt(prompt_name, arguments=None)`
|
|
@@ -142,7 +142,7 @@ surface. A representative selection:
|
|
|
142
142
|
`list_workflow_runs()`, `set_workflow_schedule()`
|
|
143
143
|
|
|
144
144
|
**Support & feedback** — `create_ticket()`, `list_tickets()`, `get_ticket_thread()`,
|
|
145
|
-
`reply_to_ticket()`, `upload_ticket_attachment()`, `submit_feedback()`,
|
|
145
|
+
`reply_to_ticket()`, `upload_ticket_attachment()`, `submit_feedback()`, `rate_answer()`, `withdraw_answer_feedback()`, `get_answer_ratings()`,
|
|
146
146
|
`list_feedback(user_id)`
|
|
147
147
|
|
|
148
148
|
**Prompts** — `list_prompts(user_id)`, `get_prompt(prompt_name, arguments=None)`
|
{assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/async_client.py
RENAMED
|
@@ -1844,13 +1844,39 @@ class AsyncAssistantRuntimeClient(BaseAssistantRuntimeClient):
|
|
|
1844
1844
|
return await self._request_post_json(endpoint, payload)
|
|
1845
1845
|
|
|
1846
1846
|
async def submit_feedback(self, user_id: str, rating: Optional[int] = None,
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1847
|
+
comment: Optional[str] = None,
|
|
1848
|
+
category: Optional[str] = None,
|
|
1849
|
+
conversation_id: Optional[str] = None,
|
|
1850
|
+
environment: Optional[dict] = None,
|
|
1851
|
+
source: Optional[str] = None,
|
|
1852
|
+
contact_ok: Optional[bool] = None) -> Optional[Dict[str, Any]]:
|
|
1853
|
+
"""Submit product/service feedback. Returns {feedback_id}.
|
|
1854
|
+
|
|
1855
|
+
source is "Form" or "Pulse".
|
|
1856
|
+
"""
|
|
1852
1857
|
endpoint, payload = self._prepare_submit_feedback(
|
|
1853
|
-
user_id, rating, comment, category, conversation_id, environment
|
|
1858
|
+
user_id, rating, comment, category, conversation_id, environment,
|
|
1859
|
+
source, contact_ok)
|
|
1860
|
+
return await self._request_post_json(endpoint, payload)
|
|
1861
|
+
|
|
1862
|
+
async def rate_answer(self, user_id: str, message_id: str, reaction: str,
|
|
1863
|
+
reasons: Optional[List[str]] = None,
|
|
1864
|
+
comment: Optional[str] = None) -> Optional[Dict[str, Any]]:
|
|
1865
|
+
"""React to one assistant answer. Returns {feedback_id} (+ locked: True)."""
|
|
1866
|
+
endpoint, payload = self._prepare_rate_answer(
|
|
1867
|
+
user_id, message_id, reaction, reasons, comment)
|
|
1868
|
+
return await self._request_post_json(endpoint, payload)
|
|
1869
|
+
|
|
1870
|
+
async def withdraw_answer_feedback(self, user_id: str,
|
|
1871
|
+
message_id: str) -> Optional[Dict[str, Any]]:
|
|
1872
|
+
"""Withdraw the user's reaction to an answer. Returns {withdrawn: bool}."""
|
|
1873
|
+
endpoint, payload = self._prepare_withdraw_answer_feedback(user_id, message_id)
|
|
1874
|
+
return await self._request_post_json(endpoint, payload)
|
|
1875
|
+
|
|
1876
|
+
async def get_answer_ratings(self, user_id: str,
|
|
1877
|
+
message_ids: List[str]) -> Optional[Dict[str, Any]]:
|
|
1878
|
+
"""Fetch the user's reactions. Returns {message_id: {reaction, reasons}}."""
|
|
1879
|
+
endpoint, payload = self._prepare_get_answer_ratings(user_id, message_ids)
|
|
1854
1880
|
return await self._request_post_json(endpoint, payload)
|
|
1855
1881
|
|
|
1856
1882
|
async def download_ticket_attachment(self, user_id: str, ticket_id: str,
|
|
@@ -1924,11 +1950,12 @@ class AsyncAssistantRuntimeClient(BaseAssistantRuntimeClient):
|
|
|
1924
1950
|
python_version: Optional[str] = None,
|
|
1925
1951
|
copilot_version: Optional[str] = None,
|
|
1926
1952
|
timeout: Optional[float] = None,
|
|
1953
|
+
site_profile: Optional[Dict[str, Any]] = None,
|
|
1927
1954
|
) -> Optional[Dict[str, Any]]:
|
|
1928
1955
|
"""Async send version/health info and receive pending notifications."""
|
|
1929
1956
|
endpoint, payload = self._prepare_heartbeat(
|
|
1930
1957
|
faco_version, fac_version, frappe_version, erpnext_version,
|
|
1931
|
-
python_version, copilot_version,
|
|
1958
|
+
python_version, copilot_version, site_profile,
|
|
1932
1959
|
)
|
|
1933
1960
|
return await self._request_post_json(endpoint, payload, timeout=timeout)
|
|
1934
1961
|
|
|
@@ -2119,8 +2119,10 @@ class BaseAssistantRuntimeClient:
|
|
|
2119
2119
|
comment: Optional[str] = None,
|
|
2120
2120
|
category: Optional[str] = None,
|
|
2121
2121
|
conversation_id: Optional[str] = None,
|
|
2122
|
-
environment: Optional[dict] = None
|
|
2123
|
-
|
|
2122
|
+
environment: Optional[dict] = None,
|
|
2123
|
+
source: Optional[str] = None,
|
|
2124
|
+
contact_ok: Optional[bool] = None) -> tuple:
|
|
2125
|
+
"""Returns (endpoint, payload). source is "Form" or "Pulse"."""
|
|
2124
2126
|
payload: Dict[str, Any] = {
|
|
2125
2127
|
"tenant_id": self.tenant_id,
|
|
2126
2128
|
"user_id": user_id,
|
|
@@ -2135,8 +2137,44 @@ class BaseAssistantRuntimeClient:
|
|
|
2135
2137
|
payload["conversation_id"] = conversation_id
|
|
2136
2138
|
if environment is not None:
|
|
2137
2139
|
payload["environment"] = environment
|
|
2140
|
+
if source is not None:
|
|
2141
|
+
payload["source"] = source
|
|
2142
|
+
if contact_ok is not None:
|
|
2143
|
+
payload["contact_ok"] = contact_ok
|
|
2138
2144
|
return "support.submit_feedback", payload
|
|
2139
2145
|
|
|
2146
|
+
def _prepare_rate_answer(self, user_id: str, message_id: str, reaction: str,
|
|
2147
|
+
reasons: Optional[List[str]] = None,
|
|
2148
|
+
comment: Optional[str] = None) -> tuple:
|
|
2149
|
+
"""Returns (endpoint, payload)."""
|
|
2150
|
+
payload: Dict[str, Any] = {
|
|
2151
|
+
"tenant_id": self.tenant_id,
|
|
2152
|
+
"user_id": user_id,
|
|
2153
|
+
"message_id": message_id,
|
|
2154
|
+
"reaction": reaction,
|
|
2155
|
+
}
|
|
2156
|
+
if reasons is not None:
|
|
2157
|
+
payload["reasons"] = list(reasons)
|
|
2158
|
+
if comment is not None:
|
|
2159
|
+
payload["comment"] = comment
|
|
2160
|
+
return "support.rate_answer", payload
|
|
2161
|
+
|
|
2162
|
+
def _prepare_withdraw_answer_feedback(self, user_id: str, message_id: str) -> tuple:
|
|
2163
|
+
"""Returns (endpoint, payload)."""
|
|
2164
|
+
return "support.withdraw_answer_feedback", {
|
|
2165
|
+
"tenant_id": self.tenant_id,
|
|
2166
|
+
"user_id": user_id,
|
|
2167
|
+
"message_id": message_id,
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
def _prepare_get_answer_ratings(self, user_id: str, message_ids: List[str]) -> tuple:
|
|
2171
|
+
"""Returns (endpoint, payload)."""
|
|
2172
|
+
return "support.get_answer_ratings", {
|
|
2173
|
+
"tenant_id": self.tenant_id,
|
|
2174
|
+
"user_id": user_id,
|
|
2175
|
+
"message_ids": list(message_ids),
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2140
2178
|
def _prepare_list_feedback(self, user_id: str) -> tuple:
|
|
2141
2179
|
"""Returns (endpoint, payload)."""
|
|
2142
2180
|
return "support.list_feedback", {
|
|
@@ -2250,6 +2288,7 @@ class BaseAssistantRuntimeClient:
|
|
|
2250
2288
|
erpnext_version: Optional[str] = None,
|
|
2251
2289
|
python_version: Optional[str] = None,
|
|
2252
2290
|
copilot_version: Optional[str] = None,
|
|
2291
|
+
site_profile: Optional[Dict[str, Any]] = None,
|
|
2253
2292
|
) -> tuple:
|
|
2254
2293
|
payload: Dict[str, Any] = {"tenant_id": self.tenant_id}
|
|
2255
2294
|
if faco_version:
|
|
@@ -2264,6 +2303,9 @@ class BaseAssistantRuntimeClient:
|
|
|
2264
2303
|
payload["python_version"] = python_version
|
|
2265
2304
|
if copilot_version:
|
|
2266
2305
|
payload["copilot_version"] = copilot_version
|
|
2306
|
+
# The site's apps, customisation counts and server setup; AR stores the latest one.
|
|
2307
|
+
if site_profile is not None:
|
|
2308
|
+
payload["site_profile"] = site_profile
|
|
2267
2309
|
return "heartbeat.heartbeat", payload
|
|
2268
2310
|
|
|
2269
2311
|
def _prepare_get_notifications(self, user_id: str) -> tuple:
|
{assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/client.py
RENAMED
|
@@ -2816,13 +2816,39 @@ class AssistantRuntimeClient(BaseAssistantRuntimeClient):
|
|
|
2816
2816
|
return self._request_post_json(endpoint, payload)
|
|
2817
2817
|
|
|
2818
2818
|
def submit_feedback(self, user_id: str, rating: Optional[int] = None,
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2819
|
+
comment: Optional[str] = None,
|
|
2820
|
+
category: Optional[str] = None,
|
|
2821
|
+
conversation_id: Optional[str] = None,
|
|
2822
|
+
environment: Optional[dict] = None,
|
|
2823
|
+
source: Optional[str] = None,
|
|
2824
|
+
contact_ok: Optional[bool] = None) -> Optional[Dict[str, Any]]:
|
|
2825
|
+
"""Submit product/service feedback. Returns {feedback_id}.
|
|
2826
|
+
|
|
2827
|
+
source is "Form" or "Pulse".
|
|
2828
|
+
"""
|
|
2824
2829
|
endpoint, payload = self._prepare_submit_feedback(
|
|
2825
|
-
user_id, rating, comment, category, conversation_id, environment
|
|
2830
|
+
user_id, rating, comment, category, conversation_id, environment,
|
|
2831
|
+
source, contact_ok)
|
|
2832
|
+
return self._request_post_json(endpoint, payload)
|
|
2833
|
+
|
|
2834
|
+
def rate_answer(self, user_id: str, message_id: str, reaction: str,
|
|
2835
|
+
reasons: Optional[List[str]] = None,
|
|
2836
|
+
comment: Optional[str] = None) -> Optional[Dict[str, Any]]:
|
|
2837
|
+
"""React to one assistant answer. Returns {feedback_id} (+ locked: True)."""
|
|
2838
|
+
endpoint, payload = self._prepare_rate_answer(
|
|
2839
|
+
user_id, message_id, reaction, reasons, comment)
|
|
2840
|
+
return self._request_post_json(endpoint, payload)
|
|
2841
|
+
|
|
2842
|
+
def withdraw_answer_feedback(self, user_id: str,
|
|
2843
|
+
message_id: str) -> Optional[Dict[str, Any]]:
|
|
2844
|
+
"""Withdraw the user's reaction to an answer. Returns {withdrawn: bool}."""
|
|
2845
|
+
endpoint, payload = self._prepare_withdraw_answer_feedback(user_id, message_id)
|
|
2846
|
+
return self._request_post_json(endpoint, payload)
|
|
2847
|
+
|
|
2848
|
+
def get_answer_ratings(self, user_id: str,
|
|
2849
|
+
message_ids: List[str]) -> Optional[Dict[str, Any]]:
|
|
2850
|
+
"""Fetch the user's reactions. Returns {message_id: {reaction, reasons}}."""
|
|
2851
|
+
endpoint, payload = self._prepare_get_answer_ratings(user_id, message_ids)
|
|
2826
2852
|
return self._request_post_json(endpoint, payload)
|
|
2827
2853
|
|
|
2828
2854
|
def download_ticket_attachment(self, user_id: str, ticket_id: str,
|
|
@@ -2907,11 +2933,12 @@ class AssistantRuntimeClient(BaseAssistantRuntimeClient):
|
|
|
2907
2933
|
python_version: Optional[str] = None,
|
|
2908
2934
|
copilot_version: Optional[str] = None,
|
|
2909
2935
|
timeout: Optional[float] = None,
|
|
2936
|
+
site_profile: Optional[Dict[str, Any]] = None,
|
|
2910
2937
|
) -> Optional[Dict[str, Any]]:
|
|
2911
2938
|
"""Send version/health info and receive pending notifications."""
|
|
2912
2939
|
endpoint, payload = self._prepare_heartbeat(
|
|
2913
2940
|
faco_version, fac_version, frappe_version, erpnext_version,
|
|
2914
|
-
python_version, copilot_version,
|
|
2941
|
+
python_version, copilot_version, site_profile,
|
|
2915
2942
|
)
|
|
2916
2943
|
return self._request_post_json(endpoint, payload, timeout=timeout)
|
|
2917
2944
|
|
|
File without changes
|
|
File without changes
|
{assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/exceptions.py
RENAMED
|
File without changes
|
{assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/skills.py
RENAMED
|
File without changes
|
{assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/streaming.py
RENAMED
|
File without changes
|
{assistant_runtime_sdk-1.14.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/types.py
RENAMED
|
File without changes
|