Initialization Parameters

When setting up Composio tools, you might need to provide various configuration parameters like API keys, session IDs, or custom settings. These parameters can be specified at two levels:

  1. App-level: Parameters that apply to all actions within a specific tool/app
  2. Action-level: Specific parameters needed for individual actions

For example, if you’re using the Image Analyzer tool, you’ll need to provide an OpenAI API key. Similarly, other tools might require their own specific configuration parameters to function properly.

1

Import required libraries

2

Import Prompt template & Initialize ChatOpenAI & composio toolset client

During the initialization of the ComposioToolSet client, we can add metadata to actions & apps. In this example, we’re adding an OpenAI API key for the IMAGE_ANALYSER_ANALYSE action:

3

Get Image Analyser Action from Composio

4

Invoke the agent

How to add metadata at App-level?

Above we saw how to add metadata at the Action-level. Here’s an example of how to add metadata at the App-level: