{"id":15504269,"url":"https://github.com/kentcdodds/epic-ai","last_synced_at":"2025-04-23T00:09:15.785Z","repository":{"id":218944576,"uuid":"656873602","full_name":"kentcdodds/epic-ai","owner":"kentcdodds","description":"The Epic Stack + OpenAI chat completion API example","archived":false,"fork":false,"pushed_at":"2024-01-24T22:17:01.000Z","size":11055,"stargazers_count":75,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-23T00:09:09.841Z","etag":null,"topics":["epic-stack","epic-stack-example"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/kentcdodds.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":"2023-06-21T20:28:49.000Z","updated_at":"2025-04-15T20:59:15.000Z","dependencies_parsed_at":"2025-03-04T18:42:32.239Z","dependency_job_id":null,"html_url":"https://github.com/kentcdodds/epic-ai","commit_stats":null,"previous_names":["kentcdodds/epic-ai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fepic-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fepic-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fepic-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fepic-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kentcdodds","download_url":"https://codeload.github.com/kentcdodds/epic-ai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250343947,"owners_count":21415040,"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":["epic-stack","epic-stack-example"],"created_at":"2024-10-02T09:16:57.322Z","updated_at":"2025-04-23T00:09:15.731Z","avatar_url":"https://github.com/kentcdodds.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Epic Stack](https://github.com/epicweb-dev/epic-stack) + [OpenAI](https://openai.com/)\n\nhttps://github.com/kentcdodds/epic-ai/assets/1500684/376ac2f7-5bca-4049-bf84-b109abb23feb\n\nThis demonstrates how to use [OpenAI](https://openai.com/) with the\n[Epic Stack](https://github.com/epicweb-dev/epic-stack). It includes streaming\nfrom the chat completion API and enhances the note editor with a completion\nbutton for both the title and the content.\n\nTo check out the changes, check\n[the git commit history](https://github.com/kentcdodds/epic-ai/commit/bf820c1c8e0232012b690558a3a5f2cc8517168b).\nThe important bits are:\n\n1. Get an API key from OpenAI (you probably will need to setup billing because\n   their free tier does not seem to work very well)\n2. Add the API key to the `.env` file for local testing and add a fake one to\n   `.env.example` for the repo\n3. Add the `openai` package to the `package.json` file\n4. Add a mock handler for the chat completion API (for now, we just use\n   passthrough, but if you want to mock it so this works offline, then go for\n   it).\n5. Add a resource route that will be used to stream the chat completion API\n6. Add a generate button to the note editor for both the title and content.\n   (Those will need to change to controlled inputs so that the completion can be\n   added to the input value).\n7. When the generate button is clicked, start a new `EventStream` and point it\n   to our resource route.\n\n[Watch me build this live on YouTube](https://www.youtube.com/watch?v=Qzpx-j-NxLY).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentcdodds%2Fepic-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkentcdodds%2Fepic-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentcdodds%2Fepic-ai/lists"}