Skip to content

Commit

Permalink
Update posthog /getTopContexts name in so we can track impovements fr…
Browse files Browse the repository at this point in the history
…om DI
  • Loading branch information
KastanDay committed Mar 8, 2024
1 parent ae00694 commit 75251d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion ai_ta_backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def getTopContexts(service: RetrievalService) -> Response:
Exception
Testing how exceptions are handled.
"""
print("In getRopContexts in Main()")
search_query: str = request.args.get('search_query', default='', type=str)
course_name: str = request.args.get('course_name', default='', type=str)
token_limit: int = request.args.get('token_limit', default=3000, type=int)
Expand Down
5 changes: 2 additions & 3 deletions ai_ta_backend/service/retrieval_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def getTopContexts(self, search_query: str, course_name: str, token_limit: int =
return []

self.posthog.capture(
event_name="success_get_top_contexts_OG",
event_name="getTopContexts_success_DI",
properties={
"user_query": search_query,
"course_name": course_name,
Expand Down Expand Up @@ -204,7 +204,7 @@ def getTopContextsWithMQR(self,
4. [CANCELED BEC POINTLESS] Rank the docs based on the relevance score.
5. Parent-doc-retrieval: Pad just the top 5 docs with expanded context from the original document.
"""
return 'fail'
raise NotImplementedError("Method deprecated for performance reasons. Hope to bring back soon.")

# try:
# top_n_per_query = 40 # HARD CODE TO ENSURE WE HIT THE MAX TOKENS
Expand Down Expand Up @@ -334,7 +334,6 @@ def vector_search(self, search_query, course_name):
top_n = 80
# EMBED
openai_start_time = time.monotonic()
print("OPENAI_API_TYPE", os.environ['OPENAI_API_TYPE'])
user_query_embedding = self.embeddings.embed_query(search_query)
openai_embedding_latency = time.monotonic() - openai_start_time

Expand Down

0 comments on commit 75251d1

Please sign in to comment.