chore: initialize sandbox and overwrite remote content
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
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
This commit is contained in:
29
src/agentscope/hooks/__init__.py
Normal file
29
src/agentscope/hooks/__init__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- 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,
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user