-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
chat_completions_azure_search_advanced.json
96 lines (96 loc) · 2.88 KB
/
chat_completions_azure_search_advanced.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
"title": "Creates a completion based on Azure Search vector data, previous assistant message and user-assigned managed identity.",
"parameters": {
"endpoint": "{endpoint}",
"api-version": "2024-05-01-preview",
"deployment-id": "<deployment-id>",
"body": {
"messages": [
{
"role": "user",
"content": "can you tell me how to care for a cat?"
},
{
"role": "assistant",
"content": "Content of the completion [doc1].",
"context": {
"intent": "cat care"
}
},
{
"role": "user",
"content": "how about dog?"
}
],
"data_sources": [
{
"type": "azure_search",
"parameters": {
"endpoint": "https://your-search-endpoint.search.windows.net/",
"authentication": {
"type": "user_assigned_managed_identity",
"managed_identity_resource_id": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resource-name}"
},
"index_name": "{index name}",
"query_type": "vector",
"embedding_dependency": {
"type": "deployment_name",
"deployment_name": "{embedding deployment name}"
},
"in_scope": true,
"top_n_documents": 5,
"strictness": 3,
"role_information": "You are an AI assistant that helps people find information.",
"fields_mapping": {
"content_fields_separator": "\\n",
"content_fields": [
"content"
],
"filepath_field": "filepath",
"title_field": "title",
"url_field": "url",
"vector_fields": [
"contentvector"
]
}
}
}
]
}
},
"responses": {
"200": {
"body": {
"id": "chatcmpl-7R1nGnsXO8n4oi9UPz2f3UHdgAYMn",
"created": 1686676106,
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "Content of the completion [doc1].",
"context": {
"citations": [
{
"content": "Citation content 2.",
"title": "Citation Title 2",
"filepath": "contoso2.txt",
"url": "https://contoso.blob.windows.net/container/contoso2.txt",
"chunk_id": "0"
}
],
"intent": "dog care"
}
}
}
],
"usage": {
"completion_tokens": 557,
"prompt_tokens": 33,
"total_tokens": 590
}
}
}
}
}