-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add support for externalUserId for chats. #25
Conversation
WalkthroughThe updates enhance chat functionality by integrating an Changes
Poem
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- chat.test.ts (3 hunks)
- chat.ts (9 hunks)
- client.ts (1 hunks)
- cortex.ts (3 hunks)
Files skipped from review due to trivial changes (1)
- client.ts
Additional comments not posted (12)
chat.test.ts (4)
70-70
: LGTM! VerifyexternalUserId
handling incortex.chat
.The addition of
externalUserId
to thecortex.chat
method call looks good.Ensure that the
externalUserId
field is properly handled in thecortex.chat
method.
77-77
: LGTM!The check for
externalUserId
in thegetChatRes
object ensures that the field is correctly returned from thegetChat
method.
165-165
: LGTM! VerifyexternalUserId
handling incortex.chat
.The addition of
externalUserId
to thestatusStream
object in thestreaming chat
test looks good.Ensure that the
externalUserId
field is properly handled in thecortex.chat
method.
193-193
: LGTM!The check for
externalUserId
in thechatResult
object ensures that the field is correctly returned from thechat
method.cortex.ts (2)
93-93
: LGTM!The addition of
externalUserId
to theCortexCreateChatOptsBase
interface aligns with the objective of associating external user identifiers with chat operations.
196-196
: LGTM! VerifyexternalUserId
handling inChat.create
.The addition of
externalUserId
to thechat
method in both the streaming and non-streaming cases looks good.Ensure that the
externalUserId
field is properly handled in theChat.create
method.Also applies to: 205-205
chat.ts (6)
12-12
: LGTM!The addition of
externalUserId
to theCreateChatOptsBase
interface aligns with the objective of associating external user identifiers with chat operations.
50-50
: LGTM!The addition of
externalUserId
to theChatListItem
interface aligns with the objective of associating external user identifiers with chat operations.
61-61
: LGTM!The addition of
externalUserId
to theChatListOpts
interface aligns with the objective of associating external user identifiers with chat operations.
78-78
: LGTM!The addition of
externalUserId
to theChat
class constructor aligns with the objective of associating external user identifiers with chat operations.
118-118
: LGTM! VerifyexternalUserId
handling increateContentSync
andcreateContentStreaming
.The addition of
externalUserId
to thecreateContentSync
andcreateContentStreaming
methods looks good.Ensure that the
externalUserId
field is properly handled in thecreateContentSync
andcreateContentStreaming
methods.Also applies to: 125-125
209-211
: LGTM! VerifyexternalUserId
handling in thelist
method andChatListItem
object.The addition of
externalUserId
to the query parameters in thelist
method and to theChatListItem
object looks good.Ensure that the
externalUserId
field is properly handled in thelist
method and theChatListItem
object.Also applies to: 226-226
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- chat.test.ts (3 hunks)
- chat.ts (9 hunks)
- client.ts (1 hunks)
- cortex.ts (3 hunks)
Files skipped from review as they are similar to previous changes (4)
- chat.test.ts
- chat.ts
- client.ts
- cortex.ts
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- chat.test.ts (3 hunks)
- chat.ts (10 hunks)
- client.ts (1 hunks)
- cortex.ts (3 hunks)
Files skipped from review as they are similar to previous changes (3)
- chat.test.ts
- client.ts
- cortex.ts
Additional comments not posted (6)
chat.ts (6)
12-12
: Addition ofexternalUserId
toCreateChatOptsBase
looks good.The
externalUserId
field is correctly added as an optional string.
50-50
: Addition ofexternalUserId
toChatListItem
looks good.The
externalUserId
field is correctly added as an optional string.
61-61
: Addition ofexternalUserId
toChatListOpts
looks good.The
externalUserId
field is correctly added as an optional string or null.
78-78
: Addition ofexternalUserId
toChat
constructor looks good.The
externalUserId
field is correctly added as an optional string.
98-103
: Inclusion ofexternalUserId
increateContentSync
looks good.The
externalUserId
field is correctly destructured from theopts
object and included in the POST request payload.
Line range hint
129-172
:
Inclusion ofexternalUserId
increateContentStreaming
looks good.The
externalUserId
field is correctly destructured from theopts
object, included in the POST request payload, and used in theChat
constructor.
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.
Do we need any updates to respond
?
I thought not, since we don't currently support changing users in the middle of a chat. At some point we should consider implementing forking for chats, but we don't have that right now. |
That sounds right. Thanks for refreshing my memory. |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- chat.ts (10 hunks)
- client.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- client.ts
Additional comments not posted (9)
chat.ts (9)
12-12
: Addition ofexternalUserId
inCreateChatOptsBase
is correct.The addition aligns with the PR's objective and is appropriately marked as optional.
50-50
: Addition ofexternalUserId
inChatListItem
is correct.The addition aligns with the PR's objective and is appropriately marked as optional.
61-61
: Verify the necessity of| null
inexternalUserId
type definition.The addition aligns with the PR's objective and is appropriately marked as optional. However, consider if
| null
is necessary, asundefined
might suffice.
78-78
: Addition ofexternalUserId
inChat
class constructor is correct.The addition aligns with the PR's objective and is appropriately marked as optional.
98-103
: Addition ofexternalUserId
increateContentSync
method is correct.The addition aligns with the PR's objective and is appropriately included in the request body.
129-134
: Addition ofexternalUserId
increateContentStreaming
method is correct.The addition aligns with the PR's objective and is appropriately included in the request body.
164-172
: Addition ofexternalUserId
inChat
instantiation withincreateContentStreaming
is correct.The addition aligns with the PR's objective and is appropriately included in the
Chat
object instantiation.
191-191
: Addition ofexternalUserId
inChat
instantiation withinget
method is correct.The addition aligns with the PR's objective and is appropriately included in the
Chat
object instantiation.
213-215
: Addition ofexternalUserId
inlist
method is correct.The addition aligns with the PR's objective and is appropriately included in the query parameters and the
ChatListItem
instantiation.Also applies to: 230-230
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- indexers/shopify-indexer.ts (1 hunks)
Additional comments not posted (1)
indexers/shopify-indexer.ts (1)
84-84
: Approve the conversion ofid
to string.The conversion of the
id
property to a string ensures consistent data types within thedocuments
array. This change is straightforward and should not have any adverse side effects. However, verify if this conversion is necessary for all use cases and ensure that all parts of the codebase that interact with this data are compatible with this change.
Summary by CodeRabbit
externalUserId
in various chat functionalities including chat creation, listing, and responses.id
property format by convertingitem.id
to a string in Shopify indexer.