Class: Roseflow::Pinecone::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/roseflow/pinecone/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = Config.new) ⇒ Client

Returns a new instance of Client.



14
15
16
17
18
# File 'lib/roseflow/pinecone/client.rb', line 14

def initialize(config = Config.new)
  @environment = config.environment
  @api_key = config.api_key
  @index_url = nil
end

Instance Attribute Details

#index_urlObject

Returns the value of attribute index_url.



12
13
14
# File 'lib/roseflow/pinecone/client.rb', line 12

def index_url
  @index_url
end

Instance Method Details

#collectionsObject



38
39
40
# File 'lib/roseflow/pinecone/client.rb', line 38

def collections
  Collection.new(connection).list
end

#create_collection(name, source) ⇒ Object



46
47
48
# File 'lib/roseflow/pinecone/client.rb', line 46

def create_collection(name, source)
  Collection.new(connection).create(name, source)
end

#create_index(name, options = {}) ⇒ Object



30
31
32
# File 'lib/roseflow/pinecone/client.rb', line 30

def create_index(name, options = {})
  Index.new(connection).create(name, options)
end

#delete_collection(name) ⇒ Object



50
51
52
# File 'lib/roseflow/pinecone/client.rb', line 50

def delete_collection(name)
  Collection.new(connection).delete(name)
end

#delete_index(name) ⇒ Object



34
35
36
# File 'lib/roseflow/pinecone/client.rb', line 34

def delete_index(name)
  Index.new(connection).delete(name)
end

#describe_collection(name) ⇒ Object



42
43
44
# File 'lib/roseflow/pinecone/client.rb', line 42

def describe_collection(name)
  Collection.new(connection).describe(name)
end

#describe_index(name) ⇒ Object



26
27
28
# File 'lib/roseflow/pinecone/client.rb', line 26

def describe_index(name)
  Index.new(connection).describe(name)
end

#index(name) ⇒ Object



54
55
56
# File 'lib/roseflow/pinecone/client.rb', line 54

def index(name)
  @index ||= get_vector_index(name)
end

#indicesObject Also known as: indexes



20
21
22
# File 'lib/roseflow/pinecone/client.rb', line 20

def indices
  Index.new(connection).list.body
end