pinecone 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '082c3fe33f5264800e3f5e76d115c2a4ed7408f6943aebe47c42f05550c667a4'
4
- data.tar.gz: 51864ea5223cb3629126f3a857c35332c4522efaaddda99f27313cfc9c548c79
3
+ metadata.gz: dfec2eabb8bf73f49e6f18a56a5ea1bb654762b9d6eba959df8375a2e4f21586
4
+ data.tar.gz: 62a15cd30e1e5cf697c52445166efaaa0c2aeee23b3bd321b1bf1770384c9163
5
5
  SHA512:
6
- metadata.gz: b169dcc7b50295d0db7f3d4a63f6690404a319e62dfe65b565075be3dfb23186c39b2aeab2169279d50325085674de90c685daa87bd68dd0dfe92bba293cec69
7
- data.tar.gz: 3d730c8d22dcc8235c68ea14ad430cd16f890ba6e8e84c36b60f0bb763eaa757e04f136c938fdbcbdfa9177de0fc5a51f5d8ecc18417e846137396a4d3d5829b
6
+ metadata.gz: 3fefd95787b1a15e5ca829d9f002a18983ac6358fe5c62b7b9e08766c60a28f5a8c08616f932e1a4a63157a55f1a2e176399946b74c86c01179d8b4a13106895
7
+ data.tar.gz: 47f7b6f8c35ea91b5756036058ea1f2220f842c2ecb298304c1fbdfd9574bad9cfbbfde8ef94be42c06a98b76e5ad442c050cab5a79b01093099000a27b351c8
@@ -6,7 +6,7 @@ module Pinecone
6
6
  parser Pinecone::ResponseParser
7
7
 
8
8
  def initialize
9
- self.class.base_uri "https://api.pinecone.io"
9
+ self.class.base_uri Pinecone.configuration.base_uri
10
10
 
11
11
  @headers = {
12
12
  "Content-Type" => "application/json",
@@ -6,7 +6,7 @@ module Pinecone
6
6
  parser Pinecone::ResponseParser
7
7
 
8
8
  def initialize
9
- self.class.base_uri "https://api.pinecone.io"
9
+ self.class.base_uri Pinecone.configuration.base_uri
10
10
  @headers = {
11
11
  "Content-Type" => "application/json",
12
12
  "Accept" => "application/json",
@@ -18,9 +18,9 @@ module Pinecone
18
18
  @base_uri = if host.start_with?("http://", "https://")
19
19
  host
20
20
  elsif host.start_with?("localhost")
21
- "http://#{host}" # Use HTTP for localhost
21
+ "http://#{host}"
22
22
  else
23
- "https://#{host}" # Use HTTPS for production hosts
23
+ "https://#{host}"
24
24
  end
25
25
  elsif index_name
26
26
  # Legacy path: call describe_index
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pinecone
4
- VERSION = "1.2.2"
4
+ VERSION = "1.2.3"
5
5
  end
data/lib/pinecone.rb CHANGED
@@ -15,13 +15,15 @@ module Pinecone
15
15
  class IndexNotFoundError < StandardError; end
16
16
 
17
17
  class Configuration
18
- attr_writer :api_key, :base_uri, :environment, :silence_deprecation_warnings
19
- attr_accessor :host
18
+ DEFAULT_BASE_URI = "https://api.pinecone.io"
19
+
20
+ attr_writer :api_key, :environment, :silence_deprecation_warnings
21
+ attr_accessor :host, :base_uri
20
22
 
21
23
  def initialize
22
24
  @api_key = nil
23
25
  @environment = nil
24
- @base_uri = nil
26
+ @base_uri = DEFAULT_BASE_URI
25
27
  @host = nil
26
28
  @silence_deprecation_warnings = false
27
29
  end
@@ -32,12 +34,6 @@ module Pinecone
32
34
  raise ConfigurationError, "Pinecone API key not set"
33
35
  end
34
36
 
35
- def base_uri
36
- return @base_uri if @base_uri
37
-
38
- raise ConfigurationError, "Pinecone domain not set"
39
- end
40
-
41
37
  def environment
42
38
  return @environment if @environment
43
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinecone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Carleton