{"id":16056072,"url":"https://github.com/ksylvest/omniai-anthropic","last_synced_at":"2026-02-18T05:15:02.803Z","repository":{"id":243725943,"uuid":"813254941","full_name":"ksylvest/omniai-anthropic","owner":"ksylvest","description":"An implementation of the OmniAI interface for Anthropic.","archived":false,"fork":false,"pushed_at":"2026-02-17T09:29:14.000Z","size":153,"stargazers_count":6,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-17T14:29:15.793Z","etag":null,"topics":["anthropic","claude","omniai","ruby"],"latest_commit_sha":null,"homepage":"https://omniai-anthropic.ksylvest.com","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/ksylvest.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-10T19:15:34.000Z","updated_at":"2026-02-17T09:28:59.000Z","dependencies_parsed_at":"2025-12-14T10:00:05.439Z","dependency_job_id":null,"html_url":"https://github.com/ksylvest/omniai-anthropic","commit_stats":null,"previous_names":["ksylvest/omniai-anthropic"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/ksylvest/omniai-anthropic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksylvest%2Fomniai-anthropic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksylvest%2Fomniai-anthropic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksylvest%2Fomniai-anthropic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksylvest%2Fomniai-anthropic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksylvest","download_url":"https://codeload.github.com/ksylvest/omniai-anthropic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksylvest%2Fomniai-anthropic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29567616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"online","status_checked_at":"2026-02-18T02:00:09.468Z","response_time":162,"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":["anthropic","claude","omniai","ruby"],"created_at":"2024-10-09T02:40:26.323Z","updated_at":"2026-02-18T05:14:57.793Z","avatar_url":"https://github.com/ksylvest.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OmniAI::Anthropic\n\n[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ksylvest/omniai-anthropic/blob/main/LICENSE)\n[![RubyGems](https://img.shields.io/gem/v/omniai-anthropic)](https://rubygems.org/gems/omniai-anthropic)\n[![GitHub](https://img.shields.io/badge/github-repo-blue.svg)](https://github.com/ksylvest/omniai-anthropic)\n[![Yard](https://img.shields.io/badge/docs-site-blue.svg)](https://omniai-anthropic.ksylvest.com)\n[![CircleCI](https://img.shields.io/circleci/build/github/ksylvest/omniai-anthropic)](https://circleci.com/gh/ksylvest/omniai-anthropic)\n\nAn Anthropic implementation of the [OmniAI](https://github.com/ksylvest/omniai)\nAPIs.\n\n## Installation\n\n```sh\ngem install omniai-anthropic\n```\n\n## Usage\n\n### Client\n\nA client is setup as follows if `ENV['ANTHROPIC_API_KEY']` exists:\n\n```ruby\nclient = OmniAI::Anthropic::Client.new\n```\n\nA client may also be passed the following options:\n\n- `api_key` (required - default is `ENV['ANTHROPIC_API_KEY']`)\n- `host` (optional)\n\n### Configuration\n\nGlobal configuration is supported for the following options:\n\n```ruby\nOmniAI::Anthropic.configure do |config|\n  config.api_key = '...' # default: ENV['ANTHROPIC_API_KEY']\n  config.host = '...' # default: 'https://api.anthropic.com'\nend\n```\n\n### Chat\n\nA chat completion is generated by passing in prompts using any a variety of\nformats:\n\n```ruby\ncompletion = client.chat('Tell me a joke!')\ncompletion.text # 'Why did the chicken cross the road? To get to the other side.'\n```\n\n```ruby\ncompletion = client.chat do |prompt|\n  prompt.system('You are a helpful assistant.')\n  prompt.user('What is the capital of Canada?')\nend\ncompletion.text # 'The capital of Canada is Ottawa.'\n```\n\n#### Model\n\n`model` takes an optional string (default is `claude-3-haiku-20240307`):\n\n```ruby\ncompletion = client.chat('Provide code for fibonacci', model: OmniAI::Anthropic::Chat::Model::CLAUDE_SONNET)\ncompletion.text # 'def fibonacci(n)...end'\n```\n\n[Anthropic API Reference `model`](https://docs.anthropic.com/en/api/messages)\n\n#### Temperature\n\n`temperature` takes an optional float between `0.0` and `1.0` (defaults is\n`0.7`):\n\n```ruby\ncompletion = client.chat('Pick a number between 1 and 5', temperature: 1.0)\ncompletion.text # '3'\n```\n\n[Anthropic API Reference `temperature`](https://docs.anthropic.com/en/api/messages)\n\n#### Stream\n\n`stream` takes an optional a proc to stream responses in real-time chunks\ninstead of waiting for a complete response:\n\n```ruby\nstream = proc do |chunk|\n  print(chunk.text) # 'Better', 'three', 'hours', ...\nend\nclient.chat('Be poetic.', stream:)\n```\n\n[Anthropic API Reference `stream`](https://docs.anthropic.com/en/api/messages)\n\n#### Format\n\n`format` takes an optional symbol (`:json`, `:text`, or `OmniAI::Schema::Format`) and modifies the system message to include additional context for formatting:\n\n```ruby\nformat = OmniAI::Schema.format(name: \"Contact\", schema: OmniAI::Schema.object(\n  properties: {\n    name: OmniAI::Schema.string,\n  },\n  required: %i[name]\n))\ncompletion = client.chat(format: :json) do |prompt|\n  prompt.user('What is the name of the drummer for the Beatles?')\nend\nformat.parse(completion.text) # { \"name\": \"Ringo\" }\n```\n\n[Anthropic API Reference `control-output-format`](https://docs.anthropic.com/en/docs/control-output-format)\n\n### Computers\n\n```bash\nsudo apt-get install convert # screenshots\nsudo apt-get install scrot # screenshots\nsudo apt-get install xdotool # mouse / keyboard\n```\n\n```ruby\ncomputer = OmniAI::Anthropic::Computer.new\n\ncompletion = client.chat(tools: [computer]) do |prompt|\n  prompt.user('Please signup for reddit')\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksylvest%2Fomniai-anthropic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksylvest%2Fomniai-anthropic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksylvest%2Fomniai-anthropic/lists"}