File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -141,11 +141,13 @@ async def api_keys(credentials: UserCredentials) -> ApiKeysResponse:
141141 Raises:
142142 HTTPException: 400 if listing fails, 401 if authentication fails
143143 """
144+ print ("Getting API Keys" )
144145 try :
145146 user = await backend .authenticate_user (credentials .email , credentials .password )
146147 keys = await backend .list_api_keys (user )
147148 return ApiKeysResponse (api_keys = keys )
148149 except Exception as e :
150+ print (e )
149151 if isinstance (e , HTTPException ):
150152 raise e
151153 raise HTTPException (status_code = 400 , detail = str (e ))
Original file line number Diff line number Diff line change @@ -17,10 +17,12 @@ async def create_user(email: str, password: str):
1717 })
1818
1919async def authenticate_user (email : str , password : str ):
20+ print ("Auth'ing" )
2021 session = db .auth .sign_in_with_password ({
2122 "email" : email ,
2223 "password" : password
2324 })
25+ print ("Auth'ed" )
2426 user = session .user
2527 if not user .user_metadata ["email_verified" ]:
2628 raise HTTPException (status_code = 401 , detail = "Email not verified. Please check your inpox & spam" )
Original file line number Diff line number Diff line change 11from pydantic import BaseModel , Field
2- from typing import List , Dict , Optional
2+ from typing import List
33from openai import OpenAI
4- import os
5- from dataclasses import dataclass , asdict
64
75from app .core .config import settings
86from app .services .types import ClusterName , RankedIdea
97from langchain_community .vectorstores import Chroma
108from langchain_openai import OpenAIEmbeddings
11- from langchain .text_splitter import RecursiveCharacterTextSplitter
129
1310
1411async def summarize_clusters (ranked_ideas : List [RankedIdea ]) -> List [ClusterName ]:
1512
1613 print ("Summarizing clusters" )
17- embeddings = OpenAIEmbeddings ()
14+ embeddings = OpenAIEmbeddings (api_key = settings . OPENAI_API_KEY )
1815 vectordb = Chroma (embedding_function = embeddings )
1916
2017 # Add all ideas at once with metadata
You can’t perform that action at this time.
0 commit comments