diff --git a/README.md b/README.md index bacb613..4f658eb 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ -# Scale API -![Scale API Logo](https://www.scaleapi.com/static/global/facebook-card.png) +# Scale +![Scale Logo](https://scale.ai/static/global/facebook-card.png) -This is the official Scale API RubyGem (`scaleapi`). +This is the official Scale RubyGem (`scaleapi`). -[Scale](https://www.scaleapi.com) is an API for Human Intelligence. Businesses like Alphabet (Google), Uber, Proctor & Gamble, Houzz, and many more use us to power tasks such as: +[Scale](https://scale.ai) is an API for Human Intelligence. Businesses like Alphabet (Google), Uber, Proctor & Gamble, Houzz, and many more use us to power tasks such as: - Draw bounding boxes and label parts of images (to train ML algorithms for self-driving cars) - Transcribe documents, images, and webpages - Scrape websites - Triage support tickets - Categorize and compare images, documents, and webpages -Scale is actively hiring software engineers - [apply here](https://www.scaleapi.com/about#jobs). +Scale is actively hiring software engineers - [apply here](https://scale.ai/about#jobs). ## Installation @@ -30,7 +30,7 @@ Or install it yourself as: ## Usage -First, initialize the Scale API client: +First, initialize the Scale client: ```ruby require 'scale' @@ -38,9 +38,9 @@ require 'scale' scale = Scale.new(api_key: 'SCALE_API_KEY') ``` -Note that you can optionally provide a `callback_auth_key` and `callback_url` when initializing the Scale API client. You can also set `default_request_params` which is a `Hash` that will be included in every request sent to Scale (either as a query string param or part of the request body). +Note that you can optionally provide a `callback_auth_key` and `callback_url` when initializing the Scale client. You can also set `default_request_params` which is a `Hash` that will be included in every request sent to Scale (either as a query string param or part of the request body). -If you're having trouble finding your API Key or Callback Auth Key, then go to the [Scale Dashboard](https://dashboard.scaleapi.com). If you set a default `callback_url` in your account settings, you won't need to pass it in everytime. +If you're having trouble finding your API Key or Callback Auth Key, then go to the [Scale Dashboard](https://scale.ai/dashboard). If you set a default `callback_url` in your account settings, you won't need to pass it in everytime. ## Creating Tasks @@ -53,16 +53,16 @@ For every type of task, you can pass in the following options when creating: ### Categoriation Tasks -To create a [categorization task](https://docs.scaleapi.com/#create-categorization-task), run the following: +To create a [categorization task](https://docs.scale.ai/#create-categorization-task), run the following: ```ruby require 'scale' scale = Scale.new(api_key: 'SCALE_API_KEY') scale.create_categorization_task({ - callback_url: 'http://www.example.com/callback', - instruction: 'Is this company public or private?', - attachment_type: 'website', - attachment: 'https://www.google.com', + callback_url: 'http://www.example.com/callback', + instruction: 'Is this company public or private?', + attachment_type: 'website', + attachment: 'https://www.google.com', categories: ['public', 'private'] }) ``` @@ -76,28 +76,28 @@ scale = Scale.new(api_key: 'SCALE_API_KEY') scale.tasks.create({ type: 'categorization', - callback_url: 'http://www.example.com/callback', - instruction: 'Is this company public or private?', - attachment_type: 'website', - attachment: 'https://www.google.com', + callback_url: 'http://www.example.com/callback', + instruction: 'Is this company public or private?', + attachment_type: 'website', + attachment: 'https://www.google.com', categories: ['public', 'private'] }) ``` This will also return a `Scale::Api::Tasks::Categorization` object. -[Read more about creating categorization tasks](https://docs.scaleapi.com/#create-categorization-task) +[Read more about creating categorization tasks](https://docs.scale.ai/#create-categorization-task) ### Comparison Tasks -To create a [comparison task](https://docs.scaleapi.com/#create-comparison-task), run the following: +To create a [comparison task](https://docs.scale.ai/#create-comparison-task), run the following: ```ruby require 'scale' scale = Scale.new(api_key: 'SCALE_API_KEY') scale.create_comparison_task({ - callback_url: 'http://www.example.com/callback', - instruction: 'Do the objects in these images have the same pattern?', + callback_url: 'http://www.example.com/callback', + instruction: 'Do the objects in these images have the same pattern?', attachments: [ 'http://i.ebayimg.com/00/$T2eC16dHJGwFFZKjy5ZjBRfNyMC4Ig~~_32.JPG', 'http://images.wisegeek.com/checkered-tablecloth.jpg' @@ -116,8 +116,8 @@ scale = Scale.new(api_key: 'SCALE_API_KEY') scale.tasks.create({ type: 'comparison', - callback_url: 'http://www.example.com/callback', - instruction: 'Do the objects in these images have the same pattern?', + callback_url: 'http://www.example.com/callback', + instruction: 'Do the objects in these images have the same pattern?', attachments: [ 'http://i.ebayimg.com/00/$T2eC16dHJGwFFZKjy5ZjBRfNyMC4Ig~~_32.JPG', 'http://images.wisegeek.com/checkered-tablecloth.jpg' @@ -129,19 +129,19 @@ scale.tasks.create({ This will also return a `Scale::Api::Tasks::Comparison` object. -[Read more about creating comparison tasks](https://docs.scaleapi.com/#create-comparison-task) +[Read more about creating comparison tasks](https://docs.scale.ai/#create-comparison-task) ### Datacollection Tasks -To create a [datacollection task](https://docs.scaleapi.com/#create-datacollection-task), run the following: +To create a [datacollection task](https://docs.scale.ai/#create-datacollection-task), run the following: ```ruby require 'scale' scale = Scale.new(api_key: 'SCALE_API_KEY') scale.create_datacollection_task({ - callback_url: 'http://www.example.com/callback', + callback_url: 'http://www.example.com/callback', instruction: 'Find the URL for the hiring page for the company with attached website.', - attachment: 'https://www.scaleapi.com/', + attachment: 'https://scale.ai/', attachment_type: 'website', fields: { hiring_page: 'Hiring Page URL' @@ -158,9 +158,9 @@ scale = Scale.new(api_key: 'SCALE_API_KEY') scale.tasks.create({ type: 'datacollection', - callback_url: 'http://www.example.com/callback', + callback_url: 'http://www.example.com/callback', instruction: 'Find the URL for the hiring page for the company with attached website.', - attachment: 'https://www.scaleapi.com/', + attachment: 'https://scale.ai/', attachment_type: 'website', fields: { hiring_page: 'Hiring Page URL' @@ -170,12 +170,12 @@ scale.tasks.create({ This will also return a `Scale::Api::Tasks::Datacollection` object. -[Read more about creating datacollection tasks](https://docs.scaleapi.com/#create-data-collection-task) +[Read more about creating datacollection tasks](https://docs.scale.ai/#create-data-collection-task) ### Image Recognition Tasks -To create an [image recognition task](https://docs.scaleapi.com/#create-image-recognition-task), run the following: +To create an [image recognition task](https://docs.scale.ai/#create-image-recognition-task), run the following: ```ruby require 'scale' scale = Scale.new(api_key: 'SCALE_API_KEY') @@ -236,11 +236,11 @@ scale.tasks.create({ This will also return a `Scale::Api::Tasks::ImageRecognition` object. -[Read more about creating image recognition tasks](https://docs.scaleapi.com/#create-image-recognition-task) +[Read more about creating image recognition tasks](https://docs.scale.ai/#create-image-recognition-task) ### Transcription Tasks -To create a [transcription task](https://docs.scaleapi.com/#create-transcription-task), run the following: +To create a [transcription task](https://docs.scale.ai/#create-transcription-task), run the following: ```ruby require 'scale' scale = Scale.new(api_key: 'SCALE_API_KEY') @@ -278,12 +278,12 @@ scale.tasks.create({ This will also return a `Scale::Api::Tasks::Transcription` object. -[Read more about creating transcription tasks](https://docs.scaleapi.com/#create-transcription-task) +[Read more about creating transcription tasks](https://docs.scale.ai/#create-transcription-task) ### Audio Transcription Tasks -To create an [audio transcription task](https://docs.scaleapi.com/#create-audio-transcription-task), run the following: +To create an [audio transcription task](https://docs.scale.ai/#create-audio-transcription-task), run the following: ```ruby require 'scale' scale = Scale.new(api_key: 'SCALE_API_KEY') @@ -314,7 +314,7 @@ scale.tasks.create({ This will also return a `Scale::Api::Tasks::AudioTranscription` object. -[Read more about creating audio transcription tasks](https://docs.scaleapi.com/#create-audio-transcription-task) +[Read more about creating audio transcription tasks](https://docs.scale.ai/#create-audio-transcription-task) ## Listing Tasks @@ -383,7 +383,7 @@ second_page = first_page.next_page `scale.tasks.list` is aliased to `scale.tasks.where` and `scale.tasks.all`. -For more information, [read our documentation](https://docs.scaleapi.com/#list-all-tasks) +For more information, [read our documentation](https://docs.scale.ai/#list-all-tasks) ## Finding tasks by ID @@ -485,7 +485,7 @@ class ScaleApiController < ApplicationController callback.response # Response content hash (code and result) callback.task # Scale::Api::Tasks object for task type - + end end ``` @@ -516,7 +516,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/scalea Currently, this repository has no tests - and adding tests using RSpec would make a for a great PR :) -Thanks to [wikiti](https://github.com/wikiti/) for creating the first unofficial Scale API Ruby Client! +Thanks to [wikiti](https://github.com/wikiti/) for creating the first unofficial Scale Ruby Client! ## License diff --git a/lib/scale/api.rb b/lib/scale/api.rb index 6558eec..f25748d 100644 --- a/lib/scale/api.rb +++ b/lib/scale/api.rb @@ -4,7 +4,7 @@ class Scale class Api < Struct.new(:api_key, :callback_auth_key, :default_request_params, :logging) - SCALE_API_URL = 'https://api.scaleapi.com/v1/' + SCALE_API_URL = 'https://api.scale.ai/v1/' SCALEAPI_GEM_INFO = Gem.loaded_specs["scaleapi"] SCALE_RUBY_CLIENT_VERSION = SCALEAPI_GEM_INFO ? SCALEAPI_GEM_INFO.version.to_s : '0.1.1'.freeze diff --git a/scaleapi-ruby.gemspec b/scaleapi-ruby.gemspec index d53e075..8b766d0 100644 --- a/scaleapi-ruby.gemspec +++ b/scaleapi-ruby.gemspec @@ -4,13 +4,13 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |spec| spec.name = "scaleapi" - spec.version = "0.8.2" + spec.version = "0.9.0" spec.authors = ["Alexandr Wang"] spec.email = ["alex@scaleapi.com", "roy@scaleapi.com"] spec.summary = %q{Official Ruby Client for Scale API} spec.description = %q{Scale is an API For Human Intelligence. Get high quality results for all sorts of tasks within minutes. This is the official Ruby client.} - spec.homepage = "https://www.scaleapi.com" + spec.homepage = "https://scale.ai" spec.license = "MIT"