Challenge 2: Equipping the Scanner

Previous Challenge Next Challenge

Introduction

We have our first agent, and if you’d now ask for resources, the LLM would gladly make some suggestions. But since it doesn’t know about our projects, it would probably fabricate imaginary ones. This is because LLMs lack real-time and specific information; think about your internal documents/databases/processes/rules, LLMs have no access to that information, unless we inform them.

This is where Tools come into the picture: they provide a way for LLMs/agents to access external systems, databases, or APIs, thereby augmenting the LLM’s knowledge base and enabling it to perform more complex, data-dependent operations. Although in this challenge we’ll use a tool to gather additional information, tools can also be used to execute actions such as creating tickets, modifying local files, updating databases, generating media, sending communications etc.

 Note
This might not be too obvious as we’re keeping it simple in this hack, but keep in mind that LLMs are flexible enough to call the appropriate tools even when you ask them questions that might not be directly related to the tool. For example, imagine an Agent with a tool for looking up weather information, you could ask the Agent what to wear, and the Agent would use the tool to check the weather conditions to find the right outfit.

Description

The provided code base already has a function that can look up the resources running in our project in tools.py. Update the resource_scanner_agent to use that function as a tool. Once everything works as expected, push the changes to the repository.

Success Criteria

  • The Agent has been configured to use the get_compute_instances_list function as a tool.
  • The Agent lists the following Virtual Machines when it’s asked to list all resources:

    - gce-sbx-lnx-blob-001
    - gce-dev-lnx-tomcat-001
    - gce-dev-lnx-tomcat-002
    - gce-prd-lnx-env-setup
    
  • The changes have been pushed to the remote Git repository.

Learning Resources

Tips

  • You can verify the list by navigating to the VM Instances page in the Google Cloud Console or by using the gcloud compute instances list command in Cloud Shell.

Previous Challenge Next Challenge