File tree 2 files changed +10
-0
lines changed
aixplain/modules/agent/tool
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,9 @@ def __init__(
60
60
if function is not None :
61
61
if isinstance (function , str ):
62
62
function = Function (function )
63
+ assert (
64
+ function is None or function is not Function .UTILITIES or model is not None
65
+ ), "Agent Creation Error: Utility function must be used with an associated model."
63
66
64
67
try :
65
68
if isinstance (supplier , dict ):
Original file line number Diff line number Diff line change 8
8
from aixplain .modules .agent import PipelineTool , ModelTool
9
9
from aixplain .modules .agent .utils import process_variables
10
10
from urllib .parse import urljoin
11
+ from aixplain .enums .function import Function
11
12
12
13
13
14
def test_fail_no_data_query ():
@@ -265,3 +266,9 @@ def test_process_variables():
265
266
"input" : "Hello, how are you?" ,
266
267
"target_language" : "English" ,
267
268
}
269
+
270
+
271
+ def test_fail_utilities_without_model ():
272
+ with pytest .raises (Exception ) as exc_info :
273
+ AgentFactory .create (name = "Test" , tools = [ModelTool (function = Function .UTILITIES )], llm_id = "6646261c6eb563165658bbb1" )
274
+ assert str (exc_info .value ) == "Agent Creation Error: Utility function must be used with an associated model."
You can’t perform that action at this time.
0 commit comments