Snippet

As you already know, snippets are used to work on logical parts. When an API call is required you write your code within the snippets section and call the API on demand.

 

As shown in above video, you can write your logic, name the snippet and test the logic as well.

  • The test case section is where we paste our request and when clicked on run, it executes the logic.
  • The Output section is where your logic’s output is displayed.

 

Snippets can be used in 3 ways.

  1. Within workflow: If the snippet needs to be called from the workflow, the snippet should be set to “use in workflow”.
  2. Within LLM Prompt: If the snippet needs to be called from the LLM prompt, the snippet should be set to “use in prompt”.
  3. Within AgentM: If the snippet needs to be called as a tool from one of the agents, the snippet should be set to “use in agent”.

snippet