From b52061ef7b23e50d3e48821e3f8bc5df70d62451 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Fri, 3 May 2024 14:13:09 -0700 Subject: [PATCH] add `SeerSimilarIssueData` dataclass --- src/sentry/seer/utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/sentry/seer/utils.py b/src/sentry/seer/utils.py index fa619e06fe0232..adce51b1c5e725 100644 --- a/src/sentry/seer/utils.py +++ b/src/sentry/seer/utils.py @@ -1,4 +1,5 @@ import logging +from dataclasses import dataclass from typing import NotRequired, TypedDict import sentry_sdk @@ -106,6 +107,17 @@ class SimilarIssuesEmbeddingsResponse(TypedDict): responses: list[RawSeerSimilarIssueData] +# Like the data that comes back from seer, but guaranteed to have a parent group id +@dataclass +class SeerSimilarIssueData: + stacktrace_distance: float + message_distance: float + should_group: bool + parent_group_id: int + # TODO: See if we end up needing the hash here + parent_group_hash: str | None = None + + def get_similar_issues_embeddings( similar_issues_request: SimilarIssuesEmbeddingsRequest, ) -> SimilarIssuesEmbeddingsResponse: