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

Add claude support for llm alerts #128

Merged
merged 9 commits into from
Dec 27, 2024
Merged

Add claude support for llm alerts #128

merged 9 commits into from
Dec 27, 2024

Conversation

andrewm4894
Copy link
Owner

This pull request introduces several significant changes to the anomaly detection system, including the addition of support for Anthropic's LLM, refactoring existing OpenAI-related code, and updating environment variables. The most important changes are summarized below:

Support for Anthropic LLM:

  • Added new environment variables for Anthropic's LLM and updated the .example.env file to include these variables. (.example.env)
  • Implemented a new module anthropic.py to handle anomaly detection using Anthropic's Messages API. (anomstack/llm/anthropic.py)

Refactoring and Code Improvements:

  • Refactored the detect_anomalies function to dispatch to the appropriate LLM platform (OpenAI or Anthropic) based on the environment variable ANOMSTACK_LLM_PLATFORM. (anomstack/llm/detect.py)
  • Moved the anomaly detection logic for OpenAI to a new module openai.py and renamed the function to detect_anomalies_openai. (anomstack/llm/openai.py) [1] [2] [3] [4] [5]

Model and Schema Definitions:

  • Created new Pydantic models Anomaly and DetectAnomaliesResponse to standardize the response schema for detected anomalies. (anomstack/llm/models.py)

Minor Improvements:

  • Updated the prompt instructions to consider the entire dataset when identifying anomalies. (metrics/defaults/python/prompt.py)
  • Added the anthropic library to the requirements.compile file. (requirements.compile)

@andrewm4894 andrewm4894 marked this pull request as ready for review December 27, 2024 21:25
Copy link

github-actions bot commented Dec 27, 2024

Your pull request is automatically being deployed to Dagster Cloud.

Location Status Link Updated
anomstack View in Cloud Dec 27, 2024 at 09:35 PM (UTC)

@andrewm4894 andrewm4894 merged commit f87f01f into main Dec 27, 2024
3 checks passed
@andrewm4894 andrewm4894 deleted the add-claude branch December 27, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant