Spaces:
Runtime error
Runtime error
Commit ·
f69a6fa
1
Parent(s): f2cb2b4
Add Reranker and Optimized Embeddings and metadata by connecting everything with postgres
Browse filesFiles changed (10)
- pyproject.toml+1-1
- src/api/main.py+9-3
- src/api/schemas.py+3-1
- src/data_ingestion/create_embeddings.py+65-42
- src/llm/anime_reranker.pyAdded+114
- src/llm/prompts.py+24-21
- src/retrieval/rag_pipeline.py+95-32
- src/retrieval/vector_search.py+127-48
- ui/gradio_app.py+654-302
- uv.lock+84-173
4 unmodified lines5678910114 unmodified linesreadme = "README.md"requires-python = ">=3.11,<3.14"dependencies = ["chromadb>=0.5.0","fastapi[all]>=0.122.0","gradio>=6.2.0","langchain>=1.1.3",4 unmodified lines5678910114 unmodified linesreadme = "README.md"requires-python = ">=3.11,<3.14"dependencies = ["chromadb>=1.5.2","fastapi[all]>=0.122.0","gradio>=6.2.0","langchain>=1.1.3",
61 unmodified lines626364656667688 unmodified lines7778798081823 unmodified lines86878889909192939495969761 unmodified lines{"query": "Anime similar to Death Note but lighter","n_results": 5,"min_score": 7.5}```"""8 unmodified linesif request.genre_filter:filters["genre_filter"] = request.genre_filterstart_time = time.time()result = rag_pipeline.recommend(3 unmodified linesend_time = time.time()# print(f"Retrieved anime : \n{result["retrieved_animes"][0]}")print(f"Retrieved anime Count : \n{result["retrieved_count"]}")print(f"Result Recommendations: \n{result["recommendations"][:20]}")return RecommendationResponse(query=result["query"],recommendations=result["recommendations"],retrieved_count=result["retrieved_count"],metadata={"model": settings.model_name,"retriever_k": rag_pipeline.retriever_k,61 unmodified lines6263646566676869708 unmodified lines7980818283848586873 unmodified lines91929394959697989910010110210361 unmodified lines{"query": "Anime similar to Death Note but lighter","n_results": 5,"min_score": 7.5,"genre_filter": ["Comedy", "Fantasy"],"anime_type": TV}```"""8 unmodified linesif request.genre_filter:filters["genre_filter"] = request.genre_filterif request.anime_type:filters["anime_type"] = request.anime_typestart_time = time.time()result = rag_pipeline.recommend(3 unmodified linesend_time = time.time()# print(f"Retrieved anime : \n{result["retrieved_animes"][0]}")print(f"Retrieved anime Count : \n{result["reranked_count"]}")print(f"Result Recommendations: \n{result["recommendations"][:20]}")return RecommendationResponse(query=result["query"],recommendations=result["recommendations"],retrieved_count=result["reranked_count"],retrieved_animes=result["retrieved_animes"],metadata={"model": settings.model_name,"retriever_k": rag_pipeline.retriever_k,
6 unmodified lines78910111213141516176 unmodified lines5, description="Number of recommendations to return")min_score: float | None = Field(None, description="Minimum MyAnimeList Score filter")genre_filter: str | None = Field(None, description="Filter by genre")class RecommendationResponse(BaseModel):query: strrecommendations: strretrieved_count: intmetadata: dict = {}6 unmodified lines789101112131415161718196 unmodified lines5, description="Number of recommendations to return")min_score: float | None = Field(None, description="Minimum MyAnimeList Score filter")genre_filter: list[str] | None = Field(None, description="Filter by genre")anime_type: str | None = Field(None, description="Filter by type(TV, Movie, etc)")class RecommendationResponse(BaseModel):query: strrecommendations: strretrieved_count: intretrieved_animes: list[dict]metadata: dict = {}
123456789101138 unmodified lines50515253545518 unmodified lines74757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341352 unmodified lines138139140141142143144145146147148149150import pandas as pdfrom sentence_transformers import SentenceTransformerimport chromadbfrom chromadb.config import Settingsimport osimport logginglogger = logging.getLogger(__name__)class EmbeddingPipeline:38 unmodified linesreturn collectiondef embed_texts(self, texts: list[str], batch_size: int = 32) -> list[list[float]] | None:"""Create embeddings for texts18 unmodified lineselse:logger.info(f"Using existing stored embeddings.")def store_in_chromadb(self, collection, df: pd.DataFrame, embeddings: list[list[float]]):"""Store embeddings and metadata in ChromaDBArgs:collection: ChromaDB collection,df: DataFrame with anime data,embeddings: Pre_commputed embeddings"""logger.info("Storing in ChromaDB...")ids = [str(mal_id) for mal_id in df["mal_id"].tolist()]documents = df["searchable_text"].tolist()# Metadatametadatas = []for _, row in df.iterrows():metadata = {"title": row["title"],"genres": row["genres"],"score": float(row["score"]) if pd.notna(row["score"]) else 0.0,"type": row["type"] if pd.notna(row["type"]) else "Unknown","year": int(row["year"]) if pd.notna(row["year"]) else 0,"synopsis": row["synopsis"][:500],"rating": row["rating"] if pd.notna(row["rating"]) else "Rating Unspecified","scored_by": row['scored_by'],}metadatas.append(metadata)collection.add(ids=ids,embeddings=embeddings,documents=documents,metadatas=metadatas)logger.info(f"Stored {len(ids)} animes in ChromaDB")logger.info(f"Collection now has {collection.count()} documents")def run_pipeline(self, csv_path: str = 'data/processed/anime_clean.csv'):"""Run complete embedding pipeline"""logger.info("Loading processed data...")df = pd.read_csv(csv_path)logger.info(f"Loaded {len(df)} animes")collection = self.create_or_get_collection()if self.use_existing_embeddings == False:embeddings = self.embed_texts(df["searchable_text"].tolist())if embeddings:self.store_in_chromadb(collection, df, embeddings)logger.info("Embedding pipeline complete !")return collection2 unmodified linescollection = pipeline.run_pipeline()print("\n--- Testing vector search ---")query = "Anime with female main character on adventure"print(f"Query: {query}")results = collection.query(query_texts=[query], n_results=15)print("\n--- TOP 5 RESULTS ---")for i, (title, distance) in enumerate(zip([m["title"] for m in results["metadatas"][0]],12345678910111213141538 unmodified lines545556575859606162636465666718 unmodified lines86878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571582 unmodified lines161162163164165166167168169170171172173from sentence_transformers import SentenceTransformerimport chromadbfrom chromadb.config import Settingsfrom sqlmodel import Session, selectimport loggingfrom src.database.session import enginefrom src.database.models import Animeslogger = logging.getLogger(__name__)logging.basicConfig(level=logging.INFO,format='%(asctime)s - %(levelname)s - %(message)s')class EmbeddingPipeline:38 unmodified linesreturn collectiondef fetch_data_from_postgres(self):"""Fetch all anime records from PostgreSQL"""logger.info("Fetching data from PostgreSQL...")with Session(engine) as session:statement = select(Animes).where(Animes.searchable_text != None)results = session.exec(statement).all()return resultsdef embed_texts(self, texts: list[str], batch_size: int = 32) -> list[list[float]] | None:"""Create embeddings for texts18 unmodified lineselse:logger.info(f"Using existing stored embeddings.")def store_in_chromadb(self, collection, db_records: list[Animes], embeddings: list[list[float]]):"""Store embeddings and metadata in ChromaDBArgs:collection: ChromaDB collection,db_records: List of Anime data retrieved from PostgreSQL database,embeddings: Pre_commputed embeddings"""logger.info("Storing in ChromaDB...")ids = []documents = []metadatas = []for row in db_records:ids.append(str(row.mal_id))documents.append(row.searchable_text)# genres_str = ", ".join(row.genres) if isinstance(# row.genres, list) else str(row.genres or "")genres_list = row.genres if isinstance(row.genres, list) else []if len(genres_list) == 0:genres_list = ["Unknown"]metadatas.append({"title": row.title,"genres": genres_list,"score": float(row.score) if row.score else 0.0,"type": row.type if row.type else "Unknown","scored_by": row.scored_by if row.scored_by else 0})print(f"Genre List saved: {", ".join(genres_list)}")chunk_size = 500total_chunks = (len(ids) // chunk_size) + 1logger.info(f"Inserting into ChromaDB in {total_chunks} batches...")for i in range(0, len(ids), chunk_size):collection.add(ids=ids[i: i + chunk_size],embeddings=embeddings[i: i + chunk_size],documents=documents[i: i + chunk_size],metadatas=metadatas[i: i + chunk_size])logger.info(f"Inserted batch {(i//chunk_size)+1}/{total_chunks}")logger.info(f"✅ Successfully stored {len(ids)} animes in ChromaDB")def run_pipeline(self):"""Run complete embedding pipeline"""# 1. Fetch from DB instead of CSVdb_records = self.fetch_data_from_postgres()logger.info(f"Loaded {len(db_records)} animes from Postgres")collection = self.create_or_get_collection()if not self.use_existing_embeddings:texts_to_embed = [record.searchable_text for record in db_records]embeddings = self.embed_texts(texts_to_embed)if embeddings:self.store_in_chromadb(collection, db_records, embeddings)logger.info("Embedding pipeline complete!")return collection2 unmodified linescollection = pipeline.run_pipeline()print("\n--- Testing vector search ---")query = "Anime similar to Attack Titan"print(f"Query: {query}")results = collection.query(query_texts=[query], n_results=15)print("\n--- TOP 15 RESULTS ---")for i, (title, distance) in enumerate(zip([m["title"] for m in results["metadatas"][0]],
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114import pandas as pdfrom sentence_transformers import CrossEncoderfrom sklearn.preprocessing import MinMaxScaler
class AnimeReranker: def __init__(self, model_name: str = 'cross-encoder/ms-marco-MiniLM-L-6-v2', device: str = 'cpu'): """ Initializes the reranker, loading the PyTorch model into memory once. """ print(f"Loading CrossEncoder model '{model_name}' on {device}...") self.reranker = CrossEncoder(model_name, device=device) self.scaler = MinMaxScaler()
# ----Postgres Global Truth self.C = 7.676 # The true weighted average score # 50th percentile of votes (Confidence threshold) self.bayesian_m = 10875
# Hyperparameters for scoring self.passion_weight = 50 # Scaling factor for favorites/scored_by self.alpha = 0.75 # Weight for Semantic Relevance self.beta = 0.25 # Weight for Objective Quality
def _calculate_quality_score(self, df: pd.DataFrame) -> pd.DataFrame: """Internal method to calculate the objective quality of the anime.""" # Calculate Bayesian Average c = self.C v = df['scored_by'] r = df['score'] df['bayesian_score'] = (v / (v + self.bayesian_m)) * \ r + (self.bayesian_m / (v + self.bayesian_m)) * c
# Calculate Passion Rate df['passion_rate'] = df['favorites'] / (df['scored_by'] + 1)
# Combine into raw quality score df['raw_quality_score'] = df['bayesian_score'] + \ (df['passion_rate'] * self.passion_weight) return df
# def process(self, user_query: str, retrieved_anime: list[dict], top_k: int = 25) -> tuple[str, pd.DataFrame]: def process(self, user_query: str, retrieved_anime: list[dict], top_k: int = 25) -> pd.DataFrame: """ Public method to rerank, filter, and format the final context for the LLM. """ if not retrieved_anime: return pd.DataFrame()
df = pd.DataFrame(retrieved_anime)
# 1. Semantic Score (Cross-Encoder) cross_input = [[user_query, text] for text in df['searchable_text']] df['semantic_score'] = self.reranker.predict(cross_input)
# 2. Quality Score (Custom Math) df = self._calculate_quality_score(df)
# 3. Normalize & Combine df[['norm_semantic', 'norm_quality']] = self.scaler.fit_transform( df[['semantic_score', 'raw_quality_score']]) df['final_hybrid_score'] = ( self.alpha * df['norm_semantic']) + (self.beta * df['norm_quality'])
# 4. Sort and Filter df_sorted = df.sort_values( by='final_hybrid_score', ascending=False).head(top_k)
# # 5. Format for LLM # llm_context = "Here are the top retrieved anime matches:\n\n" # for _, row in df_sorted.iterrows(): # llm_context += f"Title: {row['title']} (English: {row.get('title_english', 'N/A')})\n" # llm_context += f"Genres: {row.get('genres', 'N/A')}\n" # llm_context += f"Synopsis: {row.get('synopsis', 'N/A')}\n" # llm_context += "-" * 40 + "\n"
# return llm_context, df_sorted return df_sorted
# ==========================================# USAGE IN PRODUCTION# ==========================================# 1. Initialize ONCE during app startupif __name__ == "__main__": from src.retrieval.vector_search import AnimeRetriever reranker_service = AnimeReranker() retriever = AnimeRetriever()
user_query = "Modern Romantic Comedy Anime" vector_db_results = retriever.search(query=user_query, n_results=50)
print("BEFORE RERANKING") print("--------------------------------------------------") for res in vector_db_results: print( f"Title: {res["title"]} (Score: {res["score"]}, Scored by: {res["scored_by"]}) .... Favorites={res["favorites"]}")
# 2. Call the `.process()` method during runtime (e.g., inside an API endpoint) df = reranker_service.process(user_query, vector_db_results, top_k=10) df_dict_list = df.to_dict(orient="records") if not df.empty else [] print("\nAFTER RERANKING") print("--------------------------------------------------") for res in df_dict_list: print( f"Title: {res["title"]} (Score: {res["score"]}, Scored by: {res["scored_by"]}) Favorites={res["favorites"]}") print(f"-> Has Raw Quality Score: {res["raw_quality_score"]}") print(f"-> Has Final normalized Quality Score: {res["norm_quality"]}") print(f"-> Has Raw Semantic Score: {res["semantic_score"]}") print(f"-> Has Final Semantic Score: {res["norm_semantic"]}") print(f"-> Has Final Hybrid Score: {res["final_hybrid_score"]}\n")34 unmodified lines35363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878834 unmodified linesIf you are less than 90% sure what the user wants, DO NOT call the tool. Ask for clarification instead."""def create_recommendation_prompt(user_query: str,retrieved_animes: list,n_recommendations: int | None = 5):"""Create prompt for LLM to reason about recommendationsArgs:user_query: Original user question,retrieved_animes: List of dict from vector search,n_recommendations: How many to recommend"""context_parts = []for i, anime in enumerate(retrieved_animes, 1):context_parts.append(f"{i}. **{anime['title']}** (Score: {anime['score']}/10, Scored by: {anime['scored_by']})\n"f" Genres: {anime['genres']}\n"f" Synopsis: {anime['synopsis']}\n")context = "\n".join(context_parts)prompt = f"""You are an expert, polite, casual and friendly anime recommender. Your goal is to give personalized anime recommendations based strictly on the provided database context.User's Query: "{user_query}"Available Anime Context (from vector search):{context}# Core Directives:1. **Curate, Don't List**: Do not just repeat the context. Analyze the user's specific vibe/theme requests and pick the top {n_recommendations} absolute best matches.2. **THE SEQUEL RULE**: You MUST NOT recommend direct sequels, prequels, or movies of the exact anime the user mentioned, UNLESS they explicitly ask for a watch order or sequel. (e.g., If they ask for "shows like Bleach", do NOT recommend "Bleach: Thousand-Year Blood War").3. **Conversational Tone**: Speak like a relaxed anime fan chatting with a friend. DO NOT use robotic transitions like "Based on the provided context..." or "Here are your recommendations...". Just jump right into the good stuff.4. **The Pitch**: For each pick, write 1-2 sentences explaining exactly *why* it fits their specific request based on the synopsis and genres.5. **No Hallucinations**: If an anime lacks a synopsis, do not invent one. Explain it using its genres and your general knowledge of its themes.6. **Honesty**: If the retrieved context doesn't have any genuinely good matches for the user's query, be honest. Tell them the database didn't have a perfect fit and suggest what kind of show they should look for instead.# Required Format:**[Anime Title]**[Your 1-2 sentence pitch on why it fits the user's exact vibe]**[Anime Title]**[Your pitch...](Limit to {n_recommendations} recommendations maximum.)"""return prompt34 unmodified lines35363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909134 unmodified linesIf you are less than 90% sure what the user wants, DO NOT call the tool. Ask for clarification instead."""def create_recommendation_prompt(user_query: str,retrieved_animes: list,n_recommendations: int | None = 5):"""Create prompt for LLM to reason about recommendations with strict anti-hallucination guardrails."""context_parts = []for i, anime in enumerate(retrieved_animes):# We pick the most 'semantic' fields for the LLM to reason withblock = (f"Title: {anime['title']} ({anime['year']})\n"f"Type: {anime['type']} | Score: {anime['score']} | Studio: {', '.join(anime['studios'] if isinstance(anime['studios'], list) else [anime.get('studios', 'Unknown')])}\n"f"Genres: {', '.join(anime['genres'] if isinstance(anime['genres'], list) else [anime.get('genres', '')])} | Themes: {', '.join(anime['themes'] if isinstance(anime['themes'], list) else [anime.get('themes', '')])}\n"f"Synopsis: {anime.get('synopsis', 'No synopsis available.')}\n"f"---")context_parts.append(block)context = "\n".join(context_parts)prompt = f"""You are an expert, casual, and friendly anime recommender. Your goal is to give personalized anime recommendations based STRICTLY on the provided database context.User's Query: "{user_query}"Available Anime Context (from vector search & reranker):{context}IF THE CONTEXT IS EMPTY:Politely say you cannot find any matching anime in your current database. DO NOT make up recommendations.ELSE:# Core Directives:1. Quality Over Quantity (CRITICAL): You are asked to provide up to {n_recommendations} recommendations. However, if only 1 or 2 anime in the context genuinely fit the user's specific vibe/theme request, ONLY recommend those. Do NOT force connections or hallucinate similarities just to reach the maximum number.2. The Sequel Rule: You MUST NOT recommend direct sequels, prequels, recap movies, or specials of the exact anime the user mentioned in their query, UNLESS they explicitly ask for a watch order or more of that exact show.3. Ruthless Curation: If the user asks for a specific contrast (e.g., "like Death Note but funny"), actively ignore anime in the context that do not fit that contrast.4. Conversational Tone: Speak like a relaxed, highly knowledgeable anime fan chatting with a friend. Never use robotic transitions like "Based on the provided context..." or "Here are your recommendations."5. The Pitch: For each pick, write a punchy 2-3 sentence pitch explaining exactly *why* it fits their request. Use specific plot points, themes, or the studio from the provided synopsis to back up your claim.# Required Format:**[Anime Title]**[Your 2-3 sentence pitch on why it fits the user's exact vibe, drawing directly from the synopsis or themes.]**[Anime Title]**[Your pitch...](Limit to {n_recommendations} recommendations maximum, but fewer is completely fine if the matches are weak.)"""return prompt
123456 unmodified lines12131415161718196 unmodified lines2627282930313233343536377 unmodified lines454647484950516 unmodified lines5859606162636412 unmodified lines777879808182832 unmodified lines868788899091921 unmodified line9495969798991001011021031041051061071081091101111121131148 unmodified lines1231241251261271281291306 unmodified lines137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176import jsonfrom src.retrieval.vector_search import AnimeRetrieverfrom src.llm.groq_client import GroqLLMfrom src.llm.prompts import create_recommendation_prompt, create_system_prompt, ANIME_SEARCH_TOOL, ROUTER_SYSTEM_PROMPTimport logging6 unmodified linesdef __init__(self,retriever: AnimeRetriever | None = None,llm: GroqLLM | None = None,retriever_k: int = 10,recommendation_n: int | None = 5):"""6 unmodified linesrecommendation_n: How many to recommend in final output"""self.retriever = retriever or AnimeRetriever()self.llm = llm or GroqLLM(model=settings.model_name)self.retriever_k = retriever_kself.recommendation_n = recommendation_nlogger.info("RAG Pipeline initialized")logger.info(f" - Retrieve top {retriever_k} anime from vector search")logger.info(f" - LLM reasons and recommends top {recommendation_n} anime")7 unmodified linesArgs:user_query: User's request (e.g., "Anime like death note for lighter")filters: Optional filters (min_score, genre_filter)Returns:Dict with:6 unmodified linesfilters = filters or {}# [STEP 1] The Agentic Decision Calllogger.info("[1/4] Asking LLM if it needs to search...")initial_response = self.llm.chat_with_tools(messages=[{"role": "user", "content": user_query}],12 unmodified lines}if not initial_response.tool_calls:logger.info("[2/4] No search needed. Returning conversational response.")return {"query": user_query,"retrieved_count": 0,2 unmodified lines}# [STEP 3] The LLM wants to search. Extract its optimized parameters.logger.info("[2/4] Tool called! Executing vector search...")tool_call = initial_response.tool_calls[0]tool_args = json.loads(tool_call.function.arguments)1 unmodified lineoptimized_query = tool_args.get("optimized_query", user_query)retrieved_animes = self.retriever.search(query=optimized_query,n_results=self.retriever_k,**filters)# [STEP 4] The Final Recommendation Calllogger.info("[3/4] Creating prompt with retrieved content...")prompt = create_recommendation_prompt(user_query=user_query,retrieved_animes=retrieved_animes,n_recommendations=self.recommendation_n)logger.info("[4/4] LLM generating final response...")system_prompt = create_system_prompt()recommendations = self.llm.generate(8 unmodified linesreturn {"query": user_query,"retrieved_count": len(retrieved_animes),"recommendations": recommendations,"retrieved_animes": retrieved_animes}def recommend_streaming(self, user_query: str, filters: dict | None = None):6 unmodified linesif __name__ == "__main__":import jsonpipeline = AnimeRAGPipeline(retriever_k=10,recommendation_n=5)test_queries = ["Anime similar to Death Note but lighter in tone","Romantic comedy set in high school","Dark psychological thriller","Action anime with great animation and epic fights"]for query in test_queries:result = pipeline.recommend(user_query=query)print(f"-------\nQuery: {query}:::\n-----")print(f"\nRecommendations:\n---------------")print(result["recommendations"])# Save results for inspectionfilename = f"test_result_{query[:30].replace(' ', '_')}.json"with open(f"data/{filename}", "w") as f:json.dump({"query": result["query"],"retrieved_titles": [a["title"] for a in result["retrieved_animes"]],"recommendations": result["recommendations"]}, f, indent=2)print(f"\nSaved to data/{filename}")print("\n" + "="*80 + "\n")# Pause between queries to respect rate limitsimport timetime.sleep(2)1234566 unmodified lines1314151617181920216 unmodified lines28293031323334353637383940417 unmodified lines495051525354556 unmodified lines6263646566676812 unmodified lines818283848586872 unmodified lines909192939495961 unmodified line98991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361378 unmodified lines1461471481491501511521531546 unmodified lines161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239import jsonfrom src.retrieval.vector_search import AnimeRetrieverfrom src.llm.anime_reranker import AnimeRerankerfrom src.llm.groq_client import GroqLLMfrom src.llm.prompts import create_recommendation_prompt, create_system_prompt, ANIME_SEARCH_TOOL, ROUTER_SYSTEM_PROMPTimport logging6 unmodified linesdef __init__(self,retriever: AnimeRetriever | None = None,reranker: AnimeReranker | None = None,llm: GroqLLM | None = None,retriever_k: int = 50,recommendation_n: int | None = 5):"""6 unmodified linesrecommendation_n: How many to recommend in final output"""self.retriever = retriever or AnimeRetriever()self.reranker = reranker or AnimeReranker()self.llm = llm or GroqLLM(model=settings.model_name)self.retriever_k = retriever_kself.recommendation_n = recommendation_nlogger.info("RAG Pipeline initialized")logger.info(f" - Retrieve top {retriever_k} anime from vector search")logger.info(f" - Rerank and filter using Cross-Encoder & Bayesian Math")logger.info(f" - LLM reasons and recommends top {recommendation_n} anime")7 unmodified linesArgs:user_query: User's request (e.g., "Anime like death note for lighter")filters: Optional filters (min_score, genre_filter, anime_type)Returns:Dict with:6 unmodified linesfilters = filters or {}# [STEP 1] The Agentic Decision Calllogger.info("[1/5] Asking LLM if it needs to search...")initial_response = self.llm.chat_with_tools(messages=[{"role": "user", "content": user_query}],12 unmodified lines}if not initial_response.tool_calls:logger.info("[2/5] No search needed. Returning conversational response.")return {"query": user_query,"retrieved_count": 0,2 unmodified lines}# [STEP 3] The LLM wants to search. Extract its optimized parameters.logger.info("[2/5] Tool called! Executing vector search...")tool_call = initial_response.tool_calls[0]tool_args = json.loads(tool_call.function.arguments)1 unmodified lineoptimized_query = tool_args.get("optimized_query", user_query)# 3A: Fetch Top >=50 Anime from Chromadbretrieved_animes = self.retriever.search(query=optimized_query,n_results=self.retriever_k,**filters)# 3B: Rerank the Top 50 Using Pytorch + Mathlogger.info("[3/5] Reranking results with Cross-Encoder")reranked_df = self.reranker.process(user_query=optimized_query,retrieved_anime=retrieved_animes,top_k=15)top_animes_list = reranked_df.to_dict(orient="records") if not reranked_df.empty else []print("FIRST IN TOP ANIMES LIST AFTER RERANKING \n",top_animes_list[0])print("SECOND IN TOP ANIMES LIST AFTER RERANKING \n",top_animes_list[1])print(f"After reranking, fetched {len(top_animes_list)} top animes....")# [STEP 4] The Final Recommendation Calllogger.info("[4/5] Creating prompt with retrieved content...")prompt = create_recommendation_prompt(user_query=user_query,retrieved_animes=top_animes_list,n_recommendations=self.recommendation_n)logger.info("[5/5] LLM generating final response...")system_prompt = create_system_prompt()recommendations = self.llm.generate(8 unmodified linesreturn {"query": user_query,"retrieved_count": len(retrieved_animes),"reranked_count": len(top_animes_list),"recommendations": recommendations,"retrieved_animes": top_animes_list}def recommend_streaming(self, user_query: str, filters: dict | None = None):6 unmodified linesif __name__ == "__main__":import jsonimport os# Ensure the data directory existsos.makedirs("data", exist_ok=True)pipeline = AnimeRAGPipeline(retriever_k=50,recommendation_n=5)test_queries = ["Anime similar to Death Note but lighter in tone","A really obscure and weird sci-fi mecha from the 90s", # Test the hidden gem / passion rate"A generic isekai with an overpowered main character" # Test the mainstream math]for query in test_queries:print(f"\n" + "="*80)print(f"TESTING QUERY: '{query}'")print("="*80)# 1. Run the pipeline (This executes the LLM routing, retrieval, reranking, and generation)result = pipeline.recommend(user_query=query)# 2. Extract the data for the diagnostic report# We need to reach into the pipeline's retriever to see what the raw ChromaDB output was,# since the pipeline only returns the *reranked* list.# Note: If the LLM chose NOT to search, result["retrieved_count"] will be 0.diagnostic_data = {"1_initial_user_query": result["query"],"2_llm_routing_decision": "Searched" if result["retrieved_count"] > 0 else "Chatted","3_total_retrieved_from_chroma": result["retrieved_count"],"4_total_survived_reranking": result.get("reranked_count", 0),"5_final_llm_recommendation_text": result["recommendations"],# The "Before" state: We want to see what ChromaDB found just using embeddings"6_raw_chroma_results_before_reranking": [],# The "After" state: We want to see the exact math scores for the top survivors"7_reranked_results_with_math": []}# If the LLM actually performed a search, let's build the detailed listsif result["retrieved_count"] > 0:# We need to get the optimized query that the LLM generated for the tool call.# (In a real app, you might want to return `optimized_query` in the `result` dict from `recommend()`)# For this test, we will just assume it's the original query if we can't easily grab it here.# Let's format the top 15 Reranked items with all their math exposedfor rank, anime in enumerate(result["retrieved_animes"]):diagnostic_data["7_reranked_results_with_math"].append({"rank": rank + 1,"title": anime["title"],"hybrid_score_final": round(anime.get("final_hybrid_score", 0), 4),"semantic_score_raw": round(anime.get("semantic_score", 0), 4),"quality_score_raw": round(anime.get("raw_quality_score", 0), 4),"bayesian_average": round(anime.get("bayesian_score", 0), 4),"passion_rate": round(anime.get("passion_rate", 0), 5),"chroma_distance": round(1 - anime.get("relevance_score", 1), 4) # Showing original vector distance})# 3. Save the diagnostic reportsafe_filename = f"diagnostic_{query[:20].replace(' ', '_').lower()}.json"filepath = os.path.join("data", safe_filename)with open(filepath, "w") as f:json.dump(diagnostic_data, f, indent=2)print(f"\n✅ Diagnostic saved to {filepath}")print(f"Generated Output:\n{result['recommendations']}")# Pause to respect Groq API rate limitsimport timetime.sleep(3)
123459 unmodified lines1516171819202122232425263 unmodified lines30313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778796 unmodified lines8687888990919293949596979899100101102103104105106107108109110111import chromadbfrom sentence_transformers import SentenceTransformerclass AnimeRetriever:9 unmodified linesprint(f"Loaded collection with {self.collection.count()} anime")def search(self,query: str,n_results: int = 5,genre_filter: str | None = None,min_score: float | None = None) -> list[dict]:"""Search for anime similar to query3 unmodified linesn_results: Number of results to returngenre_filter: Optional genre to filter bymin_score: Minimum MAL score (e.g., 7.0)Returns:List of dicts with anime info"""where_clause = {}if min_score:where_clause["score"] = {"$gte": min_score}# Genre Filtering laterresults = self.collection.query(query_texts=[query],n_results=n_results * 2 if genre_filter else n_results,where=where_clause if where_clause else None)anime_list = []for i in range(len(results["ids"][0])):metadata = results["metadatas"][0][i] # type: ignoredistance = results["distances"][0][i] # type: ignore# Genre filtering (if specified)if genre_filter and "genres" in metadata:# type: ignoreif genre_filter.lower() not in metadata["genres"].lower():continueanime_info = {"mal_id": results["ids"][0][i],"title": metadata["title"],"genres": metadata.get("genres", ""),"score": metadata["score"],"type": metadata["type"],"year": metadata["year"],"synopsis": metadata["synopsis"],"distance": distance,"scored_by": metadata["scored_by"],"relevance_score": 1 - distance # Convert distance to similarity}anime_list.append(anime_info)if len(anime_list) >= n_results:breakreturn anime_listdef get_by_title(self, title: str) -> dict | None:6 unmodified linesif __name__ == "__main__":retriever = AnimeRetriever()# Test queriesprint("=== Test 1: Basic Search ===")results = retriever.search("dark psychological anime", n_results=5)for anime in results:print(f"- {anime['title']} (score: {anime['score']}, relevance: {anime['relevance_score']:.3f})")print("\n=== Test 2: Genre Filter ===")results = retriever.search("high school", n_results=5, genre_filter="Comedy")for anime in results:print(f"- {anime['title']} ({anime['genres']})")print("\n=== Test 3: Score Filter ===")results = retriever.search("adventure", n_results=5, min_score=8.0)for anime in results:print(f"- {anime['title']} (score: {anime['score']})")print("\n=== Test 4: Scored by Filter ===")results = retriever.search("adventure", n_results=5, min_score=8.0)for anime in results:print(f"- {anime['title']} (score: {anime['score']}) (scored_by: {anime['scored_by']})")12345678910111213149 unmodified lines242526272829303132333435363738394041424344453 unmodified lines4950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411426 unmodified lines149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190import chromadbfrom sentence_transformers import SentenceTransformerfrom src.database.session import enginefrom src.database.models import Animesfrom sqlmodel import Session, selectimport logginglogger = logging.getLogger(__name__)logging.basicConfig(level=logging.INFO,format='%(asctime)s - %(levelname)s - %(message)s')class AnimeRetriever:9 unmodified linesprint(f"Loaded collection with {self.collection.count()} anime")def fetch_anime_batch_from_postgres(self, mal_ids: list[int]) -> dict[int, Animes]:"""Fetch multiple animes at once and return a dictionary mapped by mal_id"""with Session(engine) as session:# The .in_() operator acts like SQL's "WHERE mal_id IN (1, 2, 3)"statement = select(Animes).where(Animes.mal_id.in_(mal_ids))results = session.exec(statement).all()return {anime.mal_id: anime for anime in results}def search(self,query: str,n_results: int = 5,genre_filter: list[str] | None = None,min_score: float | None = 6.0,anime_type: str | None = None) -> list[dict]:"""Search for anime similar to query3 unmodified linesn_results: Number of results to returngenre_filter: Optional genre to filter bymin_score: Minimum MAL score (e.g., 7.0)anime_type: Type of Anime (e.g. TV, Movie, etc)Returns:List of dicts with anime info"""# 1. Build chromadb WHERE clause for filteringconditions = [{"scored_by": {"$gte": 9000}}]if min_score:logger.info(f"SCORE: Filtered based on min_score: {min_score}")conditions.append({"score": {"$gte": min_score}})if anime_type:logger.info(f"ANIME TYPE: Filtered based on anime_type: {anime_type}")conditions.append({"type": {"$eq": anime_type}})if genre_filter:logger.info(f"GENRE: Pre-filtering (OR) for genres: {', '.join(genre_filter)}")genre_or_conditions = [{"genres": {"$contains": genre}} for genre in genre_filter]if len(genre_or_conditions) == 1:conditions.append(genre_or_conditions[0])else:conditions.append({"$or": genre_or_conditions})where_clause = Noneif len(conditions) == 1:where_clause = conditions[0]elif len(conditions) > 1:where_clause = {"$and": conditions}# 2. Query ChromaDBresults = self.collection.query(query_texts=[query],n_results=n_results,where=where_clause)if not results["ids"][0]:return []# 3. Batch fetch from PostgreSQLretrieved_ids = [int(id_str) for id_str in results["ids"][0]]postgres_data_map = self.fetch_anime_batch_from_postgres(retrieved_ids)anime_list = []for i, id_str in enumerate(results["ids"][0]):mal_id = int(id_str)distance = results["distances"][0][i]# Get the rich data from our Postgres mappg_anime = postgres_data_map.get(mal_id)if not pg_anime:logger.warning(f"Anime ID {mal_id} found in Chroma but missing in Postgres!")continue# Merge Chroma math with Postgres truthsanime_info = {"mal_id": pg_anime.mal_id,"mal_url": pg_anime.url,"title": pg_anime.title,"title_english": pg_anime.title_english,"score": pg_anime.score,"scored_by": pg_anime.scored_by,"type": pg_anime.type,"year": pg_anime.year,"genres": pg_anime.genres, # Now an actual list again!"studios": pg_anime.studios,"themes": pg_anime.themes,"demographics": pg_anime.demographics,"episodes": pg_anime.episodes,"popularity": pg_anime.popularity,"rating": pg_anime.rating,"aired_from": pg_anime.aired_from,"aired_to": pg_anime.aired_to,"favorites": pg_anime.favorites,"images": pg_anime.images,"synopsis": pg_anime.synopsis,"searchable_text": pg_anime.searchable_text,# Clean rounded score"relevance_score": round(1 - distance, 3),}anime_list.append(anime_info)return anime_listdef get_by_title(self, title: str) -> dict | None:6 unmodified linesif __name__ == "__main__":retriever = AnimeRetriever()# # Test queries# print("=== Test 1: Basic Search ===")# results = retriever.search("dark psychological anime", n_results=15)# for anime in results:# print(# f"- {anime['title']} (score: {anime['score']}, relevance: {anime['relevance_score']:.3f})")# print("\n=== Test 2: Genre Filter ===")# results = retriever.search(# "high school", n_results=30, genre_filter=["Fantasy", "Action", "Comedy", "Adventure"])# for anime in results:# print(f"- {anime['title']} ({anime['genres']})")print("\n=== Test 3: Genre Filter ===")results = retriever.search("Overpowered Main character", n_results=5, genre_filter=["Adventure"])for anime in results:# print(# f"- {anime['title']} ({anime['genres']}) (Score: {anime["score"]}) (Scored by: {anime["scored_by"]})")print(anime)break# print("\n=== Test 3: Score Filter ===")# results = retriever.search("adventure", n_results=5, min_score=9.0)# for anime in results:# print(f"- {anime['title']} (score: {anime['score']})")# print("\n=== Test 4: Scored by Filter ===")# results = retriever.search("adventure", n_results=5, min_score=8.0)# for anime in results:# print(# f"- {anime['title']} (score: {anime['score']}) (scored_by: {anime['scored_by']})")# print("\n=== Test 5: TYPE Filter ===")# results = retriever.search(# "Attack On Titan", n_results=5, anime_type="Special")# for anime in results:# print(# f"- {anime['title']} (Anime Type: {anime['type']})")
1 unmodified line234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164171 unmodified linefrom gradio import themesimport requestsimport osAPI_URL = os.getenv("API_URL", "http://127.0.0.1:8000")def get_recommendations(query, min_score, genre_filter, n_results):if not query or not query.strip():return ("<div class='status-badge warning'>Waiting for prompt</div>","Tell me what you're in the mood for to get started.")try:payload = {"query": query.strip(),"n_results": int(n_results)}if min_score > 0:payload["min_score"] = float(min_score)if genre_filter and genre_filter != "Any":payload["genre_filter"] = genre_filterresponse = requests.post(f"{API_URL}/recommend", json=payload, timeout=30)response.raise_for_status()result = response.json()recommendations_text = result.get("recommendations", "")retrieved_count = result.get("retrieved_count", 0)time_taken = result.get("metadata", {}).get("Time taken for LLM + vector search", "unknown")if not recommendations_text or recommendations_text.strip() == "":return ("<div class='status-badge error'>No Matches</div>","Couldn't find anything matching that exact vibe. Try tweaking your search.")header_html = f"""<div class='results-dashboard'><div class='metric'><span class='label'>TITLES SCANNED</span><span class='value'>{retrieved_count}</span></div><div class='metric'><span class='label'>SEARCH TIME</span><span class='value'>{time_taken}</span></div><div class='status-badge success'>Search Complete</div></div>"""return header_html, recommendations_textexcept requests.exceptions.ConnectionError:return ("<div class='status-badge error'>Offline</div>","**Error:** Cannot connect to backend. Make sure the FastAPI server is running.")except Exception as e:return ("<div class='status-badge error'>Error</div>", f"**Something went wrong:** {str(e)}")CSS = """@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&family=Inter:wght@400;500&display=swap');:root {--bg-base: #0b0f19;--bg-panel: #111827;--accent: #6366f1;--accent-hover: #4f46e5;--text-main: #f3f4f6;--text-muted: #9ca3af;--border-dim: #1f2937;}body, .gradio-container {background-color: var(--bg-base) !important;font-family: 'Inter', sans-serif !important;color: var(--text-main) !important;}.gradio-container {max-width: 960px !important;margin: 0 auto !important;padding: 50px 20px !important;}/* Typography & Headers */.app-header {text-align: center;margin-bottom: 40px;}.app-title {font-family: 'Outfit', sans-serif;font-size: 42px;font-weight: 800;color: #ffffff;margin: 0 0 8px 0;letter-spacing: -1px;}.app-title span { color: var(--accent); }.app-subtitle { font-size: 16px; color: var(--text-muted); line-height: 1.5; }/* 🔥 NEW Unified Chat Input Bar 🔥 */#chat-input-container {background: var(--bg-panel);border: 1px solid var(--border-dim);border-radius: 24px;padding: 8px 8px 8px 16px;margin-bottom: 16px;display: flex;align-items: flex-end;transition: all 0.2s ease;box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);}#chat-input-container:focus-within {border-color: var(--accent);box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);}/* Override Gradio's internal Textbox styling */#query-input {border: none !important;box-shadow: none !important;background: transparent !important;flex-grow: 1;}#query-input textarea {background: transparent !important;border: none !important;box-shadow: none !important;color: #ffffff !important;font-family: 'Inter', sans-serif !important;font-size: 16px !important;padding: 12px 0 !important;resize: none !important; /* Removes the little drag handle */}#query-input textarea:focus {box-shadow: none !important;border: none !important;}/* 🔥 The Circle Send Button 🔥 */#send-btn {background: var(--accent) !important;color: #ffffff !important;border: none !important;border-radius: 50% !important;width: 44px !important;height: 44px !important;min-width: 44px !important;display: flex;align-items: center;justify-content: center;font-size: 20px !important;padding: 0 !important;margin-left: 12px;margin-bottom: 4px; /* Keeps it aligned to the bottom when text expands */cursor: pointer;transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;}#send-btn:hover {background: var(--accent-hover) !important;transform: scale(1.05);box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4) !important;}#send-btn:active {transform: scale(0.95);}/* Controls Row */.control-panel {background: transparent;margin-bottom: 30px;}.control-panel .gr-box, .control-panel select {background: var(--bg-panel) !important;border: 1px solid var(--border-dim) !important;border-radius: 8px !important;}label {font-family: 'Outfit', sans-serif !important;font-size: 12px !important;color: var(--text-muted) !important;text-transform: uppercase;letter-spacing: 0.5px;}/* Output Dashboard Elements */.results-dashboard {display: flex;gap: 30px;align-items: center;background: var(--bg-panel);border: 1px solid var(--border-dim);padding: 16px 24px;border-radius: 8px;margin-bottom: 16px;box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);}.metric { display: flex; flex-direction: column; }.metric .label { font-family: 'Outfit', sans-serif; font-size: 11px; color: var(--text-muted); letter-spacing: 0.5px; }.metric .value { font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 600; color: #fff; }.status-badge {margin-left: auto;font-family: 'Outfit', sans-serif;font-size: 12px;padding: 6px 12px;border-radius: 20px;font-weight: 600;}.status-badge.success { background: rgba(16, 185, 129, 0.1); color: #10b981; }.status-badge.error { background: rgba(239, 68, 68, 0.1); color: #ef4444; }.status-badge.warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }/* Markdown Styling for LLM Output */.markdown-output {background: transparent;font-size: 16px;line-height: 1.8;color: var(--text-main);}.markdown-output h1, .markdown-output h2, .markdown-output h3 { font-family: 'Outfit', sans-serif; color: #fff; margin-top: 24px; margin-bottom: 12px; }.markdown-output strong { color: #a855f7; font-weight: 600; }.markdown-output a { color: var(--accent); text-decoration: none; }.markdown-output a:hover { text-decoration: underline; }/* Quick Tags */.quick-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; justify-content: center; }.quick-tag {font-size: 13px;color: var(--text-muted);background: var(--bg-panel);border: 1px solid var(--border-dim);padding: 6px 14px;border-radius: 20px;cursor: pointer;transition: all 0.2s;}.quick-tag:hover {color: #fff;border-color: var(--accent);box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);}"""JS_INTERACTION = """<script>(function() {// 1. Handle clicking the quick suggestion tagsdocument.addEventListener('click', (e) => {const tag = e.target.closest('.quick-tag');if (tag) {const text = tag.getAttribute('data-text');const textarea = document.querySelector('textarea');if (textarea && text) {textarea.value = text;textarea.dispatchEvent(new Event('input', { bubbles: true }));// Find and click the send buttonlet btn = document.querySelector('#send-btn');if (btn && btn.tagName !== 'BUTTON') btn = btn.querySelector('button') || btn;if (btn) btn.click();}}});// 2. Override Gradio's internal key bindingsdocument.addEventListener('keydown', (e) => {// Target our specific textareaif (e.target.tagName.toLowerCase() === 'textarea') {if (e.key === 'Enter') {if (e.shiftKey) {// SHIFT + ENTER: We want a new line.// Stop Gradio from seeing this and triggering its default "Submit"e.stopPropagation();e.stopImmediatePropagation();// We DO NOT preventDefault, so the browser natively adds the new line.}else if (!e.ctrlKey && !e.metaKey) {// PLAIN ENTER: We want to submit.// Stop the browser from making a new linee.preventDefault();// Stop Gradio from seeing this event at alle.stopPropagation();e.stopImmediatePropagation();// Click our send buttonlet btn = document.querySelector('#send-btn');if (btn && btn.tagName !== 'BUTTON') btn = btn.querySelector('button') || btn;if (btn) btn.click();}}}}, true); // Use the capture phase to intercept before React/Gradio does})();</script>"""def create_interface():with gr.Blocks(title="Anime Recommender") as demo:gr.HTML("""<div class="app-header"><h1 class="app-title">Find your next <span>anime</span>.</h1><p class="app-subtitle">Describe the exact vibe, mood, or story you're looking for.</p><div class="quick-tags"><div class="quick-tag" data-text="Cozy slice of life set in the countryside">Cozy Countryside</div><div class="quick-tag" data-text="Dark fantasy with an unreliable narrator">Dark Fantasy</div><div class="quick-tag" data-text="Fast-paced cyberpunk action with great animation">Cyberpunk Action</div></div></div>""")# 🔥 NEW UNIFIED INPUT BAR 🔥with gr.Row(elem_id="chat-input-container"):query_input = gr.Textbox(label="",show_label=False,lines=2,placeholder="Message the recommender... (e.g., A melancholic sci-fi)",elem_id="query-input",scale=10)# Using an upward arrow icon (↑) for the send buttonsubmit_btn = gr.Button("➔",elem_id="send-btn",scale=1)with gr.Group(elem_classes="control-panel"):with gr.Row():genre_dropdown = gr.Dropdown(choices=["Any", "Action", "Sci-Fi", "Slice of Life","Fantasy", "Psychological", "Horror", "Romance"],value="Any",label="Genre Filter",)min_score_slider = gr.Slider(minimum=0, maximum=10, value=0, step=0.5,label="Minimum Rating")n_results_slider = gr.Slider(minimum=1, maximum=8, value=3, step=1,label="Number of Results")output_header = gr.HTML(value="<div class='results-dashboard'><div class='status-badge warning'>Waiting for input</div></div>")output_text = gr.Markdown(value="",elem_classes="markdown-output")gr.HTML(JS_INTERACTION)submit_btn.click(fn=get_recommendations,inputs=[query_input, min_score_slider,genre_dropdown, n_results_slider],outputs=[output_header, output_text])# Allow native submission as a fallbackquery_input.submit(fn=get_recommendations,inputs=[query_input, min_score_slider,genre_dropdown, n_results_slider],outputs=[output_header, output_text])return demoif __name__ == "__main__":demo = create_interface()theme = themes.Base(font=[themes.GoogleFont("Inter"), "ui-sans-serif","system-ui", "sans-serif"],).set(body_background_fill="transparent",block_background_fill="transparent",block_border_width="0px",input_background_fill="transparent",)demo.launch(server_name="0.0.0.0",server_port=7860,share=False,css=CSS,theme=theme)1 unmodified line234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687691 unmodified linefrom gradio import themesimport requestsimport osimport reAPI_URL = os.getenv("API_URL", "http://127.0.0.1:8000")ANIME_TYPES = ["Any", "TV", "Movie", "OVA", "ONA","Special", "Music", "CM", "PV", "TV Special"]GENRES = ["Any", "Action", "Adventure", "Avant Garde", "Award Winning", "Boys Love","Comedy", "Drama", "Ecchi", "Erotica", "Fantasy", "Girls Love", "Gourmet","Hentai", "Horror", "Mystery", "Romance", "Sci-Fi", "Slice of Life", "Sports","Supernatural", "Suspense"]SUGGESTIONS = [{"label": "🌸 Similar to Naruto","query": "Action packed themed anime similar to Naruto"},{"label": "⚔️ Dark fantasy","query": "Dark fantasy with an unreliable narrator"},{"label": "🤖 Cyberpunk action","query": "Fast-paced cyberpunk action with great animation"},{"label": "💀 Psychological","query": "Psychological thriller that messes with your head"},{"label": "💘 Romance drama", "query": "Bittersweet romance that makes you cry"},]# ─── HTML builders ────────────────────────────────────────────────────────────def _img(images: dict) -> str:webp = images.get("webp", {}).get("image_url", "")jpg = images.get("jpg", {}).get("image_url", "")return webp or jpg or ""def build_spotlight_card(anime: dict) -> str:img = _img(anime.get("images", {}))title = anime.get("title", "Unknown")eng = anime.get("title_english") or ""score = anime.get("score") or "—"year = anime.get("year") or "—"kind = anime.get("type") or "—"eps = anime.get("episodes") or "—"genres = anime.get("genres") or []studios = anime.get("studios") or []url = anime.get("mal_url", "#")raw_syn = anime.get("synopsis") or ""synopsis = raw_syn[:220].rstrip() + ("..." if len(raw_syn) > 220 else "")genre_pills = "".join(f"<span class='pill'>{g}</span>" for g in genres[:4])studio_str = ", ".join(studios[:2]) if studios else "Unknown Studio"eng_html = f"<h4 class='sc-eng'>{eng}</h4>" if eng and eng.strip() and eng != title else ""try:s = float(score)sc = "#00e5a0" if s >= 8 else "#fbbf24" if s >= 7 else "#f87171"except Exception:sc = "#6b7a99"return (f"<a href='{url}' target='_blank' class='sc'>"f"<div class='sc-poster'>"f"<img src='{img}' alt='{title}' loading='lazy' "f"onerror=\"this.src='https://placehold.co/280x400/0d1520/00c896?text=?'\"/>"f"<div class='sc-badge' style='color:{sc}'>★ {score}</div>"f"</div>"f"<div class='sc-body'>"f"<div class='sc-chips'>"f"<span class='mc'>{kind}</span><span class='mc'>{year}</span><span class='mc'>{eps} ep</span>"f"</div>"f"<h3 class='sc-title'>{title}</h3>"f"{eng_html}"f"<p class='sc-studio'>{studio_str}</p>"f"<p class='sc-synopsis'>{synopsis}</p>"f"<div class='pill-row'>{genre_pills}</div>"f"<span class='mal-btn'>View on MAL ↗</span>"f"</div></a>")def build_retrieved_row(anime: dict, idx: int) -> str:img = _img(anime.get("images", {}))title = anime.get("title", "Unknown")score = anime.get("score") or "—"year = anime.get("year") or "—"kind = anime.get("type") or ""genres = (anime.get("genres") or [])[:2]url = anime.get("mal_url", "#")raw_score = anime.get("relevance_score", 0)normalized_score = (raw_score + 1) / 2rel_pct = int(normalized_score * 100)genre_str = " · ".join(genres)return (f"<a href='{url}' target='_blank' class='rr'>"f"<span class='rr-idx'>{idx:02d}</span>"f"<img src='{img}' alt='{title}' class='rr-thumb' loading='lazy' "f"onerror=\"this.src='https://placehold.co/44x62/0d1520/00c896?text=?'\"/>"f"<div class='rr-info'>"f"<span class='rr-title'>{title}</span>"f"<span class='rr-sub'>{kind} · {year} · {genre_str}</span>"f"<div class='rr-bar-bg'><div class='rr-bar-fill' style='width:{rel_pct}%'></div></div>"f"</div>"f"<div class='rr-right'>"f"<span class='rr-score'>★ {score}</span>"f"<span class='rr-pct'>{rel_pct}%</span>"f"</div>"f"</a>")def format_output(result: dict) -> tuple[str, str]:recs_text = result.get("recommendations", "")retrieved_count = result.get("retrieved_count", 0)time_str = result.get("metadata", {}).get("Time taken for LLM + vector search", "?")retrieved = result.get("retrieved_animes", [])header = ("<div class='hud'>""<div class='hud-pill ready'>✦ Results ready</div>""<div class='hud-stats'>"f"<div class='hud-stat'><span class='hud-n'>{retrieved_count}</span>"f"<span class='hud-l'>titles scanned</span></div>""<div class='hud-sep'></div>"f"<div class='hud-stat'><span class='hud-n'>{time_str[:4]}s</span>"f"<span class='hud-l'>search time</span></div>""</div></div>")sections = re.split(r'\*\*(.+?)\*\*', recs_text)title_map = {a.get("title", "").lower(): a for a in retrieved}title_map.update({(a.get("title_english") or "").lower(): a for a in retrieved})recs_html = ""if len(sections) > 1:pre = sections[0].strip()if pre:recs_html += f"<p class='llm-intro'>{pre}</p>"pairs = list(zip(sections[1::2], sections[2::2]))for i, (rec_title, rec_body) in enumerate(pairs):rec_title = rec_title.strip()rec_body = rec_body.strip().lstrip("\n").rstrip("\n—-").strip()matched = title_map.get(rec_title.lower())if not matched:for k, v in title_map.items():if k and (k in rec_title.lower() or rec_title.lower() in k):matched = vbreakcard = build_spotlight_card(matched) if matched else f"<div class='no-img-title'>{rec_title}</div>"delay = f"{i * 0.09:.2f}"recs_html += (f"<div class='rec-block' style='animation-delay:{delay}s'>"f"{card}"f"<div class='llm-pitch'>{rec_body}</div>"f"</div>")else:recs_html = f"<div class='convo-msg'>{recs_text}</div>"sidebar = ""if retrieved:rows = "".join(build_retrieved_row(a, i + 1)for i, a in enumerate(retrieved))sidebar = ("<aside class='sidebar'>""<div class='sidebar-head'>""<span class='sidebar-label'>Vector search</span>"f"<span class='sidebar-count'>{retrieved_count}</span>""</div>"f"<div class='rr-list'>{rows}</div>""</aside>")body = ("<div class='main-layout'>""<section class='recs-col'>""<div class='recs-heading'>Recommendations</div>"f"{recs_html}""</section>"f"{sidebar}""</div>")return header, bodydef get_recommendations(query, min_score, genre_filter, anime_type, n_results):if not query or not query.strip():return ("<div class='hud'><div class='hud-pill idle'>Waiting for your prompt...</div></div>","")try:payload = {"query": query.strip(), "n_results": int(n_results)}if min_score > 0:payload["min_score"] = float(min_score)if genre_filter and "Any" not in genre_filter:payload["genre_filter"] = genre_filterif anime_type and anime_type != "Any":payload["anime_type"] = anime_typeresponse = requests.post(f"{API_URL}/recommend", json=payload, timeout=30)response.raise_for_status()result = response.json()if not result.get("recommendations", "").strip():return ("<div class='hud'><div class='hud-pill err'>No matches</div></div>","<p class='convo-msg'>Couldn't find anything for that vibe. Try different keywords.</p>")return format_output(result)except requests.exceptions.ConnectionError:return ("<div class='hud'><div class='hud-pill err'>Offline</div></div>","<p class='convo-msg'>Cannot reach the backend. Is FastAPI running?</p>")except Exception as e:return ("<div class='hud'><div class='hud-pill err'>Error</div></div>",f"<p class='convo-msg'>Something went wrong: {e}</p>")# =============================================================================# CSS (SCALED DOWN TO "AVERAGE" SIZE)# =============================================================================CSS = """@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');:root {--bg: #070c12;--bg2: #121b29;--bg3: #1a2639;--bdr: rgba(255,255,255,0.08);--acc: #00c896;--acc2: #00e8b0;--adim: rgba(0,200,150,0.12);--aglow: rgba(0,200,150,0.3);--amb: #fbbf24;--red: #f87171;--txt: #dde3f0;--mut: #6b8299;--f: 'Plus Jakarta Sans', sans-serif;--sw: 220px; /* Reduced sidebar width */}*, *::before, *::after { box-sizing: border-box; }html, body {background: var(--bg) !important;font-family: var(--f) !important;color: var(--txt) !important;margin: 0; padding: 0;}.gradio-container {max-width: 100% !important;padding: 0 !important;margin: 0 !important;}#main-content {margin-left: var(--sw);width: calc(100% - var(--sw));padding: 0;min-height: 100vh;display: flex;flex-direction: column;}footer { display: none !important; }/* ── HERO BRAND ──────────────────────────────────────────────── */.hero-brand {display: flex;flex-direction: column;align-items: center;justify-content: center;padding: 40px 20px 20px;text-align: center;}.hero-logo-row {display: flex;align-items: center;gap: 12px;margin-bottom: 6px;}.hero-icon {width: 38px; height: 38px;background: linear-gradient(135deg, var(--acc), var(--acc2));border-radius: 12px;display: flex; align-items: center; justify-content: center;font-size: 20px; flex-shrink: 0;box-shadow: 0 4px 16px var(--aglow);color: #070c12;}.hero-name { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -.5px; }.hero-name em { font-style: normal; color: var(--acc); }/* ── FIXED SIDEBAR ───────────────────────────────────────────── */#anifind-sidebar {position: fixed;top: 0; left: 0;width: var(--sw);height: 100vh;background: var(--bg);border-right: 1px solid var(--bdr);display: flex;flex-direction: column;padding: 30px 20px;overflow-y: auto;z-index: 999;scrollbar-width: none;box-shadow: 4px 0 20px rgba(0,0,0,0.2);}#anifind-sidebar::-webkit-scrollbar { display: none; }.sb-tagline {font-size: 20px; font-weight: 800; color: #fff;line-height: 1.3; letter-spacing: -.3px; margin-bottom: 10px;}.sb-tagline em { font-style: normal; color: var(--acc); }.sb-sub {font-size: 13px; color: var(--mut);line-height: 1.5; margin-bottom: 30px;}.sb-sect {font-size: 11px; font-weight: 700;letter-spacing: 1.2px; text-transform: uppercase;color: var(--mut); margin-bottom: 12px;}.chips-col { display: flex; flex-direction: column; gap: 8px; }.chip {font-family: var(--f); font-size: 13px; font-weight: 600;color: var(--txt); background: var(--bg2);border: 1px solid var(--bdr);padding: 10px 14px; border-radius: 10px;cursor: pointer; text-align: left;transition: all .3s cubic-bezier(0.34, 1.56, 0.64, 1);}.chip:hover {color: var(--acc); background: var(--bg3);border-color: rgba(0,200,150,.5);transform: translateX(4px) scale(1.02);box-shadow: 0 4px 12px rgba(0,0,0,0.25);}/* ── STICKY SEARCH BAR ───────────────────────────────────────── */#search-zone {position: sticky !important;top: 0 !important; z-index: 100;background: rgba(7,12,18,0.85) !important;backdrop-filter: blur(16px);-webkit-backdrop-filter: blur(16px);border-bottom: 1px solid var(--bdr) !important;padding: 16px 24px !important;gap: 12px !important;align-items: center !important;}#query-input {background: var(--bg2) !important;border: 2px solid var(--bdr) !important;border-radius: 12px !important;transition: all .3s cubic-bezier(0.16, 1, 0.3, 1) !important;}#query-input:focus-within {border-color: var(--acc) !important;box-shadow: 0 0 0 3px var(--adim) !important;}#query-input textarea {font-family: var(--f) !important;font-size: 13px !important;padding: 10px !important;background: transparent !important;color: #fff !important;border: none !important;box-shadow: none !important;}#send-btn { min-width: unset !important; }#send-btn button {background: linear-gradient(135deg, var(--acc), #00ffc8) !important;color: #000 !important;border: none !important;border-radius: 12px !important;height: 42px !important;width: 42px !important;font-size: 18px !important;font-weight: 900 !important;cursor: pointer;transition: all .3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;box-shadow: 0 4px 14px rgba(0, 200, 150, 0.4), inset 0 2px 0 rgba(255,255,255,0.3) !important;display: flex; align-items: center; justify-content: center;}#send-btn button:hover {transform: translateY(-2px) scale(1.05) !important;box-shadow: 0 8px 20px rgba(0, 200, 150, 0.6) !important;}#send-btn button:active { transform: scale(0.95) !important; }/* ── FILTER BAR ──────────────────────────────────────────────── */#filter-bar {background: var(--bg2) !important;border: 1px solid var(--bdr) !important;border-radius: 14px !important;margin: 16px 24px 0 !important;padding: 16px 24px !important;box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;gap: 16px !important;}#filter-bar label span {color: var(--mut) !important;font-weight: 700 !important;text-transform: uppercase !important;letter-spacing: 1px !important;font-size: 11px !important;}/* ── OUTPUT ZONE ─────────────────────────────────────────────── */#output-zone {padding: 24px !important;flex: 1;}.hud {display: flex; align-items: center; justify-content: space-between;background: var(--bg2); border: 1px solid var(--bdr);border-radius: 12px; padding: 12px 20px;margin-bottom: 24px;box-shadow: 0 2px 8px rgba(0,0,0,0.1);}.hud-pill {font-size: 13px; font-weight: 700;padding: 6px 14px; border-radius: 100px;}.hud-pill.ready { background: var(--adim); color: var(--acc); border: 1px solid rgba(0,200,150,.3); }.hud-pill.idle { background: rgba(251,191,36,.1); color: var(--amb); border: 1px solid rgba(251,191,36,.2); }.hud-pill.err { background: rgba(248,113,113,.1); color: var(--red); border: 1px solid rgba(248,113,113,.2); }.hud-stats { display: flex; align-items: center; gap: 16px; }.hud-stat { display: flex; flex-direction: column; align-items: flex-end; }.hud-n { font-size: 18px; font-weight: 800; color: #fff; line-height: 1; }.hud-l { font-size: 11px; font-weight: 600; color: var(--mut); text-transform: uppercase; margin-top: 4px; }.hud-sep { width: 1px; height: 28px; background: var(--bdr); }.main-layout {display: grid; grid-template-columns: 1fr 350px;gap: 24px; align-items: start;}.recs-heading {font-size: 12px; font-weight: 800; letter-spacing: 1.5px;text-transform: uppercase; color: var(--mut);margin-bottom: 18px; padding-bottom: 10px;border-bottom: 2px solid var(--bdr);}/* ── RECOMMENDATION BLOCK ────────────────────────────────────── */.rec-block {background: var(--bg2);border: 1px solid var(--bdr);border-radius: 16px; overflow: hidden; margin-bottom: 20px;opacity: 0; transform: translateY(15px);animation: up .4s cubic-bezier(0.16, 1, 0.3, 1) forwards;transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);box-shadow: 0 4px 16px rgba(0,0,0,0.1);}.rec-block:hover {border-color: rgba(0,200,150,.4);box-shadow: 0 8px 30px rgba(0,200,150,.15);transform: translateY(-4px) scale(1.01);}@keyframes up { to { opacity: 1; transform: translateY(0); } }.sc {display: grid; grid-template-columns: 130px 1fr;text-decoration: none !important; color: inherit !important;}.sc-poster {position: relative; overflow: hidden;background: var(--bg3); min-height: 180px;}.sc-poster img {width: 100%; height: 100%; object-fit: cover;display: block; transition: transform .5s cubic-bezier(0.16, 1, 0.3, 1);}.sc:hover .sc-poster img { transform: scale(1.06); }.sc-badge {position: absolute; top: 10px; left: 10px;background: rgba(7,12,18,.85); backdrop-filter: blur(8px);font-size: 12px; font-weight: 800; padding: 4px 10px;border-radius: 100px; border: 1px solid rgba(255,255,255,.15);box-shadow: 0 2px 8px rgba(0,0,0,0.3);}.sc-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }.sc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }.mc {font-size: 10px; font-weight: 700; letter-spacing: .5px;text-transform: uppercase; color: var(--acc);background: var(--adim); border: 1px solid rgba(0,200,150,.25);padding: 3px 8px; border-radius: 6px;}.sc-title { font-size: 17px; font-weight: 800; color: #fff; line-height: 1.2; letter-spacing: -.3px; }.sc-eng { font-size: 12px; color: #a0b2c6; font-weight: 600; font-style: italic; margin-top: -2px; }.sc-studio { font-size: 12px; color: #8a9bb0; font-weight: 600; }.sc-synopsis { font-size: 12.5px; color: #dde3f0; line-height: 1.6; flex: 1; margin-top: 6px; }.pill-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }.pill {font-size: 12px; font-weight: 600; color: var(--txt);background: var(--bg3); border: 1px solid var(--bdr);padding: 4px 12px; border-radius: 100px;}.mal-btn {display: inline-block; margin-top: 14px;font-size: 12px; font-weight: 700; color: var(--acc);background: var(--adim); border: 1px solid rgba(0,200,150,.3);padding: 8px 16px; border-radius: 8px; letter-spacing: .5px;text-transform: uppercase; align-self: flex-start;transition: all .2s ease;}.sc:hover .mal-btn {background: var(--acc); color: #000;transform: translateY(-2px);box-shadow: 0 4px 12px rgba(0,200,150,0.3);}.llm-pitch {padding: 14px 16px; font-size: 14px; color: #fff;line-height: 1.6; border-top: 1px solid var(--bdr);background: rgba(255,255,255,0.02);}/* ── RETRIEVED SIDEBAR ───────────────────────────────────────── */.sidebar {background: var(--bg2); border: 1px solid var(--bdr);border-radius: 16px; padding: 18px;position: sticky; top: 110px;max-height: calc(100vh - 130px);overflow-y: auto; scrollbar-width: thin;scrollbar-color: var(--mut) transparent;box-shadow: 0 4px 16px rgba(0,0,0,0.1);}.sidebar-head {display: flex; justify-content: space-between; align-items: center;margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--bdr);}.sidebar-label {font-size: 11px; font-weight: 700; letter-spacing: 1px;text-transform: uppercase; color: var(--mut);}.sidebar-count {font-size: 12px; font-weight: 700; color: var(--acc);background: var(--adim); padding: 3px 10px; border-radius: 100px;}.rr-list { display: flex; flex-direction: column; gap: 4px; }.rr {display: grid; grid-template-columns: 22px 44px 1fr auto;gap: 12px; align-items: center; padding: 8px;border-radius: 10px; text-decoration: none !important;color: inherit !important; transition: all .2s;}.rr:hover {background: var(--bg3);transform: translateX(4px);}.rr-idx { font-size: 11px; font-weight: 700; color: var(--mut); text-align: center; }.rr-thumb {width: 44px; height: 62px; object-fit: cover;border-radius: 6px; background: var(--bg3); display: block;}.rr-info { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }.rr-title {font-size: 13px; font-weight: 700; color: #fff;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}.rr-sub {font-size: 11px; font-weight: 500; color: #8a9bb0;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}.rr-bar-bg { height: 4px; background: var(--bg3); border-radius: 4px; overflow: hidden; margin-top: 2px; }.rr-bar-fill {height: 100%;background: linear-gradient(90deg, var(--acc), var(--acc2));border-radius: 4px;}.rr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }.rr-score { font-size: 12px; font-weight: 700; color: var(--amb); }.rr-pct { font-size: 11px; font-weight: 600; color: var(--mut); }/* ── RESPONSIVE DESIGN ───────────────────────────────────────── */@media (max-width: 1024px) {.main-layout { grid-template-columns: 1fr; }.sidebar { position: relative; top: 0; max-height: none; margin-top: 24px; }}@media (max-width: 860px) {#anifind-sidebar { width: 100%; position: relative; height: auto; border-right: none; border-bottom: 1px solid var(--bdr); }#main-content { margin-left: 0; width: 100%; }.sc { grid-template-columns: 1fr; }.sc-poster { min-height: 200px; }}"""# =============================================================================# JAVASCRIPT (INJECTED VIA HEAD TO GUARANTEE EXECUTION)# =============================================================================JS = """<script>function initAniFindJS() {document.body.addEventListener('click', function(e) {var chip = e.target.closest('.chip');if (!chip) return;var q = chip.getAttribute('data-q');var ta = document.querySelector('#query-input textarea');if (ta && q) {// Svelte/React native value setter triggervar setter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value').set;setter.call(ta, q);ta.dispatchEvent(new Event('input', { bubbles: true }));setTimeout(function() {var btn = document.querySelector('#send-btn button');if (btn) btn.click();}, 100);}});document.body.addEventListener('keydown', function(e) {if (e.target.tagName.toLowerCase() !== 'textarea') return;if (e.key === 'Enter' && !e.shiftKey && !e.ctrlKey && !e.metaKey) {e.preventDefault();e.stopPropagation();var btn = document.querySelector('#send-btn button');if (btn) btn.click();}}, true);}// Ensure the script runs after DOM is readyif (document.readyState === "loading") {document.addEventListener("DOMContentLoaded", initAniFindJS);} else {initAniFindJS();}</script>"""# =============================================================================# GRADIO INTERFACE# =============================================================================def create_interface():chips_html = "".join(f"<button class='chip' data-q='{s['query']}'>{s['label']}</button>"for s in SUGGESTIONS)sidebar_html = ("<div id='anifind-sidebar'>""<p class='sb-tagline'>Find your next<br><em>favourite anime.</em></p>""<p class='sb-sub'>Describe a vibe, a mood, a feeling — we'll match it to the perfect title.</p>""<div class='sb-sect'>Quick searches</div>"f"<div class='chips-col'>{chips_html}</div>""</div>")hero_html = ("<div class='hero-brand'>""<div class='hero-logo-row'>""<div class='hero-icon'>⛩</div>""<span class='hero-name'>Ani<em>Find</em></span>""</div>""</div>")# Added `head=JS` to properly inject the event listeners globallywith gr.Blocks(title="AniFind", head=JS) as demo:gr.HTML(sidebar_html)with gr.Column(elem_id="main-content"):gr.HTML(hero_html)with gr.Row(elem_id="search-zone"):query_input = gr.Textbox(label="", show_label=False, lines=2,placeholder="e.g. A melancholic sci-fi about memory and loss...",elem_id="query-input", scale=10,)submit_btn = gr.Button("➔", elem_id="send-btn", scale=1)with gr.Row(elem_id="filter-bar"):anime_type_dd = gr.Dropdown(choices=ANIME_TYPES, value="Any", label="Type", scale=1)genre_dd = gr.Dropdown(choices=GENRES, value=["Any"], label="Genre",multiselect=True, scale=2)score_slider = gr.Slider(minimum=0, maximum=10, value=0, step=0.5,label="Min Rating", scale=1)n_slider = gr.Slider(minimum=1, maximum=8, value=3, step=1,label="Results", scale=1)with gr.Column(elem_id="output-zone"):output_header = gr.HTML(value="<div class='hud'><div class='hud-pill idle'>Waiting for your prompt...</div></div>")output_body = gr.HTML(value="")ins = [query_input, score_slider, genre_dd, anime_type_dd, n_slider]outs = [output_header, output_body]submit_btn.click(fn=get_recommendations, inputs=ins, outputs=outs)query_input.submit(fn=get_recommendations, inputs=ins, outputs=outs)return demoif __name__ == "__main__":demo = create_interface()theme = themes.Base(font=[themes.GoogleFont("Plus Jakarta Sans"),"ui-sans-serif", "sans-serif"],).set(body_background_fill="transparent",block_background_fill="transparent",block_border_width="0px",input_background_fill="transparent",border_color_primary="transparent",shadow_drop="none",shadow_drop_lg="none",)demo.launch(server_name="0.0.0.0",server_port=7860,share=True,css=CSS,theme=theme,)
53 unmodified lines54555657585960314 unmodified lines375376377378379380381382383384385386387388389390391392393394395396397398399112 unmodified lines51251351451551651751824 unmodified lines54354454554654754854955055155255355455517 unmodified lines573574575576577578579580581582583584585586587588589590255 unmodified lines84684784884985085185285385485585614 unmodified lines871872873874875876877878879880881882883884885886887888889890121 unmodified lines1012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054103 unmodified lines1158115911601161116211631164116511661167116811691170117111721173117411755 unmodified lines11811182118311841185118611871188118911901191119211931194413 unmodified lines1608160916101611161216131614161516161617161816192 unmodified lines162216231624162516261627162816291630461 unmodified lines20922093209420952096209720982099210021011 unmodified line21032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125374 unmodified lines2500250125022503250425052506250725082509251025112512251325142515251675 unmodified lines259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618244 unmodified lines2863286428652866286728682869287028714 unmodified lines287628772878287928802881288228832884288528862887288828892890477 unmodified lines33683369337033713372337333743375337633773378337933803381338233833384338553 unmodified lines[package.metadata]requires-dist = [{ name = "chromadb", specifier = ">=0.5.0" },{ name = "fastapi", extras = ["all"], specifier = ">=0.122.0" },{ name = "gradio", specifier = ">=6.2.0" },{ name = "langchain", specifier = ">=1.1.3" },314 unmodified lines[[package]]name = "build"version = "1.3.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "colorama", marker = "(os_name == 'nt' and platform_machine != 'aarch64' and sys_platform == 'linux') or (os_name == 'nt' and platform_python_implementation != 'CPython' and sys_platform == 'linux') or (os_name == 'nt' and sys_platform != 'darwin' and sys_platform != 'linux')" },{ name = "packaging" },{ name = "pyproject-hooks" },]sdist = { url = "https://files.pythonhosted.org/packages/25/1c/23e33405a7c9eac261dff640926b8b5adaed6a6eb3e1767d441ed611d0c0/build-1.3.0.tar.gz", hash = "sha256:698edd0ea270bde950f53aed21f3a0135672206f3911e0176261a31e0e07b397", size = 48544, upload-time = "2025-08-01T21:27:09.268Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/cb/8c/2b30c12155ad8de0cf641d76a8b396a16d2c36bc6d50b621a62b7c4567c1/build-1.3.0-py3-none-any.whl", hash = "sha256:7145f0b5061ba90a1500d60bd1b13ca0a8a4cebdd0cc16ed8adf1c0e739f43b4", size = 23382, upload-time = "2025-08-01T21:27:07.844Z" },][[package]]name = "cachetools"version = "6.2.4"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/bc/1d/ede8680603f6016887c062a2cf4fc8fdba905866a3ab8831aa8aa651320c/cachetools-6.2.4.tar.gz", hash = "sha256:82c5c05585e70b6ba2d3ae09ea60b79548872185d2f24ae1f2709d37299fd607", size = 31731, upload-time = "2025-12-15T18:24:53.744Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/2c/fc/1d7b80d0eb7b714984ce40efc78859c022cd930e402f599d8ca9e39c78a4/cachetools-6.2.4-py3-none-any.whl", hash = "sha256:69a7a52634fed8b8bf6e24a050fb60bff1c9bd8f6d24572b99c32d4e71e62a51", size = 11551, upload-time = "2025-12-15T18:24:52.332Z" },][[package]]112 unmodified lines[[package]]name = "chromadb"version = "1.3.7"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "bcrypt" },24 unmodified lines{ name = "typing-extensions" },{ name = "uvicorn", extra = ["standard"] },]sdist = { url = "https://files.pythonhosted.org/packages/a9/b9/23eb242c0bad56bcac57d9f45a6cc85e016a44ae9baf763c0d040e45e2d7/chromadb-1.3.7.tar.gz", hash = "sha256:393b866b6ac60c12fc0f2a43d07b2884f2d02a68a1b2cb43c5ef87d141543571", size = 1960950, upload-time = "2025-12-12T21:03:13.941Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/b6/9d/306e220cfb4382e9f29e645339826d1deec64c34cf905c344d0d7345dbdb/chromadb-1.3.7-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:74839c349a740b8e349fabc569f8f4becae9806fa8ff9ca186797bef1f54ee4c", size = 20816599, upload-time = "2025-12-12T21:03:11.173Z" },{ url = "https://files.pythonhosted.org/packages/51/3e/0fbb4c6e7971019c976cf3dbef1c22c1a3089f74ef86c88e2e066edc47e4/chromadb-1.3.7-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:fe9c96f73450274d9f722572afc9d455b4f6f4cd960fa49e4bf489075ef30e6f", size = 20113076, upload-time = "2025-12-12T21:03:07.873Z" },{ url = "https://files.pythonhosted.org/packages/69/78/2ae4064c9b194271b9c2bc66a26a7e11363d13ed2bd691a563fac1a7c5f2/chromadb-1.3.7-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:972cb168033db76a4bb1031bc38b6cc4e6d05ef716c1ffce8ae95a1a3b515dd2", size = 20738619, upload-time = "2025-12-12T21:03:01.409Z" },{ url = "https://files.pythonhosted.org/packages/01/5d/3aa34cb02c3c0e4920a47da5d9092cab690fcbf6df13ec744eacf96891d6/chromadb-1.3.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3e05190236e309b54165866dd11676c2702a35b73beaa29502741f22f333c51a", size = 21654395, upload-time = "2025-12-12T21:03:04.909Z" },{ url = "https://files.pythonhosted.org/packages/00/36/7d2d7b6bb26e53214492d71ccb4e128fa2de4d98a215befb7787deaf2701/chromadb-1.3.7-cp39-abi3-win_amd64.whl", hash = "sha256:4618ba7bb5ef5dbf0d4fd9ce708b912d8cd1ab24d3c81e0e092841f325b2c94d", size = 21874973, upload-time = "2025-12-12T21:03:16.918Z" },][[package]]17 unmodified lines{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },][[package]]name = "coloredlogs"version = "15.0.1"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "humanfriendly" },]sdist = { url = "https://files.pythonhosted.org/packages/cc/c7/eed8f27100517e8c0e6b923d5f0845d0cb99763da6fdee00478f91db7325/coloredlogs-15.0.1.tar.gz", hash = "sha256:7c991aa71a4577af2f82600d8f8f3a89f936baeaf9b50a9c197da014e5bf16b0", size = 278520, upload-time = "2021-06-11T10:22:45.202Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/a7/06/3d6badcf13db419e25b07041d9c7b4a2c331d3f4e7134445ec5df57714cd/coloredlogs-15.0.1-py2.py3-none-any.whl", hash = "sha256:612ee75c546f53e92e70049c9dbfcc18c935a2b9a53b66085ce9ef6a6e5c0934", size = 46018, upload-time = "2021-06-11T10:22:42.561Z" },][[package]]name = "comm"version = "0.2.3"255 unmodified lines[[package]]name = "flatbuffers"version = "25.9.23"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/9d/1f/3ee70b0a55137442038f2a33469cc5fddd7e0ad2abf83d7497c18a2b6923/flatbuffers-25.9.23.tar.gz", hash = "sha256:676f9fa62750bb50cf531b42a0a2a118ad8f7f797a511eda12881c016f093b12", size = 22067, upload-time = "2025-09-24T05:25:30.106Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/ee/1b/00a78aa2e8fbd63f9af08c9c19e6deb3d5d66b4dda677a0f61654680ee89/flatbuffers-25.9.23-py2.py3-none-any.whl", hash = "sha256:255538574d6cb6d0a79a17ec8bc0d30985913b87513a01cce8bcdb6b4c44d0e2", size = 30869, upload-time = "2025-09-24T05:25:28.912Z" },][[package]]14 unmodified lines{ url = "https://files.pythonhosted.org/packages/51/c7/b64cae5dba3a1b138d7123ec36bb5ccd39d39939f18454407e5468f4763f/fsspec-2025.12.0-py3-none-any.whl", hash = "sha256:8bf1fe301b7d8acfa6e8571e3b1c3d158f909666642431cc78a1b7b4dbc5ec5b", size = 201422, upload-time = "2025-12-03T15:23:41.434Z" },][[package]]name = "google-auth"version = "2.45.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "cachetools" },{ name = "pyasn1-modules" },{ name = "rsa" },]sdist = { url = "https://files.pythonhosted.org/packages/e5/00/3c794502a8b892c404b2dea5b3650eb21bfc7069612fbfd15c7f17c1cb0d/google_auth-2.45.0.tar.gz", hash = "sha256:90d3f41b6b72ea72dd9811e765699ee491ab24139f34ebf1ca2b9cc0c38708f3", size = 320708, upload-time = "2025-12-15T22:58:42.889Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/c6/97/451d55e05487a5cd6279a01a7e34921858b16f7dc8aa38a2c684743cd2b3/google_auth-2.45.0-py2.py3-none-any.whl", hash = "sha256:82344e86dc00410ef5382d99be677c6043d72e502b625aa4f4afa0bdacca0f36", size = 233312, upload-time = "2025-12-15T22:58:40.777Z" },][[package]]name = "googleapis-common-protos"version = "1.72.0"121 unmodified lines[[package]]name = "grpcio"version = "1.76.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "typing-extensions" },]sdist = { url = "https://files.pythonhosted.org/packages/b6/e0/318c1ce3ae5a17894d5791e87aea147587c9e702f24122cc7a5c8bbaeeb1/grpcio-1.76.0.tar.gz", hash = "sha256:7be78388d6da1a25c0d5ec506523db58b18be22d9c37d8d3a32c08be4987bd73", size = 12785182, upload-time = "2025-10-21T16:23:12.106Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/a0/00/8163a1beeb6971f66b4bbe6ac9457b97948beba8dd2fc8e1281dce7f79ec/grpcio-1.76.0-cp311-cp311-linux_armv7l.whl", hash = "sha256:2e1743fbd7f5fa713a1b0a8ac8ebabf0ec980b5d8809ec358d488e273b9cf02a", size = 5843567, upload-time = "2025-10-21T16:20:52.829Z" },{ url = "https://files.pythonhosted.org/packages/10/c1/934202f5cf335e6d852530ce14ddb0fef21be612ba9ecbbcbd4d748ca32d/grpcio-1.76.0-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:a8c2cf1209497cf659a667d7dea88985e834c24b7c3b605e6254cbb5076d985c", size = 11848017, upload-time = "2025-10-21T16:20:56.705Z" },{ url = "https://files.pythonhosted.org/packages/11/0b/8dec16b1863d74af6eb3543928600ec2195af49ca58b16334972f6775663/grpcio-1.76.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:08caea849a9d3c71a542827d6df9d5a69067b0a1efbea8a855633ff5d9571465", size = 6412027, upload-time = "2025-10-21T16:20:59.3Z" },{ url = "https://files.pythonhosted.org/packages/d7/64/7b9e6e7ab910bea9d46f2c090380bab274a0b91fb0a2fe9b0cd399fffa12/grpcio-1.76.0-cp311-cp311-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:f0e34c2079d47ae9f6188211db9e777c619a21d4faba6977774e8fa43b085e48", size = 7075913, upload-time = "2025-10-21T16:21:01.645Z" },{ url = "https://files.pythonhosted.org/packages/68/86/093c46e9546073cefa789bd76d44c5cb2abc824ca62af0c18be590ff13ba/grpcio-1.76.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:8843114c0cfce61b40ad48df65abcfc00d4dba82eae8718fab5352390848c5da", size = 6615417, upload-time = "2025-10-21T16:21:03.844Z" },{ url = "https://files.pythonhosted.org/packages/f7/b6/5709a3a68500a9c03da6fb71740dcdd5ef245e39266461a03f31a57036d8/grpcio-1.76.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8eddfb4d203a237da6f3cc8a540dad0517d274b5a1e9e636fd8d2c79b5c1d397", size = 7199683, upload-time = "2025-10-21T16:21:06.195Z" },{ url = "https://files.pythonhosted.org/packages/91/d3/4b1f2bf16ed52ce0b508161df3a2d186e4935379a159a834cb4a7d687429/grpcio-1.76.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:32483fe2aab2c3794101c2a159070584e5db11d0aa091b2c0ea9c4fc43d0d749", size = 8163109, upload-time = "2025-10-21T16:21:08.498Z" },{ url = "https://files.pythonhosted.org/packages/5c/61/d9043f95f5f4cf085ac5dd6137b469d41befb04bd80280952ffa2a4c3f12/grpcio-1.76.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:dcfe41187da8992c5f40aa8c5ec086fa3672834d2be57a32384c08d5a05b4c00", size = 7626676, upload-time = "2025-10-21T16:21:10.693Z" },{ url = "https://files.pythonhosted.org/packages/36/95/fd9a5152ca02d8881e4dd419cdd790e11805979f499a2e5b96488b85cf27/grpcio-1.76.0-cp311-cp311-win32.whl", hash = "sha256:2107b0c024d1b35f4083f11245c0e23846ae64d02f40b2b226684840260ed054", size = 3997688, upload-time = "2025-10-21T16:21:12.746Z" },{ url = "https://files.pythonhosted.org/packages/60/9c/5c359c8d4c9176cfa3c61ecd4efe5affe1f38d9bae81e81ac7186b4c9cc8/grpcio-1.76.0-cp311-cp311-win_amd64.whl", hash = "sha256:522175aba7af9113c48ec10cc471b9b9bd4f6ceb36aeb4544a8e2c80ed9d252d", size = 4709315, upload-time = "2025-10-21T16:21:15.26Z" },{ url = "https://files.pythonhosted.org/packages/bf/05/8e29121994b8d959ffa0afd28996d452f291b48cfc0875619de0bde2c50c/grpcio-1.76.0-cp312-cp312-linux_armv7l.whl", hash = "sha256:81fd9652b37b36f16138611c7e884eb82e0cec137c40d3ef7c3f9b3ed00f6ed8", size = 5799718, upload-time = "2025-10-21T16:21:17.939Z" },{ url = "https://files.pythonhosted.org/packages/d9/75/11d0e66b3cdf998c996489581bdad8900db79ebd83513e45c19548f1cba4/grpcio-1.76.0-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:04bbe1bfe3a68bbfd4e52402ab7d4eb59d72d02647ae2042204326cf4bbad280", size = 11825627, upload-time = "2025-10-21T16:21:20.466Z" },{ url = "https://files.pythonhosted.org/packages/28/50/2f0aa0498bc188048f5d9504dcc5c2c24f2eb1a9337cd0fa09a61a2e75f0/grpcio-1.76.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d388087771c837cdb6515539f43b9d4bf0b0f23593a24054ac16f7a960be16f4", size = 6359167, upload-time = "2025-10-21T16:21:23.122Z" },{ url = "https://files.pythonhosted.org/packages/66/e5/bbf0bb97d29ede1d59d6588af40018cfc345b17ce979b7b45424628dc8bb/grpcio-1.76.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:9f8f757bebaaea112c00dba718fc0d3260052ce714e25804a03f93f5d1c6cc11", size = 7044267, upload-time = "2025-10-21T16:21:25.995Z" },{ url = "https://files.pythonhosted.org/packages/f5/86/f6ec2164f743d9609691115ae8ece098c76b894ebe4f7c94a655c6b03e98/grpcio-1.76.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:980a846182ce88c4f2f7e2c22c56aefd515daeb36149d1c897f83cf57999e0b6", size = 6573963, upload-time = "2025-10-21T16:21:28.631Z" },{ url = "https://files.pythonhosted.org/packages/60/bc/8d9d0d8505feccfdf38a766d262c71e73639c165b311c9457208b56d92ae/grpcio-1.76.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f92f88e6c033db65a5ae3d97905c8fea9c725b63e28d5a75cb73b49bda5024d8", size = 7164484, upload-time = "2025-10-21T16:21:30.837Z" },{ url = "https://files.pythonhosted.org/packages/67/e6/5d6c2fc10b95edf6df9b8f19cf10a34263b7fd48493936fffd5085521292/grpcio-1.76.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:4baf3cbe2f0be3289eb68ac8ae771156971848bb8aaff60bad42005539431980", size = 8127777, upload-time = "2025-10-21T16:21:33.577Z" },{ url = "https://files.pythonhosted.org/packages/3f/c8/dce8ff21c86abe025efe304d9e31fdb0deaaa3b502b6a78141080f206da0/grpcio-1.76.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:615ba64c208aaceb5ec83bfdce7728b80bfeb8be97562944836a7a0a9647d882", size = 7594014, upload-time = "2025-10-21T16:21:41.882Z" },{ url = "https://files.pythonhosted.org/packages/e0/42/ad28191ebf983a5d0ecef90bab66baa5a6b18f2bfdef9d0a63b1973d9f75/grpcio-1.76.0-cp312-cp312-win32.whl", hash = "sha256:45d59a649a82df5718fd9527ce775fd66d1af35e6d31abdcdc906a49c6822958", size = 3984750, upload-time = "2025-10-21T16:21:44.006Z" },{ url = "https://files.pythonhosted.org/packages/9e/00/7bd478cbb851c04a48baccaa49b75abaa8e4122f7d86da797500cccdd771/grpcio-1.76.0-cp312-cp312-win_amd64.whl", hash = "sha256:c088e7a90b6017307f423efbb9d1ba97a22aa2170876223f9709e9d1de0b5347", size = 4704003, upload-time = "2025-10-21T16:21:46.244Z" },{ url = "https://files.pythonhosted.org/packages/fc/ed/71467ab770effc9e8cef5f2e7388beb2be26ed642d567697bb103a790c72/grpcio-1.76.0-cp313-cp313-linux_armv7l.whl", hash = "sha256:26ef06c73eb53267c2b319f43e6634c7556ea37672029241a056629af27c10e2", size = 5807716, upload-time = "2025-10-21T16:21:48.475Z" },{ url = "https://files.pythonhosted.org/packages/2c/85/c6ed56f9817fab03fa8a111ca91469941fb514e3e3ce6d793cb8f1e1347b/grpcio-1.76.0-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:45e0111e73f43f735d70786557dc38141185072d7ff8dc1829d6a77ac1471468", size = 11821522, upload-time = "2025-10-21T16:21:51.142Z" },{ url = "https://files.pythonhosted.org/packages/ac/31/2b8a235ab40c39cbc141ef647f8a6eb7b0028f023015a4842933bc0d6831/grpcio-1.76.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:83d57312a58dcfe2a3a0f9d1389b299438909a02db60e2f2ea2ae2d8034909d3", size = 6362558, upload-time = "2025-10-21T16:21:54.213Z" },{ url = "https://files.pythonhosted.org/packages/bd/64/9784eab483358e08847498ee56faf8ff6ea8e0a4592568d9f68edc97e9e9/grpcio-1.76.0-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:3e2a27c89eb9ac3d81ec8835e12414d73536c6e620355d65102503064a4ed6eb", size = 7049990, upload-time = "2025-10-21T16:21:56.476Z" },{ url = "https://files.pythonhosted.org/packages/2b/94/8c12319a6369434e7a184b987e8e9f3b49a114c489b8315f029e24de4837/grpcio-1.76.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:61f69297cba3950a524f61c7c8ee12e55c486cb5f7db47ff9dcee33da6f0d3ae", size = 6575387, upload-time = "2025-10-21T16:21:59.051Z" },{ url = "https://files.pythonhosted.org/packages/15/0f/f12c32b03f731f4a6242f771f63039df182c8b8e2cf8075b245b409259d4/grpcio-1.76.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6a15c17af8839b6801d554263c546c69c4d7718ad4321e3166175b37eaacca77", size = 7166668, upload-time = "2025-10-21T16:22:02.049Z" },{ url = "https://files.pythonhosted.org/packages/ff/2d/3ec9ce0c2b1d92dd59d1c3264aaec9f0f7c817d6e8ac683b97198a36ed5a/grpcio-1.76.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:25a18e9810fbc7e7f03ec2516addc116a957f8cbb8cbc95ccc80faa072743d03", size = 8124928, upload-time = "2025-10-21T16:22:04.984Z" },{ url = "https://files.pythonhosted.org/packages/1a/74/fd3317be5672f4856bcdd1a9e7b5e17554692d3db9a3b273879dc02d657d/grpcio-1.76.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:931091142fd8cc14edccc0845a79248bc155425eee9a98b2db2ea4f00a235a42", size = 7589983, upload-time = "2025-10-21T16:22:07.881Z" },{ url = "https://files.pythonhosted.org/packages/45/bb/ca038cf420f405971f19821c8c15bcbc875505f6ffadafe9ffd77871dc4c/grpcio-1.76.0-cp313-cp313-win32.whl", hash = "sha256:5e8571632780e08526f118f74170ad8d50fb0a48c23a746bef2a6ebade3abd6f", size = 3984727, upload-time = "2025-10-21T16:22:10.032Z" },{ url = "https://files.pythonhosted.org/packages/41/80/84087dc56437ced7cdd4b13d7875e7439a52a261e3ab4e06488ba6173b0a/grpcio-1.76.0-cp313-cp313-win_amd64.whl", hash = "sha256:f9f7bd5faab55f47231ad8dba7787866b69f5e93bc306e3915606779bbfb4ba8", size = 4702799, upload-time = "2025-10-21T16:22:12.709Z" },][[package]]103 unmodified lines{ url = "https://files.pythonhosted.org/packages/cb/bd/1a875e0d592d447cbc02805fd3fe0f497714d6a2583f59d14fa9ebad96eb/huggingface_hub-0.36.0-py3-none-any.whl", hash = "sha256:7bcc9ad17d5b3f07b57c78e79d527102d08313caa278a641993acddcb894548d", size = 566094, upload-time = "2025-10-23T12:11:59.557Z" },][[package]]name = "humanfriendly"version = "10.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "pyreadline3", marker = "sys_platform == 'win32'" },]sdist = { url = "https://files.pythonhosted.org/packages/cc/3f/2c29224acb2e2df4d2046e4c73ee2662023c58ff5b113c4c1adac0886c43/humanfriendly-10.0.tar.gz", hash = "sha256:6b0b831ce8f15f7300721aa49829fc4e83921a9a301cc7f606be6686a2288ddc", size = 360702, upload-time = "2021-09-17T21:40:43.31Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/f0/0f/310fb31e39e2d734ccaa2c0fb981ee41f7bd5056ce9bc29b2248bd569169/humanfriendly-10.0-py2.py3-none-any.whl", hash = "sha256:1697e1a8a8f550fd43c2865cd84542fc175a61dcb779b6fee18cf6b6ccba1477", size = 86794, upload-time = "2021-09-17T21:40:39.897Z" },][[package]]name = "idna"version = "3.11"5 unmodified lines[[package]]name = "importlib-metadata"version = "8.7.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "zipp" },]sdist = { url = "https://files.pythonhosted.org/packages/76/66/650a33bd90f786193e4de4b3ad86ea60b53c89b669a5c7be931fac31cdb0/importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000", size = 56641, upload-time = "2025-04-27T15:29:01.736Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/20/b0/36bd937216ec521246249be3bf9855081de4c5e06a0c9b4219dbeda50373/importlib_metadata-8.7.0-py3-none-any.whl", hash = "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd", size = 27656, upload-time = "2025-04-27T15:29:00.214Z" },][[package]]413 unmodified lines[[package]]name = "kubernetes"version = "34.1.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "certifi" },{ name = "durationpy" },{ name = "google-auth" },{ name = "python-dateutil" },{ name = "pyyaml" },{ name = "requests" },2 unmodified lines{ name = "urllib3" },{ name = "websocket-client" },]sdist = { url = "https://files.pythonhosted.org/packages/ef/55/3f880ef65f559cbed44a9aa20d3bdbc219a2c3a3bac4a30a513029b03ee9/kubernetes-34.1.0.tar.gz", hash = "sha256:8fe8edb0b5d290a2f3ac06596b23f87c658977d46b5f8df9d0f4ea83d0003912", size = 1083771, upload-time = "2025-09-29T20:23:49.283Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/ca/ec/65f7d563aa4a62dd58777e8f6aa882f15db53b14eb29aba0c28a20f7eb26/kubernetes-34.1.0-py2.py3-none-any.whl", hash = "sha256:bffba2272534e224e6a7a74d582deb0b545b7c9879d2cd9e4aae9481d1f2cc2a", size = 2008380, upload-time = "2025-09-29T20:23:47.684Z" },][[package]]461 unmodified lines[[package]]name = "onnxruntime"version = "1.23.2"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "coloredlogs" },{ name = "flatbuffers" },{ name = "numpy" },{ name = "packaging" },1 unmodified line{ name = "sympy" },]wheels = [{ url = "https://files.pythonhosted.org/packages/44/be/467b00f09061572f022ffd17e49e49e5a7a789056bad95b54dfd3bee73ff/onnxruntime-1.23.2-cp311-cp311-macosx_13_0_arm64.whl", hash = "sha256:6f91d2c9b0965e86827a5ba01531d5b669770b01775b23199565d6c1f136616c", size = 17196113, upload-time = "2025-10-22T03:47:33.526Z" },{ url = "https://files.pythonhosted.org/packages/9f/a8/3c23a8f75f93122d2b3410bfb74d06d0f8da4ac663185f91866b03f7da1b/onnxruntime-1.23.2-cp311-cp311-macosx_13_0_x86_64.whl", hash = "sha256:87d8b6eaf0fbeb6835a60a4265fde7a3b60157cf1b2764773ac47237b4d48612", size = 19153857, upload-time = "2025-10-22T03:46:37.578Z" },{ url = "https://files.pythonhosted.org/packages/3f/d8/506eed9af03d86f8db4880a4c47cd0dffee973ef7e4f4cff9f1d4bcf7d22/onnxruntime-1.23.2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bbfd2fca76c855317568c1b36a885ddea2272c13cb0e395002c402f2360429a6", size = 15220095, upload-time = "2025-10-22T03:46:24.769Z" },{ url = "https://files.pythonhosted.org/packages/e9/80/113381ba832d5e777accedc6cb41d10f9eca82321ae31ebb6bcede530cea/onnxruntime-1.23.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:da44b99206e77734c5819aa2142c69e64f3b46edc3bd314f6a45a932defc0b3e", size = 17372080, upload-time = "2025-10-22T03:47:00.265Z" },{ url = "https://files.pythonhosted.org/packages/3a/db/1b4a62e23183a0c3fe441782462c0ede9a2a65c6bbffb9582fab7c7a0d38/onnxruntime-1.23.2-cp311-cp311-win_amd64.whl", hash = "sha256:902c756d8b633ce0dedd889b7c08459433fbcf35e9c38d1c03ddc020f0648c6e", size = 13468349, upload-time = "2025-10-22T03:47:25.783Z" },{ url = "https://files.pythonhosted.org/packages/1b/9e/f748cd64161213adeef83d0cb16cb8ace1e62fa501033acdd9f9341fff57/onnxruntime-1.23.2-cp312-cp312-macosx_13_0_arm64.whl", hash = "sha256:b8f029a6b98d3cf5be564d52802bb50a8489ab73409fa9db0bf583eabb7c2321", size = 17195929, upload-time = "2025-10-22T03:47:36.24Z" },{ url = "https://files.pythonhosted.org/packages/91/9d/a81aafd899b900101988ead7fb14974c8a58695338ab6a0f3d6b0100f30b/onnxruntime-1.23.2-cp312-cp312-macosx_13_0_x86_64.whl", hash = "sha256:218295a8acae83905f6f1aed8cacb8e3eb3bd7513a13fe4ba3b2664a19fc4a6b", size = 19157705, upload-time = "2025-10-22T03:46:40.415Z" },{ url = "https://files.pythonhosted.org/packages/3c/35/4e40f2fba272a6698d62be2cd21ddc3675edfc1a4b9ddefcc4648f115315/onnxruntime-1.23.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:76ff670550dc23e58ea9bc53b5149b99a44e63b34b524f7b8547469aaa0dcb8c", size = 15226915, upload-time = "2025-10-22T03:46:27.773Z" },{ url = "https://files.pythonhosted.org/packages/ef/88/9cc25d2bafe6bc0d4d3c1db3ade98196d5b355c0b273e6a5dc09c5d5d0d5/onnxruntime-1.23.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f9b4ae77f8e3c9bee50c27bc1beede83f786fe1d52e99ac85aa8d65a01e9b77", size = 17382649, upload-time = "2025-10-22T03:47:02.782Z" },{ url = "https://files.pythonhosted.org/packages/c0/b4/569d298f9fc4d286c11c45e85d9ffa9e877af12ace98af8cab52396e8f46/onnxruntime-1.23.2-cp312-cp312-win_amd64.whl", hash = "sha256:25de5214923ce941a3523739d34a520aac30f21e631de53bba9174dc9c004435", size = 13470528, upload-time = "2025-10-22T03:47:28.106Z" },{ url = "https://files.pythonhosted.org/packages/3d/41/fba0cabccecefe4a1b5fc8020c44febb334637f133acefc7ec492029dd2c/onnxruntime-1.23.2-cp313-cp313-macosx_13_0_arm64.whl", hash = "sha256:2ff531ad8496281b4297f32b83b01cdd719617e2351ffe0dba5684fb283afa1f", size = 17196337, upload-time = "2025-10-22T03:46:35.168Z" },{ url = "https://files.pythonhosted.org/packages/fe/f9/2d49ca491c6a986acce9f1d1d5fc2099108958cc1710c28e89a032c9cfe9/onnxruntime-1.23.2-cp313-cp313-macosx_13_0_x86_64.whl", hash = "sha256:162f4ca894ec3de1a6fd53589e511e06ecdc3ff646849b62a9da7489dee9ce95", size = 19157691, upload-time = "2025-10-22T03:46:43.518Z" },{ url = "https://files.pythonhosted.org/packages/1c/a1/428ee29c6eaf09a6f6be56f836213f104618fb35ac6cc586ff0f477263eb/onnxruntime-1.23.2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:45d127d6e1e9b99d1ebeae9bcd8f98617a812f53f46699eafeb976275744826b", size = 15226898, upload-time = "2025-10-22T03:46:30.039Z" },{ url = "https://files.pythonhosted.org/packages/f2/2b/b57c8a2466a3126dbe0a792f56ad7290949b02f47b86216cd47d857e4b77/onnxruntime-1.23.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8bace4e0d46480fbeeb7bbe1ffe1f080e6663a42d1086ff95c1551f2d39e7872", size = 17382518, upload-time = "2025-10-22T03:47:05.407Z" },{ url = "https://files.pythonhosted.org/packages/4a/93/aba75358133b3a941d736816dd392f687e7eab77215a6e429879080b76b6/onnxruntime-1.23.2-cp313-cp313-win_amd64.whl", hash = "sha256:1f9cc0a55349c584f083c1c076e611a7c35d5b867d5d6e6d6c823bf821978088", size = 13470276, upload-time = "2025-10-22T03:47:31.193Z" },{ url = "https://files.pythonhosted.org/packages/7c/3d/6830fa61c69ca8e905f237001dbfc01689a4e4ab06147020a4518318881f/onnxruntime-1.23.2-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9d2385e774f46ac38f02b3a91a91e30263d41b2f1f4f26ae34805b2a9ddef466", size = 15229610, upload-time = "2025-10-22T03:46:32.239Z" },{ url = "https://files.pythonhosted.org/packages/b6/ca/862b1e7a639460f0ca25fd5b6135fb42cf9deea86d398a92e44dfda2279d/onnxruntime-1.23.2-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e2b9233c4947907fd1818d0e581c049c41ccc39b2856cc942ff6d26317cee145", size = 17394184, upload-time = "2025-10-22T03:47:08.127Z" },][[package]]374 unmodified lines[[package]]name = "protobuf"version = "6.33.2"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/34/44/e49ecff446afeec9d1a66d6bbf9adc21e3c7cea7803a920ca3773379d4f6/protobuf-6.33.2.tar.gz", hash = "sha256:56dc370c91fbb8ac85bc13582c9e373569668a290aa2e66a590c2a0d35ddb9e4", size = 444296, upload-time = "2025-12-06T00:17:53.311Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/bc/91/1e3a34881a88697a7354ffd177e8746e97a722e5e8db101544b47e84afb1/protobuf-6.33.2-cp310-abi3-win32.whl", hash = "sha256:87eb388bd2d0f78febd8f4c8779c79247b26a5befad525008e49a6955787ff3d", size = 425603, upload-time = "2025-12-06T00:17:41.114Z" },{ url = "https://files.pythonhosted.org/packages/64/20/4d50191997e917ae13ad0a235c8b42d8c1ab9c3e6fd455ca16d416944355/protobuf-6.33.2-cp310-abi3-win_amd64.whl", hash = "sha256:fc2a0e8b05b180e5fc0dd1559fe8ebdae21a27e81ac77728fb6c42b12c7419b4", size = 436930, upload-time = "2025-12-06T00:17:43.278Z" },{ url = "https://files.pythonhosted.org/packages/b2/ca/7e485da88ba45c920fb3f50ae78de29ab925d9e54ef0de678306abfbb497/protobuf-6.33.2-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:d9b19771ca75935b3a4422957bc518b0cecb978b31d1dd12037b088f6bcc0e43", size = 427621, upload-time = "2025-12-06T00:17:44.445Z" },{ url = "https://files.pythonhosted.org/packages/7d/4f/f743761e41d3b2b2566748eb76bbff2b43e14d5fcab694f494a16458b05f/protobuf-6.33.2-cp39-abi3-manylinux2014_aarch64.whl", hash = "sha256:b5d3b5625192214066d99b2b605f5783483575656784de223f00a8d00754fc0e", size = 324460, upload-time = "2025-12-06T00:17:45.678Z" },{ url = "https://files.pythonhosted.org/packages/b1/fa/26468d00a92824020f6f2090d827078c09c9c587e34cbfd2d0c7911221f8/protobuf-6.33.2-cp39-abi3-manylinux2014_s390x.whl", hash = "sha256:8cd7640aee0b7828b6d03ae518b5b4806fdfc1afe8de82f79c3454f8aef29872", size = 339168, upload-time = "2025-12-06T00:17:46.813Z" },{ url = "https://files.pythonhosted.org/packages/56/13/333b8f421738f149d4fe5e49553bc2a2ab75235486259f689b4b91f96cec/protobuf-6.33.2-cp39-abi3-manylinux2014_x86_64.whl", hash = "sha256:1f8017c48c07ec5859106533b682260ba3d7c5567b1ca1f24297ce03384d1b4f", size = 323270, upload-time = "2025-12-06T00:17:48.253Z" },{ url = "https://files.pythonhosted.org/packages/0e/15/4f02896cc3df04fc465010a4c6a0cd89810f54617a32a70ef531ed75d61c/protobuf-6.33.2-py3-none-any.whl", hash = "sha256:7636aad9bb01768870266de5dc009de2d1b936771b38a793f73cbbf279c91c5c", size = 170501, upload-time = "2025-12-06T00:17:52.211Z" },][[package]]75 unmodified lines{ url = "https://files.pythonhosted.org/packages/8e/37/efad0257dc6e593a18957422533ff0f87ede7c9c6ea010a2177d738fb82f/pure_eval-0.2.3-py3-none-any.whl", hash = "sha256:1db8e35b67b3d218d818ae653e27f06c3aa420901fa7b081ca98cbedc874e0d0", size = 11842, upload-time = "2024-07-21T12:58:20.04Z" },][[package]]name = "pyasn1"version = "0.6.1"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/ba/e9/01f1a64245b89f039897cb0130016d79f77d52669aae6ee7b159a6c4c018/pyasn1-0.6.1.tar.gz", hash = "sha256:6f580d2bdd84365380830acf45550f2511469f673cb4a5ae3857a3170128b034", size = 145322, upload-time = "2024-09-10T22:41:42.55Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/c8/f1/d6a797abb14f6283c0ddff96bbdd46937f64122b8c925cab503dd37f8214/pyasn1-0.6.1-py3-none-any.whl", hash = "sha256:0d632f46f2ba09143da3a8afe9e33fb6f92fa2320ab7e886e2d0f7672af84629", size = 83135, upload-time = "2024-09-11T16:00:36.122Z" },][[package]]name = "pyasn1-modules"version = "0.4.2"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "pyasn1" },]sdist = { url = "https://files.pythonhosted.org/packages/e9/e6/78ebbb10a8c8e4b61a59249394a4a594c1a7af95593dc933a349c8d00964/pyasn1_modules-0.4.2.tar.gz", hash = "sha256:677091de870a80aae844b1ca6134f54652fa2c8c5a52aa396440ac3106e941e6", size = 307892, upload-time = "2025-03-28T02:41:22.17Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/47/8d/d529b5d697919ba8c11ad626e835d4039be708a35b0d22de83a269a6682c/pyasn1_modules-0.4.2-py3-none-any.whl", hash = "sha256:29253a9207ce32b64c3ac6600edc75368f98473906e8fd1043bd6b5b1de2c14a", size = 181259, upload-time = "2025-03-28T02:41:19.028Z" },][[package]]name = "pybase64"version = "1.4.3"244 unmodified lines[[package]]name = "pypika"version = "0.48.9"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/c7/2c/94ed7b91db81d61d7096ac8f2d325ec562fc75e35f3baea8749c85b28784/PyPika-0.48.9.tar.gz", hash = "sha256:838836a61747e7c8380cd1b7ff638694b7a7335345d0f559b04b2cd832ad5378", size = 67259, upload-time = "2022-03-15T11:22:57.066Z" }[[package]]name = "pyproject-hooks"4 unmodified lines{ url = "https://files.pythonhosted.org/packages/bd/24/12818598c362d7f300f18e74db45963dbcb85150324092410c8b49405e42/pyproject_hooks-1.2.0-py3-none-any.whl", hash = "sha256:9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913", size = 10216, upload-time = "2024-09-29T09:24:11.978Z" },][[package]]name = "pyreadline3"version = "3.5.4"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/0f/49/4cea918a08f02817aabae639e3d0ac046fef9f9180518a3ad394e22da148/pyreadline3-3.5.4.tar.gz", hash = "sha256:8d57d53039a1c75adba8e50dd3d992b28143480816187ea5efbd5c78e6c885b7", size = 99839, upload-time = "2024-09-19T02:40:10.062Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/5a/dc/491b7661614ab97483abf2056be1deee4dc2490ecbf7bff9ab5cdbac86e1/pyreadline3-3.5.4-py3-none-any.whl", hash = "sha256:eaf8e6cc3c49bcccf145fc6067ba8643d1df34d604a1ec0eccbf7a18e6d3fae6", size = 83178, upload-time = "2024-09-19T02:40:08.598Z" },][[package]]name = "pytest"version = "9.0.2"477 unmodified lines{ url = "https://files.pythonhosted.org/packages/d1/b7/b95708304cd49b7b6f82fdd039f1748b66ec2b21d6a45180910802f1abf1/rpds_py-0.30.0-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:ac37f9f516c51e5753f27dfdef11a88330f04de2d564be3991384b2f3535d02e", size = 562191, upload-time = "2025-11-30T20:24:36.853Z" },][[package]]name = "rsa"version = "4.9.1"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "pyasn1" },]sdist = { url = "https://files.pythonhosted.org/packages/da/8a/22b7beea3ee0d44b1916c0c1cb0ee3af23b700b6da9f04991899d0c555d4/rsa-4.9.1.tar.gz", hash = "sha256:e7bdbfdb5497da4c07dfd35530e1a902659db6ff241e39d9953cad06ebd0ae75", size = 29034, upload-time = "2025-04-16T09:51:18.218Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/64/8d/0133e4eb4beed9e425d9a98ed6e081a55d195481b7632472be1af08d2f6b/rsa-4.9.1-py3-none-any.whl", hash = "sha256:68635866661c6836b8d39430f97a996acbd61bfa49406748ea243539fe239762", size = 34696, upload-time = "2025-04-16T09:51:17.142Z" },][[package]]name = "safehttpx"version = "0.1.7"53 unmodified lines54555657585960314 unmodified lines375376377378379380381382383384385386387388389390112 unmodified lines50350450550650750850924 unmodified lines53453553653753853954054154254354454554617 unmodified lines564565566567568569255 unmodified lines82582682782882983083183283383414 unmodified lines849850851852853854121 unmodified lines9769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018103 unmodified lines1122112311241125112611275 unmodified lines11331134113511361137113811391140114111421143114411451146413 unmodified lines156015611562156315641565156615671568156915702 unmodified lines157315741575157615771578157915801581461 unmodified lines2043204420452046204720482049205020511 unmodified line20532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075374 unmodified lines2450245124522453245424552456245724582459246024612462246324642465246675 unmodified lines254225432544254525462547244 unmodified lines2792279327942795279627972798279928002801280228034 unmodified lines280828092810281128122813477 unmodified lines32913292329332943295329653 unmodified lines[package.metadata]requires-dist = [{ name = "chromadb", specifier = ">=1.5.2" },{ name = "fastapi", extras = ["all"], specifier = ">=0.122.0" },{ name = "gradio", specifier = ">=6.2.0" },{ name = "langchain", specifier = ">=1.1.3" },314 unmodified lines[[package]]name = "build"version = "1.4.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "colorama", marker = "(os_name == 'nt' and platform_machine != 'aarch64' and sys_platform == 'linux') or (os_name == 'nt' and platform_python_implementation != 'CPython' and sys_platform == 'linux') or (os_name == 'nt' and sys_platform != 'darwin' and sys_platform != 'linux')" },{ name = "packaging" },{ name = "pyproject-hooks" },]sdist = { url = "https://files.pythonhosted.org/packages/42/18/94eaffda7b329535d91f00fe605ab1f1e5cd68b2074d03f255c7d250687d/build-1.4.0.tar.gz", hash = "sha256:f1b91b925aa322be454f8330c6fb48b465da993d1e7e7e6fa35027ec49f3c936", size = 50054, upload-time = "2026-01-08T16:41:47.696Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/c5/0d/84a4380f930db0010168e0aa7b7a8fed9ba1835a8fbb1472bc6d0201d529/build-1.4.0-py3-none-any.whl", hash = "sha256:6a07c1b8eb6f2b311b96fcbdbce5dab5fe637ffda0fd83c9cac622e927501596", size = 24141, upload-time = "2026-01-08T16:41:46.453Z" },][[package]]112 unmodified lines[[package]]name = "chromadb"version = "1.5.2"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "bcrypt" },24 unmodified lines{ name = "typing-extensions" },{ name = "uvicorn", extra = ["standard"] },]sdist = { url = "https://files.pythonhosted.org/packages/9e/48/aa5906f9f817b73c9e87e085d3a64705d91b7bb4f76f4649b9379baea980/chromadb-1.5.2.tar.gz", hash = "sha256:4fc3535a0fcd45343f93d298591882f68e659f24ed319aef14094b168105f956", size = 2386235, upload-time = "2026-02-27T19:49:34.167Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/6b/3b/36989e7ebfa2ee10a85deacd423989b07f9e3bd176846863ace1305e9460/chromadb-1.5.2-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:a898ab200f9a22a16751eed5444dac330f1f82184264e16d5420e41e0afe63e4", size = 20733964, upload-time = "2026-02-27T19:49:31.683Z" },{ url = "https://files.pythonhosted.org/packages/85/b3/db3e5a8a47106d339c3e109e73859647969a81e9c54ca15bc6dde6685c1e/chromadb-1.5.2-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:8e6a12adb34bf441f8cc368b6460fbc9e14bee5cf926f34e752da759d68dec56", size = 19993688, upload-time = "2026-02-27T19:49:28.5Z" },{ url = "https://files.pythonhosted.org/packages/c2/88/0a9b6dddac3097f321ec8b057d09a61b4edb2b42b891fce7c2bfd01cd4c3/chromadb-1.5.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b533db30303ce5a82856ded8897c3cafd3160e1f2dccf5473d0bfdee49a159b3", size = 20642212, upload-time = "2026-02-27T19:49:22.467Z" },{ url = "https://files.pythonhosted.org/packages/ae/74/b8cd9d9bc72c545a579fd1f7bb44558a801ed5f5bab164a25eea16d51ad9/chromadb-1.5.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e48e5b0f300d6f709446a5d9299614e3b6bca997772d810e1298b76b0c4e7dbb", size = 21529269, upload-time = "2026-02-27T19:49:25.699Z" },{ url = "https://files.pythonhosted.org/packages/e8/96/fa83f81f8b618ffca7527915f99cf054c6f8bd272bf3cf5c0616757083ba/chromadb-1.5.2-cp39-abi3-win_amd64.whl", hash = "sha256:042e746ee0c9db34eef2723c4dca30197ded3bf9d27846d996fd51715ec7b0e3", size = 21863829, upload-time = "2026-02-27T19:49:36.422Z" },][[package]]17 unmodified lines{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },][[package]]name = "comm"version = "0.2.3"255 unmodified lines[[package]]name = "flatbuffers"version = "25.12.19"source = { registry = "https://pypi.org/simple" }wheels = [{ url = "https://files.pythonhosted.org/packages/e8/2d/d2a548598be01649e2d46231d151a6c56d10b964d94043a335ae56ea2d92/flatbuffers-25.12.19-py2.py3-none-any.whl", hash = "sha256:7634f50c427838bb021c2d66a3d1168e9d199b0607e6329399f04846d42e20b4", size = 26661, upload-time = "2025-12-19T23:16:13.622Z" },][[package]]14 unmodified lines{ url = "https://files.pythonhosted.org/packages/51/c7/b64cae5dba3a1b138d7123ec36bb5ccd39d39939f18454407e5468f4763f/fsspec-2025.12.0-py3-none-any.whl", hash = "sha256:8bf1fe301b7d8acfa6e8571e3b1c3d158f909666642431cc78a1b7b4dbc5ec5b", size = 201422, upload-time = "2025-12-03T15:23:41.434Z" },][[package]]name = "googleapis-common-protos"version = "1.72.0"121 unmodified lines[[package]]name = "grpcio"version = "1.78.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "typing-extensions" },]sdist = { url = "https://files.pythonhosted.org/packages/06/8a/3d098f35c143a89520e568e6539cc098fcd294495910e359889ce8741c84/grpcio-1.78.0.tar.gz", hash = "sha256:7382b95189546f375c174f53a5fa873cef91c4b8005faa05cc5b3beea9c4f1c5", size = 12852416, upload-time = "2026-02-06T09:57:18.093Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/86/c7/d0b780a29b0837bf4ca9580904dfb275c1fc321ded7897d620af7047ec57/grpcio-1.78.0-cp311-cp311-linux_armv7l.whl", hash = "sha256:2777b783f6c13b92bd7b716667452c329eefd646bfb3f2e9dabea2e05dbd34f6", size = 5951525, upload-time = "2026-02-06T09:55:01.989Z" },{ url = "https://files.pythonhosted.org/packages/c5/b1/96920bf2ee61df85a9503cb6f733fe711c0ff321a5a697d791b075673281/grpcio-1.78.0-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:9dca934f24c732750389ce49d638069c3892ad065df86cb465b3fa3012b70c9e", size = 11830418, upload-time = "2026-02-06T09:55:04.462Z" },{ url = "https://files.pythonhosted.org/packages/83/0c/7c1528f098aeb75a97de2bae18c530f56959fb7ad6c882db45d9884d6edc/grpcio-1.78.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:459ab414b35f4496138d0ecd735fed26f1318af5e52cb1efbc82a09f0d5aa911", size = 6524477, upload-time = "2026-02-06T09:55:07.111Z" },{ url = "https://files.pythonhosted.org/packages/8d/52/e7c1f3688f949058e19a011c4e0dec973da3d0ae5e033909677f967ae1f4/grpcio-1.78.0-cp311-cp311-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:082653eecbdf290e6e3e2c276ab2c54b9e7c299e07f4221872380312d8cf395e", size = 7198266, upload-time = "2026-02-06T09:55:10.016Z" },{ url = "https://files.pythonhosted.org/packages/e5/61/8ac32517c1e856677282c34f2e7812d6c328fa02b8f4067ab80e77fdc9c9/grpcio-1.78.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:85f93781028ec63f383f6bc90db785a016319c561cc11151fbb7b34e0d012303", size = 6730552, upload-time = "2026-02-06T09:55:12.207Z" },{ url = "https://files.pythonhosted.org/packages/bd/98/b8ee0158199250220734f620b12e4a345955ac7329cfd908d0bf0fda77f0/grpcio-1.78.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:f12857d24d98441af6a1d5c87442d624411db486f7ba12550b07788f74b67b04", size = 7304296, upload-time = "2026-02-06T09:55:15.044Z" },{ url = "https://files.pythonhosted.org/packages/bd/0f/7b72762e0d8840b58032a56fdbd02b78fc645b9fa993d71abf04edbc54f4/grpcio-1.78.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:5397fff416b79e4b284959642a4e95ac4b0f1ece82c9993658e0e477d40551ec", size = 8288298, upload-time = "2026-02-06T09:55:17.276Z" },{ url = "https://files.pythonhosted.org/packages/24/ae/ae4ce56bc5bb5caa3a486d60f5f6083ac3469228faa734362487176c15c5/grpcio-1.78.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:fbe6e89c7ffb48518384068321621b2a69cab509f58e40e4399fdd378fa6d074", size = 7730953, upload-time = "2026-02-06T09:55:19.545Z" },{ url = "https://files.pythonhosted.org/packages/b5/6e/8052e3a28eb6a820c372b2eb4b5e32d195c661e137d3eca94d534a4cfd8a/grpcio-1.78.0-cp311-cp311-win32.whl", hash = "sha256:6092beabe1966a3229f599d7088b38dfc8ffa1608b5b5cdda31e591e6500f856", size = 4076503, upload-time = "2026-02-06T09:55:21.521Z" },{ url = "https://files.pythonhosted.org/packages/08/62/f22c98c5265dfad327251fa2f840b591b1df5f5e15d88b19c18c86965b27/grpcio-1.78.0-cp311-cp311-win_amd64.whl", hash = "sha256:1afa62af6e23f88629f2b29ec9e52ec7c65a7176c1e0a83292b93c76ca882558", size = 4799767, upload-time = "2026-02-06T09:55:24.107Z" },{ url = "https://files.pythonhosted.org/packages/4e/f4/7384ed0178203d6074446b3c4f46c90a22ddf7ae0b3aee521627f54cfc2a/grpcio-1.78.0-cp312-cp312-linux_armv7l.whl", hash = "sha256:f9ab915a267fc47c7e88c387a3a28325b58c898e23d4995f765728f4e3dedb97", size = 5913985, upload-time = "2026-02-06T09:55:26.832Z" },{ url = "https://files.pythonhosted.org/packages/81/ed/be1caa25f06594463f685b3790b320f18aea49b33166f4141bfdc2bfb236/grpcio-1.78.0-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:3f8904a8165ab21e07e58bf3e30a73f4dffc7a1e0dbc32d51c61b5360d26f43e", size = 11811853, upload-time = "2026-02-06T09:55:29.224Z" },{ url = "https://files.pythonhosted.org/packages/24/a7/f06d151afc4e64b7e3cc3e872d331d011c279aaab02831e40a81c691fb65/grpcio-1.78.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:859b13906ce098c0b493af92142ad051bf64c7870fa58a123911c88606714996", size = 6475766, upload-time = "2026-02-06T09:55:31.825Z" },{ url = "https://files.pythonhosted.org/packages/8a/a8/4482922da832ec0082d0f2cc3a10976d84a7424707f25780b82814aafc0a/grpcio-1.78.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:b2342d87af32790f934a79c3112641e7b27d63c261b8b4395350dad43eff1dc7", size = 7170027, upload-time = "2026-02-06T09:55:34.7Z" },{ url = "https://files.pythonhosted.org/packages/54/bf/f4a3b9693e35d25b24b0b39fa46d7d8a3c439e0a3036c3451764678fec20/grpcio-1.78.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:12a771591ae40bc65ba67048fa52ef4f0e6db8279e595fd349f9dfddeef571f9", size = 6690766, upload-time = "2026-02-06T09:55:36.902Z" },{ url = "https://files.pythonhosted.org/packages/c7/b9/521875265cc99fe5ad4c5a17010018085cae2810a928bf15ebe7d8bcd9cc/grpcio-1.78.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:185dea0d5260cbb2d224c507bf2a5444d5abbb1fa3594c1ed7e4c709d5eb8383", size = 7266161, upload-time = "2026-02-06T09:55:39.824Z" },{ url = "https://files.pythonhosted.org/packages/05/86/296a82844fd40a4ad4a95f100b55044b4f817dece732bf686aea1a284147/grpcio-1.78.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:51b13f9aed9d59ee389ad666b8c2214cc87b5de258fa712f9ab05f922e3896c6", size = 8253303, upload-time = "2026-02-06T09:55:42.353Z" },{ url = "https://files.pythonhosted.org/packages/f3/e4/ea3c0caf5468537f27ad5aab92b681ed7cc0ef5f8c9196d3fd42c8c2286b/grpcio-1.78.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fd5f135b1bd58ab088930b3c613455796dfa0393626a6972663ccdda5b4ac6ce", size = 7698222, upload-time = "2026-02-06T09:55:44.629Z" },{ url = "https://files.pythonhosted.org/packages/d7/47/7f05f81e4bb6b831e93271fb12fd52ba7b319b5402cbc101d588f435df00/grpcio-1.78.0-cp312-cp312-win32.whl", hash = "sha256:94309f498bcc07e5a7d16089ab984d42ad96af1d94b5a4eb966a266d9fcabf68", size = 4066123, upload-time = "2026-02-06T09:55:47.644Z" },{ url = "https://files.pythonhosted.org/packages/ad/e7/d6914822c88aa2974dbbd10903d801a28a19ce9cd8bad7e694cbbcf61528/grpcio-1.78.0-cp312-cp312-win_amd64.whl", hash = "sha256:9566fe4ababbb2610c39190791e5b829869351d14369603702e890ef3ad2d06e", size = 4797657, upload-time = "2026-02-06T09:55:49.86Z" },{ url = "https://files.pythonhosted.org/packages/05/a9/8f75894993895f361ed8636cd9237f4ab39ef87fd30db17467235ed1c045/grpcio-1.78.0-cp313-cp313-linux_armv7l.whl", hash = "sha256:ce3a90455492bf8bfa38e56fbbe1dbd4f872a3d8eeaf7337dc3b1c8aa28c271b", size = 5920143, upload-time = "2026-02-06T09:55:52.035Z" },{ url = "https://files.pythonhosted.org/packages/55/06/0b78408e938ac424100100fd081189451b472236e8a3a1f6500390dc4954/grpcio-1.78.0-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:2bf5e2e163b356978b23652c4818ce4759d40f4712ee9ec5a83c4be6f8c23a3a", size = 11803926, upload-time = "2026-02-06T09:55:55.494Z" },{ url = "https://files.pythonhosted.org/packages/88/93/b59fe7832ff6ae3c78b813ea43dac60e295fa03606d14d89d2e0ec29f4f3/grpcio-1.78.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:8f2ac84905d12918e4e55a16da17939eb63e433dc11b677267c35568aa63fc84", size = 6478628, upload-time = "2026-02-06T09:55:58.533Z" },{ url = "https://files.pythonhosted.org/packages/ed/df/e67e3734527f9926b7d9c0dde6cd998d1d26850c3ed8eeec81297967ac67/grpcio-1.78.0-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:b58f37edab4a3881bc6c9bca52670610e0c9ca14e2ea3cf9debf185b870457fb", size = 7173574, upload-time = "2026-02-06T09:56:01.786Z" },{ url = "https://files.pythonhosted.org/packages/a6/62/cc03fffb07bfba982a9ec097b164e8835546980aec25ecfa5f9c1a47e022/grpcio-1.78.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:735e38e176a88ce41840c21bb49098ab66177c64c82426e24e0082500cc68af5", size = 6692639, upload-time = "2026-02-06T09:56:04.529Z" },{ url = "https://files.pythonhosted.org/packages/bf/9a/289c32e301b85bdb67d7ec68b752155e674ee3ba2173a1858f118e399ef3/grpcio-1.78.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2045397e63a7a0ee7957c25f7dbb36ddc110e0cfb418403d110c0a7a68a844e9", size = 7268838, upload-time = "2026-02-06T09:56:08.397Z" },{ url = "https://files.pythonhosted.org/packages/0e/79/1be93f32add280461fa4773880196572563e9c8510861ac2da0ea0f892b6/grpcio-1.78.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:a9f136fbafe7ccf4ac7e8e0c28b31066e810be52d6e344ef954a3a70234e1702", size = 8251878, upload-time = "2026-02-06T09:56:10.914Z" },{ url = "https://files.pythonhosted.org/packages/65/65/793f8e95296ab92e4164593674ae6291b204bb5f67f9d4a711489cd30ffa/grpcio-1.78.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:748b6138585379c737adc08aeffd21222abbda1a86a0dca2a39682feb9196c20", size = 7695412, upload-time = "2026-02-06T09:56:13.593Z" },{ url = "https://files.pythonhosted.org/packages/1c/9f/1e233fe697ecc82845942c2822ed06bb522e70d6771c28d5528e4c50f6a4/grpcio-1.78.0-cp313-cp313-win32.whl", hash = "sha256:271c73e6e5676afe4fc52907686670c7cea22ab2310b76a59b678403ed40d670", size = 4064899, upload-time = "2026-02-06T09:56:15.601Z" },{ url = "https://files.pythonhosted.org/packages/4d/27/d86b89e36de8a951501fb06a0f38df19853210f341d0b28f83f4aa0ffa08/grpcio-1.78.0-cp313-cp313-win_amd64.whl", hash = "sha256:f2d4e43ee362adfc05994ed479334d5a451ab7bc3f3fee1b796b8ca66895acb4", size = 4797393, upload-time = "2026-02-06T09:56:17.882Z" },][[package]]103 unmodified lines{ url = "https://files.pythonhosted.org/packages/cb/bd/1a875e0d592d447cbc02805fd3fe0f497714d6a2583f59d14fa9ebad96eb/huggingface_hub-0.36.0-py3-none-any.whl", hash = "sha256:7bcc9ad17d5b3f07b57c78e79d527102d08313caa278a641993acddcb894548d", size = 566094, upload-time = "2025-10-23T12:11:59.557Z" },][[package]]name = "idna"version = "3.11"5 unmodified lines[[package]]name = "importlib-metadata"version = "8.7.1"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "zipp" },]sdist = { url = "https://files.pythonhosted.org/packages/f3/49/3b30cad09e7771a4982d9975a8cbf64f00d4a1ececb53297f1d9a7be1b10/importlib_metadata-8.7.1.tar.gz", hash = "sha256:49fef1ae6440c182052f407c8d34a68f72efc36db9ca90dc0113398f2fdde8bb", size = 57107, upload-time = "2025-12-21T10:00:19.278Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/fa/5e/f8e9a1d23b9c20a551a8a02ea3637b4642e22c2626e3a13a9a29cdea99eb/importlib_metadata-8.7.1-py3-none-any.whl", hash = "sha256:5a1f80bf1daa489495071efbb095d75a634cf28a8bc299581244063b53176151", size = 27865, upload-time = "2025-12-21T10:00:18.329Z" },][[package]]413 unmodified lines[[package]]name = "kubernetes"version = "35.0.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "certifi" },{ name = "durationpy" },{ name = "python-dateutil" },{ name = "pyyaml" },{ name = "requests" },2 unmodified lines{ name = "urllib3" },{ name = "websocket-client" },]sdist = { url = "https://files.pythonhosted.org/packages/2c/8f/85bf51ad4150f64e8c665daf0d9dfe9787ae92005efb9a4d1cba592bd79d/kubernetes-35.0.0.tar.gz", hash = "sha256:3d00d344944239821458b9efd484d6df9f011da367ecb155dadf9513f05f09ee", size = 1094642, upload-time = "2026-01-16T01:05:27.76Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/0c/70/05b685ea2dffcb2adbf3cdcea5d8865b7bc66f67249084cf845012a0ff13/kubernetes-35.0.0-py2.py3-none-any.whl", hash = "sha256:39e2b33b46e5834ef6c3985ebfe2047ab39135d41de51ce7641a7ca5b372a13d", size = 2017602, upload-time = "2026-01-16T01:05:25.991Z" },][[package]]461 unmodified lines[[package]]name = "onnxruntime"version = "1.24.2"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "flatbuffers" },{ name = "numpy" },{ name = "packaging" },1 unmodified line{ name = "sympy" },]wheels = [{ url = "https://files.pythonhosted.org/packages/2c/4e/050c947924ffd8ff856d219d8f83ee3d4e7dc52d5a6770ff34a15675c437/onnxruntime-1.24.2-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:69d1c75997276106d24e65da2e69ec4302af1b117fef414e2154740cde0f6214", size = 17217298, upload-time = "2026-02-19T17:15:09.891Z" },{ url = "https://files.pythonhosted.org/packages/30/17/c814121dff4de962476ced979c402c3cce72d5d46e87099610b47a1f2622/onnxruntime-1.24.2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:670d7e671af2dbd17638472f9b9ff98041889efd7150718406b9ea989312d064", size = 15027128, upload-time = "2026-02-19T17:13:19.367Z" },{ url = "https://files.pythonhosted.org/packages/2c/32/4e5921ba8b82ac37cad45f1108ca6effd430f49c7f20577d53f317d166ed/onnxruntime-1.24.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:93fe190ee555ae8e9c1214bcfcf13af85cd06dd835e8d835ce5a8d01056844fe", size = 17107440, upload-time = "2026-02-19T17:14:02.932Z" },{ url = "https://files.pythonhosted.org/packages/48/55/9d13c97d912db81e81c9b369a49b36f2804fa3bb8de64462e5e6bd412d0b/onnxruntime-1.24.2-cp311-cp311-win_amd64.whl", hash = "sha256:04a3a80b28dd39739463cb1e34081eed668929ba0b8e1bc861885dcdf66b7601", size = 12506375, upload-time = "2026-02-19T17:14:57.049Z" },{ url = "https://files.pythonhosted.org/packages/b0/d4/cf0e0b3bd84e7b68fe911810f7098f414936d1ffb612faa569a3fb8a76a5/onnxruntime-1.24.2-cp311-cp311-win_arm64.whl", hash = "sha256:a845096277444670b0b52855bb4aad706003540bd34986b50868e9f29606c142", size = 12167758, upload-time = "2026-02-19T17:14:47.386Z" },{ url = "https://files.pythonhosted.org/packages/23/1c/38af1cfe82c75d2b205eb5019834b0f2b0b6647ec8a20a3086168e413570/onnxruntime-1.24.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:d8a50b422d45c0144864c0977d04ad4fa50a8a48e5153056ab1f7d06ea9fc3e2", size = 17217857, upload-time = "2026-02-19T17:15:14.297Z" },{ url = "https://files.pythonhosted.org/packages/01/8a/e2d4332ae18d6383376e75141cd914256bee12c3cc439f42260eb176ceb9/onnxruntime-1.24.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:76c44fc9a89dcefcd5a4ab5c6bbbb9ff1604325ab2d5d0bc9ff5a9cba7b37f4a", size = 15027167, upload-time = "2026-02-19T17:13:21.92Z" },{ url = "https://files.pythonhosted.org/packages/35/af/ad86cfbfd65d5a86204b3a30893e92c0cf3f1a56280efc5a12e69d81f52d/onnxruntime-1.24.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:09aa6f8d766b4afc3cfba68dd10be39586b49f9462fbd1386c5d5644239461ca", size = 17106547, upload-time = "2026-02-19T17:14:05.758Z" },{ url = "https://files.pythonhosted.org/packages/ee/62/9d725326f933bf8323e309956a17e52d33fb59d35bb5dda1886f94352938/onnxruntime-1.24.2-cp312-cp312-win_amd64.whl", hash = "sha256:ebcee9276420a65e5fa08b05f18379c2271b5992617e5bdc0d0d6c5ea395c1a1", size = 12506161, upload-time = "2026-02-19T17:14:59.377Z" },{ url = "https://files.pythonhosted.org/packages/aa/a9/7b06efd5802db881860d961a7cb4efacb058ed694c1c8f096c0c1499d017/onnxruntime-1.24.2-cp312-cp312-win_arm64.whl", hash = "sha256:8d770a934513f6e17937baf3438eaaec5983a23cdaedb81c9fc0dfcf26831c24", size = 12169884, upload-time = "2026-02-19T17:14:49.962Z" },{ url = "https://files.pythonhosted.org/packages/9c/98/8f5b9ae63f7f6dd5fb2d192454b915ec966a421fdd0effeeef5be7f7221f/onnxruntime-1.24.2-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:038ebcd8363c3835ea83eed66129e1d11d8219438892dfb7dc7656c4d4dfa1f9", size = 17217884, upload-time = "2026-02-19T17:13:36.193Z" },{ url = "https://files.pythonhosted.org/packages/55/e6/dc4dc59565c93506c45017c0dd3f536f6d1b7bc97047821af13fba2e3def/onnxruntime-1.24.2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8235cc11e118ad749c497ba93288c04073eccd8cc6cc508c8a7988ae36ab52d8", size = 15026995, upload-time = "2026-02-19T17:13:25.029Z" },{ url = "https://files.pythonhosted.org/packages/ac/62/6f2851cf3237a91bc04cdb35434293a623d4f6369f79836929600da574ba/onnxruntime-1.24.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e92b46cc6d8be4286436a05382a881c88d85a2ae1ea9cfe5e6fab89f2c3e89cc", size = 17106308, upload-time = "2026-02-19T17:14:09.817Z" },{ url = "https://files.pythonhosted.org/packages/62/5a/1e2b874daf24f26e98af14281fdbdd6ae1ed548ba471c01ea2a3084c55bb/onnxruntime-1.24.2-cp313-cp313-win_amd64.whl", hash = "sha256:1fd824ee4f6fb811bc47ffec2b25f129f31a087214ca91c8b4f6fda32962b78f", size = 12506095, upload-time = "2026-02-19T17:15:02.434Z" },{ url = "https://files.pythonhosted.org/packages/2d/6f/8fac5eecb94f861d56a43ede3c2ebcdce60132952d3b72003f3e3d91483c/onnxruntime-1.24.2-cp313-cp313-win_arm64.whl", hash = "sha256:d8cf0acbf90771fff012c33eb2749e8aca2a8b4c66c672f30ee77c140a6fba5b", size = 12168564, upload-time = "2026-02-19T17:14:52.28Z" },{ url = "https://files.pythonhosted.org/packages/35/e4/7dfed3f445f7289a0abff709d012439c6c901915390704dd918e5f47aad3/onnxruntime-1.24.2-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e22fb5d9ac51b61f50cca155ce2927576cc2c42501ede6c0df23a1aeb070bdd5", size = 15036844, upload-time = "2026-02-19T17:13:27.928Z" },{ url = "https://files.pythonhosted.org/packages/90/45/9d52397e30b0d8c1692afcec5184ca9372ff4d6b0f6039bba9ad479a2563/onnxruntime-1.24.2-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2956f5220e7be8b09482ae5726caabf78eb549142cdb28523191a38e57fb6119", size = 17117779, upload-time = "2026-02-19T17:14:13.862Z" },][[package]]374 unmodified lines[[package]]name = "protobuf"version = "6.33.5"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/ba/25/7c72c307aafc96fa87062aa6291d9f7c94836e43214d43722e86037aac02/protobuf-6.33.5.tar.gz", hash = "sha256:6ddcac2a081f8b7b9642c09406bc6a4290128fce5f471cddd165960bb9119e5c", size = 444465, upload-time = "2026-01-29T21:51:33.494Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/b1/79/af92d0a8369732b027e6d6084251dd8e782c685c72da161bd4a2e00fbabb/protobuf-6.33.5-cp310-abi3-win32.whl", hash = "sha256:d71b040839446bac0f4d162e758bea99c8251161dae9d0983a3b88dee345153b", size = 425769, upload-time = "2026-01-29T21:51:21.751Z" },{ url = "https://files.pythonhosted.org/packages/55/75/bb9bc917d10e9ee13dee8607eb9ab963b7cf8be607c46e7862c748aa2af7/protobuf-6.33.5-cp310-abi3-win_amd64.whl", hash = "sha256:3093804752167bcab3998bec9f1048baae6e29505adaf1afd14a37bddede533c", size = 437118, upload-time = "2026-01-29T21:51:24.022Z" },{ url = "https://files.pythonhosted.org/packages/a2/6b/e48dfc1191bc5b52950246275bf4089773e91cb5ba3592621723cdddca62/protobuf-6.33.5-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:a5cb85982d95d906df1e2210e58f8e4f1e3cdc088e52c921a041f9c9a0386de5", size = 427766, upload-time = "2026-01-29T21:51:25.413Z" },{ url = "https://files.pythonhosted.org/packages/4e/b1/c79468184310de09d75095ed1314b839eb2f72df71097db9d1404a1b2717/protobuf-6.33.5-cp39-abi3-manylinux2014_aarch64.whl", hash = "sha256:9b71e0281f36f179d00cbcb119cb19dec4d14a81393e5ea220f64b286173e190", size = 324638, upload-time = "2026-01-29T21:51:26.423Z" },{ url = "https://files.pythonhosted.org/packages/c5/f5/65d838092fd01c44d16037953fd4c2cc851e783de9b8f02b27ec4ffd906f/protobuf-6.33.5-cp39-abi3-manylinux2014_s390x.whl", hash = "sha256:8afa18e1d6d20af15b417e728e9f60f3aa108ee76f23c3b2c07a2c3b546d3afd", size = 339411, upload-time = "2026-01-29T21:51:27.446Z" },{ url = "https://files.pythonhosted.org/packages/9b/53/a9443aa3ca9ba8724fdfa02dd1887c1bcd8e89556b715cfbacca6b63dbec/protobuf-6.33.5-cp39-abi3-manylinux2014_x86_64.whl", hash = "sha256:cbf16ba3350fb7b889fca858fb215967792dc125b35c7976ca4818bee3521cf0", size = 323465, upload-time = "2026-01-29T21:51:28.925Z" },{ url = "https://files.pythonhosted.org/packages/57/bf/2086963c69bdac3d7cff1cc7ff79b8ce5ea0bec6797a017e1be338a46248/protobuf-6.33.5-py3-none-any.whl", hash = "sha256:69915a973dd0f60f31a08b8318b73eab2bd6a392c79184b3612226b0a3f8ec02", size = 170687, upload-time = "2026-01-29T21:51:32.557Z" },][[package]]75 unmodified lines{ url = "https://files.pythonhosted.org/packages/8e/37/efad0257dc6e593a18957422533ff0f87ede7c9c6ea010a2177d738fb82f/pure_eval-0.2.3-py3-none-any.whl", hash = "sha256:1db8e35b67b3d218d818ae653e27f06c3aa420901fa7b081ca98cbedc874e0d0", size = 11842, upload-time = "2024-07-21T12:58:20.04Z" },][[package]]name = "pybase64"version = "1.4.3"244 unmodified lines[[package]]name = "pypika"version = "0.51.1"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/f8/78/cbaebba88e05e2dcda13ca203131b38d3640219f20ebb49676d26714861b/pypika-0.51.1.tar.gz", hash = "sha256:c30c7c1048fbf056fd3920c5a2b88b0c29dd190a9b2bee971fd17e4abe4d0ebe", size = 80919, upload-time = "2026-02-04T11:27:48.304Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/57/83/c77dfeed04022e8930b08eedca2b6e5efed256ab3321396fde90066efb65/pypika-0.51.1-py2.py3-none-any.whl", hash = "sha256:77985b4d7ce71b9905255bf12468cf598349e98837c037541cfc240e528aec46", size = 60585, upload-time = "2026-02-04T11:27:46.251Z" },][[package]]name = "pyproject-hooks"4 unmodified lines{ url = "https://files.pythonhosted.org/packages/bd/24/12818598c362d7f300f18e74db45963dbcb85150324092410c8b49405e42/pyproject_hooks-1.2.0-py3-none-any.whl", hash = "sha256:9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913", size = 10216, upload-time = "2024-09-29T09:24:11.978Z" },][[package]]name = "pytest"version = "9.0.2"477 unmodified lines{ url = "https://files.pythonhosted.org/packages/d1/b7/b95708304cd49b7b6f82fdd039f1748b66ec2b21d6a45180910802f1abf1/rpds_py-0.30.0-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:ac37f9f516c51e5753f27dfdef11a88330f04de2d564be3991384b2f3535d02e", size = 562191, upload-time = "2025-11-30T20:24:36.853Z" },][[package]]name = "safehttpx"version = "0.1.7"
pyproject.toml+1-1
src/api/main.py+9-3
src/api/schemas.py+3-1
src/data_ingestion/create_embeddings.py+65-42
src/llm/anime_reranker.pyAdded+114
src/llm/prompts.py+24-21
src/retrieval/rag_pipeline.py+95-32
src/retrieval/vector_search.py+127-48
ui/gradio_app.py+654-302
uv.lock+84-173