shiftaiagenticinfra-sdk-python 0.0.8__tar.gz → 0.0.10__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.
Files changed (27) hide show
  1. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/PKG-INFO +25 -1
  2. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/README.md +24 -0
  3. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/pyproject.toml +1 -1
  4. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/api/analytics_api.py +45 -0
  5. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/api/conversations_api.py +69 -3
  6. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/models/__init__.py +40 -0
  7. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftaiagenticinfra_sdk_python.egg-info/PKG-INFO +25 -1
  8. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/setup.cfg +0 -0
  9. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/setup.py +0 -0
  10. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/__init__.py +0 -0
  11. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/api/__init__.py +0 -0
  12. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/api/agents_api.py +0 -0
  13. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/api/internal/__init__.py +0 -0
  14. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/api/internal/trulens_api.py +0 -0
  15. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/api/messages_api.py +0 -0
  16. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/api/platform_api.py +0 -0
  17. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/api/platform_session_api.py +0 -0
  18. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/api/users_api.py +0 -0
  19. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/client.py +0 -0
  20. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/http/__init__.py +0 -0
  21. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/http/exceptions.py +0 -0
  22. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftai/http/http_client.py +0 -0
  23. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftaiagenticinfra_sdk_python.egg-info/SOURCES.txt +0 -0
  24. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftaiagenticinfra_sdk_python.egg-info/dependency_links.txt +0 -0
  25. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftaiagenticinfra_sdk_python.egg-info/requires.txt +0 -0
  26. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/shiftaiagenticinfra_sdk_python.egg-info/top_level.txt +0 -0
  27. {shiftaiagenticinfra_sdk_python-0.0.8 → shiftaiagenticinfra_sdk_python-0.0.10}/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.8
3
+ Version: 0.0.10
4
4
  Summary: Shiftai Agentic Infra Python SDK
5
5
  Author: ShiftAI
6
6
  Author-email: ShiftAI <s.tadakamalla@theshiftai.in>
@@ -388,6 +388,14 @@ Get all feedback submissions for a specific BOT message (most recent first).
388
388
 
389
389
  **Return Type:** `List[FeedbackDTO]`
390
390
 
391
+ #### `await analytics.get_latest_feedbacks(timeperiod=None)`
392
+ Get latest feedback submissions for the project, most recent first.
393
+
394
+ **Parameters:**
395
+ - `timeperiod` (int, **optional**): None or omitted = all feedbacks; N (e.g. 24) = only feedbacks from the last N hours
396
+
397
+ **Return Type:** `LatestFeedbacksResponse` (`.feedbacks` list of `LatestFeedbackItemResponse`; optional `.message` when time window is used and there are no feedbacks)
398
+
391
399
  #### `await analytics.get_dashboard()`
392
400
  Get project dashboard metrics (includes cache analytics: `cacheServed`, `estimatedTokensSaved`, `estimatedCostSaved` when available).
393
401
 
@@ -458,6 +466,22 @@ Get all conversations for a specific user.
458
466
 
459
467
  **Return Type:** `List[ConversationSummaryResponse]`
460
468
 
469
+ #### `await conversations.get_conversations_by_email(email)`
470
+ Get all conversations for a specific user by email.
471
+
472
+ **Parameters:**
473
+ - `email` (str, required): User's email address
474
+
475
+ **Return Type:** `List[ConversationSummaryResponse]`
476
+
477
+ #### `await conversations.delete_conversation(conversation_id)`
478
+ Delete a conversation.
479
+
480
+ **Parameters:**
481
+ - `conversation_id` (UUID, required): Conversation identifier
482
+
483
+ **Return Type:** `Dict[str, Any]`
484
+
461
485
  ## Error Handling
462
486
 
463
487
  The SDK surfaces HTTP errors as typed exceptions:
@@ -359,6 +359,14 @@ Get all feedback submissions for a specific BOT message (most recent first).
359
359
 
360
360
  **Return Type:** `List[FeedbackDTO]`
361
361
 
362
+ #### `await analytics.get_latest_feedbacks(timeperiod=None)`
363
+ Get latest feedback submissions for the project, most recent first.
364
+
365
+ **Parameters:**
366
+ - `timeperiod` (int, **optional**): None or omitted = all feedbacks; N (e.g. 24) = only feedbacks from the last N hours
367
+
368
+ **Return Type:** `LatestFeedbacksResponse` (`.feedbacks` list of `LatestFeedbackItemResponse`; optional `.message` when time window is used and there are no feedbacks)
369
+
362
370
  #### `await analytics.get_dashboard()`
363
371
  Get project dashboard metrics (includes cache analytics: `cacheServed`, `estimatedTokensSaved`, `estimatedCostSaved` when available).
364
372
 
@@ -429,6 +437,22 @@ Get all conversations for a specific user.
429
437
 
430
438
  **Return Type:** `List[ConversationSummaryResponse]`
431
439
 
440
+ #### `await conversations.get_conversations_by_email(email)`
441
+ Get all conversations for a specific user by email.
442
+
443
+ **Parameters:**
444
+ - `email` (str, required): User's email address
445
+
446
+ **Return Type:** `List[ConversationSummaryResponse]`
447
+
448
+ #### `await conversations.delete_conversation(conversation_id)`
449
+ Delete a conversation.
450
+
451
+ **Parameters:**
452
+ - `conversation_id` (UUID, required): Conversation identifier
453
+
454
+ **Return Type:** `Dict[str, Any]`
455
+
432
456
  ## Error Handling
433
457
 
434
458
  The SDK surfaces HTTP errors as typed exceptions:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "shiftaiagenticinfra-sdk-python"
7
- version = "0.0.8"
7
+ version = "0.0.10"
8
8
  description = "Shiftai Agentic Infra Python SDK"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -10,6 +10,9 @@ from ..models import (
10
10
  FeedbackSubmissionRequest,
11
11
  FeedbackSubmissionResponse,
12
12
  FeedbackDTO,
13
+ LatestFeedbacksRequest,
14
+ LatestFeedbackItemResponse,
15
+ LatestFeedbacksResponse,
13
16
  DashboardMetricsDTO,
14
17
  TopAgentDTO,
15
18
  TopUserDTO,
@@ -103,6 +106,48 @@ class AnalyticsApi:
103
106
  FeedbackDTO,
104
107
  )
105
108
 
109
+ async def get_latest_feedbacks(
110
+ self,
111
+ timeperiod: Optional[int] = None,
112
+ ) -> LatestFeedbacksResponse:
113
+ """
114
+ Get latest feedback submissions for the project, most recent first.
115
+
116
+ POST /api/platform/feedbacks/latest
117
+
118
+ Args:
119
+ timeperiod: Optional. None or omitted = all feedbacks.
120
+ N (e.g. 24) = only feedbacks from the last N hours.
121
+
122
+ Returns:
123
+ LatestFeedbacksResponse with .feedbacks (list) and optional .message
124
+ (e.g. when timeperiod is set and there are no feedbacks in that window).
125
+ """
126
+ self._http_client.ensure_authenticated()
127
+
128
+ body: Dict[str, Any] = {} if timeperiod is None else {"timeperiod": timeperiod}
129
+ data = await self._http_client.post_map("/api/platform/feedbacks/latest", body)
130
+
131
+ if isinstance(data, list):
132
+ items = [
133
+ LatestFeedbackItemResponse(
134
+ **self._http_client._filter_known_fields(item, LatestFeedbackItemResponse)
135
+ )
136
+ for item in data
137
+ ]
138
+ return LatestFeedbacksResponse(feedbacks=items)
139
+ if isinstance(data, dict):
140
+ msg = data.get("message")
141
+ raw_list = data.get("feedbacks", [])
142
+ items = [
143
+ LatestFeedbackItemResponse(
144
+ **self._http_client._filter_known_fields(item, LatestFeedbackItemResponse)
145
+ )
146
+ for item in raw_list
147
+ ]
148
+ return LatestFeedbacksResponse(message=msg, feedbacks=items)
149
+ return LatestFeedbacksResponse(feedbacks=[])
150
+
106
151
  async def get_dashboard(self) -> DashboardMetricsDTO:
107
152
  """
108
153
  Get dashboard metrics.
@@ -1,12 +1,17 @@
1
1
  """
2
2
  API for platform conversation operations.
3
- Provides methods for retrieving conversation messages and listing conversations.
3
+ Provides methods for retrieving and managing conversations.
4
4
  """
5
5
 
6
- from typing import List
6
+ from typing import List, Dict, Any
7
7
  from uuid import UUID
8
8
  from ..http import HttpClient
9
- from ..models import ConversationMessageResponse, ConversationSummaryResponse
9
+ from ..models import (
10
+ ConversationMessageResponse,
11
+ ConversationSummaryResponse,
12
+ GetConversationsByEmailRequest,
13
+ DeleteConversationRequest,
14
+ )
10
15
 
11
16
 
12
17
  class ConversationsApi:
@@ -106,4 +111,65 @@ class ConversationsApi:
106
111
  request,
107
112
  ConversationSummaryResponse
108
113
  )
114
+
115
+ async def get_conversations_by_email(
116
+ self,
117
+ email: str,
118
+ ) -> List[ConversationSummaryResponse]:
119
+ """
120
+ Get all conversations for a specific user by email within the authenticated project.
121
+
122
+ POST /api/platform/conversations/email
123
+
124
+ Args:
125
+ email: User's email address (required)
126
+
127
+ Returns:
128
+ List of conversation summaries for the user
129
+
130
+ Raises:
131
+ ValueError: If email is missing or API key is not configured
132
+ ApiException: If the API request fails
133
+ """
134
+ self._http_client.ensure_authenticated()
135
+
136
+ if not email or not email.strip():
137
+ raise ValueError("email is required")
138
+
139
+ request = GetConversationsByEmailRequest(email=email.strip())
140
+
141
+ return await self._http_client.post_list(
142
+ "/api/platform/conversations/email",
143
+ request,
144
+ ConversationSummaryResponse,
145
+ )
146
+
147
+ async def delete_conversation(
148
+ self,
149
+ conversation_id: UUID,
150
+ ) -> Dict[str, Any]:
151
+ """
152
+ Delete a conversation.
153
+
154
+ POST /api/platform/conversation/delete
155
+
156
+ Args:
157
+ conversation_id: UUID of the conversation to delete (required)
158
+
159
+ Returns:
160
+ Dict with:
161
+ - On success (200): success, message, timestamp
162
+ - On errors (4xx/5xx): error, message, status, timestamp
163
+ """
164
+ self._http_client.ensure_authenticated()
165
+
166
+ if conversation_id is None:
167
+ raise ValueError("conversation_id is required")
168
+
169
+ request = DeleteConversationRequest(conversationId=conversation_id)
170
+
171
+ return await self._http_client.post_map(
172
+ "/api/platform/conversation/delete",
173
+ request,
174
+ )
109
175
 
@@ -182,6 +182,34 @@ class FeedbackDTO:
182
182
  submittedAt: Optional[str] = None # ISO 8601 datetime string
183
183
 
184
184
 
185
+ @dataclass
186
+ class LatestFeedbacksRequest:
187
+ """Request for latest feedbacks; optional time window in hours."""
188
+ timeperiod: Optional[int] = None # None or omitted = all; N = last N hours
189
+
190
+
191
+ @dataclass
192
+ class LatestFeedbackItemResponse:
193
+ """Single item in the latest-feedbacks list (POST /api/platform/feedbacks/latest)."""
194
+ messageId: Optional[UUID] = None
195
+ username: Optional[str] = None
196
+ agentName: Optional[str] = None
197
+ conversationId: Optional[UUID] = None
198
+ sender: Optional[str] = None
199
+ message: Optional[str] = None # Human query the bot was replying to
200
+ feedbackTitle: Optional[str] = None
201
+ feedback: Optional[str] = None
202
+ context: Optional[str] = None
203
+ time: Optional[str] = None # ISO-8601 when feedback was submitted
204
+
205
+
206
+ @dataclass
207
+ class LatestFeedbacksResponse:
208
+ """Response from latest feedbacks: list of items and optional message (e.g. empty timeline)."""
209
+ message: Optional[str] = None # Set when timeperiod used and no feedbacks in window
210
+ feedbacks: List[LatestFeedbackItemResponse] = field(default_factory=list)
211
+
212
+
185
213
  @dataclass
186
214
  class DeleteMessageRequest:
187
215
  """Request for soft-deleting a message turn (bot message and its paired human)."""
@@ -335,6 +363,18 @@ class ConversationSummaryResponse:
335
363
  conversationTitle: Optional[str] = None # LLM-generated conversation title
336
364
 
337
365
 
366
+ @dataclass
367
+ class GetConversationsByEmailRequest:
368
+ """Request object for retrieving conversations by user email."""
369
+ email: str
370
+
371
+
372
+ @dataclass
373
+ class DeleteConversationRequest:
374
+ """Request object for deleting a conversation."""
375
+ conversationId: UUID
376
+
377
+
338
378
  @dataclass
339
379
  class ConversationMessageResponse:
340
380
  """Simplified message response for conversation messages.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shiftaiagenticinfra-sdk-python
