-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security AI Assistant] Adds ability to specify LangSmith config and …
…APM URL for tracing in cloud environments (#180227) ## Summary While we wait for #178304, this is a PR for allowing users to specify their LangSmith config for tracing in cloud environments by only storing them in session storage. This is also behind an experimental feature flag and must be enabled with the `assistantModelEvaluation` flag ala: ``` xpack.securitySolution.enableExperimental: [ 'assistantModelEvaluation'] ``` ~Note I: `xpack.securitySolution.enableExperimental` should be allowlisted in cloud, but I have manually enabled via source for initial testing.~ Note II: I have verified the above is configurable on cloud deployments 👍 The new `traceOptions` are stored with the `elasticAssistantDefault.traceOptions` key, and the following keys: ``` { apmUrl : "${basepath}/app/apm" langSmithApiKey: "🫣" langSmithProject: "Cloud Testing" } ``` The `langSmithApiKey` and `langSmithProject` are then sent along with the request to `/actions/connector/{connectorId}/_execute`, and a new `LangChainTracer` is created using the values. The tracing infrastructue was already in place for evaluation, so no other changes were necessary. The `apmUrl` value is now used for the `View APM trace for message` action, so if you have set up a remote APM server, you can now link directly to that instance from the message. A basic UI was added for these fields under the `Run` step of the Evaluation Settings. No need to save or run an evaluation once entering. Fields are immediately stored in session storage upon entry. <p align="center"> <img width="500" src="https://github.com/elastic/kibana/assets/2946766/02445b24-9d4b-40a9-bbad-f261ec098faa" /> </p> ### Test Instructions Click on the [latest Kibana Buildkite build](https://buildkite.com/elastic/kibana-pull-request/builds/201924#annotation-cloud), go to the `ci:cloud-deploy` cluster (grabbing creds from vault), then set a LangChain Project/API key in the above UI, then make a request to the LLM and verify the trace is collected in the LangSmith UI: > [!NOTE] > Only LangChain codepaths can be traced to LangSmith, so you must ensure LangChain is enabled by either turning on the Knowledge Base or enabling the Alert tools. The former can't be done in default `ci:cloud-deploy` deployments as they only have a 1GB ML nodes, so it is easiest to just turn on the Alert tools. <p align="center"> <img width="500" src="https://github.com/elastic/kibana/assets/2946766/b7c6747c-3314-44e2-8d58-f9d2bfdda687" /> </p> ### Checklist Delete any items that are not applicable to this PR. - [X] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- Loading branch information
Showing
16 changed files
with
228 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.