Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files2731 unmodified lines2732273327342735273627372738134 unmodified lines2873287428752875287628762877287828792880288128792880288228832884288528866 unmodified lines28932894289528962897289828992900290129022893290329042905290629072731 unmodified lines ( m for m in available_api_models if "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 lines text_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"])) 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) if p_text and p_type in ("text", "output_text", 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 lines or 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 reasoning if r ).strip() else: reasoning_str = str(reasoning).strip() if reasoning 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