Skip to content

Commit

Permalink
Merge pull request #1338 from jay-hodgson/SWC-7120
Browse files Browse the repository at this point in the history
SWC-7120: agentId is now agentRegistrationId
  • Loading branch information
jay-hodgson authored Oct 31, 2024
2 parents eee2d7c + 3a2f373 commit aef2ec9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { TransitionGroup } from 'react-transition-group'

export type SynapseChatProps = {
initialMessage?: string //optional initial message
agentId?: string // if provided, use this agent
agentRegistrationId?: string // if provided, use this agent
chatbotName?: string // optional name of this chatbot agent
hideTitle?: boolean
textboxPositionOffset?: string // when embedded in a form, the textbox (form) stuck to the bottom may need to be offset due to container padding (dialog content for example!)
Expand All @@ -46,7 +46,7 @@ type TraceEventWithFriendlyMessage = {

export const SynapseChat: React.FunctionComponent<SynapseChatProps> = ({
initialMessage,
agentId,
agentRegistrationId,
chatbotName = 'SynapseChat',
hideTitle = false,
textboxPositionOffset = '0px',
Expand Down Expand Up @@ -177,7 +177,7 @@ export const SynapseChat: React.FunctionComponent<SynapseChatProps> = ({
if (createAgentSession && !agentSession) {
createAgentSession({
agentAccessLevel,
agentId,
agentRegistrationId,
})
}
}, [createAgentSession, agentSession, accessToken])
Expand Down
6 changes: 3 additions & 3 deletions packages/synapse-react-client/src/mocks/chat/mockChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ import {
export const mockChatSessionId = 'session-456'
export const mockCreateAgentSessionRequest: CreateAgentSessionRequest = {
agentAccessLevel: AgentAccessLevel.READ_YOUR_PRIVATE_DATA,
agentId: 'experimental-agent-123',
agentRegistrationId: 'experimental-agent-123',
}
export const mockAgentSession: AgentSession = {
sessionId: mockChatSessionId,
agentAccessLevel: AgentAccessLevel.PUBLICLY_ACCESSIBLE,
startedOn: '2024-09-01T12:00:00Z',
agentId: 'default-agent',
agentRegistrationId: 'default-agent',
}
export const mockAgentSession2: AgentSession = {
sessionId: 'session-789',
agentAccessLevel: AgentAccessLevel.WRITE_YOUR_PRIVATE_DATA,
startedOn: '2024-09-01T12:00:00Z',
agentId: 'default-agent',
agentRegistrationId: 'default-agent',
}
export const mockListAgentSessionsRequest: ListAgentSessionsRequest = {
nextPageToken: 'token-789',
Expand Down
7 changes: 3 additions & 4 deletions packages/synapse-types/src/Chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ export type CreateAgentSessionRequest = {
*/
agentAccessLevel: AgentAccessLevel
/**
* Optional. Most users will not use this parameter. If you are authorized to test experimental agents,
* provide the ID of the agent you wish to test.
* Optional. When provided, the registered agent will be used for this session. When excluded the default 'baseline' agent will be used.
*/
agentId?: string
agentRegistrationId?: string
}
export type UpdateAgentSessionRequest = {
/**
Expand Down Expand Up @@ -50,7 +49,7 @@ export type AgentSession = {
* Identifies the agent that will be used for this session. The default value is null, which indicates
* that the default agent will be used.
*/
agentId?: string
agentRegistrationId?: string
}

// Type for ListAgentSessionsRequest
Expand Down

0 comments on commit aef2ec9

Please sign in to comment.