-
Notifications
You must be signed in to change notification settings - Fork 0
Add Session TS examples #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
// --- Check Updated State --- | ||
const updatedSession = await sessionService.getSession({ appName: appName, userId: userId, sessionId: sessionId }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const updatedSession = await sessionService.getSession({ appName, userId, sessionId });
appName: appName, | ||
sessionService: sessionService | ||
}); | ||
const session = await sessionService.createSession({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const session = await sessionService.createSession({ appName, userId, sessionId });
for await (const event of runner.run({ | ||
userId: userId, | ||
sessionId: sessionId, | ||
newMessage: userMessage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for await (const event of runner.run({ userId, sessionId, newMessage: userMessage }))
const session = await sessionService.createSession({ | ||
appName: appName, | ||
userId: userId, | ||
sessionId: sessionId, | ||
state: { "user:login_count": 0, "task_status": "idle" } | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, we can skip the writing in the key: value
style when key is the same as variable name
const updatedSession = await sessionService.getSession({ | ||
appName: appName, | ||
userId: userId, | ||
sessionId: sessionId | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
}; | ||
|
||
// --- Create Event with Actions --- | ||
const actionsWithUpdate: EventActions = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have createEventActions
that do it for you but it is not exposed to the public API, do you think we need to expose it?
cc: @cornellgit
Issue #440672247 , #440671736 (session and state) and #440672181 (memory) TS examples