Spaces:
Running
Running
Update app.py
Browse files8 unmodified lines9101112121314152 unmodified lines1819202121222324252627282829303185 unmodified lines117118119120120121122123193 unmodified lines3173183193203203213223238 unmodified linesfrom docx.oxml import parse_xml, OxmlElementfrom docx.oxml.ns import nsdecls, qn
# Use the classic reliable legacy library version that matches your environment perfectly# Classic reliable legacy library version that matches your environment perfectlyimport google.generativeai as generative_ai
# ---------------------------------------------------------------------------2 unmodified linesdef process_live_ai_request(word, api_key): """ Queries the stable Gemini 1.5 Flash model directly using the classic generativeai SDK configuration setup that generated your tables last week. generativeai SDK configuration setup that successfully generated your tables. """ clean_key = api_key.strip() if api_key else "" if not clean_key: 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>') # Perfect 0.069 inches padding applied precisely to word cells # Word cell margins locked down precisely to your 0.069 inches padding benchmark 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)193 unmodified lines with gr.Row(): with gr.Column(scale=2): # FIX: Forced dark typography explicitly with an absolute tag-level inline CSS style block # FIX: Locked font contrast parameters inline directly onto the paragraph block 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; padding: 0 !important; line-height: 1.4 !important;">app.py+5-5