Skip to content

Commit

Permalink
delete file
Browse files Browse the repository at this point in the history
  • Loading branch information
Qxisylolo committed Feb 19, 2025
1 parent 48d3b47 commit c9f4960
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
17 changes: 0 additions & 17 deletions common/utils/llm_chat/get_is_data2summary_available.ts

This file was deleted.

10 changes: 5 additions & 5 deletions public/components/ui_action_context_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ import { AI_ASSISTANT_QUERY_EDITOR_TRIGGER } from '../ui_triggers';
import { getUiActions } from '../services';
import { DataPublicPluginSetup } from '../../../../src/plugins/data/public';
import { DATA2SUMMARY_AGENT_CONFIG_ID } from '../../common/constants/llm';
import { checkAgentsExist } from '../../common/utils/llm_chat/get_is_data2summary_available';
import { AssistantServiceStart } from '../services/assistant_service';
interface Props {
data: DataPublicPluginSetup;
isQuerySummaryCollapsed$: BehaviorSubject<boolean>;
resultSummaryEnabled$: BehaviorSubject<boolean>;
isSummaryAgentAvailable$: BehaviorSubject<boolean>;
httpSetup: HttpSetup;
label?: string;
assistantServiceStart: AssistantServiceStart;
}

export const ActionContextMenu = (props: Props) => {
Expand All @@ -47,14 +48,13 @@ export const ActionContextMenu = (props: Props) => {
const shouldShowSummarizationAction = resultSummaryEnabled && isSummaryAgentAvailable;

useEffect(() => {
props.isSummaryAgentAvailable$.next(false);
if (!resultSummaryEnabled) return;
props.isSummaryAgentAvailable$.next(false);
const fetchSummaryAgent = async () => {
try {
const summaryAgentStatus = await checkAgentsExist(
props.httpSetup,
const summaryAgentStatus = await props.assistantServiceStart.client.agentConfigExists(
DATA2SUMMARY_AGENT_CONFIG_ID,
props.data.query.queryString.getQuery().dataset?.dataSource?.id
{ dataSourceId: props.data.query.queryString.getQuery().dataset?.dataSource?.id }
);
props.isSummaryAgentAvailable$.next(!!summaryAgentStatus.exists);
} catch (error) {
Expand Down
1 change: 1 addition & 0 deletions public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ export class AssistantPlugin
resultSummaryEnabled$={resultSummaryEnabled$}
isSummaryAgentAvailable$={isSummaryAgentAvailable$}
data={setupDeps.data}
assistantServiceStart={this.assistantService.start(core.http)}
/>
);
},
Expand Down

0 comments on commit c9f4960

Please sign in to comment.