{"id":18450261,"url":"https://github.com/johnnymo87/openai-ruby-client","last_synced_at":"2025-10-26T08:11:56.168Z","repository":{"id":259520630,"uuid":"651533347","full_name":"johnnymo87/openai-ruby-client","owner":"johnnymo87","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-12T14:38:42.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T15:35:05.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnnymo87.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-06-09T12:58:43.000Z","updated_at":"2025-03-12T14:38:47.000Z","dependencies_parsed_at":"2024-10-26T06:43:29.956Z","dependency_job_id":"a4c3bf1a-7b00-4810-94a4-4d1fb8d96315","html_url":"https://github.com/johnnymo87/openai-ruby-client","commit_stats":null,"previous_names":["johnnymo87/openai-ruby-client"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnymo87%2Fopenai-ruby-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnymo87%2Fopenai-ruby-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnymo87%2Fopenai-ruby-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnymo87%2Fopenai-ruby-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnnymo87","download_url":"https://codeload.github.com/johnnymo87/openai-ruby-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249167446,"owners_count":21223506,"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":[],"created_at":"2024-11-06T07:24:14.005Z","updated_at":"2025-10-26T08:11:56.092Z","avatar_url":"https://github.com/johnnymo87.png","language":"Ruby","readme":"## openai-ruby-client\n\nThis is just a personal script for how I use [the `openai-ruby` gem](https://github.com/alexrudall/ruby-openai) to interact with OpenAI's API, building and sending a prompt to a reason model, e.g. [the `o1` model](https://platform.openai.com/docs/models/o1). To see if you have access to it, check like so:\n\n```bash\ncurl https://api.openai.com/v1/models -H \"Authorization: Bearer $OPENAI_ACCESS_TOKEN\"\n```\n\n\n## Install\n\n1. Install or update `rbenv` (and `ruby-build` to get access to recent releases of python).\n   ```\n   brew update \u0026\u0026 brew install ruby-build rbenv\n   brew update \u0026\u0026 brew upgrade ruby-build rbenv\n   ```\n1. Install ruby.\n   ```\n   rbenv install $(cat ./.ruby-version)\n   ```\n1. Install ruby gems.\n   ```\n   bundle\n   ```\n\n### Environment Variables\n\nThis application requires [an OpenAI API key](https://platform.openai.com/docs/quickstart). You can set it as an `OPENAI_ACCESS_TOKEN` environment variable in your shell or in [an `.envrc` file](https://github.com/direnv/direnv). Below are steps for how to use `direnv` to manage environment variables, but you can also simply set the environment variable in your shell.\n\n1. Install `direnv` and configure your shell to enable automatic environment variable loading.\n   ```\n   brew install direnv\n   ```\n1. Update your dotfiles to use the direnv hook.\n   ```\n   # in e.g. ~/.bash_profile\n\n   if which direnv \u003e /dev/null; then\n     eval \"$(direnv hook bash)\"\n   fi\n   ```\n   * If you use zsh instead of bash, replace `direnv hook bash` with `direnv hook zsh`. See [the hooks documentation page in the direnv GitHub repository](https://github.com/direnv/direnv/blob/master/docs/hook.md) for more details.\n1. Copy `.envrc.example` to `.envrc`.\n   ```\n   cp .envrc.example .envrc\n   ```\n1. Fill out `.envrc`.\n1. Source the environment variables defined in `.envrc`.\n   ```\n   direnv allow\n   ```\n\n## Run\n\nWrite a prompt in a file in the `prompts/` directory, e.g. `prompts/reasoning-model-000001`. Consider using [this script](https://gist.github.com/johnnymo87/4701b6671730768ba95f19a5ee29a177) to merge many files into one in a way that's useful when prompting.\n\nThere's an `reasoning_model_client.rb` file. Use it to execute the prompt.\n```\nbundle exec ruby reasoning_model_client.rb execute prompts/reasoning-model-000001\n```\nThe result will be in the `log/` directory. There's no support for follow up prompts, so if there's anything from the result that you want to use in a follow up prompt, you'll have to copy it manually.\n\n## Contributing\n\nIf you'd like to contribute to the project, please feel free to submit a pull request or open an issue to discuss your ideas.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnymo87%2Fopenai-ruby-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnnymo87%2Fopenai-ruby-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnymo87%2Fopenai-ruby-client/lists"}