Bird
0
0

Identify the error in this Chroma vector store setup code:

medium📝 Debug Q14 of 15
LangChain - Embeddings and Vector Stores
Identify the error in this Chroma vector store setup code:
embed = SomeEmbeddingFunction()
store = Chroma(embedding_function=embed)
store.add_texts(['Sample text'])
AMissing collection_name parameter in Chroma initialization
BEmbedding function is not assigned correctly
Cadd_texts method does not exist
DChroma requires a database URL parameter
Step-by-Step Solution
Solution:
  1. Step 1: Check required parameters for Chroma

    Chroma requires both embedding_function and collection_name to be set.
  2. Step 2: Identify missing parameter

    The code misses collection_name, which is mandatory.
  3. Final Answer:

    Missing collection_name parameter in Chroma initialization -> Option A
  4. Quick Check:

    collection_name missing = Missing collection_name parameter in Chroma initialization [OK]
Quick Trick: Always include collection_name when creating Chroma store [OK]
Common Mistakes:
  • Assuming embedding_function alone is enough
  • Thinking add_texts method is invalid
  • Believing database URL is mandatory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes