knowsuchagency commited on
Commit
311d9aa
1 Parent(s): 2d016e2

feat: Add Sentry error tracking for improved error handling

Browse files
Files changed (2) hide show
  1. main.py +3 -0
  2. requirements.txt +1 -0
main.py CHANGED
@@ -5,6 +5,7 @@ from pathlib import Path
5
  from typing import List, Literal
6
 
7
  import gradio as gr
 
8
  from loguru import logger
9
  from openai import OpenAI
10
  from promptic import llm
@@ -12,6 +13,8 @@ from pydantic import BaseModel, ValidationError
12
  from pypdf import PdfReader
13
  from tenacity import retry, retry_if_exception_type
14
 
 
 
15
 
16
  class DialogueItem(BaseModel):
17
  text: str
 
5
  from typing import List, Literal
6
 
7
  import gradio as gr
8
+ import sentry_sdk
9
  from loguru import logger
10
  from openai import OpenAI
11
  from promptic import llm
 
13
  from pypdf import PdfReader
14
  from tenacity import retry, retry_if_exception_type
15
 
16
+ sentry_sdk.init(os.getenv("SENTRY_DSN"))
17
+
18
 
19
  class DialogueItem(BaseModel):
20
  text: str
requirements.txt CHANGED
@@ -5,3 +5,4 @@ google-generativeai~=0.6
5
  loguru~=0.7
6
  pypdf~=4.1
7
  tenacity~=8.3
 
 
5
  loguru~=0.7
6
  pypdf~=4.1
7
  tenacity~=8.3
8
+ sentry-sdk~=2.5