raindrop-ai 0.0.21__tar.gz → 0.0.23__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.1
2
2
  Name: raindrop-ai
3
- Version: 0.0.21
3
+ Version: 0.0.23
4
4
  Summary: Raindrop AI (Python SDK)
5
5
  License: MIT
6
6
  Author: Raindrop AI
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "raindrop-ai"
3
- version = "0.0.21"
3
+ version = "0.0.23"
4
4
  description = "Raindrop AI (Python SDK)"
5
5
  authors = ["Raindrop AI <sdk@raindrop.ai>"]
6
6
  license = "MIT"
@@ -22,7 +22,7 @@ logger = logging.getLogger(__name__)
22
22
 
23
23
  write_key = None
24
24
  api_url = "https://api.raindrop.ai/v1/"
25
- max_queue_size = 10000
25
+ max_queue_size = 10_000
26
26
  upload_size = 10
27
27
  upload_interval = 1.0
28
28
  buffer = []
@@ -176,7 +176,7 @@ def track_ai(
176
176
  payload.properties = {}
177
177
  payload.properties["$context"] = _get_context()
178
178
 
179
- data = payload.model_dump()
179
+ data = payload.model_dump(mode="json")
180
180
 
181
181
  size = _get_size(data)
182
182
  if size > max_ingest_size_bytes:
@@ -240,7 +240,8 @@ def track_signal(
240
240
  properties: Optional[Dict[str, Any]] = None,
241
241
  attachment_id: Optional[str] = None,
242
242
  comment: Optional[str] = None,
243
- after: Optional[str] = None
243
+ after: Optional[str] = None,
244
+ sentiment: Optional[Literal["POSITIVE", "NEGATIVE"]] = None,
244
245
  ) -> None:
245
246
  """
246
247
  Track a signal event.
@@ -254,6 +255,7 @@ def track_signal(
254
255
  attachment_id: Optional ID of an attachment
255
256
  comment: Optional comment string (required and used only if signal_type is 'feedback').
256
257
  after: Optional after content string (required and used only if signal_type is 'edit').
258
+ sentiment: Optional sentiment indicating if the signal is POSITIVE (default is NEGATIVE)
257
259
  """
258
260
  if not _check_write_key():
259
261
  return
@@ -276,6 +278,7 @@ def track_signal(
276
278
  "timestamp": timestamp or _get_timestamp(),
277
279
  "properties": final_properties,
278
280
  "attachment_id": attachment_id,
281
+ "sentiment": sentiment
279
282
  }
280
283
 
281
284
  try:
@@ -315,6 +318,7 @@ def begin(
315
318
  properties: Optional[Dict[str, Any]] = None,
316
319
  input: Optional[str] = None,
317
320
  attachments: Optional[List[Attachment]] = None,
321
+ convo_id: Optional[str] = None,
318
322
  ) -> Interaction:
319
323
  """
320
324
  Starts (or resumes) an interaction and returns a helper object.
@@ -324,7 +328,7 @@ def begin(
324
328
  # Prepare ai_data if input is provided
325
329
  ai_data_partial = None
326
330
  if input:
327
- ai_data_partial = PartialAIData(input=input)
331
+ ai_data_partial = PartialAIData(input=input, convo_id=convo_id)
328
332
 
329
333
  # Combine properties with initial_fields, giving precedence to initial_fields if keys clash
330
334
  final_properties = (properties or {}).copy()
@@ -335,7 +339,7 @@ def begin(
335
339
  event=event,
336
340
  ai_data=ai_data_partial,
337
341
  properties=final_properties or None, # Pass None if empty, matching PartialTrackAIEvent defaults
338
- attachments=attachments
342
+ attachments=attachments,
339
343
  )
340
344
 
341
345
  _track_ai_partial(partial_event)
@@ -65,6 +65,7 @@ class BaseSignal(_Base):
65
65
  )
66
66
  properties: Dict[str, Any] = Field(default_factory=dict)
67
67
  attachment_id: Optional[str] = None
68
+ sentiment: Optional[Literal["POSITIVE", "NEGATIVE"]] = None
68
69
 
69
70
  @field_validator("event_id", "signal_name")
70
71
  def _non_empty_strings(cls, v, info):
File without changes