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
All the code used in the following examples can be found in our GitHub repository gen-ai-examples/custom-tool-and-agent.
This example uses weather_forecast_tool.py. You can also use your own custom tool.
git clone https://github.com/GDP-ADMIN/gen-ai-examples.git
cd gen-ai-examples/examples/custom-tool-and-agentOpening the Admin Dashboard in GLChat.
Open your browser and sign in to GLChat.

Choose the
Admin Dashboard.
If you have already logged in and chosen GLoria Chatbot, you can easily switch to the Admin Dashboard by clicking your profile at the bottom left of the page and selecting
Switch to Admin Dashboard.
In the Admin Dashboard, locate the
AI Agent/Toolssection in the left sidebar and click theUpload Toolbutton.

Upload the
weather_forecast_tool.py.Upon successful upload, the
weather_forecast_toolshould 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 this example, we will create an agent with the ability to make weather forecasts using the weather_forecast_tool we registered in the previous step.
Opening the Admin Dashboard in GLChat.
Open your browser and sign in to GLChat.

Choose the
Admin Dashboard.
If you have already logged in and chosen GLoria Chatbot, you can easily switch to the Admin Dashboard by clicking your profile at the bottom left of the page and selecting
Switch to Admin Dashboard.
In the Admin Dashboard, locate the
AI Agent/Agentsection in the left sidebar and click theCreate Agentbutton.

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_tool1 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:

Click the
Savebutton.Upon successful creation, the
Weather Forecast Agentshould 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 this example, we will create a chatbot with the ability to make weather forecasts using the Weather Forecast Agent we created in the previous step.
Opening the Admin Dashboard in GLChat.
Open your browser and sign in to GLChat.

Choose the
Admin Dashboard.
If you have already logged in and chosen GLoria Chatbot, you can easily switch to the Admin Dashboard by clicking your profile at the bottom left of the page and selecting
Switch to Admin Dashboard.
In the Admin Dashboard, locate the
Chatbot/Create Chatbotsection in the left sidebar and click theNew Chatbotbutton.

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 Agent1 select the agent we created earlier • Recommended Questions: -

Click the
Savebutton.Upon successful creation, the
Weather Forecast Chatbotshould 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
Opening the GLoria Chatbot in GLChat.
Open your browser and sign in to GLChat.

Choose the
GLoria Chatbot.
If you have already logged in and chosen Admin Dashboard, you can easily switch to the GLoria Chatbot by clicking your profile at the bottom left of the page and selecting
Switch to GLoria Chatbot.
In the GLoria Chatbot, select the
Weather Forecast Chatbot.

Select the
Weather Forecast Agentand 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!
Troubleshooting
For common issues and their solutions, please refer to the centralized FAQ document.
Last updated