Skip to content

Commit

Permalink
Merge pull request #12 from Find-AI/release-please--branches--main--c…
Browse files Browse the repository at this point in the history
…hanges--next

release: 0.1.0-alpha.3
  • Loading branch information
philipithomas authored Oct 3, 2024
2 parents 3570a4d + 48264e4 commit d277f93
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.2"
".": "0.1.0-alpha.3"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 6
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/find-ai%2Ffind-ai-bf9b5b8a950e0a79b0bf1911bf01feb5a3575113be8f5d24f7b487351f3470c5.yml
configured_endpoints: 2
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/find-ai%2Ffind-ai-703a90257c6ec20e6b67cbb97b6699e96ffef05e62249c4d98bd8fb5b197617d.yml
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.1.0-alpha.3 (2024-10-02)

Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/Find-AI/find-ai-ruby/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)

### Features

* **api:** OpenAPI spec update via Stainless API ([#11](https://github.com/Find-AI/find-ai-ruby/issues/11)) ([96c2c1d](https://github.com/Find-AI/find-ai-ruby/commit/96c2c1dc60a94573ffb5bb8784a1ac78bedaaaf6))


### Chores

* **types:** more detailed type documentation ([#13](https://github.com/Find-AI/find-ai-ruby/issues/13)) ([07c3177](https://github.com/Find-AI/find-ai-ruby/commit/07c3177ed3717f61c7ba031dbf058cfc1212d2d4))

## 0.1.0-alpha.2 (2024-09-26)

Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/Find-AI/find-ai-ruby/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
Expand Down
4 changes: 0 additions & 4 deletions lib/find-ai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
require "find-ai/pooled_net_requester"
require "find-ai/util"
require "find-ai/version"
require "find-ai/models/enrich_create_response"
require "find-ai/models/enrich_retrieve_response"
require "find-ai/models/enrich_create_response"
require "find-ai/models/enrich_retrieve_response"
require "find-ai/models/search_create_response"
require "find-ai/models/search_retrieve_response"
require "find-ai/resources/company_enrichment"
Expand Down
13 changes: 9 additions & 4 deletions lib/find-ai/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ class Client < BaseClient
# Default max number of retries to attempt after a failed retryable request.
DEFAULT_MAX_RETRIES = 2

# Client options.
# Client option
# @return [String]
attr_reader :api_key

# @return [FindAI::Resources::CompanyEnrichment]
Expand All @@ -23,11 +24,15 @@ def auth_headers
end

# Creates and returns a new client for interacting with the API.
def initialize(base_url: nil, api_key: nil, max_retries: nil)
#
# @param base_url [String, nil] Override the default base URL for the API, e.g., `"https://api.example.com/v2/"`
# @param api_key [String, nil] Defaults to `ENV["FIND_AI_API_KEY"]`
# @param max_retries [Integer] Max number of retries to attempt after a failed retryable request.
#
# @return [FindAI::Client]
def initialize(base_url: nil, api_key: nil, max_retries: DEFAULT_MAX_RETRIES)
base_url ||= "https://usefind.ai/found"

max_retries ||= DEFAULT_MAX_RETRIES

@api_key = [api_key, ENV["FIND_AI_API_KEY"]].find { |v| !v.nil? }
if @api_key.nil?
raise ArgumentError, "api_key is required"
Expand Down
35 changes: 0 additions & 35 deletions lib/find-ai/models/enrich_create_response.rb

This file was deleted.

35 changes: 0 additions & 35 deletions lib/find-ai/models/enrich_retrieve_response.rb

This file was deleted.

32 changes: 0 additions & 32 deletions lib/find-ai/resources/company_enrichment/enrich.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,6 @@ class Enrich
def initialize(client:)
@client = client
end

# Returns structured data about a company based on a domain input.
#
# @param params [Hash] Attributes to send in this request.
# @option params [String] :domain The domain of the company.
#
# @param opts [Hash|RequestOptions] Options to specify HTTP behaviour for this request.
#
# @return [FindAI::Models::EnrichCreateResponse]
def create(params = {}, opts = {})
req = {}
req[:method] = :post
req[:path] = "/v1/companies/enrich"
req[:body] = params
req[:model] = FindAI::Models::EnrichCreateResponse
@client.request(req, opts)
end

# The endpoint to poll to check the latest results when data about a company isn't
# immediately available.
#
# @param token [String] The token returned with your initial API call.
# @param opts [Hash|RequestOptions] Options to specify HTTP behaviour for this request.
#
# @return [FindAI::Models::EnrichRetrieveResponse]
def retrieve(token, opts = {})
req = {}
req[:method] = :get
req[:path] = "/v1/companies/enrich/#{token}"
req[:model] = FindAI::Models::EnrichRetrieveResponse
@client.request(req, opts)
end
end
end
end
Expand Down
33 changes: 0 additions & 33 deletions lib/find-ai/resources/people_enrichment/enrich.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,6 @@ class Enrich
def initialize(client:)
@client = client
end

# Returns structured data about a person based on their business email address.
#
# @param params [Hash] Attributes to send in this request.
# @option params [String] :email The person's business email address. We won't accept personal email address such
# as Gmail, Yahoo etc.
#
# @param opts [Hash|RequestOptions] Options to specify HTTP behaviour for this request.
#
# @return [FindAI::Models::EnrichCreateResponse]
def create(params = {}, opts = {})
req = {}
req[:method] = :post
req[:path] = "/v1/people/enrich"
req[:body] = params
req[:model] = FindAI::Models::EnrichCreateResponse
@client.request(req, opts)
end

# The endpoint to poll to check the latest results when data about a person isn't
# immediately available.
#
# @param token [String] The token returned with your initial API call.
# @param opts [Hash|RequestOptions] Options to specify HTTP behaviour for this request.
#
# @return [FindAI::Models::EnrichRetrieveResponse]
def retrieve(token, opts = {})
req = {}
req[:method] = :get
req[:path] = "/v1/people/enrich/#{token}"
req[:model] = FindAI::Models::EnrichRetrieveResponse
@client.request(req, opts)
end
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions lib/find-ai/resources/searches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ def initialize(client:)
# Starts a search.
#
# @param params [Hash] Attributes to send in this request.
# @option params [Float] :max_matches The maximum number of results to return. optional for result_mode exact
# @option params [String] :query Search query.
# @option params [String] :result_mode The mode of the search. Valid values are 'exact' or 'best'.
# @option params [String] :scope The scope of the search. Valid values are 'people' or 'companies'.
# @option params [Float, nil] :max_matches The maximum number of results to return. optional for result_mode exact
# @option params [String, nil] :query Search query.
# @option params [String, nil] :result_mode The mode of the search. Valid values are 'exact' or 'best'.
# @option params [String, nil] :scope The scope of the search. Valid values are 'people' or 'companies'.
#
# @param opts [Hash|RequestOptions] Options to specify HTTP behaviour for this request.
# @param opts [Hash, FindAI::RequestOptions] Options to specify HTTP behaviour for this request.
#
# @return [FindAI::Models::SearchCreateResponse]
def create(params = {}, opts = {})
Expand All @@ -30,7 +30,7 @@ def create(params = {}, opts = {})
# The endpoint to poll to check the latest results of a search.
#
# @param id [String] The id returned with your initial API call.
# @param opts [Hash|RequestOptions] Options to specify HTTP behaviour for this request.
# @param opts [Hash, FindAI::RequestOptions] Options to specify HTTP behaviour for this request.
#
# @return [Array<FindAI::Models::SearchRetrieveResponse::SearchRetrieveResponse>]
def retrieve(id, opts = {})
Expand Down
2 changes: 1 addition & 1 deletion lib/find-ai/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module FindAI
VERSION = "0.1.0-alpha.2"
VERSION = "0.1.0-alpha.3"
end
10 changes: 0 additions & 10 deletions test/find-ai/resources/company_enrichment/enrich_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,4 @@ class FindAI::Test::Resources::EnrichTest < Test::Unit::TestCase
def setup
@find_ai = FindAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key")
end

def test_create
response = @find_ai.company_enrichment.enrich.create
assert_kind_of(FindAI::Models::EnrichCreateResponse, response)
end

def test_retrieve
response = @find_ai.company_enrichment.enrich.retrieve("token")
assert_kind_of(FindAI::Models::EnrichRetrieveResponse, response)
end
end
10 changes: 0 additions & 10 deletions test/find-ai/resources/people_enrichment/enrich_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,4 @@ class FindAI::Test::Resources::EnrichTest < Test::Unit::TestCase
def setup
@find_ai = FindAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key")
end

def test_create
response = @find_ai.people_enrichment.enrich.create
assert_kind_of(FindAI::Models::EnrichCreateResponse, response)
end

def test_retrieve
response = @find_ai.people_enrichment.enrich.retrieve("token")
assert_kind_of(FindAI::Models::EnrichRetrieveResponse, response)
end
end

0 comments on commit d277f93

Please sign in to comment.