// This file is autogenerated, DO NOT EDIT
// tab-widgets/inference-api/infer-api-search.asciidoc:603

[source, python]
----
resp = client.search(
    index="alibabacloud-ai-search-embeddings",
    knn={
        "field": "content_embedding",
        "query_vector_builder": {
            "text_embedding": {
                "model_id": "alibabacloud_ai_search_embeddings",
                "model_text": "Calculate fuel cost"
            }
        },
        "k": 10,
        "num_candidates": 100
    },
    source=[
        "id",
        "content"
    ],
)
print(resp)
----
