Running a Custom Tool and Agent in GLChat
This is an example of how to use a custom tool and agent in GLChat.
This documentation has been deprecated and moved to the GL SDK Gitbook
Registering a Custom Tool in GLChat
git clone https://github.com/GDP-ADMIN/gen-ai-examples.git
cd gen-ai-examples/examples/custom-tool-and-agent
In the Admin Dashboard, locate the
AI Agent/Tools
section in the left sidebar and click theUpload Tool
button.

Upload the
weather_forecast_tool.py
.Upon successful upload, the
weather_forecast_tool
should appear in theCustom Tool
. A confirmation message will also be displayed indicating that your tool has been successfully registered in the GLChat.

Creating an Agent with a Custom Tool in GLChat
The agent can only use tools that have been registered in GLChat. You can register the tools by following the Registering a Custom Tool in GLChat guide.
In the Admin Dashboard, locate the
AI Agent/Agent
section in the left sidebar and click theCreate Agent
button.

Fill in all the required fields, for example: • Agent Name: weather_forecast_agent • Agent Display Name: Weather Forecast Agent • Description: This is a weather forecast agent • Model: gpt-4o • Tools:
weather_forecast_tool
1 select the tool we registered earlier • Sub-Agents: - 2 since we are creating a single agent, leave the Sub-Agents field empty • Timeout: 60 • Instructions:
You are an agent that can make a weather forecast prediction.
You are provided with tools to help you make a weather forecast.
Always use the provided tools when make a weather forecast, do not assume or make up your own answer.

Click the
Save
button.Upon successful creation, the
Weather Forecast Agent
should appear in theCustom Agents
. A confirmation message will also be displayed indicating that your agent has been successfully created in the GLChat.

Creating a Chatbot with a Custom Agent in GLChat
The chatbot can only use agents that have been created in GLChat. You can create the agents by following the Creating an Agent with a Custom Tool in GLChat guide.
In the Admin Dashboard, locate the
Chatbot/Create Chatbot
section in the left sidebar and click theNew Chatbot
button.

Fill in all the required fields, for example: • Chatbot ID: weather-forecast-chatbot • Chatbot Name: Weather Forecast Chatbot • Description: This is a weather forecast chatbot • Supported Agents:
Weather Forecast Agent
1 select the agent we created earlier • Recommended Questions: -

Click the
Save
button.Upon successful creation, the
Weather Forecast Chatbot
should appear in the list of chatbots. A confirmation message will also be displayed indicating that your chatbot has been successfully created in the GLChat.

Chatting with a Custom Agent
In the GLoria Chatbot, select the
Weather Forecast Chatbot
.

Select the
Weather Forecast Agent
and ask the agent a question.
What is the weather forecast for Tuesday?


Congratulations! You are now chatting with your custom agent that uses your custom tool!
Last updated