refactor: rename default_model->model, add thinking_type support, fix pet urlopen error handling
This commit is contained in:
@@ -48,7 +48,11 @@ def render_sidebar():
|
||||
pet_script = os.path.join(os.path.dirname(__file__), 'desktop_pet_v2.pyw')
|
||||
if not os.path.exists(pet_script): pet_script = os.path.join(os.path.dirname(__file__), 'desktop_pet.pyw')
|
||||
subprocess.Popen([sys.executable, pet_script], **kwargs)
|
||||
def _pet_req(q): threading.Thread(target=lambda: urlopen(f'http://127.0.0.1:51983/?{q}', timeout=2), daemon=True).start()
|
||||
def _pet_req(q):
|
||||
def _do():
|
||||
try: urlopen(f'http://127.0.0.1:51983/?{q}', timeout=2)
|
||||
except Exception: pass
|
||||
threading.Thread(target=_do, daemon=True).start()
|
||||
agent._pet_req = _pet_req
|
||||
if not hasattr(agent, '_turn_end_hooks'): agent._turn_end_hooks = {}
|
||||
def _pet_hook(ctx):
|
||||
|
||||
Reference in New Issue
Block a user