# function-calling **Repository Path**: router_gao/function-calling ## Basic Information - **Project Name**: function-calling - **Description**: No description available - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-04-30 - **Last Updated**: 2025-04-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Function Call with Qwen API This project demonstrates how to use function calling with the Qwen API to retrieve weather information and create temperature charts for different cities. ## Overview The project consists of a Python script that: 1. Makes API calls to the Qwen language model 2. Uses function calling to retrieve coordinates and temperature data for cities 3. Compares temperature trends between cities 4. Generates visualizations of the data ## Features - **City Coordinates Lookup**: Retrieve latitude and longitude for any city - **Temperature Data Retrieval**: Get historical temperature data for any location - **Temperature Comparison**: Compare temperature trends between two cities - **Visualization**: Generate charts showing temperature trends - **Logging**: Comprehensive logging of all API requests and responses ## Files - `function-call-multiple.py`: Main Python script that implements the function calling logic - `mermaid-flowchart-log.md`: Visualization of the log file showing the sequence of function calls - `mermaid-flowchart-script.md`: Visualization of the Python script structure and flow - `qwen_api_communication_multiple_*.log`: Log files generated during execution ## Requirements - Python 3.6+ - Required Python packages (see requirements.txt) ## Usage 1. Install the required dependencies: ``` pip install -r requirements.txt ``` 2. Run the script: ``` python function-call-multiple.py ``` 3. The script will execute the example query and generate logs and visualizations. ## Customization You can modify the example query in the script to ask different questions about cities and their temperatures. The script supports: - Listing coordinates of multiple cities - Comparing temperature trends between cities - Analyzing temperature data for specific years ## API Keys The script uses the following API keys: - Qwen API key (for the language model) - Open-Meteo API (for geocoding and weather data, no key required) ## Flowcharts The project includes two Mermaid flowcharts: 1. `mermaid-flowchart-log.md`: Shows the sequence of function calls in the log file 2. `mermaid-flowchart-script.md`: Illustrates the structure and flow of the Python script