shiftaiagenticinfra-sdk-python 0.0.10__tar.gz → 0.0.12__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.
- {shiftaiagenticinfra_sdk_python-0.0.10/shiftaiagenticinfra_sdk_python.egg-info → shiftaiagenticinfra_sdk_python-0.0.12}/PKG-INFO +61 -15
- shiftaiagenticinfra_sdk_python-0.0.10/PKG-INFO → shiftaiagenticinfra_sdk_python-0.0.12/README.md +547 -530
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/pyproject.toml +1 -1
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/api/analytics_api.py +98 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/api/messages_api.py +30 -28
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/client.py +2 -1
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/models/__init__.py +60 -4
- shiftaiagenticinfra_sdk_python-0.0.10/README.md → shiftaiagenticinfra_sdk_python-0.0.12/shiftaiagenticinfra_sdk_python.egg-info/PKG-INFO +576 -501
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/setup.cfg +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/setup.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/__init__.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/api/__init__.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/api/agents_api.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/api/conversations_api.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/api/internal/__init__.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/api/internal/trulens_api.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/api/platform_api.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/api/platform_session_api.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/api/users_api.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/http/__init__.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/http/exceptions.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftai/http/http_client.py +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftaiagenticinfra_sdk_python.egg-info/SOURCES.txt +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftaiagenticinfra_sdk_python.egg-info/dependency_links.txt +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftaiagenticinfra_sdk_python.egg-info/requires.txt +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/shiftaiagenticinfra_sdk_python.egg-info/top_level.txt +0 -0
- {shiftaiagenticinfra_sdk_python-0.0.10 → shiftaiagenticinfra_sdk_python-0.0.12}/tests/test_integration.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shiftaiagenticinfra-sdk-python
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.12
|
|
4
4
|
Summary: Shiftai Agentic Infra Python SDK
|
|
5
5
|
Author: ShiftAI
|
|
6
6
|
Author-email: ShiftAI <s.tadakamalla@theshiftai.in>
|
|
@@ -162,23 +162,24 @@ async def main():
|
|
|
162
162
|
username="john_doe",
|
|
163
163
|
message="Hello, how can I help you?",
|
|
164
164
|
agent_name="SupportBot",
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
agent_version="1.0.0"
|
|
165
|
+
user_email="john@example.com", # Required for message submission
|
|
166
|
+
agent_platform="OpenAI", # Optional; when omitted, lookup uses name and project only
|
|
167
|
+
agent_version="1.0.0" # Optional; backend defaults to "1.0.0" when omitted
|
|
168
168
|
)
|
|
169
169
|
|
|
170
170
|
print(f"Message sent! ID: {human_response.messageId}")
|
|
171
|
+
print(f"Org context: {human_response.orgContext}") # Optional; may be null if org knowledge is unavailable/not configured
|
|
171
172
|
|
|
172
173
|
# 3. Send a bot response
|
|
173
174
|
bot_response = await client.messages.send_bot_message(
|
|
174
175
|
username="john_doe",
|
|
175
176
|
message="I can help you with your questions!",
|
|
176
177
|
agent_name="SupportBot",
|
|
177
|
-
agent_platform="OpenAI",
|
|
178
|
-
agent_version="1.0.0", # Required: Agent version
|
|
179
178
|
reply_message_id=human_response.messageId,
|
|
180
179
|
rag_context="Retrieved context from knowledge base...",
|
|
181
|
-
user_email="john@example.com"
|
|
180
|
+
user_email="john@example.com", # Required for message submission
|
|
181
|
+
agent_platform="OpenAI", # Optional
|
|
182
|
+
agent_version="1.0.0" # Optional; backend defaults to "1.0.0" when omitted
|
|
182
183
|
)
|
|
183
184
|
|
|
184
185
|
# 4. Get analytics
|
|
@@ -224,14 +225,14 @@ Send a human message with automatic user/agent creation.
|
|
|
224
225
|
- `username` (str, **required**): User identifier (e.g., "john_doe", "user123")
|
|
225
226
|
- `message` (str, **required**): The actual message content (e.g., "Hello, how can I help you?")
|
|
226
227
|
- `agent_name` (str, **required**): Target agent name (e.g., "SupportBot", "GPT-4")
|
|
227
|
-
- `
|
|
228
|
-
- `
|
|
228
|
+
- `user_email` (str, **required**): User's email address (required for message submission; e.g., "john@example.com")
|
|
229
|
+
- `agent_platform` (str, **optional**): Agent platform/provider (e.g., "OpenAI", "Azure"). When omitted, lookup/creation use name and project only.
|
|
229
230
|
- `user_metadata` (dict, **optional**): Custom user attributes (e.g., `{"role": "premium", "subscription": "gold"}`)
|
|
230
231
|
- `intent` (str, **optional**): Message intent classification (e.g., "question", "complaint", "request")
|
|
231
232
|
- `entities` (dict, **optional**): Extracted named entities (e.g., `{"person": "John", "location": "New York"}`)
|
|
232
233
|
- `annotations` (dict, **optional**): Additional message annotations (e.g., `{"priority": "high", "tags": ["urgent"]}`)
|
|
233
234
|
- `source_event` (dict, **optional**): Original event data from source system
|
|
234
|
-
- `agent_version` (str, **optional**): Agent version/model (e.g., "gpt-4", "claude-2")
|
|
235
|
+
- `agent_version` (str, **optional**): Agent version/model (e.g., "gpt-4", "claude-2"). Backend defaults to `"1.0.0"` when omitted.
|
|
235
236
|
- `agent_metadata` (dict, **optional**): Agent configuration data (e.g., `{"temperature": 0.7, "max_tokens": 1000}`)
|
|
236
237
|
- `mode` (str, **optional**): Mode identifier for the message. Allowed values: `"SIMPLE"` or `"EXPAND"`
|
|
237
238
|
- `conversation_id` (UUID, **optional**): Conversation ID to store the HUMAN message in. If omitted, backend creates a new conversation automatically.
|
|
@@ -245,16 +246,16 @@ Send a bot response to a human message.
|
|
|
245
246
|
- `username` (str, **required**): User identifier (must match the human message sender)
|
|
246
247
|
- `message` (str, **required**): Bot response content (e.g., "I can help you with that!")
|
|
247
248
|
- `agent_name` (str, **required**): Agent name (must match the human message agent)
|
|
248
|
-
- `agent_platform` (str, **required**): Agent platform (must match the human message platform)
|
|
249
249
|
- `reply_message_id` (UUID, **required**): ID of the human message being replied to
|
|
250
250
|
- `rag_context` (str, **required**): RAG context used for generating the response
|
|
251
|
-
- `user_email` (str, **required**): User's email address for
|
|
251
|
+
- `user_email` (str, **required**): User's email address (required for message submission)
|
|
252
|
+
- `agent_platform` (str, **optional**): Agent platform (must match the human message when provided). When omitted, lookup uses name and project only.
|
|
252
253
|
- `user_metadata` (dict, **optional**): User metadata
|
|
253
254
|
- `intent` (str, **optional**): Response intent
|
|
254
255
|
- `entities` (dict, **optional**): Extracted entities from response
|
|
255
256
|
- `annotations` (dict, **optional**): Response annotations
|
|
256
257
|
- `source_event` (dict, **optional**): Source event data
|
|
257
|
-
- `agent_version` (str, **optional**): Agent version/model
|
|
258
|
+
- `agent_version` (str, **optional**): Agent version/model. Backend defaults to `"1.0.0"` when omitted.
|
|
258
259
|
- `agent_metadata` (dict, **optional**): Agent configuration
|
|
259
260
|
- `mode` (str, **optional**): Mode identifier for the message. Allowed values: `"SIMPLE"` or `"EXPAND"`
|
|
260
261
|
|
|
@@ -262,6 +263,7 @@ Send a bot response to a human message.
|
|
|
262
263
|
|
|
263
264
|
**Response Notes (Cache):**
|
|
264
265
|
- `cacheHit` / `cacheResponse` may be present when the backend cache API was checked (typically for HUMAN messages).
|
|
266
|
+
- `orgContext` may be present in submission response (typically HUMAN flow). May be null if org knowledge is unavailable, or not configured.
|
|
265
267
|
|
|
266
268
|
### Platform Session API
|
|
267
269
|
|
|
@@ -286,10 +288,17 @@ POST `/api/platformsession/endconversation`
|
|
|
286
288
|
Low-level message submission with full control.
|
|
287
289
|
|
|
288
290
|
**Parameters:**
|
|
289
|
-
- `request` (PlatformMessageSubmissionRequest, **required**): Complete message request object
|
|
291
|
+
- `request` (PlatformMessageSubmissionRequest, **required**): Complete message request object. `email` is required for message submission; the SDK raises `ValueError` if it is missing or blank.
|
|
290
292
|
|
|
291
293
|
**Return Type:** `PlatformMessageSubmissionResponse`
|
|
292
294
|
|
|
295
|
+
**Response fields to expect in `PlatformMessageSubmissionResponse`:**
|
|
296
|
+
- `success`, `messageId`, `conversationId`, `message`
|
|
297
|
+
- `contextualPrompt`, `humanQuery`, `previousKConversations`, `similarConversations`
|
|
298
|
+
- `operationStatus`, `conversationTitle`
|
|
299
|
+
- `cacheResponse`, `cacheHit`
|
|
300
|
+
- `orgContext` (optional; typically HUMAN flow. May be null if org knowledge is unavailable, or not configured.)
|
|
301
|
+
|
|
293
302
|
#### `await messages.get_all()`
|
|
294
303
|
Get all messages for the authenticated project.
|
|
295
304
|
|
|
@@ -396,6 +405,42 @@ Get latest feedback submissions for the project, most recent first.
|
|
|
396
405
|
|
|
397
406
|
**Return Type:** `LatestFeedbacksResponse` (`.feedbacks` list of `LatestFeedbackItemResponse`; optional `.message` when time window is used and there are no feedbacks)
|
|
398
407
|
|
|
408
|
+
#### User preferences (tenant-isolated; require Api-Key)
|
|
409
|
+
|
|
410
|
+
**Categories:** `USER_PERSONAL` (tone, style, formatting), `METRICS` (structure, visualization), `CALCULATION` (formulas, methods). Use value `"DELETE"` (case-insensitive) to remove the item at the given index.
|
|
411
|
+
|
|
412
|
+
#### `await analytics.update_user_preference(request)`
|
|
413
|
+
Update one user preference item (or remove with value `"DELETE"`).
|
|
414
|
+
|
|
415
|
+
**Endpoint:** POST `/api/analytics/user-preferences/update`
|
|
416
|
+
|
|
417
|
+
**Parameters:**
|
|
418
|
+
- `request` (`UserPreferenceUpdateRequest`, **required**): `profileId` (UUID), `category` (USER_PERSONAL | METRICS | CALCULATION), `index` (0-based, non-negative), `value` (new text or `"DELETE"` to remove item at index)
|
|
419
|
+
|
|
420
|
+
**Return Type:** `UserPreferenceItemResponse` (includes `updatedAt` on success)
|
|
421
|
+
|
|
422
|
+
#### `await analytics.list_user_preferences_by_email(email)`
|
|
423
|
+
List preferences for one user by email.
|
|
424
|
+
|
|
425
|
+
**Endpoint:** POST `/api/analytics/user-preferences/list`
|
|
426
|
+
|
|
427
|
+
**Parameters:**
|
|
428
|
+
- `email` (str, **required**): User email in the tenant (e.g. `"john@example.com"`)
|
|
429
|
+
|
|
430
|
+
**Return Type:** `UserPreferenceListResponse` (`.userpreferences` list of `UserPreferenceItemResponse`)
|
|
431
|
+
|
|
432
|
+
#### `await analytics.list_all_user_preferences(limit=None)`
|
|
433
|
+
List all user preferences in the tenant with optional limit.
|
|
434
|
+
|
|
435
|
+
**Endpoint:** POST `/api/analytics/user-preferences/list/all`
|
|
436
|
+
|
|
437
|
+
**Parameters:**
|
|
438
|
+
- `limit` (int, **optional**): Max profiles to return (default 50, max 500). Omit or `None` for default.
|
|
439
|
+
|
|
440
|
+
**Return Type:** `UserPreferenceListResponse` (`.userpreferences` list of `UserPreferenceItemResponse`)
|
|
441
|
+
|
|
442
|
+
**Response shape (single profile):** `UserPreferenceItemResponse` has `profileId`, `username`, `userEmail`, `botName`, `userPreferences` (object with `userPersonalFeedbacks`, `metricsFeedbacks`, `calculationFeedbacks` arrays of strings), `createdAt`, `updatedAt` (ISO-8601).
|
|
443
|
+
|
|
399
444
|
#### `await analytics.get_dashboard()`
|
|
400
445
|
Get project dashboard metrics (includes cache analytics: `cacheServed`, `estimatedTokensSaved`, `estimatedCostSaved` when available).
|
|
401
446
|
|
|
@@ -500,7 +545,8 @@ try:
|
|
|
500
545
|
username="user",
|
|
501
546
|
message="Hello",
|
|
502
547
|
agent_name="Bot",
|
|
503
|
-
|
|
548
|
+
user_email="user@example.com", # Required for message submission
|
|
549
|
+
agent_platform="OpenAI" # Optional
|
|
504
550
|
)
|
|
505
551
|
except BadRequestException as e:
|
|
506
552
|
print(f"Invalid request: {e}")
|