mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Add Agent Framework Lab Lightning package with RL training examples (#937)
* add math agent * . * update * update debug mode * add tau2 training * . * . * . * . * add tests * . * revert observability * update readme * fix task serialization issue * fix exception * add inline docs * update readme * update pyproject toml * minor fix * update and use git lfs * update * update ignore file to use lab specific * fix type * update depedency --------- Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
import importlib.metadata
|
||||
|
||||
from ._tau2_utils import patch_env_set_state, unpatch_env_set_state
|
||||
from .runner import TaskRunner
|
||||
from .runner import ASSISTANT_AGENT_ID, ORCHESTRATOR_ID, USER_SIMULATOR_ID, TaskRunner
|
||||
|
||||
try:
|
||||
__version__ = importlib.metadata.version(__name__)
|
||||
@@ -13,6 +13,9 @@ except importlib.metadata.PackageNotFoundError:
|
||||
__version__ = "0.0.0" # Fallback for development mode
|
||||
|
||||
__all__ = [
|
||||
"ASSISTANT_AGENT_ID",
|
||||
"ORCHESTRATOR_ID",
|
||||
"USER_SIMULATOR_ID",
|
||||
"TaskRunner",
|
||||
"patch_env_set_state",
|
||||
"unpatch_env_set_state",
|
||||
|
||||
@@ -32,6 +32,8 @@ from ._message_utils import flip_messages, log_messages
|
||||
from ._sliding_window import SlidingWindowChatMessageStore
|
||||
from ._tau2_utils import convert_agent_framework_messages_to_tau2_messages, convert_tau2_tool_to_ai_function
|
||||
|
||||
__all__ = ["ASSISTANT_AGENT_ID", "ORCHESTRATOR_ID", "USER_SIMULATOR_ID", "TaskRunner"]
|
||||
|
||||
# Agent instructions matching tau2's LLMAgent
|
||||
ASSISTANT_AGENT_INSTRUCTION = """
|
||||
You are a customer service agent that helps the user according to the <policy> provided below.
|
||||
@@ -413,5 +415,8 @@ class TaskRunner:
|
||||
domain="airline",
|
||||
)
|
||||
|
||||
logger.info(f"Evaluation completed - Reward: {self.full_reward_info.reward}, Info: {self.full_reward_info}")
|
||||
return self.full_reward_info.reward # type: ignore[no-any-return]
|
||||
logger.info(
|
||||
f"Evaluation completed - Reward: {self.full_reward_info.reward if self.full_reward_info else None}, "
|
||||
f"Info: {self.full_reward_info}"
|
||||
)
|
||||
return self.full_reward_info.reward if self.full_reward_info else 0.0
|
||||
|
||||
Reference in New Issue
Block a user