diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/documentation.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/documentation.ts index 2360784a22674..cf407a9c9832c 100644 --- a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/documentation.ts +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/documentation.ts @@ -18,13 +18,15 @@ export async function registerDocumentationFunction({ }: FunctionRegistrationParameters) { const isProductDocAvailable = (await llmTasks.retrieveDocumentationAvailable()) ?? false; - functions.registerInstruction(({ availableFunctionNames }) => { - return availableFunctionNames.includes(RETRIEVE_DOCUMENTATION_NAME) - ? `When asked questions about the Elastic stack or products, You should use the ${RETRIEVE_DOCUMENTATION_NAME} function before answering, + if (isProductDocAvailable) { + functions.registerInstruction(({ availableFunctionNames }) => { + return availableFunctionNames.includes(RETRIEVE_DOCUMENTATION_NAME) + ? `When asked questions about the Elastic stack or products, You should use the ${RETRIEVE_DOCUMENTATION_NAME} function before answering, to retrieve documentation related to the question. Consider that the documentation returned by the function is always more up to date and accurate than any own internal knowledge you might have.` - : undefined; - }); + : undefined; + }); + } functions.registerFunction( {