fix: fix issue with linking tools and adding new tools (#1988)
Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
This commit is contained in:
@@ -3,7 +3,6 @@ import inspect
|
||||
import traceback
|
||||
import warnings
|
||||
from abc import ABC, abstractmethod
|
||||
from lib2to3.fixer_util import is_list
|
||||
from typing import List, Literal, Optional, Tuple, Union
|
||||
|
||||
from tqdm import tqdm
|
||||
@@ -252,7 +251,7 @@ class Agent(BaseAgent):
|
||||
warnings.warn("Tool rules only work reliably for the latest OpenAI models that support structured outputs.")
|
||||
# add default rule for having send_message be a terminal tool
|
||||
|
||||
if not is_list(agent_state.tool_rules):
|
||||
if agent_state.tool_rules is None:
|
||||
agent_state.tool_rules = []
|
||||
agent_state.tool_rules.append(TerminalToolRule(tool_name="send_message"))
|
||||
self.tool_rules_solver = ToolRulesSolver(tool_rules=agent_state.tool_rules)
|
||||
|
||||
Reference in New Issue
Block a user