{"id":18482704,"url":"https://github.com/raheesahmed/assistant_with_function_calling","last_synced_at":"2025-04-19T13:49:46.070Z","repository":{"id":229702700,"uuid":"776946846","full_name":"RaheesAhmed/assistant_with_function_calling","owner":"RaheesAhmed","description":"The chatbot can send a webhook with user details like name and phone number when requested.","archived":false,"fork":false,"pushed_at":"2024-05-06T13:32:40.000Z","size":101,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"Main","last_synced_at":"2025-03-29T08:23:32.284Z","etag":null,"topics":["assistants-api","chatgpt-api","function-calling","gpt4","openai","openai-assistant-api-chatbot","openai-assistants","openai-function-call","openai-functions"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RaheesAhmed.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-03-24T21:44:14.000Z","updated_at":"2024-11-28T12:47:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"ddffae8a-3c5b-47a1-b903-ed3845dd1ca0","html_url":"https://github.com/RaheesAhmed/assistant_with_function_calling","commit_stats":null,"previous_names":["raheesahmed/assistant_with_function_calling"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaheesAhmed%2Fassistant_with_function_calling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaheesAhmed%2Fassistant_with_function_calling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaheesAhmed%2Fassistant_with_function_calling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaheesAhmed%2Fassistant_with_function_calling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RaheesAhmed","download_url":"https://codeload.github.com/RaheesAhmed/assistant_with_function_calling/tar.gz/refs/heads/Main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249707386,"owners_count":21313832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["assistants-api","chatgpt-api","function-calling","gpt4","openai","openai-assistant-api-chatbot","openai-assistants","openai-function-call","openai-functions"],"created_at":"2024-11-06T12:29:49.086Z","updated_at":"2025-04-19T13:49:46.015Z","avatar_url":"https://github.com/RaheesAhmed.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chatbot with OpenAI Assistants API \u0026 Function Calling\n\nThis project showcases a chatbot integrated with the OpenAI Assistants API, capable of engaging in conversations and executing specific actions based on user requests. One notable feature is its ability to send a webhook containing user details, such as name and phone number, when requested by the user. This functionality demonstrates the chatbot's potential in real-world applications, particularly in customer service and support scenarios where collecting user information is crucial.\n\nThe chatbot is built using Node.js and Express, with the OpenAI API providing the intelligence for natural language understanding and response generation. The webhook functionality is implemented using the fetch API, allowing the chatbot to communicate with external services.\nAn OpenAI API key. You can get one by signing up at OpenAI.\n\n### Setting Up Your Project:\n\n```\ngit clone https://github.com/RaheesAhmed/assistant_with_function_calling.git\n```\n\nGO to the Directory:\n\n```\ncd assistant_with_function_calling\n```\n\n### Install Packages:\n\n```\nnpm install\n```\n\nCreate a .env file in the root of your project directory and add your OpenAI API key:\n\n```\nOPENAI_API_KEY=your_api_key_here\n```\n\nReplace your_api_key_here with your actual OpenAI API key.\n\nThe `get_webhook.js` File\nThis file contains the function to send a webhook with user details.\n\nThe `index.js` File\nThis file contains the main logic of the chatbot and the OpenAI assistant.\n\nEndpoint\nThe main endpoint for interacting with the chatbot is /chat.\n\nRequest Method\n`POST`\n`Request URL` yourdomain.com/chat\n`Request Body`\nThe request body should be a JSON object containing the following fields:\n\n`question`: The question to ask the chatbot.\n`userDetails`: An object containing user details. For example,\n`{ \"name\": \"John Doe\", \"phoneNumber\": \"1234567890\",\"date\":\"2022/12/31\" }`.\n\nExample request body:\n\n```\n{\"question\":\"I need human help\",\"userDetails\":{\"name\":\"John Doe\",\"phoneNumber\":\"1234567890\"}}\n\n```\n\nResponse\nThe response will be a JSON object containing the following field:\n\nresponse: The response from the chatbot.\nExample response:\n\n```\n{\n  \"response\": \"Please provide your name and phone number so we can assist you further.\"\n}\n```\n\nError Handling\nIf an error occurs, the API will return a JSON object with an error field containing the error message.\n\nExample error response:\n\n```\n{\n  \"error\": \"An error occurred while processing your request.\"\n}\n\n```\n\nGoogle Calander:https://console.cloud.google.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraheesahmed%2Fassistant_with_function_calling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraheesahmed%2Fassistant_with_function_calling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraheesahmed%2Fassistant_with_function_calling/lists"}