{"id":19267928,"url":"https://github.com/yav-ai/nodejs-openai-function-calling-example","last_synced_at":"2026-03-06T21:33:23.074Z","repository":{"id":191296561,"uuid":"684336429","full_name":"YAV-AI/NodeJS-OpenAI-Function-Calling-Example","owner":"YAV-AI","description":"This repository contains a basic Node.js example demonstrating how to call functions using the OpenAI API. The example showcases a conversation with the OpenAI GPT-3.5 Turbo model, including making function calls and processing their responses.","archived":false,"fork":false,"pushed_at":"2024-03-13T07:56:04.000Z","size":7,"stargazers_count":28,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-14T19:36:27.144Z","etag":null,"topics":["chatgpt","chatgpt-api","openai","openai-api","openai-function-call","openai-function-example","openai-functions","openai-nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YAV-AI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-28T23:50:20.000Z","updated_at":"2025-05-04T23:39:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa046e7c-3be8-42c3-af59-b772cd5f7bfe","html_url":"https://github.com/YAV-AI/NodeJS-OpenAI-Function-Calling-Example","commit_stats":null,"previous_names":["yav-ai/nodejs-openai-function-calling-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YAV-AI/NodeJS-OpenAI-Function-Calling-Example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAV-AI%2FNodeJS-OpenAI-Function-Calling-Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAV-AI%2FNodeJS-OpenAI-Function-Calling-Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAV-AI%2FNodeJS-OpenAI-Function-Calling-Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAV-AI%2FNodeJS-OpenAI-Function-Calling-Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YAV-AI","download_url":"https://codeload.github.com/YAV-AI/NodeJS-OpenAI-Function-Calling-Example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAV-AI%2FNodeJS-OpenAI-Function-Calling-Example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30198661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","chatgpt-api","openai","openai-api","openai-function-call","openai-function-example","openai-functions","openai-nodejs"],"created_at":"2024-11-09T20:14:30.343Z","updated_at":"2026-03-06T21:33:23.046Z","avatar_url":"https://github.com/YAV-AI.png","language":"JavaScript","readme":"# OpenAI Function Calling example in Node.js\n\nThis repository contains a basic Node.js example demonstrating how to call functions using the OpenAI API. The example showcases a conversation with the OpenAI GPT-3.5 Turbo model, including making function calls and processing their responses.\n\n## Whats New?\n\n- Uses `tools` and `tool_choice`\n- Supports parallel function calling\n\n## Getting Started\n\n**Dependencies**: This project has no external dependencies, making it lightweight and easy to set up. You can run this example with just Node.js. However, if you have a preferred library or tool for making HTTP requests, feel free to integrate it as needed to enhance the functionality or suit your specific requirements.\n\nTo get started with this example:\n\n1. Clone this repository to your local machine:\n\n   ```shell\n   git clone \u003cthis-repo\u003e\n   ```\n\n2. Obtain an API key from \u003ca href=\"https://platform.openai.com/account/api-keys\"\u003eOpenAI\u003c/a\u003e\n\n3. Replace `Bearer sk-xxxxxxxxx` in the code with your API key.\n\n### Parallel Function calling (Uses tools and tool_choice):\n\n```shell\nnode index.js\n```\n\n### Single Function call (Deprecated) (Uses function_call and functions):\n\n```shell\nnode index[Deprecated].js\n```\n\n5. Customise the functions and conversation as needed. In this example, a simple weather-related function is included, but you can add more functions to suit your use case.\n\n## Usage\n\nThis repository serves as a starting point for understanding how to integrate function calls into your conversational AI system using the OpenAI GPT-3.5 Turbo model. You can extend the example by adding more functions, handling different types of requests, and tailoring it to your specific application.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyav-ai%2Fnodejs-openai-function-calling-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyav-ai%2Fnodejs-openai-function-calling-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyav-ai%2Fnodejs-openai-function-calling-example/lists"}