我正在关注本教程 - https://learn.microsoft.com/en-us/azure/search/search-get-started-vector。post
我尝试使用python
api ,而不是发送呼叫。
对于请求
POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/docs/search?api-version=2023-11-01
Content-Type: application/json
api-key: {{admin-api-key}}
{
"count": true,
"select": "HotelId, HotelName, Description, Category",
"vectors": [
{
"value": [0.01944167, 0.0040178085
. . .
010858015, -0.017496133],
"k": 7,
"fields": "DescriptionVector",
"kind": "vector",
"exhaustive": true
}
]
}
参数如何映射到https://learn.microsoft.com/en-us/python/api/azure-search-documents/azure.search.documents.searchclient?view=azure-python#azure-searchsearch
中提到的api -文档搜索客户端搜索
到目前为止,我已经创建了
search_client.search(query_type='semantic', semantic_configuration_name='my-semantic-config',
search_text="which restaurant has rating of 4 or over?",
select='HotelName,Description,Category', query_caption='extractive',
vector_queries = [..],
我在哪里提到其他参数,例如k
, fields
, kind
,exhaustive
这应该在
vector_queries
“VectorQuery”对象数组中提及。定义在这里:https://learn.microsoft.com/en-us/python/api/azure-search-documents/azure.search.documents.models.vectorquery ?view=azure-python