{"id":13574783,"url":"https://github.com/EC-DIGIT-CSIRC/openai-cti-summarizer","last_synced_at":"2025-04-04T18:32:09.106Z","repository":{"id":165222176,"uuid":"616927488","full_name":"EC-DIGIT-CSIRC/openai-cti-summarizer","owner":"EC-DIGIT-CSIRC","description":"Small web frontend for using openAI's GPT-3.5 and GPT-4's API","archived":false,"fork":false,"pushed_at":"2024-07-15T05:33:12.000Z","size":906,"stargazers_count":50,"open_issues_count":12,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-08-02T15:12:08.924Z","etag":null,"topics":["fastapi","llms","openai","openai-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EC-DIGIT-CSIRC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-03-21T11:17:30.000Z","updated_at":"2024-05-21T12:24:41.000Z","dependencies_parsed_at":"2024-01-14T04:07:37.981Z","dependency_job_id":null,"html_url":"https://github.com/EC-DIGIT-CSIRC/openai-cti-summarizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EC-DIGIT-CSIRC%2Fopenai-cti-summarizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EC-DIGIT-CSIRC%2Fopenai-cti-summarizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EC-DIGIT-CSIRC%2Fopenai-cti-summarizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EC-DIGIT-CSIRC%2Fopenai-cti-summarizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EC-DIGIT-CSIRC","download_url":"https://codeload.github.com/EC-DIGIT-CSIRC/openai-cti-summarizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223153557,"owners_count":17096554,"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":["fastapi","llms","openai","openai-api"],"created_at":"2024-08-01T15:00:54.665Z","updated_at":"2024-11-05T10:31:08.137Z","avatar_url":"https://github.com/EC-DIGIT-CSIRC.png","language":"Python","funding_links":[],"categories":["资源列表","Tools"],"sub_categories":["项目","Assessment"],"readme":"# OpenAI and FastAPI - Text summarization \n\nThis text summarizer is a web based frontend for summarising (Cyber Threat Intelligence]() (CTI) reports. \nIt uses OpenAI's GPT-3.5 and GPT-4 API to generate meaningful summaries for management as well as for extracting IP addresses, domains, URLs, hashes etc from a CTI report.\n\nHowever, if this task is not what you need, you can also give it another system prompt as well. GPT-3.5 and GPT-4 are so flexible.\n\nOne of the main benefits of using the API is that, according to OpenAI's documentation, they delete the queries after some time and don't use it for training the next models. See [here](https://platform.openai.com/docs/guides/chat/chat-vs-completions) and [here](https://openai.com/policies/usage-policies).\n\n\n\nInput:\n\n![Example of a (public) Blog CTI blog post](static/text-example.png)\n\n\nOutput:\n\n![Example a GPT4 generated summary](static/summary-example.png)\n\n\n\n\nThis code is losely based on [Oikosohn's](https://github.com/oikosohn/openai-quickstart-fastapi) openai quickstart fastapi repo, which in turn was based on [openai-quickstart-python](https://github.com/openai/openai-quickstart-python).\n\n\nIt uses the OpenAI API [quickstart tutorial](https://beta.openai.com/docs/quickstart) and the [FastAPI](https://fastapi.tiangolo.com/) web framework. \n\nWith prompt engineering, we ask openai's gpt-4 model to summarize a CTI text for upper management.\n\n**Note**: you will have to get your own API key for this.\n\n\n## Setup\n\n1. First make a copy of the example environment variables file\n\n   ```bash\n   # Linux\n   $ cp env.example .env\n   ```\n\n   ```shell\n   # Windows\n   xcopy .env.example .env\n   ```\n\n2. Add your [API key](https://beta.openai.com/account/api-keys) to the newly created `.env` file\n   *Note*: when coding, you might want to not send a request to openai for every page reload. In that case, set `DRY_RUN=1` in `.env`.\n\n\n3. Then build the image:\n\n```bash\ndocker build -t openai-summarizer:0.1 . --network=host\n```\n\n(The .env file will be copied into the image as well)\n\n\n4. Run the dockerized app\n\n   ```bash\n   $  docker compose up -d\n   ```\n   \n\nYou should now be able to access the app at [http://localhost:9999](http://localhost:9999)! \n\n\n## Reference\n\n- [openai/openai-quickstart-python](https://github.com/openai/openai-quickstart-python)\n- [Oikosohn's fastapi openai demo](https://github.com/oikosohn/openai-quickstart-fastapi)\n\n\n# License\n\nThis code is released under the [EUPL license 1.2](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEC-DIGIT-CSIRC%2Fopenai-cti-summarizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEC-DIGIT-CSIRC%2Fopenai-cti-summarizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEC-DIGIT-CSIRC%2Fopenai-cti-summarizer/lists"}