Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions plugins/hitl/plugin.definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ const PLUGIN_CONFIG_SCHEMA = sdk.z.object({
.nonnegative()
.optional()
.placeholder('0'),
useHumanAgentInfo: sdk.z
.boolean()
.default(true)
.title('Use Human Agent Info')
.describe(
'(Works only with webchat) Enable this to use the human agent name and photo (if available) as the bot name and photo while in HITL mode.'
),
flowOnHitlStopped: sdk.z
.boolean()
.default(true)
Expand Down
8 changes: 7 additions & 1 deletion plugins/hitl/src/webchat.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as configuration from './configuration'
import * as bp from '.botpress'

type WebchatGetOrCreateUserInput = {
Expand Down Expand Up @@ -40,11 +41,16 @@ export const tryLinkWebchatUser = async (
id: upstreamConversationId,
})

const sessionConfig = await configuration.retrieveSessionConfig({
...props,
upstreamConversationId,
})

const {
conversation: { integration: upstreamIntegration },
} = upstreamConversation

if (upstreamIntegration !== 'webchat') {
if (upstreamIntegration !== 'webchat' || !sessionConfig.useHumanAgentInfo) {
// this only works when the hitl frontend is webchat
return undefined
}
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ _This step can be executed in any directory and git repository of your choice. Y

You can then modify both the definition and implementation of your integration respectively located in the `integration.definition.ts` and `src/index.ts` files.

For more information on how to develop an integration, please refer to the [Documentation](https://botpress.com/docs/getting-started-1).
For more information on how to develop an integration, please refer to the [Documentation](https://botpress.com/docs/for-developers/sdk/integration/getting-started).

### Integration Deployment

Expand Down
Loading