Method: Langchain::Vectorsearch::Milvus#add_texts

Defined in:
lib/langchain/vectorsearch/milvus.rb

#add_texts(texts:) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/langchain/vectorsearch/milvus.rb', line 26

def add_texts(texts:)
  client.entities.insert(
    collection_name: index_name,
    data: texts.map do |text|
      {content: text, vector: llm.embed(text: text).embedding}
    end
  )
end