JSON Format for Smart Tools

A portable way to share SkyDeck.AI smart tools written in Python code

Overall

To create a smart tool on SkyDeck.AI, you need to upload a set of files according to the specifications mentioned in the File Structure section. Once uploaded, our platform will perform the initial setup, which may take a few minutes. Afterward, the tool will be available in the GenStudio Workspace.

File Structure

<tool_name>.json

The tool's behavior is also configured through a JSON file. Here is a brief overview of the key fields in the configuration:

  • version: The current version of the tool.

  • tool_name: The name of the tool. This name should be unique in your workspace.

  • tool_code: Contains the Python code to be executed. More details on this field will be on the next section.

  • description: A brief description of what the tool does.

  • usage_notes: Instructions on how to use the tool.

  • model_version: Specify the models that are allowed to use for follow-up questions. To specify all models, use ["gpt-4", "gpt-3.5", "claude", "chat-bison"].

  • creator: Information about the creator of the tool, including name, email, and organization.

  • variables: An array of variables used by the tool. Each variable has a name, description, and default value. The order of variables in the UI follows the order in this array.

  • expected_output: The type of output produced by the tool. During the development stage, the value should always be text.

  • avatar_type: The format of the avatar used in the tool's UI.

  • timestamp: The date and time when the tool was last updated.

  • requirements: specifies the required packages to run the script in tool_code.

  • avatar: the string representing the logo of this tool

tool_code convention:

This script outlines the functioning of your tool. The main component of this script is the execute function, which has the following requirements:

  • The function should have a single input parameter called variables, which is a dictionary. Each key in this dictionary corresponds to a field that the user would input into your tool.

  • The function should return a string, which will be displayed as the response on the GenStudio UI.

Example Tools

Image generation using DALL-E 2

Description:

This tool accepts an image description as input and generates a corresponding URL for the image. The output includes the URL along with an expiration note. The tool functions by sending the query to the OpenAI DALL-E API and retrieving the response.

Input:

  • Description: Image description, e.g., "A white furry cat"

Output:

  • A message with the generated URL for the image along with the expiration note.

Python script (which would be a field inside image_generation.json):

image_generation.json

Real-time weather report with Open-Meteo API

Description:

This tool leverages the Open-Meteo API to provide real-time weather information based on users' questions. By asking a question about the weather, such as temperature, precipitation, or wind conditions, the tool retrieves the most relevant and up-to-date data.

The functioning of this tool relies on APIChain - a feature from the LangChain library - to access the Open-Meteo API documentation. This enables the tool to learn how to make the correct API calls and retrieve the required information seamlessly.

Input:

  • Question: Ask a specific question about the weather, e.g., "What is the current temperature in New York City?"

Output:

  • A response providing the requested weather information.

Python script (which would be a field inside weather_reporter.json):

Note that Langchain is now integrated with Rememberizer. See https://python.langchain.com/docs/integrations/retrievers/rememberizer/

weather_reporter.json

Limitations

AWS Lambda only allows a function to run for a maximum of 15 minutes and 10GB of RAM. Therefore, the tools should finish their execution within this constraint.

Last updated