Spaces:
Running
Running
Update app.py
Browse files8 unmodified lines91011121213141516161718195 unmodified lines252627282829303185 unmodified lines11711811912012012112212396 unmodified lines22022122222322322422522642 unmodified lines26927027127227227327427427527640 unmodified lines3173183193213203213223238 unmodified linesfrom docx.oxml import parse_xml, OxmlElementfrom docx.oxml.ns import nsdecls, qn
# Use the classic legacy package to guarantee perfect model connectivity# Import the official legacy package to ensure perfect model version mappingimport google.generativeai as generative_ai
# ---------------------------------------------------------------------------# 1. CORE API LINGUISTIC PIPELINE (VERIFIED LEGACY WORKSPACE ROUTING)# 1. CORE API LINGUISTIC PIPELINE (STABLE SDK ENVIRONMENT CONFIGURATION)# ---------------------------------------------------------------------------def process_live_ai_request(word, api_key): """5 unmodified lines return "Missing Key", "Missing Key", "Enter valid key above" try: # Bind your personal API key directly to the classic workspace configuration # Bind your personal API key directly to the classic legacy workspace configuration generative_ai.configure(api_key=clean_key) model = generative_ai.GenerativeModel('gemini-1.5-flash') 85 unmodified lines cell_top.width = Inches(col_widths[col_idx]) tcPr_top = cell_top._tc.get_or_add_tcPr() borders_top = parse_xml(f'<w:tcBorders {nsdecls("w")}><w:top w:val="single" w:sz="4" w:color="B7B7B7"/><w:left w:val="single" w:sz="4" w:color="B7B7B7"/><w:bottom w:val="single" w:sz="4" w:color="B7B7B7"/><w:right w:val="single" w:sz="4" w:color="B7B7B7"/></w:tcBorders>') # Cell cushion margin padding assigned exactly to your 0.069 inches benchmark # Cell margin constraints set safely to your exact 0.069 inches metric layout padding_top = parse_xml(f'<w:tcMar {nsdecls("w")}><w:top w:w="99" w:type="dxa"/><w:left w:w="99" w:type="dxa"/><w:bottom w:w="99" w:type="dxa"/><w:right w:w="99" w:type="dxa"/></w:tcMar>') tcPr_top.append(borders_top) tcPr_top.append(padding_top)96 unmodified lines return "".join(html_elements)
# ---------------------------------------------------------------------------# 4. RUNTIME WORKFLOW CONTROLLER (PACED SEQUENCE ENGINE)# 4. RUNTIME WORKFLOW CONTROLLER (PACED LOGS ENGINE)# ---------------------------------------------------------------------------def process_pipeline(api_key, ms_name, book, ch, ver, raw_input): if not raw_input.strip():42 unmodified lines return "", "Success: Canvas workspace cleared cleanly.", "", gr.update(visible=False)
# ---------------------------------------------------------------------------# 5. GRADIO UI DESIGN PALETTE CONFIGURATIONS# 5. GRADIO DESIGN THEME LAYOUT PARAMETERS# ---------------------------------------------------------------------------# Re-bound background to your exact #F4F3EF ivory hue parametersbei_css = """body, .gradio-container { background-color: #F4F3EF !important; }.bei-banner { background-color: #1B4D3E; padding: 22px; text-align: center; border-radius: 8px; border-bottom: 4px solid #D4AF37; }40 unmodified lines with gr.Row(): with gr.Column(scale=2): # FIX: Injected inline styling directly into standard text tags to force high contrast gray over Gradio's standard layouts # FIX: Injected inline style color mapping directly onto paragraphs and strong text nodes gr.HTML(''' <div class="api-guide-box"> <p style="color: #2D3748 !important; font-family: Arial, sans-serif !important; font-size: 11pt !important; margin: 0 !important;">app.py+7-8