1313)
1414from ai21 .models .agents .agent import ResponseLanguage
1515from ai21 .types import NOT_GIVEN , NotGiven
16- from ai21 .utils .typing import remove_not_given
16+ from ai21 .utils .typing import remove_not_given , warn_if_tool_resources_in_kwargs
1717
1818
1919class BaseAgents (ABC ):
@@ -26,19 +26,19 @@ def _create_body(
2626 description : str | NotGiven ,
2727 models : List [str ] | NotGiven ,
2828 tools : List [Dict [str , Any ]] | NotGiven ,
29- tool_resources : Dict [str , Any ] | NotGiven ,
3029 requirements : List [AgentRequirement ] | NotGiven ,
3130 budget : BudgetLevel | NotGiven ,
3231 response_language : ResponseLanguage | NotGiven ,
3332 ** kwargs ,
3433 ) -> dict :
34+ warn_if_tool_resources_in_kwargs (kwargs )
35+
3536 return remove_not_given (
3637 {
3738 "name" : name ,
3839 "description" : description ,
3940 "models" : models ,
4041 "tools" : tools ,
41- "tool_resources" : tool_resources ,
4242 "requirements" : requirements ,
4343 "budget" : budget ,
4444 "response_language" : response_language ,
@@ -53,20 +53,20 @@ def _modify_body(
5353 description : str | NotGiven ,
5454 models : List [str ] | NotGiven ,
5555 tools : List [Dict [str , Any ]] | NotGiven ,
56- tool_resources : Dict [str , Any ] | NotGiven ,
5756 requirements : List [AgentRequirement ] | NotGiven ,
5857 budget : BudgetLevel | NotGiven ,
5958 visibility : Visibility | NotGiven ,
6059 response_language : ResponseLanguage | NotGiven ,
6160 ** kwargs ,
6261 ) -> dict :
62+ warn_if_tool_resources_in_kwargs (kwargs )
63+
6364 return remove_not_given (
6465 {
6566 "name" : name ,
6667 "description" : description ,
6768 "models" : models ,
6869 "tools" : tools ,
69- "tool_resources" : tool_resources ,
7070 "requirements" : requirements ,
7171 "budget" : budget ,
7272 "visibility" : visibility ,
@@ -85,7 +85,6 @@ def create(
8585 avatar : str | NotGiven = NOT_GIVEN ,
8686 models : List [str ] | NotGiven = NOT_GIVEN ,
8787 tools : List [Dict [str , Any ]] | NotGiven = NOT_GIVEN ,
88- tool_resources : Dict [str , Any ] | NotGiven = NOT_GIVEN ,
8988 requirements : List [AgentRequirement ] | NotGiven = NOT_GIVEN ,
9089 budget : BudgetLevel | NotGiven = NOT_GIVEN ,
9190 response_language : ResponseLanguage | NotGiven = NOT_GIVEN ,
@@ -110,7 +109,6 @@ def modify(
110109 description : str | NotGiven = NOT_GIVEN ,
111110 models : List [str ] | NotGiven = NOT_GIVEN ,
112111 tools : List [Dict [str , Any ]] | NotGiven = NOT_GIVEN ,
113- tool_resources : Dict [str , Any ] | NotGiven = NOT_GIVEN ,
114112 requirements : List [AgentRequirement ] | NotGiven = NOT_GIVEN ,
115113 budget : BudgetLevel | NotGiven = NOT_GIVEN ,
116114 visibility : Visibility | NotGiven = NOT_GIVEN ,
0 commit comments