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

feat(ai): use openAI provider for suggested fix #69161

Closed
wants to merge 2 commits into from

Conversation

JoshFerge
Copy link
Member

instead of using openAI directly, use the new LLM usecase abstractions. Note we'll want to wait to merge this until we have documentation for self hosted, as they'll have to configure providers.

@JoshFerge JoshFerge requested a review from a team as a code owner April 17, 2024 22:35
@JoshFerge JoshFerge requested review from a team and removed request for a team April 17, 2024 22:35
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 17, 2024
@@ -264,28 +250,18 @@ def describe_event_for_ai(event, model):
return data


def suggest_fix(event_data, model=settings.SENTRY_AI_SUGGESTED_FIX_MODEL, stream=False):
def suggest_fix(event_data, model=settings.SENTRY_AI_SUGGESTED_FIX_MODEL):
"""Runs an OpenAI request to suggest a fix."""
prompt = PROMPT.replace("___FUN_PROMPT___", random.choice(FUN_PROMPT_CHOICES))
event_info = describe_event_for_ai(event_data, model=model)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to use the model configured in the usecase config instead of settings.SENTRY_AI_SUGGESTED_FIX_MODEL now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah good point, this parameter shouldn't be used anymore

Copy link

codecov bot commented Apr 17, 2024

Codecov Report

Attention: Patch coverage is 93.38843% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 79.69%. Comparing base (12398b1) to head (95f47ca).
Report is 4 commits behind head on master.

❗ Current head 95f47ca differs from pull request most recent head 64ced53. Consider uploading reports for the commit 64ced53 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #69161       +/-   ##
===========================================
- Coverage   81.44%   79.69%    -1.76%     
===========================================
  Files        2843     6433     +3590     
  Lines      176165   285413   +109248     
  Branches    31430    49140    +17710     
===========================================
+ Hits       143479   227450    +83971     
- Misses      32683    57595    +24912     
- Partials        3      368      +365     
Files Coverage Δ
src/sentry/api/endpoints/event_ai_suggested_fix.py 75.26% <100.00%> (+0.52%) ⬆️
src/sentry/conf/server.py 89.18% <ø> (ø)
src/sentry/llm/exceptions.py 100.00% <100.00%> (ø)
src/sentry/llm/providers/openai.py 100.00% <100.00%> (+4.16%) ⬆️
src/sentry/llm/providers/preview.py 100.00% <100.00%> (+14.28%) ⬆️
src/sentry/options/defaults.py 100.00% <100.00%> (ø)
src/sentry/llm/providers/base.py 93.33% <93.33%> (+6.66%) ⬆️
src/sentry/llm/usecases/__init__.py 93.33% <93.33%> (+8.88%) ⬆️
src/sentry/llm/providers/vertex.py 84.61% <84.61%> (ø)

... and 4642 files with indirect coverage changes

Base automatically changed from jferg/llmservice to master April 19, 2024 15:38
@JoshFerge JoshFerge requested review from a team as code owners April 19, 2024 15:38
@getsantry
Copy link
Contributor

getsantry bot commented May 11, 2024

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label May 11, 2024
@getsantry getsantry bot closed this May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants