{"record":{"id":"f908742831eaa91d","repo":"chroma-core/chroma","slug":"multiple-embedding-functions-provided-please-prov","errorCode":null,"errorMessage":"Multiple embedding functions provided. Please provide only one.","messagePattern":"Multiple embedding functions provided\\. Please provide only one\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clients/js/packages/chromadb-core/src/ChromaClient.ts","lineNumber":244,"sourceCode":"   * ```\n   */\n  async createCollection({\n    name,\n    metadata,\n    embeddingFunction = new DefaultEmbeddingFunction(),\n    configuration,\n  }: CreateCollectionParams): Promise<Collection> {\n    await this.init();\n    if (!configuration) {\n      configuration = {};\n    }\n    if (\n      hasEmbeddingFunctionConflict(\n        embeddingFunction,\n        configuration.embedding_function,\n      )\n    ) {\n      throw new Error(\n        \"Multiple embedding functions provided. Please provide only one.\",\n      );\n    }\n    if (embeddingFunction && !configuration.embedding_function) {\n      configuration.embedding_function = embeddingFunction;\n    }\n    let collectionConfiguration: Api.CollectionConfiguration | undefined =\n      undefined;\n    if (configuration) {\n      collectionConfiguration =\n        loadApiCollectionConfigurationFromCreateCollectionConfiguration(\n          configuration,\n        );\n    }\n    const newCollection = await this.api.createCollection(\n      this.tenant,\n      this.database,\n      {","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/js/packages/chromadb-core/src/ChromaClient.ts#L226-L262","documentation":"Select.from_dict() (operator.py:1286) refuses to deserialize a Select from anything that is not a Python dict. Select controls which record keys a Search returns (documents, embeddings, scores, or metadata fields), and its dict form is the wire/JSON representation produced by Select.to_dict() (e.g. {\"keys\": [\"#document\", \"#score\"]}). Passing a string, list, or any non-mapping means the payload cannot be interpreted as a Select, so construction fails immediately with a TypeError. This is the first guard in a strict decode-validate pipeline — it exists to surface malformed search payloads at construction time instead of during query execution.","triggerScenarios":"Calling Search(select=<non-dict>) is mostly intercepted earlier by plan.py:147-157, so this fires mainly on direct calls: Select.from_dict([\"#document\"]) or Select.from_dict(\"#document\") instead of {\"keys\": [...]}; rehydrating a Search plan with json.loads output that was double-encoded (a JSON string instead of an object); passing a YAML/JSON config value that parses to a list or None instead of a mapping; or reusing a Where/Rank-style payload dict for select.","commonSituations":"Hand-building query payloads from JSON config files or HTTP request bodies where select arrives as a bare list of strings; replaying serialized Search.to_dict() output after it was flattened or stringified; version migrations where the select parameter changed from a plain list to a Select object or {\"keys\": ...} dict; copy-pasting from docs that show Search().select(K.DOCUMENT) (builder form) while passing the same value into the Search(select=...) constructor.","solutions":["Change the argument to the dict form: Select.from_dict({\"keys\": [\"#document\", \"#score\"]}) — the payload must be a mapping with a 'keys' entry.","If you only have a list/set of key strings, pass it directly to Search(select=[\"#document\", \"#score\"]); plan.py:151-153 wraps it into {\"keys\": list(select)} for you.","If the payload comes from JSON text, decode it first: Select.from_dict(json.loads(payload_json)) so you hand it a dict, not a str.","For programmatic construction prefer the typed/builder API: Select(keys={K.DOCUMENT, K.SCORE}) or Search().select(K.DOCUMENT, \"title\")."],"exampleFix":"// before\nsearch = Search(select=Select.from_dict([\"#document\", \"#score\"]))  # TypeError: Expected dict for Select, got list\n\n# after\nsearch = Search(select={\"keys\": [\"#document\", \"#score\"]})\n# or simply\nsearch = Search(select=[\"#document\", \"#score\"])","handlingStrategy":"type-guard","validationCode":"from typing import Any, Dict\ndef is_select_payload(v: Any) -> bool:\n    return isinstance(v, dict)","typeGuard":"def is_select_payload(v: Any) -> TypeGuard[Dict[str, Any]]:\n    return isinstance(v, dict)","tryCatchPattern":"try:\n    Select.from_dict(payload)\nexcept TypeError as e:\n    raise ValueError(f\"Invalid select payload (expected mapping like {{'keys': [...]}}): {e}\") from e","preventionTips":["Build select payloads only via Select(...).to_dict() or {'keys': [...]} literals.","json.loads raw text before decoding; never forward undecoded strings.","For plain key lists pass Search(select=[\"#document\"]) and let plan.py wrap it."],"tags":["chromadb","select","deserialization","typeerror","query-payload"],"backgroundTag":"dict-schema-validation-failed","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}