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

[Security solution] Fixes LangChain errors with Claude 3/Sonnet #180935

Closed
wants to merge 25 commits into from

Conversation

stephmilovic
Copy link
Contributor

@stephmilovic stephmilovic commented Apr 16, 2024

Summary

See #181088

Fixes errors we had with the ActionsClientLLM 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.

  1. Introduces a new actions client equipped LangChain chat model, ActionsClientSimpleChatModel extends SimpleChatModel
  2. Updates the callAgentExecutor pattern to use ActionsClientSimpleChatModel instead of ActionsClientLLM when streaming is off
  3. Updates the directory name of where we store LangChain Model I/O
    from kbn-elastic-assistant-common/impl/llm/ to kbn-elastic-assistant-common/impl/language_models/ to align with the proper naming from LangChain
  4. language_models files renamed to align with the LangChain class they are extending (Ex: ActionsClientChatOpenAI extends ChatOpenAI, filename is chat_openai.ts)

@stephmilovic 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
@stephmilovic
Copy link
Contributor Author

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant