Skip to content

Commit 382124f

Browse files
Merge branch 'main' of github.com:abhishekbhatia1710/kibana into lead-gen-telemetry
2 parents cab8f10 + 4169123 commit 382124f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/threat_hunting/top_threat_hunting_leads

x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/threat_hunting/top_threat_hunting_leads/use_lead_attachment.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*/
77

88
import { useCallback } from 'react';
9+
import { useUiSetting } from '@kbn/kibana-react-plugin/public';
10+
import { AGENT_BUILDER_EXPERIMENTAL_FEATURES_SETTING_ID } from '@kbn/management-settings-ids';
911
import { THREAT_HUNTING_AGENT_ID } from '../../../../../common/constants';
1012
import { useKibana } from '../../../../common/lib/kibana';
1113
import { LEAD_ATTACHMENT_PROMPT } from '../../../../agent_builder/components/prompts';
@@ -48,6 +50,11 @@ const buildLeadPrompt = (lead: HuntingLead): string => {
4850

4951
export const useLeadAttachment = () => {
5052
const { agentBuilder } = useKibana().services;
53+
const skillsEnabled = useUiSetting<boolean>(
54+
AGENT_BUILDER_EXPERIMENTAL_FEATURES_SETTING_ID,
55+
false
56+
);
57+
const agentId = skillsEnabled ? undefined : THREAT_HUNTING_AGENT_ID;
5158

5259
const openWithLead = useCallback(
5360
(lead: HuntingLead) => {
@@ -60,10 +67,10 @@ export const useLeadAttachment = () => {
6067
newConversation: true,
6168
initialMessage: buildLeadPrompt(lead),
6269
sessionTag: 'security',
63-
agentId: THREAT_HUNTING_AGENT_ID,
70+
agentId,
6471
});
6572
},
66-
[agentBuilder]
73+
[agentBuilder, agentId]
6774
);
6875

6976
return openWithLead;

0 commit comments

Comments
 (0)