mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Security Assistant] Fixes LangSmith support for specifying configuration via env vars (#180426)
## Summary With https://github.com/elastic/kibana/pull/180227, LangSmith configuration (Project & API Key) could no longer be specified using environment variables when working locally. This fixes that issue, which was caused by sending `''` for `langSmithProject` and `langSmithApiKey` instead of `undefined`. To test, set the below env vars, then start kibana. Be sure to not have the UI trace options set as shown in https://github.com/elastic/kibana/pull/180227. ``` # LangChain LangSmith export LANGCHAIN_TRACING_V2=true export LANGCHAIN_ENDPOINT="https://api.smith.langchain.com" export LANGCHAIN_API_KEY="🫣" export LANGCHAIN_PROJECT="Best Project Ever" ```
This commit is contained in:
parent
49e9294f69
commit
e7401d35c2
2 changed files with 5 additions and 3 deletions
|
@ -80,8 +80,10 @@ export const fetchConnectorExecuteAction = async ({
|
|||
replacements,
|
||||
isEnabledKnowledgeBase,
|
||||
isEnabledRAGAlerts,
|
||||
langSmithProject: traceOptions?.langSmithProject,
|
||||
langSmithApiKey: traceOptions?.langSmithApiKey,
|
||||
langSmithProject:
|
||||
traceOptions?.langSmithProject === '' ? undefined : traceOptions?.langSmithProject,
|
||||
langSmithApiKey:
|
||||
traceOptions?.langSmithApiKey === '' ? undefined : traceOptions?.langSmithApiKey,
|
||||
...optionalRequestParams,
|
||||
};
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ export const getLangSmithTracer = ({
|
|||
return [];
|
||||
}
|
||||
const lcTracer = new LangChainTracer({
|
||||
projectName: projectName ?? 'default', // Shows as the 'test' run's 'name' in langsmith ui
|
||||
projectName, // Shows as the 'test' run's 'name' in langsmith ui
|
||||
exampleId,
|
||||
client: new Client({ apiKey }),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue