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
[Security solution] Fixes LangChain errors with Claude 3/Sonnet #180935
Closed
Conversation
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
stephmilovic
added
release_note:skip
Skip the PR/issue when compiling release notes
Team: SecuritySolution
Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc.
Team:Security Generative AI
Security Generative AI
v8.14.0
labels
Apr 16, 2024
closing in favor of #181088 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
release_note:skip
Skip the PR/issue when compiling release notes
Team:Security Generative AI
Security Generative AI
Team: SecuritySolution
Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc.
v8.14.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
See #181088
Fixes errors we had with theActionsClientLLM
class and Claude 3 Sonnet. As Claude 3 is implemented as chat model, it had trouble reliably using the LLM pattern when used in combination with tools. It would error more than half of the time when asked a question about ES|QL. This PR gets us off of the legacy LLM pattern (used by GPT-3) in order for LangChain to perform its best with the latest chat models. Learn more here about chat models and LLMs.Introduces a new actions client equipped LangChain chat model,ActionsClientSimpleChatModel
extendsSimpleChatModel
Updates thecallAgentExecutor
pattern to useActionsClientSimpleChatModel
instead ofActionsClientLLM
when streaming is offUpdates the directory name of where we store LangChain Model I/Ofrom
kbn-elastic-assistant-common/impl/llm/
tokbn-elastic-assistant-common/impl/language_models/
to align with the proper naming from LangChainlanguage_models
files renamed to align with the LangChain class they are extending (Ex:ActionsClientChatOpenAI extends ChatOpenAI
, filename ischat_openai.ts
)