{"id":36471274,"url":"https://github.com/8ff/gpt","last_synced_at":"2026-01-12T00:38:06.102Z","repository":{"id":102517494,"uuid":"609234484","full_name":"8ff/gpt","owner":"8ff","description":"GPT-3.5 Turbo  \u0026 GPT-4 Chatbot Golang Library","archived":false,"fork":false,"pushed_at":"2024-09-04T19:20:16.000Z","size":654,"stargazers_count":13,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-06T02:57:09.201Z","etag":null,"topics":["chatgpt","chatgpt-api","chatgpt-go","chatgpt3","golang","gpt-3","gpt-4","library","openai-api","openai-api-chatbot"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/8ff.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}},"created_at":"2023-03-03T16:52:17.000Z","updated_at":"2024-09-04T19:20:19.000Z","dependencies_parsed_at":"2024-01-17T22:09:28.668Z","dependency_job_id":"5f4b5bf3-4456-48c6-a134-bcd71d4b3e3e","html_url":"https://github.com/8ff/gpt","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"15f54bdd0e77e618734b2e96ccde5bb6840d97f9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/8ff/gpt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ff%2Fgpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ff%2Fgpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ff%2Fgpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ff%2Fgpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/8ff","download_url":"https://codeload.github.com/8ff/gpt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ff%2Fgpt/sbom","scorecard":{"id":6129,"data":{"date":"2025-08-11","repo":{"name":"github.com/8ff/gpt","commit":"70eaef7d23d76ed802dd8735ce09d40aa998b23b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/vuln-check.yml:12","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/vuln-check.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/8ff/gpt/vuln-check.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/vuln-check.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/8ff/gpt/vuln-check.yml/main?enable=pin","Warn: goCommand not pinned by hash: .github/workflows/vuln-check.yml:27","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Affero General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-14T13:35:36.919Z","repository_id":102517494,"created_at":"2025-08-14T13:35:36.919Z","updated_at":"2025-08-14T13:35:36.919Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28329806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"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","chatgpt-go","chatgpt3","golang","gpt-3","gpt-4","library","openai-api","openai-api-chatbot"],"created_at":"2026-01-12T00:38:05.450Z","updated_at":"2026-01-12T00:38:06.096Z","avatar_url":"https://github.com/8ff.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](media/logo.svg \"GPT-3.5 Turbo \u0026 GPT-4 Chatbot Golang Library\")\n# GPT-3.5 Turbo \u0026 GPT-4 Chatbot Golang Library\n[![Go Report Card](https://goreportcard.com/badge/github.com/8ff/gpt)](https://goreportcard.com/report/github.com/8ff/gpt)\n[![GoDoc](https://godoc.org/github.com/8ff/gpt?status.svg)](https://godoc.org/github.com/8ff/gpt)\n[![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/8ff/gpt/blob/main/LICENSE)\n\nThis repository contains a Golang implementation of a chatbot using the OpenAI GPT-3.5 Turbo as well as the new GPT-4 API. The chatbot is able to generate human-like responses to user queries.\n\n## Library\nThe core of this chatbot implementation are the gpt_3_5_turbo and gpt_4 packages, which are Golang libraries for interacting with the OpenAI GPT-3.5 Turbo and GPT-4 API. These libraries provide a simple API for sending text queries to the GPT-3.5 and GPT-4 models and receiving human-like responses in return. They include support for features like setting the API token, configuring the request, and managing message history. With these libraries, developers can easily incorporate the power of the GPT-3.5 \u0026 GPT-4 models into their Golang applications and build intelligent chatbots or other NLP-driven tools.\n\n\n## Prerequisites\n\nTo use this chatbot, you need to have an API token for the OpenAI GPT-3.5 Turbo or GPT-4 API. You can obtain one by following the instructions on the [OpenAI website](https://beta.openai.com/signup/).\n\n## Example\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\tgpt \"github.com/8ff/gpt/pkg/gpt_3_5_turbo\"\n\t// gpt \"github.com/8ff/gpt/pkg/gpt_4\"\n)\n\nfunc main() {\n\t// Read API_TOKEN from env\n\ttoken := os.Getenv(\"API_TOKEN\")\n\n\tapi, err := gpt.Init(gpt.Params{\n\t\tAPI_TOKEN:    token,\n\t\tStripNewline: true,\n\t\tRequest: gpt.ChatRequest{\n\t\t\tModel: \"gpt-3.5-turbo\",\n\t\t\t// Model: \"gpt-4-0613\",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tchoices, err := api.Query(\"What are you ?\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, choice := range choices {\n\t\tfmt.Printf(\"Response: %s\\n\", choice.Message.Content)\n\t}\n}\n```\n\n## Installation\n\nTo install this chatbot, you need to have Go installed on your machine. Once you have Go installed, you can use the following command to download and install the chatbot:\n\n```bash\ngit clone github.com/8ff/gpt\n```\n\n## Usage\n\nThis repository also contains two demo applications for using the chatbot: a single request app and a chat app.\n\n### Single Request App\n\nThe single request app is located in `cmd/singleRequest`. To use the single request app, set the `API_TOKEN` environment variable to your OpenAI API token, and run the following command:\n\n```bash\ngo run main.go\n```\n\n![](media/singleRequest.gif \"Single Request App\")\n\n\nThe app will prompt you for a message, and generate a response based on your input.\n\n### Chat App\n\nThe chat app is located in `cmd/chat`. To use the chat app, set the `API_TOKEN` environment variable to your OpenAI API token, and run the following command:\n\n```bash\ngo run main.go\n```\n\n![](media/chat.gif \"Chat App\")\n\n\nThe app will prompt you for a message, and generate a response based on your input. You can continue chatting with the bot until you type \"exit\".\n\n## License\n\nThis code is released under the GPL3 License. See `LICENSE` for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8ff%2Fgpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F8ff%2Fgpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8ff%2Fgpt/lists"}