Browse Courses

Agentic Action

This document outlines the actions that an agent can take in a structured manner. It covers how actions are specified, the use of tools, and how agents can be fine-tuned for coding tasks.

Actions taken by the Agent

Even though actions are taken, how these actions are performed is crucial. The agent follows a structured approach to execute tasks effectively. The action to take can be specified in JSON format, which allows the agent to understand the task and execute it accordingly where both parts are separated by a Key value pair. The agent can also use tools to perform actions, which are defined in the tools section of the JSON. Such an example of an action is shown below:

 1{
 2  "action": "fetch_repo_info",
 3  "params": {
 4    "repo_name": "hugomods/template-mod"
 5  },
 6  "tools": [
 7    {
 8      "name": "github_api",
 9      "description": "Fetch repository information from GitHub"
10    }
11  ]
12}

Simialry the agent can also call a function to perform an action. But these actions are to be stopped when the job is done and handed over to the user. In this process, another element comes into play, that is parsing the response. The agent can parse the response generated usually by using the LLM to extract the relevant information. The parser can then decide which tools to be called using the correct arguments.

Agents fine-tuned for the Coding Task

The agent when fine-tuned for the coding tasks, does not generate a raw json response, but rather generates a code block that can be executed. This is done by using the vscode-chat-code-block format, which allows the agent to generate code snippets that can be executed in a code editor. The agent can also generate code snippets in various programming languages, such as Python, JavaScript, and Java.

FAQs