mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
fix: Product Documentation function not available error (#212676)
## Summary Closes [#212655](https://github.com/elastic/kibana/issues/212655) FIX: When a user asks a question about the Elastic stack, we expect the LLM to request the `retrieve_elastic_doc` function. However, due to the limit of number of functions we can register, it errors out because the function is not available. 
This commit is contained in:
parent
85555042be
commit
cb4e2023b4
1 changed files with 7 additions and 5 deletions
|
@ -18,6 +18,7 @@ export async function registerDocumentationFunction({
|
||||||
}: FunctionRegistrationParameters) {
|
}: FunctionRegistrationParameters) {
|
||||||
const isProductDocAvailable = (await llmTasks.retrieveDocumentationAvailable()) ?? false;
|
const isProductDocAvailable = (await llmTasks.retrieveDocumentationAvailable()) ?? false;
|
||||||
|
|
||||||
|
if (isProductDocAvailable) {
|
||||||
functions.registerInstruction(({ availableFunctionNames }) => {
|
functions.registerInstruction(({ availableFunctionNames }) => {
|
||||||
return availableFunctionNames.includes(RETRIEVE_DOCUMENTATION_NAME)
|
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,
|
? `When asked questions about the Elastic stack or products, You should use the ${RETRIEVE_DOCUMENTATION_NAME} function before answering,
|
||||||
|
@ -25,6 +26,7 @@ export async function registerDocumentationFunction({
|
||||||
is always more up to date and accurate than any own internal knowledge you might have.`
|
is always more up to date and accurate than any own internal knowledge you might have.`
|
||||||
: undefined;
|
: undefined;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
functions.registerFunction(
|
functions.registerFunction(
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue