mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 18:27:59 -04:00
## Summary Part of https://github.com/elastic/kibana-team/issues/1271 This PR introduces the first set of end to end integration test for the inference APIs, and the tooling required to do so (see issue for more context) - Add a dedicated pipeline for ai-infra GenAI tests. pipeline is triggered when: - genAI stack connectors, or ai-infra owned code is changed - when the `ci:all-gen-ai-suites` label is present on a PR - on merge - adapt the `ftr_configs.sh` script to load GenAI connector configuration from vault when a specific var env is set - create the `@kbn/gen-ai-functional-testing` package, which for now only contains utilities to load the GenAI connector configuration in FTR tests - Add FTR integration tests for the `chatComplete` API of the `inference` plugin --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
scripts | ||
src | ||
.gitignore | ||
index.ts | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
README.md | ||
tsconfig.json |
@kbn/gen-ai-functional-testing
Package exposing various utilities for GenAI/LLM related functional testing.
Features
LLM connectors
Utilizing LLM connectors on FTR tests can be done via the getPreconfiguredConnectorConfig
and getAvailableConnectors
tools.
getPreconfiguredConnectorConfig
should be used to define the list of connectors when creating the FTR test's configuration.
import { getPreconfiguredConnectorConfig } from '@kbn/gen-ai-functional-testing'
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const xpackFunctionalConfig = {...};
const preconfiguredConnectors = getPreconfiguredConnectorConfig();
return {
...xpackFunctionalConfig.getAll(),
kbnTestServer: {
...xpackFunctionalConfig.get('kbnTestServer'),
serverArgs: [
...xpackFunctionalConfig.get('kbnTestServer.serverArgs'),
`--xpack.actions.preconfigured=${JSON.stringify(preconfiguredConnectors)}`,
],
},
};
}
then the getAvailableConnectors
can be used during the test suite to retrieve the list of LLM connectors.
For example to run some predefined test suite against all exposed LLM connectors:
import { getAvailableConnectors } from '@kbn/gen-ai-functional-testing';
export default function (providerContext: FtrProviderContext) {
describe('Some GenAI FTR test suite', async () => {
getAvailableConnectors().forEach((connector) => {
describe(`Using connector ${connector.id}`, () => {
myTestSuite(connector, providerContext);
});
});
});
}