3
- Version: 0.0.8
3
+ Version: 0.0.10
4
4
  Summary: Shiftai Agentic Infra Python SDK
5
5
  Author: ShiftAI
6
6
  Author-email: ShiftAI <s.tadakamalla@theshiftai.in>
@@ -388,6 +388,14 @@ Get all feedback submissions for a specific BOT message (most recent first).
388
388
 
389
389
  **Return Type:** `List[FeedbackDTO]`
390
390
 
391
+ #### `await analytics.get_latest_feedbacks(timeperiod=None)`
392
+ Get latest feedback submissions for the project, most recent first.
393
+
394
+ **Parameters:**
395
+ - `timeperiod` (int, **optional**): None or omitted = all feedbacks; N (e.g. 24) = only feedbacks from the last N hours
396
+
397
+ **Return Type:** `LatestFeedbacksResponse` (`.feedbacks` list of `LatestFeedbackItemResponse`; optional `.message` when time window is used and there are no feedbacks)
398
+
391
399
  #### `await analytics.get_dashboard()`
392
400
  Get project dashboard metrics (includes cache analytics: `cacheServed`, `estimatedTokensSaved`, `estimatedCostSaved` when available).
393
401
 
@@ -458,6 +466,22 @@ Get all conversations for a specific user.
458
466
 
459
467
  **Return Type:** `List[ConversationSummaryResponse]`
460
468
 
469
+ #### `await conversations.get_conversations_by_email(email)`
470
+ Get all conversations for a specific user by email.
471
+
472
+ **Parameters:**
473
+ - `email` (str, required): User's email address
474
+
475
+ **Return Type:** `List[ConversationSummaryResponse]`
476
+
477
+ #### `await conversations.delete_conversation(conversation_id)`
478
+ Delete a conversation.
479
+
480
+ **Parameters:**
481
+ - `conversation_id` (UUID, required): Conversation identifier
482
+
483
+ **Return Type:** `Dict[str, Any]`
484
+
461
485
  ## Error Handling
462
486
 
463
487
  The SDK surfaces HTTP errors as typed exceptions: