{"id":13878170,"url":"https://github.com/alchaplinsky/ai21","last_synced_at":"2025-06-20T20:41:01.072Z","repository":{"id":171754720,"uuid":"647803112","full_name":"alchaplinsky/ai21","owner":"alchaplinsky","description":"A Ruby client for AI21  Studio API","archived":false,"fork":false,"pushed_at":"2023-06-22T10:02:33.000Z","size":37,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-26T19:55:28.020Z","etag":null,"topics":["ai","api-client","artificial-intelligence","machine-learning","ml","ruby"],"latest_commit_sha":null,"homepage":"https://docs.ai21.com/reference","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/alchaplinsky.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-31T14:51:09.000Z","updated_at":"2023-07-07T11:17:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"d1f40ce9-12e1-44be-8cbd-329e66d8eab1","html_url":"https://github.com/alchaplinsky/ai21","commit_stats":null,"previous_names":["alchaplinsky/ai21"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alchaplinsky/ai21","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchaplinsky%2Fai21","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchaplinsky%2Fai21/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchaplinsky%2Fai21/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchaplinsky%2Fai21/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alchaplinsky","download_url":"https://codeload.github.com/alchaplinsky/ai21/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchaplinsky%2Fai21/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261014035,"owners_count":23097161,"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":["ai","api-client","artificial-intelligence","machine-learning","ml","ruby"],"created_at":"2024-08-06T08:01:41.750Z","updated_at":"2025-06-20T20:40:56.056Z","avatar_url":"https://github.com/alchaplinsky.png","language":"Ruby","readme":"# Ruby client for AI21\n\nUse the [Studio AI21](https://www.ai21.com/studio) API with Ruby! Differentiate your product with generative text AI :robot:.\n\n## Installation\n\n### Gem install\nInstall gem with:\n\n```\ngem install ai21\n```\n\nand require with:\n\n```ruby\nrequire \"ai21\"\n```\n\n### Bundler\nAdd gem to your application's `Gemfile`:\n\n```ruby\ngem \"ai21\"\n```\n\nAnd then execute:\n\n```\nbundle install\n```\n\n## Getting Started\n\n- Sign up for AI21 Studio here https://studio.ai21.com/sign-up\n- Get your API key from https://studio.ai21.com/account/api-key\n- Refer to [AI21 API doc](https://docs.ai21.com/reference/) to understand options that can be passed to different tasks\n\n## Usage\n\nInstantiate a client\n```ruby\nclient = AI21::Client.new \"YOUR_API_TOKEN\"\n```\n\n#### Completion\n```ruby\nclient.complete(\"The capital of France is \")\n```\n\n#### Intstruct\n```ruby\nclient.instruct(\"Tell me the name of main character in 'The Matrix'\")\n```\n\n#### Paraphrase\n```ruby\nclient.paraphrase(\"there is nothing that can't be fixed\")\n```\n\n#### Correction\n```ruby\nclient.correct(\"can you fix this speling mistake?\")\n```\n\n#### Improvements\n```ruby\nclient.improvements(\"This is a bad decision to let AI control the world\")\n```\n\n#### Summarization\n```ruby\nclient.summarize(\"Long text that requires summarization ...\")\n```\n\n#### Question Answering\n```ruby\nclient.answer(\"what is the capital of France?\", \"Capital of France is the city called Paris\")\n```\n\n#### Tokenize\n```ruby\nclient.tokenize(\"Lorem ipsum long long tokens!\")\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/alchaplinsky/ai21. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/alchaplinsky/ai21/blob/main/CODE_OF_CONDUCT.md).\n\n## Code of Conduct\n\nEveryone interacting in the Ai21 project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/alchaplinsky/ai21/blob/main/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchaplinsky%2Fai21","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falchaplinsky%2Fai21","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchaplinsky%2Fai21/lists"}