Skip to content

Commit

Permalink
[8.14] [Obs AI Assistant] Fix import issues from /public folders (#18…
Browse files Browse the repository at this point in the history
…2940) (#183268)

# Backport

This will backport the following commits from `main` to `8.14`:
- [[Obs AI Assistant] Fix import issues from /public folders
(#182940)](#182940)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dario
Gieselaar","email":"dario.gieselaar@elastic.co"},"sourceCommit":{"committedDate":"2024-05-13T11:44:43Z","message":"[Obs
AI Assistant] Fix import issues from /public folders (#182940)\n\nMake
sure the evaluation script doesn't import from `public` folders\r\nthat
include code that cannot run in Node.js.\r\n\r\nCo-authored-by: Kibana
Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"551e1232b870654d036aff4d52f43443ee3ecf20","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:Obs
AI
Assistant","ci:project-deploy-observability","v8.14.0","v8.15.0"],"title":"[Obs
AI Assistant] Fix import issues from /public
folders","number":182940,"url":"#182940
AI Assistant] Fix import issues from /public folders (#182940)\n\nMake
sure the evaluation script doesn't import from `public` folders\r\nthat
include code that cannot run in Node.js.\r\n\r\nCo-authored-by: Kibana
Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"551e1232b870654d036aff4d52f43443ee3ecf20"}},"sourceBranch":"main","suggestedTargetBranches":["8.14"],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"#182940
AI Assistant] Fix import issues from /public folders (#182940)\n\nMake
sure the evaluation script doesn't import from `public` folders\r\nthat
include code that cannot run in Node.js.\r\n\r\nCo-authored-by: Kibana
Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"551e1232b870654d036aff4d52f43443ee3ecf20"}}]}]
BACKPORT-->

Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
  • Loading branch information
kibanamachine and dgieselaar committed May 13, 2024
1 parent 1f07ae1 commit c4107bd
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import * as table from 'table';
import { TableUserConfig } from 'table';
import { format, parse } from 'url';
import { ToolingLog } from '@kbn/tooling-log';
import { MessageRole } from '@kbn/observability-ai-assistant-plugin/public';
import { MessageRole } from '@kbn/observability-ai-assistant-plugin/common';
import { EvaluateWith, options } from './cli';
import { getServiceUrls } from './get_service_urls';
import { KibanaClient } from './kibana_client';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ import {
import type { ObservabilityAIAssistantScreenContext } from '@kbn/observability-ai-assistant-plugin/common/types';
import { throwSerializedChatCompletionErrors } from '@kbn/observability-ai-assistant-plugin/common/utils/throw_serialized_chat_completion_errors';
import {
APIReturnType,
isSupportedConnectorType,
Message,
MessageRole,
ObservabilityAIAssistantAPIClientRequestParamsOf,
} from '@kbn/observability-ai-assistant-plugin/public';
} from '@kbn/observability-ai-assistant-plugin/common';
import { streamIntoObservable } from '@kbn/observability-ai-assistant-plugin/server';
import { ToolingLog } from '@kbn/tooling-log';
import axios, { AxiosInstance, AxiosResponse, isAxiosError } from 'axios';
Expand All @@ -47,6 +45,10 @@ import {
} from 'rxjs';
import { format, parse, UrlObject } from 'url';
import { inspect } from 'util';
import type {
ObservabilityAIAssistantAPIClientRequestParamsOf,
APIReturnType,
} from '@kbn/observability-ai-assistant-plugin/public';
import { EvaluationResult } from './types';

// eslint-disable-next-line spaced-comment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import expect from '@kbn/expect';
import { RuleResponse } from '@kbn/alerting-plugin/common/routes/rule/response/types/v1';
import moment from 'moment';
import { apm, timerange } from '@kbn/apm-synthtrace-client';
import { MessageRole } from '@kbn/observability-ai-assistant-plugin/public';
import { MessageRole } from '@kbn/observability-ai-assistant-plugin/common';
import { chatClient, kibanaClient, synthtraceEsClients, logger } from '../../services';
import {
apmTransactionRateAIAssistant,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import expect from '@kbn/expect';
import moment from 'moment';
import { apm, timerange, serviceMap } from '@kbn/apm-synthtrace-client';
import { RuleResponse } from '@kbn/alerting-plugin/common/routes/rule/response/types/v1';
import { MessageRole } from '@kbn/observability-ai-assistant-plugin/public';
import { MessageRole } from '@kbn/observability-ai-assistant-plugin/common';
import { chatClient, kibanaClient, synthtraceEsClients } from '../../services';
import { apmErrorCountAIAssistant } from '../../alert_templates/templates';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// <reference types="@kbn/ambient-ftr-types"/>

import expect from '@kbn/expect';
import { MessageRole } from '@kbn/observability-ai-assistant-plugin/public';
import { MessageRole } from '@kbn/observability-ai-assistant-plugin/common';
import { chatClient, esClient } from '../../services';

describe('elasticsearch functions', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// <reference types="@kbn/ambient-ftr-types"/>

import expect from '@kbn/expect';
import { MessageRole } from '@kbn/observability-ai-assistant-plugin/public';
import { MessageRole } from '@kbn/observability-ai-assistant-plugin/common';
import { chatClient, esClient } from '../../services';

describe('kb functions', () => {
Expand Down

0 comments on commit c4107bd

Please sign in to comment.