Repository navigation
Tracked users: client.events.track and .list, user_id= on complete and sections - #52
Open
bruel-gabrielsson wants to merge 1 commit into
Open
bruel-gabrielsson wants to merge 1 commit into
bruel-gabrielsson wants to merge 1 commit into
Conversation
…d sections Co-authored-by: Cursor <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets a site record its users' events with the SDK and get results from those stored histories, instead of sending the history on every call.
client.events.track(user_id, event, catalog_id=, timestamp=)posts to/v1/eventsand returns the event id. AnOrderis sent as the API stores it, with acart_id(generated if not given) andunit_selling_price0. A naive timestamp is refused.client.events.list(user_id=, limit=, types=)readsGET /v1/events/own, which returns only the calling account's events (Unbox-AI/unbox-api#590).complete(user_id=...)andsections(user_id=...)senduser_idwith no history. The only event allowed alongside it is the currentSearch, which is recorded as the user's event by default (register_event=Falseturns that off). Withoutuser_id, nothing is recorded unlessregister_event=True, as before.historynow defaults to empty, soclient.complete(user_id="u1")works.The server side is on
deploy/behaviorgptin unbox-api and is off by default (EVENTS_SCOPED_TO_ACCOUNT,EVENTS_PUBLISHABLE_KEYS,features.events). These calls return errors until it is turned on for the BehaviorGPT deployment, so hold the release until then.Tests: 19 new in
tests/test_events.py; all 192 pass; ruff clean.