@@ -319,32 +319,32 @@ def search_event_by_tags(
319319 ) -> list [UserEventData ]:
320320 """
321321 Search user events by tags.
322-
322+
323323 Args:
324324 tags: List of tag names that events must have (AND condition)
325325 tag_values: Dict of tag=value pairs for exact matches (AND condition)
326326 topk: Number of events to retrieve, default is 10
327-
327+
328328 Examples:
329329 - search_event_by_tags(tags=["emotion", "romance"])
330330 Returns events that have both 'emotion' AND 'romance' tags (with any value)
331-
331+
332332 - search_event_by_tags(tag_values={"emotion": "happy", "topic": "work"})
333333 Returns events where emotion tag equals 'happy' AND topic tag equals 'work'
334-
334+
335335 - search_event_by_tags(tags=["emotion"], tag_values={"topic": "work"})
336336 Returns events that have 'emotion' tag (any value) AND topic tag equals 'work'
337337 """
338338 params = f"?topk={ topk } "
339-
339+
340340 if tags :
341341 tags_str = "," .join (tags )
342342 params += f"&tags={ tags_str } "
343-
343+
344344 if tag_values :
345345 tag_values_str = "," .join ([f"{ k } ={ v } " for k , v in tag_values .items ()])
346346 params += f"&tag_values={ tag_values_str } "
347-
347+
348348 r = unpack_response (
349349 self .project_client .client .get (
350350 f"/users/event_tags/search/{ self .user_id } { params } "
@@ -364,6 +364,7 @@ def context(
364364 chats : list [OpenAICompatibleMessage ] = None ,
365365 event_similarity_threshold : float = None ,
366366 customize_context_prompt : str = None ,
367+ time_range_in_days : int = None ,
367368 full_profile_and_only_search_event : bool = None ,
368369 fill_window_with_events : bool = None ,
369370 ) -> str :
@@ -380,6 +381,8 @@ def context(
380381 params += f"&topic_limits_json={ json .dumps (topic_limits )} "
381382 if profile_event_ratio :
382383 params += f"&profile_event_ratio={ profile_event_ratio } "
384+ if time_range_in_days :
385+ params += f"&time_range_in_days={ time_range_in_days } "
383386 if require_event_summary is not None :
384387 params += (
385388 f"&require_event_summary={ 'true' if require_event_summary else 'false' } "
0 commit comments