[8.10] Move function naming to American English (#165561) (#165578)

# Backport

This will backport the following commits from `main` to `8.10`:
- [Move function naming to American English
(#165561)](https://github.com/elastic/kibana/pull/165561)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Coen
Warmer","email":"coen.warmer@gmail.com"},"sourceCommit":{"committedDate":"2023-09-04T11:39:38Z","message":"Move
function naming to American English
(#165561)","sha":"bc2146c472a8899dbf258ef49dc4c648d2766e0c","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","v8.10.0","v8.11.0"],"number":165561,"url":"https://github.com/elastic/kibana/pull/165561","mergeCommit":{"message":"Move
function naming to American English
(#165561)","sha":"bc2146c472a8899dbf258ef49dc4c648d2766e0c"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/165561","number":165561,"mergeCommit":{"message":"Move
function naming to American English
(#165561)","sha":"bc2146c472a8899dbf258ef49dc4c648d2766e0c"}}]}]
BACKPORT-->

Co-authored-by: Coen Warmer <coen.warmer@gmail.com>
This commit is contained in:
Kibana Machine 2023-09-04 08:54:10 -04:00 committed by GitHub
parent 62630c95fd
commit 706cf86d0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 21 deletions

View file

@ -66,8 +66,8 @@ The knowledge base is an Elasticsearch index, with an inference processor powere
Both the user and the LLM are able to suggest functions, that are executed on behalf (and with the privileges of) the user. Functions allow both the user and the LLM to include relevant context into the conversation. This context can be text, data, or a visual component, like a timeseries graph. Some of the functions that are available are:
- `recall` and `summarise`: these functions query (with a semantic search) or write to (with a summarisation) the knowledge database. This allows the LLM to create a (partly) user-specific working memory, and access predefined embeddings that help improve its understanding of the Elastic platform.
- `lens`: a function that can be used to create Lens visualisations using Formulas.
- `recall` and `summarize`: these functions query (with a semantic search) or write to (with a summarisation) the knowledge database. This allows the LLM to create a (partly) user-specific working memory, and access predefined embeddings that help improve its understanding of the Elastic platform.
- `lens`: a function that can be used to create Lens vizualisations using Formulas.
- `get_apm_timeseries`, `get_apm_service_summary`, `get_apm_downstream_dependencies` and `get_apm_error_document`: a set of APM functions, some with visual components, that are helpful in performing root cause analysis.
Function calling is completely transparent to the user - they can edit function suggestions from the LLM, or inspect a function response (but not edit it), or they can request a function themselves.
Function calling is completely transparent to the user - they can edit function suggestions from the LLM, or inspect a function response (but not edit it), or they can request a function themselves.

View file

@ -14,7 +14,7 @@ import { registerElasticsearchFunction } from './elasticsearch';
import { registerKibanaFunction } from './kibana';
import { registerLensFunction } from './lens';
import { registerRecallFunction } from './recall';
import { registerSummarisationFunction } from './summarise';
import { registerSummarizationFunction } from './summarize';
import { registerAlertsFunction } from './alerts';
export async function registerFunctions({
@ -53,7 +53,7 @@ export async function registerFunctions({
);
if (isReady) {
description += `You can use the "summarise" functions to store new information you have learned in a knowledge database. Once you have established that you did not know the answer to a question, and the user gave you this information, it's important that you create a summarisation of what you have learned and store it in the knowledge database.
description += `You can use the "summarize" functions to store new information you have learned in a knowledge database. Once you have established that you did not know the answer to a question, and the user gave you this information, it's important that you create a summarisation of what you have learned and store it in the knowledge database.
Additionally, you can use the "recall" function to retrieve relevant information from the knowledge database.
`;
@ -64,9 +64,9 @@ export async function registerFunctions({
- ALWAYS query the knowledge base, using the recall function, when a user starts a chat, no matter how confident you are in your ability to answer the question.
- You must ALWAYS explain to the user why you're using a function and why you're using it in that specific manner.
- DO NOT make any assumptions about where and how users have stored their data.
- ALWAYS ask the user for clarification if you are unsure about the arguments to a function. When given this clarification, you MUST use the summarise function to store what you have learned.
- ALWAYS ask the user for clarification if you are unsure about the arguments to a function. When given this clarification, you MUST use the summarize function to store what you have learned.
`;
registerSummarisationFunction({ service, registerFunction });
registerSummarizationFunction({ service, registerFunction });
registerRecallFunction({ service, registerFunction });
registerLensFunction({ service, pluginsStart, registerFunction });
} else {

View file

@ -148,9 +148,9 @@ export function registerLensFunction({
name: 'lens',
contexts: ['core'],
description:
"Use this function to create custom visualisations, using Lens, that can be saved to dashboards. When using this function, make sure to use the recall function to get more information about how to use it, with how you want to use it. Make sure the query also contains information about the user's request. The visualisation is displayed to the user above your reply, DO NOT try to generate or display an image yourself.",
"Use this function to create custom visualizations, using Lens, that can be saved to dashboards. When using this function, make sure to use the recall function to get more information about how to use it, with how you want to use it. Make sure the query also contains information about the user's request. The visualisation is displayed to the user above your reply, DO NOT try to generate or display an image yourself.",
descriptionForUser:
'Use this function to create custom visualisations, using Lens, that can be saved to dashboards.',
'Use this function to create custom visualizations, using Lens, that can be saved to dashboards.',
parameters: {
type: 'object',
additionalProperties: false,

View file

@ -20,7 +20,7 @@ export function registerRecallFunction({
{
name: 'recall',
contexts: ['core'],
description: `Use this function to recall earlier learnings. Anything you will summarise can be retrieved again later via this function. This is semantic/vector search so there's no need for an exact match.
description: `Use this function to recall earlier learnings. Anything you will summarize can be retrieved again later via this function. This is semantic/vector search so there's no need for an exact match.
Make sure the query covers the following aspects:
- The user's prompt, verbatim

View file

@ -8,7 +8,7 @@
import type { RegisterFunctionDefinition } from '../../common/types';
import type { ObservabilityAIAssistantService } from '../types';
export function registerSummarisationFunction({
export function registerSummarizationFunction({
service,
registerFunction,
}: {
@ -17,12 +17,12 @@ export function registerSummarisationFunction({
}) {
registerFunction(
{
name: 'summarise',
name: 'summarize',
contexts: ['core'],
description:
"Use this function to summarise things learned from the conversation. You can score the learnings with a confidence metric, whether it is a correction on a previous learning. An embedding will be created that you can recall later with a semantic search. There is no need to ask the user for permission to store something you have learned, unless you do not feel confident. When you create this summarisation, make sure you craft it in a way that can be recalled with a semantic search later, and that it would have answered the user's original request.",
"Use this function to summarize things learned from the conversation. You can score the learnings with a confidence metric, whether it is a correction on a previous learning. An embedding will be created that you can recall later with a semantic search. There is no need to ask the user for permission to store something you have learned, unless you do not feel confident. When you create this summarisation, make sure you craft it in a way that can be recalled with a semantic search later, and that it would have answered the user's original request.",
descriptionForUser:
'This function allows the Elastic Assistant to summarise things from the conversation.',
'This function allows the Elastic Assistant to summarize things from the conversation.',
parameters: {
type: 'object',
additionalProperties: false,
@ -66,7 +66,7 @@ export function registerSummarisationFunction({
signal
) => {
return service
.callApi('POST /internal/observability_ai_assistant/functions/summarise', {
.callApi('POST /internal/observability_ai_assistant/functions/summarize', {
params: {
body: {
id,

View file

@ -178,7 +178,7 @@ const functionRecallRoute = createObservabilityAIAssistantServerRoute({
});
const functionSummariseRoute = createObservabilityAIAssistantServerRoute({
endpoint: 'POST /internal/observability_ai_assistant/functions/summarise',
endpoint: 'POST /internal/observability_ai_assistant/functions/summarize',
params: t.type({
body: t.type({
id: t.string,
@ -208,7 +208,7 @@ const functionSummariseRoute = createObservabilityAIAssistantServerRoute({
labels,
} = resources.params.body;
return client.summarise({
return client.summarize({
entry: {
confidence,
id,

View file

@ -325,12 +325,12 @@ export class ObservabilityAIAssistantClient {
});
};
summarise = async ({
summarize = async ({
entry,
}: {
entry: Omit<KnowledgeBaseEntry, '@timestamp'>;
}): Promise<void> => {
return this.dependencies.knowledgeBaseService.summarise({
return this.dependencies.knowledgeBaseService.summarize({
namespace: this.dependencies.namespace,
user: this.dependencies.user,
entry,

View file

@ -112,7 +112,7 @@ export class KnowledgeBaseService {
return;
}
await this.summarise({
await this.summarize({
entry: operation.document,
});
}
@ -223,7 +223,7 @@ export class KnowledgeBaseService {
}
};
summarise = async ({
summarize = async ({
entry: { id, ...document },
user,
namespace,