Skip to content

Commit

Permalink
[Obs AI Assistant] Increase no of max function calls to 5 (#175588)
Browse files Browse the repository at this point in the history
The function limit of 3 is too low, it runs into issues w/ ES|QL query
generation if the `get_dataset_info` and `execute_query` functions are
used.
  • Loading branch information
dgieselaar authored Jan 26, 2024
1 parent e2a9470 commit beff74e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1267,11 +1267,15 @@ describe('Observability AI Assistant client', () => {

await requestAlertsFunctionCall();

await requestAlertsFunctionCall();

await requestAlertsFunctionCall();

await finished(stream);
});

it('executed the function no more than three times', () => {
expect(functionClientMock.executeFunction).toHaveBeenCalledTimes(3);
expect(functionClientMock.executeFunction).toHaveBeenCalledTimes(5);
});

it('does not give the LLM the choice to call a function anymore', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class ObservabilityAIAssistantClient {

let numFunctionsCalled: number = 0;

const MAX_FUNCTION_CALLS = 3;
const MAX_FUNCTION_CALLS = 5;
const MAX_FUNCTION_RESPONSE_TOKEN_COUNT = 4000;

const next = async (nextMessages: Message[]): Promise<void> => {
Expand Down

0 comments on commit beff74e

Please sign in to comment.