Spaces:
Running
Running
Update app.py
Browse files11 unmodified lines12131415151617185 unmodified lines24252627282728293031216 unmodified lines24824925025125125225325411 unmodified linesfrom docx.oxml.ns import nsdecls, qn
# ---------------------------------------------------------------------------# 1. CORE API LINGUISTIC PIPELINE (WORD-BY-WORD WITH CORRECT 1.5 FLASH ROUTING)# 1. CORE API LINGUISTIC PIPELINE (WORD-BY-WORD WITH FOOLPROOF URL ROUTING)# ---------------------------------------------------------------------------def process_live_ai_request(word, api_key): """5 unmodified lines if not clean_key: return "Missing Key", "Missing Key", "Enter valid key above" # FIX: Corrected model string path to 'gemini-1.5-flash-latest' to eliminate HTTP 404 routing errors url = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent?key={clean_key}" # FIX: Updated to the correct, fully-qualified web path to eliminate the HTTP 404 error url = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key={clean_key}" headers = {"Content-Type": "application/json"} prompt = f"""216 unmodified lines word_packages = [] for tok in tokens: # 400 millisecond delay to ensure continuous queries never trigger rate locks # Pacing step spacing out sequential web hits to completely avoid rate locks time.sleep(0.4) tl, ts, mo = process_live_ai_request(tok, api_key) word_packages.append((tok, tl, ts, mo))app.py+4-4