Running a Custom Tool and Agent in GLChat

This is an example of how to use a custom tool and agent in GLChat.

Prerequisites

This example specifically requires:

  • A GLChat account with admin dashboard access

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-agent
Opening the Admin Dashboard in GLChat.
  1. Open your browser and sign in to GLChat.

  2. Choose the Admin Dashboard.

  3. 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.

  1. In the Admin Dashboard, locate the AI Agent/Tools section in the left sidebar and click the Upload Tool button.

  1. Upon successful upload, the weather_forecast_tool should appear in the Custom 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

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.
  1. Open your browser and sign in to GLChat.

  2. Choose the Admin Dashboard.

  3. 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.

  1. In the Admin Dashboard, locate the AI Agent/Agent section in the left sidebar and click the Create Agent button.

  1. 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.
  1. Click the Save button.

  2. Upon successful creation, the Weather Forecast Agent should appear in the Custom 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

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.
  1. Open your browser and sign in to GLChat.

  2. Choose the Admin Dashboard.

  3. 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.

  1. In the Admin Dashboard, locate the Chatbot/Create Chatbot section in the left sidebar and click the New Chatbot button.

  1. 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: -

  1. Click the Save button.

  2. 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

Opening the GLoria Chatbot in GLChat.
  1. Open your browser and sign in to GLChat.

  2. Choose the GLoria Chatbot.

  3. 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.

  1. In the GLoria Chatbot, select the Weather Forecast Chatbot.

  1. Select the Weather Forecast Agent and ask the agent a question.

What is the weather forecast for Tuesday?

Troubleshooting

For common issues and their solutions, please refer to the centralized FAQ document.

Last updated