You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/wwl-data-ai/build-agent-with-custom-tools/4-how-use-custom-tools.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: How to integrate custom tools
4
4
metadata:
5
5
title: How to integrate custom tools
6
6
description: "Learn how to integrate custom tools into your agent. This unit covers function calling, Azure Function integration, and OpenAPI specification integration."
description="Retrieve weather information for a location.",
196
+
auth=OpenApiAnonymousAuthDetails(),
197
+
)
198
+
)
156
199
157
-
agent = agent_client.create_agent(
158
-
model="gpt-4o-mini",
159
-
name="openapi-agent",
160
-
instructions="You are a snowfall tracking assistant. Use the API to fetch snowfall data.",
161
-
tools=[openapi_tool]
200
+
agent = project_client.agents.create_version(
201
+
agent_name="openapi-agent",
202
+
definition=PromptAgentDefinition(
203
+
model="gpt-4.1",
204
+
instructions="You are a weather assistant. Use the API to fetch weather data.",
205
+
tools=[openapi_tool],
206
+
),
162
207
)
163
208
```
164
209
165
-
The agent can now use the OpenAPI tool to fetch snowfall data dynamically.
210
+
The agent can now use the OpenAPI tool to fetch weather data dynamically.
166
211
167
212
> [!NOTE]
168
213
> One of the concepts related to agents and custom tools that developers often have difficulty with is the *declarative* nature of the solution. You don't need to write code that explicitly *calls* your custom tool functions - the agent itself decides to call tool functions based on messages in prompts. By providing the agent with functions that have meaningful names and well-documented parameters, the agent can "figure out" when and how to call the function all by itself!
0 commit comments