Files
tw2/src/agentscope/hooks/__init__.py
codex-bot a64378956a
Some checks failed
Pre-commit / run (ubuntu-latest) (push) Has been cancelled
Deploy Sphinx documentation to Pages / build_en (ubuntu-latest, 3.10) (push) Has been cancelled
Deploy Sphinx documentation to Pages / build_zh (ubuntu-latest, 3.10) (push) Has been cancelled
Python Unittest Coverage / test (macos-15, 3.10) (push) Has been cancelled
Python Unittest Coverage / test (macos-15, 3.11) (push) Has been cancelled
Python Unittest Coverage / test (macos-15, 3.12) (push) Has been cancelled
Python Unittest Coverage / test (ubuntu-latest, 3.10) (push) Has been cancelled
Python Unittest Coverage / test (ubuntu-latest, 3.11) (push) Has been cancelled
Python Unittest Coverage / test (ubuntu-latest, 3.12) (push) Has been cancelled
Python Unittest Coverage / test (windows-latest, 3.10) (push) Has been cancelled
Python Unittest Coverage / test (windows-latest, 3.11) (push) Has been cancelled
Python Unittest Coverage / test (windows-latest, 3.12) (push) Has been cancelled
chore: initialize sandbox and overwrite remote content
2026-03-02 22:32:27 +08:00

30 lines
670 B
Python

# -*- coding: utf-8 -*-
"""The built-in hook functions in agentscope."""
from functools import partial
from ._studio_hooks import (
as_studio_forward_message_pre_print_hook,
)
from .. import _config
from ..agent import AgentBase
__all__ = [
"as_studio_forward_message_pre_print_hook",
]
def _equip_as_studio_hooks(
studio_url: str,
) -> None:
"""Connect to the agentscope studio."""
AgentBase.register_class_hook(
"pre_print",
"as_studio_forward_message_pre_print_hook",
partial(
as_studio_forward_message_pre_print_hook,
studio_url=studio_url,
run_id=_config.run_id,
),
)