assistant-runtime-sdk 1.15.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.15.0 → assistant_runtime_sdk-1.16.0}/PKG-INFO +2 -2
- {assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/README.md +1 -1
- {assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/__init__.py +1 -1
- {assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/async_client.py +32 -6
- {assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/base.py +40 -2
- {assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/client.py +32 -6
- {assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/pyproject.toml +1 -1
- {assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/LICENSE +0 -0
- {assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/auth.py +0 -0
- {assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/exceptions.py +0 -0
- {assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/skills.py +0 -0
- {assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/streaming.py +0 -0
- {assistant_runtime_sdk-1.15.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.15.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,
|
|
@@ -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", {
|
{assistant_runtime_sdk-1.15.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,
|
|
File without changes
|
|
File without changes
|
{assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/exceptions.py
RENAMED
|
File without changes
|
{assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/skills.py
RENAMED
|
File without changes
|
{assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/streaming.py
RENAMED
|
File without changes
|
{assistant_runtime_sdk-1.15.0 → assistant_runtime_sdk-1.16.0}/assistant_runtime_sdk/types.py
RENAMED
|
File without changes
|