Spaces:
Paused
Paused
Filter empty thoughts from recording and chat display
Browse filesFiles changed (4)
308 unmodified lines309310311312313314315316317318319320321322323324325326308 unmodified linesfor round_n in range(rounds):text = generate(render(msgs), 256).strip()emit({"type": "model", "round": round_n, "text": text})record_thought(text, round_n)t = parse_tool(text)if not t:# No tool call. In contemplate mode: record + keep going.if contemplate:msgs.append({"role": "assistant", "content": text})msgs.append({"role": "user","content": "Continue your thoughts. What else do ""you observe or conclude?"})continuereturn text, eventstool, params = tdedup = f"{tool}|{params}"308 unmodified lines309310311312313314315316317318319320321322323324325326327328308 unmodified linesfor round_n in range(rounds):text = generate(render(msgs), 256).strip()emit({"type": "model", "round": round_n, "text": text})if text:record_thought(text, round_n)t = parse_tool(text) if text else Noneif not t:# No tool call. In contemplate mode: record + keep going.if contemplate:if text:msgs.append({"role": "assistant", "content": text})msgs.append({"role": "user","content": "Continue your thoughts. What else do ""you observe or conclude?"})continuereturn (text or "(no response)"), eventstool, params = tdedup = f"{tool}|{params}"
308 unmodified lines309310311312313314315316317318319320321322323324325326308 unmodified linesfor round_n in range(rounds):text = generate(render(msgs), 256).strip()emit({"type": "model", "round": round_n, "text": text})record_thought(text, round_n)t = parse_tool(text)if not t:# No tool call. In contemplate mode: record + keep going.if contemplate:msgs.append({"role": "assistant", "content": text})msgs.append({"role": "user","content": "Continue your thoughts. What else do ""you observe or conclude?"})continuereturn text, eventstool, params = tdedup = f"{tool}|{params}"308 unmodified lines309310311312313314315316317318319320321322323324325326327328308 unmodified linesfor round_n in range(rounds):text = generate(render(msgs), 256).strip()emit({"type": "model", "round": round_n, "text": text})if text:record_thought(text, round_n)t = parse_tool(text) if text else Noneif not t:# No tool call. In contemplate mode: record + keep going.if contemplate:if text:msgs.append({"role": "assistant", "content": text})msgs.append({"role": "user","content": "Continue your thoughts. What else do ""you observe or conclude?"})continuereturn (text or "(no response)"), eventstool, params = tdedup = f"{tool}|{params}"
858 unmodified lines859860861862863864865866858 unmodified lineselif e["type"] == "model":add_verbose({"tag": "chat","data": f"model[{e['round']}]: {e['text'][:120]}"})# In contemplate mode, surface each thought in chatif CONTEMPLATE and e.get("round", 0) >= 0:with _chat_lock:_chat_messages.append({"role": "phox","text": f"[thought #{e['round']}] {e['text'][:200]}"})858 unmodified lines859860861862863864865866858 unmodified lineselif e["type"] == "model":add_verbose({"tag": "chat","data": f"model[{e['round']}]: {e['text'][:120]}"})# In contemplate mode, surface non-empty thoughtsif CONTEMPLATE and e.get("text", "").strip():with _chat_lock:_chat_messages.append({"role": "phox","text": f"[thought #{e['round']}] {e['text'][:200]}"})
858 unmodified lines859860861862863864865866858 unmodified lineselif e["type"] == "model":add_verbose({"tag": "chat","data": f"model[{e['round']}]: {e['text'][:120]}"})# In contemplate mode, surface each thought in chatif CONTEMPLATE and e.get("round", 0) >= 0:with _chat_lock:_chat_messages.append({"role": "phox","text": f"[thought #{e['round']}] {e['text'][:200]}"})858 unmodified lines859860861862863864865866858 unmodified lineselif e["type"] == "model":add_verbose({"tag": "chat","data": f"model[{e['round']}]: {e['text'][:120]}"})# In contemplate mode, surface non-empty thoughtsif CONTEMPLATE and e.get("text", "").strip():with _chat_lock:_chat_messages.append({"role": "phox","text": f"[thought #{e['round']}] {e['text'][:200]}"})
agent_core.py+6-4
bqsm_assist/agent_core.py+6-4
bqsm_assist/phoenix_dashboard.py+2-2
phoenix_dashboard.py+2-2