Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Integration Assistant plugin #184296

Merged
merged 101 commits into from
Jun 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
f1452a5
stashing changes
P1llus May 24, 2024
071b330
remove unecessary api code and update placeholder services
P1llus May 24, 2024
d102b28
update types, remove more code that is not needed anymore
P1llus May 24, 2024
b89cf96
cleaning up a lot of old code, reformat for kibana etc
P1llus May 24, 2024
84c58d4
fixing import paths
P1llus May 24, 2024
4e6a6bb
adding license headers and fixing last type paths
P1llus May 24, 2024
1da8c88
adding template files and more cleanup
P1llus May 25, 2024
9bc9dbf
adding templates, removing pages, adding some test buttons
P1llus May 25, 2024
813e342
stashing changes
P1llus May 25, 2024
540882c
stashing many changes with a non-descriptive commit message :)
P1llus May 26, 2024
58ad9f5
adding some fix to build integration api, starting on tests
P1llus May 27, 2024
eeb253d
adding some basic styling and conditions to test UI buttons
P1llus May 27, 2024
a4057b0
adding some small fixes
P1llus May 27, 2024
49f9db3
adding some initial jest tests
P1llus May 27, 2024
6659c9f
typo
patrykkopycinski May 27, 2024
83c6ee2
adding tests for ecs graph
P1llus May 27, 2024
0dd0851
split handleValidatePipeline to new file for mocks, added initial tes…
P1llus May 29, 2024
9e5fa1d
updating existing and adding new tests for backend, add esclient from…
P1llus May 29, 2024
2c54358
added context to related routes
P1llus May 29, 2024
6aefd4f
disable config by default
semd May 30, 2024
8e641b4
log debug
semd May 30, 2024
7c1ca51
Merge branch 'main' into integration_assistant
kibanamachine May 30, 2024
819374b
Add testpipeline API, update testPipeline to allow passing client as …
P1llus May 30, 2024
2bc589d
remove yarn.lock created by accident, add support for testing/updatin…
P1llus May 30, 2024
88a61bc
use actionsclient
patrykkopycinski May 30, 2024
24efa82
Merge branch 'integration_assistant' of github.com:P1llus/kibana into…
patrykkopycinski May 30, 2024
37815f3
removing the public folder and disable UI, will provide in separate PR
P1llus May 31, 2024
4d127ee
Merge branch 'main' into integration_assistant
kibanamachine May 31, 2024
f576253
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 31, 2024
ca5ca42
Adding some minor route argument changes
P1llus May 31, 2024
696b170
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine May 31, 2024
044ca8a
update readme
P1llus May 31, 2024
ba3b3e5
Update file operations to be sync rather than async as they have to b…
P1llus May 31, 2024
2985be8
Merge branch 'main' into integration_assistant
kibanamachine May 31, 2024
b78e00a
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine May 31, 2024
728a3d9
removing reference to local bedrock model in tests
P1llus May 31, 2024
1e005ef
Merge branch 'integration_assistant' of github.com:P1llus/kibana into…
P1llus May 31, 2024
1461631
Merge branch 'main' into integration_assistant
kibanamachine May 31, 2024
a3da613
fix create router type for backend
P1llus May 31, 2024
71725fd
renamed all template files to pass linter checks
P1llus May 31, 2024
1351f97
Merge branch 'main' into integration_assistant
P1llus May 31, 2024
4242078
revert commented out request validation
P1llus May 31, 2024
62668fe
fix sending object instead of string to missing keys prompt
P1llus May 31, 2024
d238614
Skip fields_to_remove if an empty array
bhapas Jun 3, 2024
ee12e81
Merge remote-tracking branch 'upstream/main' into integration_assistant
bhapas Jun 3, 2024
be0289c
conflicts solved
semd Jun 3, 2024
4338c97
Merge branch 'main' into integration_assistant
kibanamachine Jun 3, 2024
c2332dd
Merge branch 'main' into integration_assistant
patrykkopycinski Jun 3, 2024
a568780
fix
patrykkopycinski Jun 3, 2024
c3ab152
Merge branch 'integration_assistant' of github.com:P1llus/kibana into…
patrykkopycinski Jun 3, 2024
b79d05c
Update docs
bhapas Jun 4, 2024
abb17ce
Merge branch 'integration_assistant' of github.com:P1llus/kibana into…
bhapas Jun 4, 2024
bbd749e
Merge branch 'main' into integration_assistant
bhapas Jun 4, 2024
ead0fd6
Update yarn.lock
bhapas Jun 4, 2024
3d518bd
Merge branch 'main' into integration_assistant
bhapas Jun 4, 2024
378e17b
Merge branch 'main' into integration_assistant
bhapas Jun 4, 2024
9fa57d2
fix changed FakeListLLM to FakeStreamingLLM
bhapas Jun 4, 2024
0ef31c4
Merge branch 'main' into integration_assistant
kibanamachine Jun 4, 2024
687bd94
Merge branch 'integration_assistant' of github.com:P1llus/kibana into…
bhapas Jun 4, 2024
498556e
Merge branch 'main' into integration_assistant
bhapas Jun 4, 2024
d1f0667
Merge branch 'main' into integration_assistant
bhapas Jun 4, 2024
a3aac1f
Add integration_assistant to eslint
bhapas Jun 4, 2024
a337e06
Merge branch 'main' into integration_assistant
bhapas Jun 4, 2024
1b23cd2
Fix files with eslint issues
bhapas Jun 4, 2024
7cb7799
Use SimpleChatModel
patrykkopycinski Jun 4, 2024
9aac53e
Merge branch 'integration_assistant' of github.com:P1llus/kibana into…
patrykkopycinski Jun 4, 2024
e32fc9d
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jun 4, 2024
c5678e3
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine Jun 4, 2024
bce115d
fix
patrykkopycinski Jun 4, 2024
d42f6fd
fix eslint issue
bhapas Jun 5, 2024
8e6d180
Merge branch 'main' into integration_assistant
bhapas Jun 5, 2024
a5db6d2
Merge branch 'main' into integration_assistant
bhapas Jun 5, 2024
4488364
Merge branch 'main' into integration_assistant
bhapas Jun 5, 2024
e0b9cd8
Add versioned routes and make the APIs internal
bhapas Jun 7, 2024
6d8a9a4
Merge branch 'main' into integration_assistant
bhapas Jun 7, 2024
2367be8
Remove unnecessary addition in package.json
bhapas Jun 7, 2024
0cadcc0
update yarn.lock
bhapas Jun 7, 2024
b930406
Merge branch 'main' into integration_assistant
bhapas Jun 7, 2024
317db28
Merge branch 'main' into integration_assistant
bhapas Jun 10, 2024
32ebbf1
Merge remote-tracking branch 'upstream/main' into integration_assistant
bhapas Jun 10, 2024
4ce2877
Revert unnecessary changes
bhapas Jun 10, 2024
ecd4593
Merge branch 'main' into integration_assistant
bhapas Jun 10, 2024
4e4779c
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine Jun 10, 2024
e1df3e6
Merge branch 'main' into integration_assistant
kibanamachine Jun 10, 2024
b37688f
Revert eslint changes
bhapas Jun 10, 2024
b2ae8fe
Merge branch 'main' into integration_assistant
kibanamachine Jun 10, 2024
980995a
Merge branch 'main' into integration_assistant
bhapas Jun 11, 2024
6160ba6
Merge branch 'main' into integration_assistant
kibanamachine Jun 11, 2024
40408ff
Use SimpleChatModel
bhapas Jun 11, 2024
ad8417f
Update yarn.lock
bhapas Jun 11, 2024
f67cffa
Merge branch 'main' into integration_assistant
kibanamachine Jun 12, 2024
a10dce0
Disable the feature by default
bhapas Jun 12, 2024
499b424
Merge branch 'main' into integration_assistant
kibanamachine Jun 12, 2024
df8dbc5
test
patrykkopycinski Jun 12, 2024
fc15ed1
fix
patrykkopycinski Jun 12, 2024
efcb60a
Merge branch 'main' into integration_assistant
kibanamachine Jun 13, 2024
f5b7853
Ignore building system tests for custom packages
bhapas Jun 13, 2024
c5d827a
Merge branch 'main' into integration_assistant
kibanamachine Jun 13, 2024
77214b0
bump langgraph
patrykkopycinski Jun 13, 2024
3492c88
revert
patrykkopycinski Jun 13, 2024
360f840
Merge branch 'main' into integration_assistant
kibanamachine Jun 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding some initial jest tests
P1llus committed May 27, 2024
commit 49f9db3cac9393abef826e05a6616dd9ad56003e
104 changes: 104 additions & 0 deletions x-pack/plugins/integration_assistant/__jest__/fake_llm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { GenerationChunk } from '@langchain/core/outputs';
import { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';
import { LLM, BaseLLMParams } from '@langchain/core/language_models/llms';

/**
* Interface for the input parameters specific to the Fake List model.
*/
export interface FakeListInput extends BaseLLMParams {
/** Responses to return */
responses: string[];

/** Time to sleep in milliseconds between responses */
sleep?: number;
}

/**
* A fake LLM that returns a predefined list of responses. It can be used for
* testing purposes.
*/
export class FakeListLLM extends LLM {
static lc_name() {
return 'FakeListLLM';
}

responses: string[];

i = 0;

sleep?: number;

constructor({ responses, sleep }: FakeListInput) {
super({});
this.responses = responses;
this.sleep = sleep;
}

_llmType() {
return 'fake-list';
}

async _call(
_prompt: string,
_options: this['ParsedCallOptions'],
_runManager?: CallbackManagerForLLMRun
): Promise<string> {
const response = this._currentResponse();
this._incrementResponse();
await this._sleepIfRequested();

return response;
}

_currentResponse() {
return this.responses[this.i];
}

_incrementResponse() {
if (this.i < this.responses.length - 1) {
this.i += 1;
} else {
this.i = 0;
}
}

async *_streamResponseChunks(
_input: string,
_options: this['ParsedCallOptions'],
_runManager?: CallbackManagerForLLMRun
): AsyncGenerator<GenerationChunk> {
const response = this._currentResponse();
this._incrementResponse();

for await (const text of response) {
await this._sleepIfRequested();
yield this._createResponseChunk(text);
}
}

async _sleepIfRequested() {
if (this.sleep !== undefined) {
await this._sleep();
}
}

async _sleep() {
return new Promise<void>((resolve) => {
setTimeout(() => resolve(), this.sleep);
});
}

_createResponseChunk(text: string): GenerationChunk {
return new GenerationChunk({
text,
generationInfo: {},
});
}
}
Loading