comfyui_LLM_party

1625

Available Nodes

AmapWeatherTool

Amap Weather Query Tool Documentation

Overview

The Amap Weather Query Tool is part of the ComfyUI LLM Party repository designed to fetch weather information using the Amap Weather API. This node provides users with the functionality to inquire about weather conditions for a specific city by providing its city code. The tool is versatile and can be embedded in various ComfyUI workflows, offering real-time weather prediction and data.

Features

  • Fetch Weather Information: Retrieve current and forecasted weather details for a specified city.
  • User Configurable: Allows users to enable or disable the feature as required.
  • Multi-language Support: Adjusts the node display name based on system language settings or user configuration.

Inputs

The Amap Weather Query Tool requires the following inputs:

  1. City Code (city_code):

    • Type: String
    • Default: "110000" (Beijing)
    • Description: The city code for which you want to fetch the weather information.
  2. API Key (api_key):

    • Type: String
    • Default: A placeholder text "你的高德API密钥" (Your Amap API Key)
    • Description: The Amap API key is required to authenticate requests. Users need to replace the default text with their valid API key.
  3. Enable Toggle (is_enable):

    • Type: Boolean
    • Default: True
    • Description: A toggle to enable or disable the execution of the tool. If disabled, the tool will not fetch any weather data.

Outputs

The tool produces the following output:

  • Tool Output (tool):
    • Type: String
    • Description: The output is a JSON-formatted string containing the function call details needed to retrieve the weather information from Amap. This output includes metadata such as the function name and the city code parameters.

Usage in ComfyUI Workflows

Within ComfyUI workflows, the Amap Weather Query Tool can be a valuable component for integrating weather-related data into applications. For instance, a user wanting to include real-time weather data in a localized AI assistant could use this node to fetch the necessary information dynamically.

Example Workflow

  1. Set Up Node:

    • Integrate the Amap Weather Query Tool into your existing ComfyUI workflow.
    • Input the city code for the location you're interested in.
    • Insert your Amap API key.
    • Ensure the node is enabled by checking the is_enable toggle.
  2. Execute Workflow:

    • When the workflow is executed, the node will contact the Amap Weather API and retrieve the weather information in the specified format.
  3. Process Output:

    • Use the output to display weather information within a UI element or as part of a decision-making process in your application.

Special Features and Considerations

  • Language Support: The node adapts its display name based on system language settings or user configurations in a config.ini file. This is particularly useful for users who prefer to work in their native language.

  • API Key Requirement: Users must have a valid Amap API key to utilize this tool. The lack of a proper API key will result in unsuccessful requests.

  • Weather Forecasting: By setting the extensions parameter to ‘all,’ users can access not only current weather but also forecast data.

The Amap Weather Query Tool thus stands as a crucial node for users needing weather data customized to their specifications within the ComfyUI ecosystem.