Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files2731 unmodified lines273227332734273527362737134 unmodified lines2872287328742875287628772878287928802881288228836 unmodified lines28902891289228932894289528962731 unmodified lines(m for m in available_api_modelsif "flash" in m.lower()and not any(bad in m.lower()for bad in ("tts", "image", "embedding", "aqa", "audio", "exp", "thinking")134 unmodified linestext_parts = []for part in raw_content:if isinstance(part, dict):if part.get("type") in ("text", "output_text", None) and part.get("text"):text_parts.append(str(part["text"]))else:p_type = getattr(part, "type", None)p_text = getattr(part, "text", None)if p_text and p_type in ("text", "output_text", None):text_parts.append(str(p_text))content_str = "\n".join(text_parts).strip()elif raw_content is None:6 unmodified linesor getattr(msg, "reasoning", None)or "")reasoning_str = str(reasoning).strip() if reasoning else ""tool_calls = getattr(msg, "tool_calls", None)if not content_str and tool_calls:2731 unmodified lines2732273327342735273627372738134 unmodified lines287328742875287628772878287928802881288228832884288528866 unmodified lines2893289428952896289728982899290029012902290329042905290629072731 unmodified lines(m for m in available_api_modelsif "flash" in m.lower()and "2.5" not in m.lower()and not any(bad in m.lower()for bad in ("tts", "image", "embedding", "aqa", "audio", "exp", "thinking")134 unmodified linestext_parts = []for part in raw_content:if isinstance(part, dict):if part.get("type") in ("text", "output_text", "reasoning", None) and (part.get("text") or part.get("thinking")):text_parts.append(str(part.get("text") or part.get("thinking")))else:p_type = getattr(part, "type", None)p_text = getattr(part, "text", None) or getattr(part, "thinking", None)if p_text and p_type in ("text", "output_text", "reasoning", None):text_parts.append(str(p_text))content_str = "\n".join(text_parts).strip()elif raw_content is None:6 unmodified linesor getattr(msg, "reasoning", None)or "")if isinstance(reasoning, list):reasoning_str = "\n".join(str(r.get("text", r) if isinstance(r, dict) else r).strip()for r in reasoningif r).strip()else:reasoning_str = str(reasoning).strip() if reasoning else ""tool_calls = getattr(msg, "tool_calls", None)if not content_str and tool_calls:
app.py+16-5