chore: Change create_tool endpoint on v1 routes to error instead of upsert (#2102)
This commit is contained in:
@@ -30,7 +30,7 @@ def roll_d20() -> str:
|
||||
|
||||
|
||||
# create a tool from the function
|
||||
tool = client.create_tool(roll_d20)
|
||||
tool = client.create_or_update_tool(roll_d20)
|
||||
print(f"Created tool with name {tool.name}")
|
||||
|
||||
# create a new agent
|
||||
|
||||
@@ -370,7 +370,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"birthday_tool = client.create_tool(query_birthday_db)"
|
||||
"birthday_tool = client.create_or_update_tool(query_birthday_db)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -181,8 +181,8 @@
|
||||
"\n",
|
||||
"# TODO: add an archival andidate tool (provide justification) \n",
|
||||
"\n",
|
||||
"read_resume_tool = client.create_tool(read_resume) \n",
|
||||
"submit_evaluation_tool = client.create_tool(submit_evaluation)"
|
||||
"read_resume_tool = client.create_or_update_tool(read_resume) \n",
|
||||
"submit_evaluation_tool = client.create_or_update_tool(submit_evaluation)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -239,7 +239,7 @@
|
||||
" print(\"Pretend to email:\", content)\n",
|
||||
" return\n",
|
||||
"\n",
|
||||
"email_candidate_tool = client.create_tool(email_candidate)"
|
||||
"email_candidate_tool = client.create_or_update_tool(email_candidate)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -713,8 +713,8 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"# create tools \n",
|
||||
"search_candidate_tool = client.create_tool(search_candidates_db)\n",
|
||||
"consider_candidate_tool = client.create_tool(consider_candidate)\n",
|
||||
"search_candidate_tool = client.create_or_update_tool(search_candidates_db)\n",
|
||||
"consider_candidate_tool = client.create_or_update_tool(consider_candidate)\n",
|
||||
"\n",
|
||||
"# delete agent if exists \n",
|
||||
"if client.get_agent_id(\"recruiter_agent\"): \n",
|
||||
|
||||
@@ -48,8 +48,8 @@ swarm.client.set_default_embedding_config(EmbeddingConfig.default_config(provide
|
||||
swarm.client.set_default_llm_config(LLMConfig.default_config(model_name="gpt-4"))
|
||||
|
||||
# create tools
|
||||
transfer_a = swarm.client.create_tool(transfer_agent_a)
|
||||
transfer_b = swarm.client.create_tool(transfer_agent_b)
|
||||
transfer_a = swarm.client.create_or_update_tool(transfer_agent_a)
|
||||
transfer_b = swarm.client.create_or_update_tool(transfer_agent_b)
|
||||
|
||||
# create agents
|
||||
if swarm.client.get_agent_id("agentb"):
|
||||
|
||||
@@ -93,7 +93,7 @@ def main():
|
||||
functions = [first_secret_word, second_secret_word, third_secret_word, fourth_secret_word, auto_error]
|
||||
tools = []
|
||||
for func in functions:
|
||||
tool = client.create_tool(func)
|
||||
tool = client.create_or_update_tool(func)
|
||||
tools.append(tool)
|
||||
tool_names = [t.name for t in tools[:-1]]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user