def recommend(query_dict: dict, index_name: str,
              marqo_config: config.Config = Depends(get_config)):
    """
    Recommend similar documents. Input a list of existing document IDs or dict of IDs and weights, and the response
    will be a list of "recommendations", which are documents similar to the input. These similar documents are
    retrieved by searching using interpolated vectors from the input. No inference is done during this process.
    Please refer to [Recommend API document](https://docs.marqo.ai/latest/reference/api/search/recommend/) for details.
    """
    with RequestMetricsStore.for_request().time(f"POST /indexes/{index_name}/search"):
        # TODO this a temporary fix due to the mixed use of pydantic v1 and v2.
        #  RecommendQuery can be injected after migrated to v2
        query = parse_request_object(RecommendQuery, query_dict)

        return marqo_config.recommender.recommend(
            index_name=index_name,
            documents=query.documents,
            tensor_fields=query.tensorFields,
            interpolation_method=query.interpolationMethod,
            exclude_input_documents=query.excludeInputDocuments,
            result_count=query.limit,
            offset=query.offset,
            highlights=query.showHighlights,
            ef_search=query.efSearch,
            approximate=query.approximate,
            searchable_attributes=query.searchableAttributes,
            reranker=query.reRanker,
            filter=query.filter,
            attributes_to_retrieve=query.attributesToRetrieve,
            score_modifiers=query.scoreModifiers,
            rerank_depth=query.rerankDepth
        )

    Recommend similar documents. Input a list of existing document IDs or dict of IDs and weights, and the response
    will be a list of "recommendations", which are documents similar to the input. These similar documents are
    retrieved by searching using interpolated vectors from the input. No inference is done during this process.
    Please refer to [Recommend API document](https://docs.marqo.ai/latest/reference/api/search/recommend/) for details.
    
src/marqo/tensor_search/api.py