{"id":20918553,"url":"https://github.com/karstenj/openai-examples","last_synced_at":"2026-04-30T05:35:53.155Z","repository":{"id":143983581,"uuid":"575750602","full_name":"karstenj/openai-examples","owner":"karstenj","description":"OpenAI examples","archived":false,"fork":false,"pushed_at":"2022-12-09T13:40:50.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-30T12:36:46.843Z","etag":null,"topics":["html","openai","python","uml"],"latest_commit_sha":null,"homepage":"","language":"Python","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/karstenj.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":"2022-12-08T08:04:35.000Z","updated_at":"2023-02-02T10:38:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"24a23ebb-96ed-4a1c-a375-3b2b2d403a6a","html_url":"https://github.com/karstenj/openai-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/karstenj/openai-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karstenj%2Fopenai-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karstenj%2Fopenai-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karstenj%2Fopenai-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karstenj%2Fopenai-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karstenj","download_url":"https://codeload.github.com/karstenj/openai-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karstenj%2Fopenai-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32456167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["html","openai","python","uml"],"created_at":"2024-11-18T16:39:12.909Z","updated_at":"2026-04-30T05:35:48.146Z","avatar_url":"https://github.com/karstenj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAI Examples\nA collection of [OpenAI](https://openai.com/) examples using the Python API and the model on the web.\n\n## Quickstart\n### Required Packages\n* [aocd](https://github.com/wimglenn/advent-of-code-data)\n    * `pip install aocd`\n* [openai](https://github.com/openai/openai-python)\n    * `pip install openai`\n### Environment Variables\n* AOC_SESSION - Session ID taken from browser cookie information\n* OPENAI_API_KEY - Create an API key in your OpenAI account and enter it's value in this variable\n\n## Examples\n### Advent of Code\nBased on @ostwilkens AoC solution https://github.com/ostwilkens/aoc2022.\n\nGenerated solutions for Advent of Code 2022:\n* [day1/part1](aoc/2022-1-1.py)\n* [day1/part2](aoc/2022-1-2.py)\n* [day3/part1](aoc/2022-3-1.py)\n* [day3/part2](aoc/2022-3-2.py)\n* [day4/part1](aoc/2022-4-1.py)\n* [day4/part2](aoc/2022-4-2.py)\n\n### Cyberdojo\nIn this example an algorithmic problem description taken from [cyber-dojo.org](https://cyber-dojo.org) is passed to the OpenAI model text-davinci-003. \nThe following files have to be created per algorithmic problem:\n* `\u003cproblem name\u003e_desc.txt` - problem description\n* `\u003cproblem name\u003e_func.txt` - function prototype\n* `\u003cproblem name\u003e_input_\u003cident\u003e.txt` - input data for testing\n\nGenerated solutions:\n* Print Diamond [print_diamond.py](cyberdojo/print_diamond.py) [print_diamond_desc.txt](cyberdojo/print_diamond_desc.txt)\n* Anagrams [anagrams.py](cyberdojo/anagrams.py) [anagrams_desc.txt](cyberdojo/anagrams_desc.txt)\n\n### UML Diagram\n#### Description\nThe following description is passed to the model [text-davinci-003](https://beta.openai.com/playground?model=text-davinci-003)\n```\nDraw an UML model in PlantUML syntax for the following use case. \nA library offers a lot of books. Books can be borrowed by users. \nBorrowed books are assigned to an user. \nA book has a shelf life.\n```\n#### Solution\n[Book Library PlantUML Code](uml/BookLibrary.puml)\n![Book Library UML](uml/BookLibrary.png \"Book Library UML\")\n\n### HTML Page\n#### Description\nThe following description is passed to the model [text-davinci-003](https://beta.openai.com/playground?model=text-davinci-003)\n```\nSnow fall on a html page\n\n1. Create a html page with a black background color\n\n2. Create a canvas in a html document which acts as background\n\n3. Generate an animation of snow fall\n```\n#### Solution\n[Snow Fall HTML Page](html/SnowFall.html \"Snow Fall HTML Page\")\n\n## Special thanks to\n* The OpenAI team\n* Eric Wastl for creating https://adventofcode.com/\n* wimglenn and contributors of https://github.com/wimglenn/advent-of-code-data\n* ostwilkens sharing his OpenAI AoC solution https://github.com/ostwilkens/aoc2022 \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarstenj%2Fopenai-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarstenj%2Fopenai-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarstenj%2Fopenai-examples/lists"}