{"id":26065636,"url":"https://github.com/assistantengine/open-functions-actions","last_synced_at":"2025-03-08T19:28:14.735Z","repository":{"id":281024477,"uuid":"943919207","full_name":"AssistantEngine/open-functions-actions","owner":"AssistantEngine","description":"Serializes OpenFunctions into ready-to-use ChatGPT actions.","archived":false,"fork":false,"pushed_at":"2025-03-06T14:19:02.000Z","size":3710,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T15:40:29.483Z","etag":null,"topics":["chatgpt","customgpt"],"latest_commit_sha":null,"homepage":"https://www.assistant-engine.com","language":"PHP","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/AssistantEngine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2025-03-06T13:37:59.000Z","updated_at":"2025-03-06T14:21:51.000Z","dependencies_parsed_at":"2025-03-06T15:42:17.900Z","dependency_job_id":"96def1ee-6ccb-4d0f-8377-e271100352e2","html_url":"https://github.com/AssistantEngine/open-functions-actions","commit_stats":null,"previous_names":["assistantengine/open-functions-actions"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssistantEngine%2Fopen-functions-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssistantEngine%2Fopen-functions-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssistantEngine%2Fopen-functions-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssistantEngine%2Fopen-functions-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AssistantEngine","download_url":"https://codeload.github.com/AssistantEngine/open-functions-actions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242598960,"owners_count":20155877,"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":["chatgpt","customgpt"],"created_at":"2025-03-08T19:28:09.567Z","updated_at":"2025-03-08T19:28:14.721Z","avatar_url":"https://github.com/AssistantEngine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![Demo Assistant Example](media/open-functions-actions.gif)\n\n\u003c/div\u003e\n\n# Open Functions Actions\n\nThis repository helps to connect **OpenFunctions** as Actions to Custom GPTs inside ChatGPT. It provides an easy way to serialize **OpenFunctions** to the required OpenAPI schema and includes a controller to receive requests directly from ChatGPT.\n\n## Installation\n\nInstall the package via Composer:\n\n```bash\ncomposer require assistant-engine/open-functions-actions\n```\n\n## Usage\n\n### Serializing OpenFunction to the OpenAPI Schema\n\nThe repository provides the ActionSerializer class that converts your **OpenFunctions** instance into an OpenAPI-compliant specification. This schema is essential for integrating your functions as actions in ChatGPT.\n\n```php\n// Instantiate an OpenFunction (e.g., DeliveryOpenFunction).\n$deliveryFunction = new DeliveryOpenFunction([\n    'Margherita',\n    'Pepperoni',\n    'Hawaiian',\n    'Veggie',\n    'BBQ Chicken',\n    'Meat Lovers'\n]);\n\n// Create an instance of ActionSerializer.\n$serializer = new ActionSerializer('Delivery Action API', '1.0.0', 'https://api.example.com', 'default');\n\n// Generate the API spec as an array.\n$apiSpecArray = $serializer-\u003eserialize($deliveryFunction);\n\necho $serializer-\u003etoJson($deliveryFunction);\n```\n\nYou can copy the output directly into the *Schema* from you custom GPT.\n\n### Providing the Endpoint for ChatGPT\n\n#### Extend the Abstract Controller\n\nYou can create a controller by extending the provided abstract controller and implement the resolveOpenFunction() method. This method should return an instance of your Open Function implementation (for example, the DeliveryOpenFunction).\n\n```php\n\u003c?php\n\nnamespace App\\Http\\Controllers;\n\nuse AssistantEngine\\OpenFunctions\\Actions\\Http\\Controllers\\OpenFunctionActionController;\nuse AssistantEngine\\OpenFunctions\\Core\\Contracts\\AbstractOpenFunction;\nuse AssistantEngine\\OpenFunctions\\Core\\Examples\\DeliveryOpenFunction;\n\nclass DeliveryActionController extends OpenFunctionActionController\n{\n    /**\n     * Return an instance of the DeliveryOpenFunction.\n     *\n     * @param string $identifier (default is 'default')\n     * @return AbstractOpenFunction\n     */\n    public function resolveOpenFunction(string $identifier = 'default'): AbstractOpenFunction\n    {\n        return new DeliveryOpenFunction([\n            'Margherita',\n            'Pepperoni',\n            'Hawaiian',\n            'Veggie',\n            'BBQ Chicken',\n            'Meat Lovers'\n        ]);\n    }\n}\n```\n\n#### Register the Route\n\nNext, register a POST route so that the endpoint /actions/{identifier}/{functionName} is reachable. When a request is sent to this endpoint, it will automatically trigger the handleAction() method inherited from the abstract controller.\n\nYou can add the following line to your routes file (usually in routes/web.php or routes/api.php):\n\n```php\nuse App\\Http\\Controllers\\DeliveryActionController;\n\nRoute::post('/actions/{identifier}/{functionName}', [DeliveryActionController::class, 'handleAction']);\n```\n\nAfter that you should be able to chat with your **OpenFunctions** like demonstrated in the video.\n\n### Available Open Function Implementations\n\nIn addition to creating your own **OpenFunction**, there are several ready-to-use implementations available.\nHere’s a quick overview:\n\n- **[Notion](https://github.com/AssistantEngine/open-functions-notion)**: Connects to your Notion workspace and enables functionalities such as listing databases, retrieving pages, and managing content blocks.\n- **[GitHub](https://github.com/AssistantEngine/open-functions-github)**: Integrates with GitHub to allow repository operations like listing branches, reading files, and committing changes.\n- **[Bitbucket](https://github.com/AssistantEngine/open-functions-bitbucket)**: Provides an interface similar to GitHub’s, enabling you to interact with Bitbucket repositories to list files, read file contents, and commit modifications.\n- **[Trello](https://github.com/AssistantEngine/open-functions-trello)**: Enables interactions with Trello boards, lists, and cards, facilitating project management directly within your assistant.\n- **[Slack](https://github.com/AssistantEngine/open-functions-slack)**: Seamlessly connects your assistant to Slack and perform actions like listing channels, posting messages, replying to threads, adding reactions, and retrieving channel history and user profiles.\n- **[Jira Service Desk](https://github.com/AssistantEngine/open-functions-jira-service-desk)**: Integrates with Jira Service Desk to interact with service requests—enabling you to create, update, and manage requests (cards), list queues, add comments, transition statuses, and manage priorities.\n\n## More Repositories\n\nWe’ve created more repositories to make AI integration even simpler and more powerful! Check them out:\n\n- **[Filament Assistant](https://github.com/AssistantEngine/filament-assistant)**: Add conversational AI capabilities directly into Laravel Filament.\n- **[Open Functions Core](https://github.com/AssistantEngine/open-functions-core)**: This library provides a set of primitives that simplify LLM calling.\n\n\u003e We are a young startup aiming to make it easy for developers to add AI to their applications. We welcome feedback, questions, comments, and contributions. Feel free to contact us at [contact@assistant-engine.com](mailto:contact@assistant-engine.com).\n\n\n## Consultancy \u0026 Support\n\nDo you need assistance integrating Filament Assistant into your Laravel Filament application, or help setting it up?  \nWe offer consultancy services to help you get the most out of our package, whether you’re just getting started or looking to optimize an existing setup.\n\nReach out to us at [contact@assistant-engine.com](mailto:contact@assistant-engine.com).\n\n## Contributing\n\nWe welcome contributions from the community! Feel free to submit pull requests, open issues, and help us improve the package.\n\n## License\n\nThis project is licensed under the MIT License. Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassistantengine%2Fopen-functions-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassistantengine%2Fopen-functions-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassistantengine%2Fopen-functions-actions/lists"}