forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Obs AI Assistant] Write ES|QL docs with LLM (elastic#183173)
Uses the LLM to re-write docs from the `built-docs` repo, that have a lot of weird technical artifacts, to improve the output from the LLM. (cherry picked from commit 4fc13a4) # Conflicts: # x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/kibana_client.ts # x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/index.ts
- Loading branch information
1 parent
7a22f1f
commit 0acb55e
Showing
138 changed files
with
3,545 additions
and
2,897 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...ervability_solution/observability_ai_assistant_app/scripts/evaluation/select_connector.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import inquirer from 'inquirer'; | ||
import { ToolingLog } from '@kbn/tooling-log'; | ||
import { KibanaClient } from './kibana_client'; | ||
|
||
export async function selectConnector({ | ||
connectors, | ||
preferredId, | ||
log, | ||
message = 'Select a connector', | ||
}: { | ||
connectors: Awaited<ReturnType<KibanaClient['getConnectors']>>; | ||
preferredId?: string; | ||
log: ToolingLog; | ||
message?: string; | ||
}) { | ||
let connector = connectors.find((item) => item.id === preferredId); | ||
|
||
if (!connector && preferredId) { | ||
log.warning(`Could not find connector ${preferredId}`); | ||
} | ||
|
||
if (!connector && connectors.length === 1) { | ||
connector = connectors[0]; | ||
log.debug('Using the only connector found'); | ||
} else if (!connector) { | ||
const connectorChoice = await inquirer.prompt({ | ||
type: 'list', | ||
name: 'connector', | ||
message, | ||
choices: connectors.map((item) => ({ name: `${item.name} (${item.id})`, value: item.id })), | ||
}); | ||
|
||
connector = connectors.find((item) => item.id === connectorChoice.connector)!; | ||
} | ||
|
||
return connector; | ||
} |
19 changes: 0 additions & 19 deletions
19
...ty_solution/observability_ai_assistant_app/scripts/load_esql_docs/format_esql_examples.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.