{"id":29953031,"url":"https://github.com/atelierarith/docstringchef.jl","last_synced_at":"2026-04-12T16:07:42.081Z","repository":{"id":304047626,"uuid":"895901705","full_name":"AtelierArith/DocstringChef.jl","owner":"AtelierArith","description":"May I explain something?","archived":false,"fork":false,"pushed_at":"2025-07-11T00:44:51.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-11T02:43:51.318Z","etag":null,"topics":["julia","julialang","llm","openai"],"latest_commit_sha":null,"homepage":"","language":"Julia","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/AtelierArith.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,"zenodo":null},"funding":{"github":"terasakisatoshi"}},"created_at":"2024-11-29T06:33:00.000Z","updated_at":"2025-07-11T00:44:54.000Z","dependencies_parsed_at":"2025-07-11T02:49:16.238Z","dependency_job_id":"c9f1a617-25b6-48e7-9685-1302be6ad003","html_url":"https://github.com/AtelierArith/DocstringChef.jl","commit_stats":null,"previous_names":["atelierarith/docstringchef.jl"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/AtelierArith/DocstringChef.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FDocstringChef.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FDocstringChef.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FDocstringChef.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FDocstringChef.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AtelierArith","download_url":"https://codeload.github.com/AtelierArith/DocstringChef.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FDocstringChef.jl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268554925,"owners_count":24269068,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"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":["julia","julialang","llm","openai"],"created_at":"2025-08-03T14:15:43.078Z","updated_at":"2026-04-12T16:07:42.042Z","avatar_url":"https://github.com/AtelierArith.png","language":"Julia","funding_links":["https://github.com/sponsors/terasakisatoshi"],"categories":[],"sub_categories":[],"readme":"# DocstringChef.jl\n\nThis Julia package supports docstring generation or explaining code given the function or method definition.\n\n## Setup\n\n- [Install Julia](https://julialang.org/downloads/)\n- Set `OPENAI_API_KEY`\n  - See https://github.com/JuliaML/OpenAI.jl to learn more.\n\n⚠️ We strongly suggest setting up your API key as an ENV variable.\n\nTo confirm `ENV[\"OPENAI_API_KEY\"]` is set properly, open Julia REPL in your terminal and run:\n\n```julia\njulia\u003e using OpenAI\n\njulia\u003e function main()\n               secret_key = ENV[\"OPENAI_API_KEY\"]\n               model = \"gpt-4o-mini\"\n               prompt =  \"Say \\\"this is a test\\\"\"\n\n               r = create_chat(\n                   secret_key,\n                   model,\n                   [Dict(\"role\" =\u003e \"user\", \"content\"=\u003e prompt)]\n                 )\n               println(r.response[:choices][begin][:message][:content])\n       end\nmain (generic function with 1 method)\n\njulia\u003e main()\nThis is a test.\n```\n\nYou can also use `DotEnv.jl` package.\n\n```julia\njulia\u003e # store API key in `.env` in advance\njulia\u003e using DotEnv\njulia\u003e DotEnv.load!()\njulia\u003e @assert haskey(ENV, \"OPENAI_API_KEY\")\n```\n\n## Clone our repository and resolve dependencies:\n\n```\n$ git clone https://github.com/AtelierArith/DocstringChef.jl.git\n$ cd DocstringChef.jl\n$ julia --project -e 'using Pkg; Pkg.instantiate()'\n```\n\n## Usage\n\n### `@explain` macro\n\nThe `@doc \u003cexpr\u003e` macro defined in the Base packages shows docstring for a given `\u003cexpr\u003e`. Not all source codes provide docstrings.\n\nThe `@explain` macro provides a function to retrieve the source code, decode the source code using OpenAI's functions, and create a (yet another) docstring.\n\n```julia\njulia\u003e @explain sin(1.0)\n  sin(x::T) where T\u003c:Union{Float32, Float64}\n\n  Compute the sine of the input value x.\n\n  The function calculates the sine of x using a specialized\n  algorithm that optimizes performance for both Float32 and\n  Float64 types. The computation handles various edge\n  cases, such as very small input values, NaN, and\n  infinity. For absolute values of x less than π/4, the\n  function computes the sine directly. For larger values,\n  it reduces the input using the periodicity of the sine\n  function and computes the sine of the reduced value.\n\n  Parameters\n  ––––––––––\n\n    •  x: A Float32 or Float64 value representing the\n       angle in radians.\n\n  Returns\n  –––––––\n\n    •  Returns the sine of the input value as a\n       Float32 or Float64, depending on the input\n       type.\n\n    •  If x is NaN, the result will be NaN.\n\n    •  If x is infinite, a domain error is raised.\n\n  Examples\n  ––––––––\n\n  julia\u003e sin(0.0)        # 0.0\n  julia\u003e sin(π/6)       # 0.5\n  julia\u003e sin(π/2)       # 1.0\n  julia\u003e sin(3π/2)      # -1.0\n\n  Notes\n  –––––\n\n    •  The function optimizes performance for small\n       values close to zero by returning x directly\n       instead of calculating the sine.\n\n    •  For large values of x, the function utilizes\n       the periodicity of sine to reduce the input\n       before calculation.\n\njulia\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatelierarith%2Fdocstringchef.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatelierarith%2Fdocstringchef.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatelierarith%2Fdocstringchef.jl/lists"}