Skip to content

Commit fcd8f2a

Browse files
committed
add more context to intro and fix comments in script
1 parent 4341c6a commit fcd8f2a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

articles/app-service/invoke-openapi-web-app-from-azure-ai-agent-service.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ ms.collection: ce-skilling-ai-copilot
1111

1212
# Invoke an OpenAPI App Service web app from Azure AI Agent Service
1313

14-
[Azure AI Agent Service](https://learn.microsoft.com/azure/ai-services/agents/overview) allows you to create AI agents tailored to your needs through custom instructions and augmented by advanced tools like code interpreter, and custom functions. You can now connect your Azure AI Agent to an external API using an [OpenAPI 3.0](https://www.openapis.org/what-is-openapi) specified tool, allowing for scalable interoperability with various applications. In the following tutorial, you're using an Azure AI Agent to invoke an API hosted on Azure App Service.
14+
[Azure AI Agent Service](https://learn.microsoft.com/azure/ai-services/agents/overview) allows you to create AI agents tailored to your needs through custom instructions and augmented by advanced tools like code interpreter, and custom functions. You can now connect your Azure AI Agent to an external API using an [OpenAPI 3.0](https://www.openapis.org/what-is-openapi) specified tool, allowing for scalable interoperability with various applications.
15+
16+
Azure App Service is a fully managed platform for building, deploying, and scaling web apps and APIs. If your API is hosted on Azure App Service, you can connect your AI Agent to the API using the OpenAPI specification. The OpenAPI specification defines the API and how to interact with it. You can then use natural language to invoke the API through your AI Agent.
17+
18+
In the following tutorial, you're using an Azure AI Agent to invoke an API hosted on Azure App Service.
1519

1620
## Prerequisites
1721

@@ -344,14 +348,13 @@ Now that you have the required infrastructure, you can put it all together and s
344348
# Create Auth object for the OpenApiTool (note that connection or managed identity auth setup requires additional setup in Azure)
345349
auth = OpenApiAnonymousAuthDetails()
346350
347-
# Initialize agent OpenAPI tool using the read in OpenAPI spec
348-
# openapi = OpenApiTool(name="GetWeatherForecast", spec=openapi_spec, description="Retrieve weather information", auth=auth)
351+
# Initialize agent OpenAPI tool using the OpenAPI spec
349352
openapi = OpenApiTool(name="toDolistAgent", spec=openapi_spec, description="Manage the to do list", auth=auth)
350353
351354
# Prompt for the message content
352355
message_content = input("Message content: ")
353356
354-
# Create agent with OpenAPI tool and process assistant run
357+
# Create agent with OpenAPI tool
355358
with project_client:
356359
agent = project_client.agents.create_agent(
357360
model="gpt-4o-mini",
@@ -381,9 +384,8 @@ Now that you have the required infrastructure, you can put it all together and s
381384
# Check if you got "Rate limit is exceeded.", then you want to get more quota
382385
print(f"Run failed: {run.last_error}")
383386
384-
# Fetch and log all messages
387+
# Fetch all messages
385388
messages = project_client.agents.list_messages(thread_id=thread.id)
386-
# print(f"Messages: {messages}")
387389
388390
# Get the last message from the sender
389391
last_msg = messages.get_last_text_message_by_role("assistant")

0 commit comments

Comments
 (0)