In this document, we'll explore about Vertex AI agent, how to use it. We can use Vertex AI with multiple tools but in this document we will solely be looking into use of tool openAPI. By the end, you'll have a clear understanding of how to use Vertex AI agent using OpenAPI.
Vertex AI is a machine learning (Machine learning is a subset of artificial intelligence (AI) focused on the development of algorithms that allow computers to learn from and make predictions or decisions based on data) platform from Google Cloud that enables businesses to build, deploy, and manage machine learning models. Google Vertex AI is a fully managed platform that makes it easy to adapt and we doesn’t need to worry about performance and scalability.
Implementation of vertex agent can easily be in done in multiple platforms like mobile app, web application, device, bot, interactive voice response system, and so on.
By using vertex AI agent we can provide users engaging ways to interact with the product.. It also ensures data privacy and compliance with industry standards.
Vertex AI agent is a powerful feature of the Vertex AI platform and improves the development, deployment, and management of machine learning models. It can easily integrate with Google Cloud services( BigQuery, Cloud Storage, Firebase), and focus on scalability, security, and compliance make it a valuable tool for organizations looking to leverage AI and machine learning to drive innovation and efficiency.
Vertex AI Agent ensures smoothness in development and deployment of AI-powered conversational agents. It has many benefits. Here are some benefits of using Vertex AI Agent:
Before we proceed, please follow the steps to get started:-
Vertex AI Chatbot is a powerful feature of Google's Vertex AI platform designed to create, deploy, and manage conversational AI agents. Vertex AI Chatbot can carry on human-like conversation with users using Natural Language Understanding (NLU) or Natural Language Processing (NLP) and Machine Learning (ML).
Vertex AI Chatbot is ideal for users looking for a robust, scalable solution within the Google Cloud ecosystem. Vertex AI chatbot is different from the existing bots present there in market. Some of the key features that make it different from any AI chatbot other out there:-
So now let’s get our hands dirty and create our very first Agent to begin the journey with. Here are some elaborated steps mentioned below so that you can have a good understanding within a lesser time.
Let’s head towards cloud console and search for Agent builder to create our Vertex AI agent.
3.After that you will be navigated to Agent Console with a default generative agent created for you. Let’s test this first before moving further. Just enter any prompt as user input in the panel and it will provide you the response just like any AI chatbot.
4.The response coming from agent can be customized by providing goal and instructions. The responses can also be controlled by using the agent tools.
5. There are 2 type of tools available in agent tools section OpenAPI and Data Store. Let’s discuss about the OpenAPI in lil more detail.
OpenAPI brings several benefits in Vertex AI Agents. OpenAPI provides a structured and standard document for your APIs. This documentation can be automatically generated and maintained, ensuring that all API endpoints, request parameters, and response structures are clearly defined and easily accessible. Your APIs can be seamlessly integrate with Vertex AI Agents using OpenAPI. The standardized format makes it easier for Vertex AI to understand and interact with your APIs, reducing the time and effort required for integration. Working with standardized API documentation helps all team members to easily understand how to interact with the APIs, making it easier to develop. Using OpenAPI ensures that the APIs your Vertex AI Agents interact with are consistently defined and documented. This reduces the risk of errors and improves the reliability of your integrations.
You can check documentation for openAPI here https://swagger.io/specification/.
For illustration purpose I’ve used a example here in which I am creating a openAPI with the help of gemini by providing a curl command to it. I’ve created a openAPI which will return car’s basic detail (model, manufacturer) based on car's license plate number provided by the user. If in any case the API cannot found the data it will ask for those detail to user. OpenAPI just made it easier by creating the complete code and documentation itself. I just used it in my agent and it worked like magic in no time. To use openAPI in vertex agent you need to use vertex agent tools. Here we will see how to achieve this. Sounds interesting right, so let’s start the seamless integration with the following steps:-
Let’s head towards to tools section in agent console.
2. Enter tool name which can be use a identifier in agent, and for the type select OpenAPI from the dropdown.
3. Provide a description of this tool. This description is provided to the model as context informing how the tool is used. For my example I used the description “Returns detail on a car based on its number plate.”.
4.Scroll down a lil bit and in schema section add your openAPI schema. It supports JSON and YAML format. You can use https://editor.swagger.io/ to create a openAPI for your self based on what you need to perform.
5.Here I used a car details OpenAPI to fetch the car details by providing its car number. Once you provide your car number it will return all the details regarding to the car available.
openapi: 3.0.0
info:
title: Car Details API
version: 1.0.0
paths:
/get_car_details:
post:
operationId: getCarDetails
description: Retrieves car details based on license plate.
requestBody:
content:
application/json:
schema:
type: object
properties:
license_plate:
type: string
example: aa-bbs32
responses:
'200':
description: Successful response.
content:
application/json:
schema:
type: object
properties:
manufacturer:
type: string
example: Renault.
type:
type: string
example: Clio.
weight:
type: number
example: 1100
dimensions:
type: object
properties:
length:
type: number
example: 4050
width:
type: number
example: 1798
height:
type: number
example: 1440
engine:
type: object
properties:
type:
type: string
example: Petrol.
displacement:
type: number
example: 3333
power:
type: number
example: 96
torque:
type: number
description: 135
environmental:
type: object
properties:
co2_emissions:
type: number
example: 108
fuel_consumption:
type: number
format: float
example: 4.8
6.You can use your own YAML code here or you can select a pre defined code present in the sample dropdown in schema section.
7.TaDa your openAPI is created and ready to use. Let’s move forward to the final steps on how to use it.
8. Head back to agents section and create a new agent.
9. Define name of your agent add goal and instruction according to your need. Goal is the end result what you want and instructions are the steps that are taken care during the entire process.Like here I provided a goal that agent need to get the car number and provide details of that car to the user. I restricted the agent to not answer any other question. You can also control the agent to work in single language only just by writing “Answer in english only”.In the instruction section I defined that how to greet the user. What tool should be used if user enter the car number and so on. And in the end confirm all details with the user.Also if API is not able to found details itself it will ask some details to the user.
Congratulation, you have successfully created your first Vertex AI Agent. Now let’s test how it works. You can start chat with the agent, it will ask you about your car number, and provide detail accordingly.
Here’s how easily you have created your first Vertex AI Agent and tested it successfully. Hope now you have a good understanding about Vertex AI, Agent and OpenAPI tool. Try it yourself and check the magic of Vertex Agent.
The AI industry is rapidly evolving, and Vertex AI agents have the potential to become significant players in the near future. It's crucial to stay adaptable to shifting market conditions and consumer preferences. Keep an eye on FlutterflowDevs for future updates, as we are a company driven by innovation and forward-thinking.
Vertex AI is built on Google Cloud and offers the ability to scale AI workloads efficiently. It can handle large datasets and complex models which makes it suitable for enterprises with AI. The platform is designed to be user-friendly, with tools and interfaces.
Integrating Vertex AI Agents with OpenAPI offers a powerful combination that enhances the development and deployment. By leveraging OpenAPI's standardized and widely supported format, you can ensure seamless integration, improved automation, and consistent API interactions. This integration facilitates better collaboration, scalability, and reliability across your machine learning workflows.
Overall, using Vertex AI Agents with OpenAPI is a strategic approach that maximizes the potential of your machine learning projects, driving efficiency, collaboration, and innovation in your AI initiatives.
We’re the top Flutterflow app development firm globally, delivering high-quality, results-driven mobile application services. Reach out to us – we’d love to help!