SearchEventsInput
¶
Source code in docs_src/capo_opensearchmemory/types/search_events_input.py
actor_id
instance-attribute
¶
actor_id: ActorId
The actor whose events to search (exact match). Required: every search covers exactly one actor, and an event stored without an actor is never returned. Narrow the search further with sessionIds, combined by AND. This is the only way to filter by actor: a query that references system_metadata.actor_id fails with ValidationException (reason nonFilterableField).
max_results
instance-attribute
¶
max_results: NotRequired[MaxResults]
The maximum number of events to return, from 1 to 100. The default is 20.
next_token
instance-attribute
¶
next_token: NotRequired[PaginationToken]
The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
query
instance-attribute
¶
query: SearchQuery
The query: a subset of the OpenSearch Query DSL (see SearchQuery), validated by the same rules as on SearchMemories. Query event text as text and embeddings as vector. A search covers both conversation turns and chunks of documents submitted as a blob. You can't use actor and session fields here. Use the top-level actorId and sessionIds.
To search only the content of particular events, filter on event_ids with term or terms, for example with the sourceEventIds that a SearchMemories result returns. A terms clause on event_ids can list up to 10 event IDs. More IDs fail with ValidationException (reason queryBodyTooLarge). You can use event_ids only in term, terms, and exists queries.
session_ids
instance-attribute
¶
session_ids: NotRequired[SessionIdList]
Returns only events from one of these sessions (exact match). Combined with actorId by AND. Omit for no session filter. An empty list fails validation. An event stored without a session never matches a session filter. This is the only way to filter by session: a query that references system_metadata.session_id fails with ValidationException (reason nonFilterableField).
sort
instance-attribute
¶
sort: NotRequired[SearchSort]
The sort order (see SearchSort). Omit to return the most relevant events first.