### Install YoMo CLI Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-weather/README.md This command installs the YoMo Command Line Interface (CLI), which is necessary for interacting with the YoMo platform and managing serverless functions. It's the first step in setting up the development environment. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Install YoMo Command Line Interface Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-google-web-search/README.md Installs the YoMo CLI tool using a curl command, which is essential for managing YoMo serverless functions and interacting with the YoMo platform. This command fetches and executes the installation script. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Run Yomo Application Locally Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-weather-google-api/README.md This command starts the Yomo application locally, enabling testing and development. It requires setting the `GOOGLE_CLOUD_API_KEY` environment variable for Google Cloud API access. ```bash GOOGLE_CLOUD_API_KEY= yomo run ``` -------------------------------- ### Install YoMo CLI Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-currency-converter/README.md This command installs the YoMo Command Line Interface (CLI) tool, which is essential for managing YoMo applications and services. It uses `curl` to download and execute an installation script from the official YoMo distribution. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-postgres-db/README.md Install the necessary project dependencies using npm. This command fetches all required packages defined in the project's `package.json` file. ```bash npm install ``` -------------------------------- ### Install YoMo CLI Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-weather/README.md Command to install the YoMo Command Line Interface. The CLI is essential for developing, deploying, and managing YoMo serverless functions and interacting with the YoMo platform. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Install YoMo Command Line Interface Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-send-mail-resend/README.md Installs the YoMo CLI tool using a curl command, which fetches and executes the installation script. The CLI is essential for developing, testing, and deploying YoMo serverless functions. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Install YoMo CLI Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-timezone-calculator/README.md This command installs the YoMo Command Line Interface (CLI) tool, which is essential for interacting with the YoMo platform and managing serverless functions. It fetches and executes the installation script from the official YoMo domain. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Install YoMo CLI using curl Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-duckduckgo-web-search/README.md This command downloads and executes the YoMo CLI installation script from the official YoMo website. The CLI is essential for managing and interacting with YoMo serverless functions. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Install YoMo CLI Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-tavily-web-search/README.md This command facilitates the installation of the YoMo Command Line Interface. The CLI is a crucial tool for managing and interacting with YoMo serverless functions, enabling developers to deploy, run, and monitor their applications efficiently. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Install YoMo Command Line Interface Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-postgres-db/README.md Download and install the YoMo CLI tool using a curl command. This CLI is essential for running and managing YoMo functions. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Start YoMo LLM Bridge Service Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-weather/README.md This command initiates the YoMo LLM Bridge service using a specified configuration file. The bridge acts as an intermediary, facilitating communication and function calls between LLMs and serverless functions. ```bash yomo serve -c ./yomo.yml ``` -------------------------------- ### Install YoMo CLI using curl Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-ip-and-latency/README.md This command installs the YoMo Command Line Interface (CLI) by downloading and executing a shell script from the official YoMo website. The CLI is essential for interacting with the YoMo platform and managing serverless functions. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Install YoMo CLI Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-ip-and-latency/README.md This command installs the YoMo command-line interface, which is essential for developing, managing, and deploying applications on the YoMo platform. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Install YoMo CLI Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-utc-time/README.md This `curl` command installs the YoMo Command Line Interface (CLI). The YoMo CLI is a crucial tool for developing, deploying, and managing serverless functions and the LLM Bridge on the YoMo platform. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Deploy Yomo Application to Vivgrid Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-weather-google-api/README.md These commands outline the steps to deploy the Yomo application to the Vivgrid platform. It involves creating a `yc.yml` configuration file with content from the Vivgrid Console and then using the `yc deploy` command. ```bash touch yc.yml ## Paste the content from Vivgrid Console to yc.yml yc deploy . ``` -------------------------------- ### Install YoMo CLI Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-send-mail-resend/README.md Provides the command to install the YoMo Command Line Interface, which is used for managing and interacting with YoMo serverless functions. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Start YoMo LLM Bridge Service Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-utc-time/README.md This `yomo serve` command initiates the YoMo LLM Bridge service. It uses the specified `yomo.yml` configuration file to set up the bridge, which acts as an intermediary for routing LLM requests and function calls. ```bash yomo serve -c ./yomo.yml ``` -------------------------------- ### Install YoMo CLI (Bash) Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-send-mail-smtp/README.md Installs the YoMo Command Line Interface (CLI) by downloading and executing the installation script via curl. The CLI is essential for managing and deploying YoMo serverless functions, providing command-line access to YoMo's features. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Download Go Module Dependencies Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-send-mail-resend/README.md Downloads and installs all necessary Go module dependencies for the project. This command ensures that all required libraries and packages are available for compilation and execution of the Go serverless function. ```bash go mod download ``` -------------------------------- ### Example LLM Chat Completion API Response Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-weather/README.md A sample JSON response from the LLM chat completion API after a successful function call. It illustrates the structure of the returned weather information, including details for specified locations. ```json { "id": "chatcmpl-AcrlEtrh6nuOkz7fjGlwkCg2L7QpC", "object": "chat.completion", "created": 1733826484, "model": "gpt-4o-2024-08-06", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Currently, it is not raining in either Paris or Sydney. \n\n- In **Paris**, the weather is characterized by broken clouds with a temperature of 6.1°C.\n- In **Sydney**, the weather also features broken clouds with a temperature of 20.82°C." }, "finish_reason": "stop", "content_filter_results": {} } ], "usage": { "prompt_tokens": 708, "completion_tokens": 137, "total_tokens": 730, "prompt_tokens_details": null, "completion_tokens_details": null }, "system_fingerprint": "fp_04751d0b65", "prompt_filter_results": [] } ``` -------------------------------- ### Install YoMo CLI Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-currency-converter/README.md Command to install the YoMo Command Line Interface (CLI) using a curl script. The CLI is necessary for developing, running, and deploying YoMo functions, providing tools for interacting with the YoMo ecosystem. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Run Unit Tests with Bun Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-weather-google-api/README.md This command executes the project's unit tests using the Bun JavaScript runtime. It's used to verify the correctness and functionality of the implemented code. ```bash bun test ``` -------------------------------- ### Install YoMo CLI using curl Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-utc-time/README.md Installs the YoMo command-line interface by executing a shell script downloaded via curl. The YoMo CLI is a prerequisite for developing, deploying, and managing serverless functions and other services on the YoMo platform. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Example Log Output for Weather Function Call Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-weather/README.md This snippet shows the console log output generated by the serverless function when it processes weather queries for specific cities. It includes detailed RAG (Retrieval Augmented Generation) information from the OpenWeatherMap API, demonstrating the function's internal processing. ```bash 2024/08/07 17:23:58 INFO get-weather city=Paris rag="{\"coord\":{\"lon\":2.3522,\"lat\":48.8566},\"weather\":[{\"id\":803,\"main\":\"Clouds\",\"description\":\"broken clouds\",\"icon\":\"04d\"}],\"base\":\"stations\",\"main\":{\"temp\":19.8,\"feels_like\":19.56,\"temp_min\":18.36,\"temp_max\":21.75,\"pressure\":1015,\"humidity\":66,\"sea_level\":1015,\"grnd_level\":1009},\"visibility\":10000,\"wind\":{\"speed\":5.14,\"deg\":300},\"clouds\":{\"all\":75},\"dt\":1723022471,\"sys\":{\"type\":2,\"id\":2012208,\"country\":\"FR\",\"sunrise\":1723005151,\"sunset\":1723058410},\"timezone\":7200,\"id\":6455259,\"name\":\"Paris\",\"cod\":200}" 2024/08/07 17:23:58 INFO get-weather city=Sydney rag="{\"coord\":{\"lon\":151.2093,\"lat\":-33.8688},\"weather\":[{\"id\":800,\"main\":\"Clear\",\"description\":\"clear sky\",\"icon\":\"01n\"}],\"base\":\"stations\",\"main\":{\"temp\":10.46,\"feels_like\":9.62,\"temp_min\":8.49,\"temp_max\":12.01,\"pressure\":1027,\"humidity\":79,\"sea_level\":1027,\"grnd_level\":1019},\"visibility\":10000,\"wind\":{\"speed\":0.45,\"deg\":99,\"gust\":0.89},\"clouds\":{\"all\":0},\"dt\":1723022638,\"sys\":{\"type\":2,\"id\":2091046,\"country\":\"AU\",\"sunrise\":1722976940,\"sunset\":1723015175},\"timezone\":36000,\"id\":6619279,\"name\":\"Sydney\",\"cod\":200}" ``` -------------------------------- ### Install YoMo CLI using curl Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-send-mail-smtp/README.md Installs the YoMo Command Line Interface (CLI) by downloading and executing a shell script directly from the official YoMo website, enabling interaction with YoMo services. ```bash curl -fsSL https://get.yomo.run | sh ``` -------------------------------- ### Example LLM Response for Currency Conversion Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-currency-converter/README.md An example JSON response from the LLM after processing a currency conversion request. It shows the assistant's reply with the calculated exchange rate and affordability assessment, demonstrating the output of the function calling integration. ```json { "id": "chatcmpl-Acss0I5tuh2ibDWr13E2p0X3LHVrG", "object": "chat.completion", "created": 1733830748, "model": "gpt-4o-2024-08-06", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "As of the current exchange rate, $8 is approximately JPY 1,138.60 (using the rate of 1 USD = 142.3246 JPY). Therefore, you can afford the book that costs JPY 1,000." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 226, "completion_tokens": 118, "total_tokens": 240, "prompt_tokens_details": null, "completion_tokens_details": null }, "system_fingerprint": "fp_04751d0b65", "prompt_filter_results": [] } ``` -------------------------------- ### Start YoMo LLM Bridge Service Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-currency-converter/README.md This command initiates the YoMo LLM Bridge service, which acts as an intermediary for LLM function calls. It uses the specified configuration file (`yomo.yml`) to define the bridge's behavior and integration with various LLM providers. ```bash yomo serve -c ./yomo.yml ``` -------------------------------- ### Deploy LLM Function Calling Serverless with Vivgrid CLI Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-weather/README.md This command deploys the specified Go application (`app.go`) to the Vivgrid platform. It also sets an environment variable, `OPENWEATHERMAP_API_KEY`, which is crucial for the application's functionality. This single command enables global distribution of the function calling serverless. ```Shell yc deploy app.go --env OPENWEATHERMAP_API_KEY= ``` -------------------------------- ### Trigger LLM Function Calling with cURL Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-weather/README.md Example cURL command to simulate an LLM chat completion request that triggers the weather function calling. This demonstrates how to interact with the API endpoint and provide a user query. ```bash curl https://api.vivgrid.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer " \ -d '{ "model": "gpt-4o", "messages": [ { "role": "user", "content": "Is it raining in Paris and Sydney?" } ] }' ``` -------------------------------- ### Example LLM Chat Completion Response Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-weather/README.md This JSON object represents a typical response from an LLM chat completion endpoint, showing the structured output including the assistant's message, token usage, and other metadata based on the weather query. It illustrates the format of the LLM's reply. ```json { "id": "chatcmpl-9tXBf7I4gb9GRlZBxHRvYaewoZm30", "object": "chat.completion", "created": 1723022639, "model": "gpt-4o-2024-05-13", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "As of the most recent data:\n\n- In **Paris**, the weather is currently characterized by broken clouds with a cloud coverage of 75%. It is not raining.\n- In **Sydney**, the weather is clear with no clouds. It is also not raining.\n\nSo, it is not raining in either Paris or Sydney at this moment." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 714, "completion_tokens": 138, "total_tokens": 852 }, "system_fingerprint": "fp_3aa7262c27" } ``` -------------------------------- ### Run YoMo Function Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-postgres-db/README.md Execute the 'postgres-db-tool' function using the YoMo CLI. This command starts the function, making it ready to receive and process requests. ```bash yomo run -n postgres-db-tool ``` -------------------------------- ### Start YoMo LLM Bridge Service Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-ip-and-latency/README.md This command initiates the YoMo LLM Bridge service, using a specified configuration file (`yomo.yml`). The bridge acts as an intermediary, connecting LLMs with custom function calling capabilities. ```bash yomo serve -c ./yomo.yml ``` -------------------------------- ### Example LLM Function Call via cURL Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-postgres-db/README.md Demonstrates how to make an API call to an LLM completion endpoint, prompting it to query the number of tables in a PostgreSQL database. This simulates an LLM interacting with the database tool through a function call. ```bash curl --request POST \ --url https://api.vivgrid.com/v1/chat/completions \ --header 'Authorization: Bearer ' \ --header 'content-type: application/json' \ --data '{ "messages": [ { "role": "assistant", "content": "tell me how many tables in my centre database" } ] }' ``` -------------------------------- ### Example LLM Function Calling Response Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-ip-and-latency/README.md This JSON snippet illustrates a typical response from the LLM Bridge API after a successful function call. It contains the model's generated content, metadata, and content filtering results, showing the output of the LLM's interaction with the function. ```json { "id": "chatcmpl-B27HtaKk2XrWs5y9p7hf2jNBQLMiJ", "object": "chat.completion", "created": 1739844369, "model": "gpt-4o-2024-08-06", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Puma's website (puma.com) has an IP address of 151.101.194.132 with an average latency of 252.080 ms. Meanwhile, Nike's website (nike.com) has an IP address of 108.157.254.92 with an average latency of 92.155 ms. Therefore, Nike's website is faster compared to Puma's website based on these latency measurements." }, "finish_reason": "stop", "content_filter_results": { "hate": { "filtered": false, "severity": "safe" }, "self_harm": { "filtered": false, "severity": "safe" }, "sexual": { "filtered": false, "severity": "safe" }, "violence": { "filtered": false, "severity": "safe" }, "jailbreak": { "filtered": false, "detected": false }, "profanity": { "filtered": false, "detected": false } } } ], "usage": { "prompt_tokens": 247, "completion_tokens": 139, "total_tokens": 295, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "completion_tokens_details": { "audio_tokens": 0, "reasoning_tokens": 0 } }, "system_fingerprint": "fp_f3927aa00d", "prompt_filter_results": [ { "index": 0, "content_filter_results": { "hate": { "filtered": false, "severity": "safe" }, "self_harm": { "filtered": false, "severity": "safe" }, "sexual": { "filtered": false, "severity": "safe" }, "violence": { "filtered": false, "severity": "safe" }, "jailbreak": { "filtered": false, "detected": false }, "profanity": { "filtered": false, "detected": false } } } ] } ``` -------------------------------- ### Example LLM Response with Weather-Based Recommendations Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-weather-google-api/README.md This snippet illustrates the LLM's generated response after successfully calling the weather function. It integrates the retrieved weather data (temperature, wind, rain) with practical advice on clothing and accessories for the described activity. ```markdown For your hike on the Yarra Bend Park Loop, the current weather is clear with a temperature of approximately 12.3°C (feels like 11.9°C). Here are some suggestions on what to wear: 1. **Layers**: Start with a base layer such as a moisture-wicking t-shirt. Add a light sweater or fleece for warmth since it can be chilly. 2. **Jacket**: Bring a lightweight jacket or windbreaker to keep warm, especially as it is breezy with a southeast wind at 6 km/h with gusts up to 14 km/h. 3. **Pants**: Comfortable hiking pants or leggings will be suitable. 4. **Footwear**: Wear sturdy hiking boots or shoes with good grip. 5. **Accessories**: Consider a hat or beanie for warmth, and bring gloves if you tend to get cold easily. 6. **Backpack**: Carry a small backpack with water, snacks, and any additional layers you might need. Since there is **no rain** expected, you shouldn't need waterproof gear, but it's always wise to check the latest forecast before heading out. Enjoy your hike! ``` -------------------------------- ### Example LLM User Query for Weather Information Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-weather-google-api/README.md This snippet shows a typical user query to an LLM that would trigger the weather function calling mechanism. The query asks for advice on what to wear for a hike, implying a need for weather data. ```text I'm going for a hike on the Yarra Bend Park Loop. What should I wear? ``` -------------------------------- ### Example LLM Function Call Response Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-postgres-db/README.md Illustrates the expected JSON response from the LLM completion API after a successful function call. This output shows the assistant's reply, indicating the number of tables found in the specified database. ```json { "id": "chatcmpl-B9M9aiAAv0Q3rf6LxxUFxphuAVPsC", "object": "chat.completion", "created": 1741569810, "model": "gpt-4o-2024-08-06", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Your \"centre\" database contains 5 tables." }, "finish_reason": "stop", "content_filter_results": { "hate": { "filtered": false, "severity": "safe" }, "self_harm": { "filtered": false, "severity": "safe" }, "sexual": { "filtered": false, "severity": "safe" }, "violence": { "filtered": false, "severity": "safe" }, "jailbreak": { "filtered": false, "detected": false }, "profanity": { "filtered": false, "detected": false } } } ], "usage": { "prompt_tokens": 164, "completion_tokens": 45, "total_tokens": 117, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "completion_tokens_details": { "audio_tokens": 0, "reasoning_tokens": 0 } }, "system_fingerprint": "fp_b705f0c291", "prompt_filter_results": [ { "index": 0, "content_filter_results": { "hate": { "filtered": false }, "self_harm": { "filtered": false }, "sexual": { "filtered": false }, "violence": { "filtered": false }, "jailbreak": { "filtered": false, "detected": false }, "profanity": { "filtered": false, "detected": false } } } ] } ``` -------------------------------- ### Example LLM Chat Completion API Response Structure Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-tavily-web-search/README.md This JSON snippet provides an example of the response structure returned by the LLM chat completions API. It details fields such as `id`, `object`, `created`, `model`, `choices` (containing the assistant's message and finish reason), `usage` statistics, and `content_filter_results`, illustrating the typical output format for successful function calls. ```json { "id": "chatcmpl-B0UuxQ3FXgrDXb4Gk4S21EfglS1BT", "object": "chat.completion", "created": 1739458547, "model": "gpt-4o-2024-08-06", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "On January 13, 2025, the stock market experienced mixed performances. The Dow Jones Industrial Average rose by 0.9%, while the S\u0026P 500 rebounded from earlier losses to close up 0.2%. However, the Nasdaq Composite fell 0.4%. The tech sector, particularly chip stocks, weighed down on the markets. Concerns were prevalent about the Federal Reserve's next move on interest rates, especially after a strong jobs report earlier raised doubts about potential rate cuts. The market dynamics were also influenced by pending economic data on inflation and the Consumer Price Index scheduled for that week." }, "finish_reason": "stop", "content_filter_results": { "hate": { "filtered": false, "severity": "safe" }, "self_harm": { "filtered": false, "severity": "safe" }, "sexual": { "filtered": false, "severity": "safe" }, "violence": { "filtered": false, "severity": "safe" }, "jailbreak": { "filtered": false, "detected": false }, "profanity": { "filtered": false, "detected": false } } } ], "usage": { "prompt_tokens": 3850, "completion_tokens": 148, "total_tokens": 3875, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "completion_tokens_details": { "audio_tokens": 0, "reasoning_tokens": 0 } }, "system_fingerprint": "fp_f3927aa00d", "prompt_filter_results": [ { "index": 0, "content_filter_results": { "hate": { "filtered": false, "severity": "safe" }, "self_harm": { "filtered": false, "severity": "safe" }, "sexual": { "filtered": false, "severity": "safe" }, "violence": { "filtered": false, "severity": "safe" }, "jailbreak": { "filtered": false, "detected": false }, "profanity": { "filtered": false, "detected": false } } } ] } ``` -------------------------------- ### Example LLM Chat Completion API Response Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-duckduckgo-web-search/README.md This JSON snippet illustrates a typical response from the vivgrid chat completions API after a successful function call. It contains details such as the completion ID, model used, generated assistant message, and usage statistics. ```json { "id": "chatcmpl-B0UuxQ3FXgrDXb4Gk4S21EfglS1BT", "object": "chat.completion", "created": 1739458547, "model": "gpt-4o-2024-08-06", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "On January 13, 2025, the stock market experienced mixed performances. The Dow Jones Industrial Average rose by 0.9%, while the S\u0026P 500 rebounded from earlier losses to close up 0.2%. However, the Nasdaq Composite fell 0.4%. The tech sector, particularly chip stocks, weighed down on the markets. Concerns were prevalent about the Federal Reserve's next move on interest rates, especially after a strong jobs report earlier raised doubts about potential rate cuts. The market dynamics were also influenced by pending economic data on inflation and the Consumer Price Index scheduled for that week." }, "finish_reason": "stop", "content_filter_results": { "hate": { "filtered": false, "severity": "safe" }, "self_harm": { "filtered": false, "severity": "safe" }, "sexual": { "filtered": false, "severity": "safe" }, "violence": { "filtered": false, "severity": "safe" }, "jailbreak": { "filtered": false, "detected": false }, "profanity": { "filtered": false, "detected": false } } } ], "usage": { "prompt_tokens": 3850, "completion_tokens": 148, "total_tokens": 3875, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "completion_tokens_details": { "audio_tokens": 0, "reasoning_tokens": 0 } }, "system_fingerprint": "fp_f3927aa00d", "prompt_filter_results": [ { "index": 0, "content_filter_results": { "hate": { "filtered": false, "severity": "safe" }, "self_harm": { "filtered": false, "severity": "safe" }, "sexual": { "filtered": false, "severity": "safe" }, "violence": { "filtered": false, "severity": "safe" }, "jailbreak": { "filtered": false, "detected": false }, "profanity": { "filtered": false, "detected": false } } } ] } ``` -------------------------------- ### View Realtime Logs for Vivgrid Deployments Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-weather/README.md This command allows users to retrieve and display realtime logs from their applications deployed on Vivgrid. It is essential for monitoring application health, debugging issues, and understanding operational behavior in a distributed environment. ```Shell yc logs ``` -------------------------------- ### Configure Environment Variables for YoMo Function Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-weather/README.md Set up necessary environment variables for the YoMo serverless function. This includes the function's name, the Zipper service address, your YoMo credential, and the OpenWeatherMap API key required for weather data retrieval. ```sh YOMO_SFN_NAME=my_first_llm_function_tool YOMO_SFN_ZIPPER=zipper.vivgrid.com:9000 YOMO_SFN_CREDENTIAL= OPENWEATHERMAP_API_KEY= ``` -------------------------------- ### Start YoMo LLM Bridge Service Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-timezone-calculator/README.md This command initiates the YoMo LLM Bridge service using the specified configuration file (`yomo.yml`). The bridge acts as an intermediary, routing LLM function calls and managing interactions with various LLM providers based on the defined settings. ```bash yomo serve -c ./yomo.yml ``` -------------------------------- ### Deploy LLM Function Calling Serverless with Vivgrid CLI Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-utc-time/README.md This command initiates the deployment of the application defined in 'app.go' across all configured data regions on Vivgrid. It simplifies the process of achieving global distribution for your LLM Function Calling serverless application with a single command. ```Shell yc deploy app.go ``` -------------------------------- ### Configure YoMo Serverless Function Environment Variables Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-get-ip-and-latency/README.md This snippet shows how to set up essential environment variables for deploying a YoMo serverless function, including its name, Zipper address, and credentials. These variables are crucial for the function's deployment and operation. ```sh YOMO_SFN_NAME=my_first_llm_function_tool YOMO_SFN_ZIPPER=zipper.vivgrid.com:9000 YOMO_SFN_CREDENTIAL= ``` -------------------------------- ### YoMo LLM Bridge Configuration (YAML) Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-weather/README.md This YAML configuration defines the settings for the YoMo LLM Bridge, including its name, host, port, and details for the AI bridge. It specifies the LLM provider (e.g., OpenAI), API key, and model to be used. ```yaml name: generic-llm-bridge host: 0.0.0.0 port: 9000 bridge: ai: server: addr: 0.0.0.0:9000 provider: openai providers: openai: api_key: model: ``` -------------------------------- ### Invoke LLM for Currency Conversion Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-currency-converter/README.md Example cURL command to invoke an LLM API endpoint with a user message requesting currency conversion. This demonstrates how to trigger the function calling mechanism by sending a natural language query to the LLM. ```bash curl https://api.vivgrid.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer " \ -d '{ "messages": [ { "role": "user", "content": "I want to buy a book that costs JPY 1,000. I have $8. Can I afford it?" } ] }' ``` -------------------------------- ### Run YoMo Serverless Function (Bash) Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/node-tool-send-mail-smtp/README.md Executes the YoMo serverless function, connecting it to the LLM bridge. This command starts the function, making it available for invocation by the LLM and enabling it to process function calls. ```bash yomo run -n my_first_llm_function_tool ``` -------------------------------- ### Attach Serverless Function to YoMo LLM Bridge Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-weather/README.md This command executes the Go application, effectively attaching the serverless function to the running YoMo LLM Bridge. It requires the OpenWeatherMap API key to be pre-set as an environment variable for successful operation. ```bash OPENWEATHERMAP_API_KEY= yomo run app.go ``` -------------------------------- ### Configure Environment Variables for YoMo LLM Bridge Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-weather/README.md This snippet shows how to set up environment variables required for the YoMo LLM Bridge, including the service name, zipper address, and the OpenWeatherMap API key. These variables are crucial for the function calling to operate correctly. ```sh YOMO_SFN_NAME=llm_tool_get_weather YOMO_SFN_ZIPPER=localhost:9000 OPENWEATHERMAP_API_KEY= ``` -------------------------------- ### Example Response from LLM Bridge with Function Calling Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-get-ip-and-latency/README.md This JSON object represents a successful response from the LLM Bridge after a function call. It includes the LLM's generated content, which now incorporates real-time data (IP addresses and latency) obtained through the custom function. ```json { "id": "chatcmpl-9tXvPPQUNEu7IyeZp902NQ2O6dF1M", "object": "chat.completion", "created": 1723025475, "model": "gpt-4o-2024-05-13", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Puma's website (puma.com) has an IP address of 151.101.66.132 with an average latency of 54.03 ms, while Nike's website (nike.com) has an IP address of 13.225.183.89 with an average latency of 80.91 ms. This suggests that Puma's website is faster than Nike's in terms of latency." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 240, "completion_tokens": 126, "total_tokens": 366 }, "system_fingerprint": "fp_3aa7262c27" } ``` -------------------------------- ### Start MailDev SMTP Development Server with Docker Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-send-mail-smtp/README.md Launches a MailDev container using Docker, mapping ports 1080 (for the web interface) and 1025 (for SMTP) to the host machine. This provides a local SMTP server for testing email sending functionality without actually sending emails. ```bash docker run -p 1080:1080 -p 1025:1025 maildev/maildev ``` -------------------------------- ### Example LLM Response for Single Currency Conversion Source: https://github.com/yomorun/llm-function-calling-examples/blob/main/golang-tool-currency-converter/README.md This JSON object illustrates a typical response from the LLM Bridge after processing a single currency conversion request. It contains the LLM's generated message, which includes the calculated conversion result based on the user's input. ```json { "id": "chatcmpl-9rLPlliiUPndzuRi2kuu2TfZHM2cz", "object": "chat.completion", "created": 1722500729, "model": "gpt-4o-2024-05-13", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "With $10, you can get approximately 1,498.63 yen. Since the sunglasses cost 1,499 yen, you are just short by about 0.37 yen. So, you cannot afford the sunglasses with $10." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 223, "completion_tokens": 70, "total_tokens": 293 }, "system_fingerprint": "fp_4e2b2da518" } ```