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,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(
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue