{"id":22297939,"url":"https://github.com/katorres02/w-ruby","last_synced_at":"2026-05-18T08:34:15.453Z","repository":{"id":56897834,"uuid":"72034905","full_name":"katorres02/w-ruby","owner":"katorres02","description":"API client for watson IBM services","archived":false,"fork":false,"pushed_at":"2017-02-13T23:32:45.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-03T16:56:14.317Z","etag":null,"topics":["api","conversation-api","ruby","ruby-on-rails","watson","watson-conversation"],"latest_commit_sha":null,"homepage":"","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/katorres02.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}},"created_at":"2016-10-26T18:58:17.000Z","updated_at":"2018-02-27T02:05:02.000Z","dependencies_parsed_at":"2022-08-21T02:20:20.065Z","dependency_job_id":null,"html_url":"https://github.com/katorres02/w-ruby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/katorres02/w-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katorres02%2Fw-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katorres02%2Fw-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katorres02%2Fw-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katorres02%2Fw-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/katorres02","download_url":"https://codeload.github.com/katorres02/w-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katorres02%2Fw-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33170880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","conversation-api","ruby","ruby-on-rails","watson","watson-conversation"],"created_at":"2024-12-03T17:52:06.186Z","updated_at":"2026-05-18T08:34:15.435Z","avatar_url":"https://github.com/katorres02.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Watson-client\n\nAPI client for watson IPBM services\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'watson-client'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install watson-client\n\n## Usage\n\n### Conversation API\nInitialize your own credentials for Conversation API\n```ruby\nWatson::Conversation.configure(\n  password: 'YOUR_CONVERSATION_PASSWORD',\n  username: 'YOUR_CONVERSATION_USERNAME',\n  url:      'https://gateway.watsonplatform.net/conversation/api',\n  workspace_id: 'YOUR_CONVERSATION_WORKSPACE_ID'\n)\n```\n\n**Example:**\nA simple response from your dialog model\n```ruby\nrequire 'watson'\n\nclient = Watson::Conversation.new\nclient.send_message('message one')\n  \u003e\u003e \"Watson response one\"\nclient.send_message('message two')\n  \u003e\u003e \"Watson response two\"\n```\n\nTry something different\n```ruby\nrequire 'watson'\n\nputs 'Say Hi!'\nuser_input = nil\nuntil user_input == 'q' || user_input == 'exit'\n  print '\u003e '\n  user_input = gets.chomp\n  return if user_input == 'q' || user_input == 'exit'\n  r = client.send_message(user_input)\n  puts r\n  sleep 0.5\nend\n```\n\n### Retrieve and Rank API\nInitialize your own credentials for Conversation API\n```ruby\nWatson::RetrieveAndRank.configure(\n  url:      'https://watson-api-explorer.mybluemix.net/retrieve-and-rank/api',\n  password: 'YOUR_RETRIEVE_AND_RANK_PASSWORD',\n  username: 'YOUR_RETRIEVE_AND_RANK_USERNAME',\n  cluster_id: 'YOUR_RETRIEVE_AND_RANK_CLUSTER_ID',\n  collection_name: 'YOUR_RETRIEVE_AND_RANK_COLLECTION_NAME'\n)\n```\nGet the suggested answers\n```ruby\nresponses = Watson::RetrieveAndRank.send_message('message')\n```\n\nThe response is returned as a JSON array.\n\n### Conversation Enhanced\nCombination of Conversation API and Retrieve \u0026 Rank API. In order to get this class working you need to set both both configurations variables.\nIf the `Conversation` class detects an unknown message, we call `RetrieveAndRank` with the intent name of that unknown message, so we need to set that intent name in the constructor of `ConversationEnhanced` class.\n\n```ruby\nclient = Watson::ConversationEnhanced.new('INTENT_NAME')\nuser_input = nil\nuntil user_input == 'q' || user_input == 'exit'\n  print '\u003e '\n  user_input = gets.chomp\n  return if user_input == 'q' || user_input == 'exit'\n  r = client.send_message(user_input)\n  puts r\n  sleep 0.5\nend\n\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/katorres02/w-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatorres02%2Fw-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkatorres02%2Fw-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatorres02%2Fw-ruby/lists"}