@大宮 僚馬 To call the semantic search API, you need to use the OpenAIClient.SearchAsync
method instead of OpenAIClient.GetChatCompletionsAsync
. Here is an example of how to call the semantic search API using the OpenAIClient
:
OpenAIClientOptions clientOptions = new OpenAIClientOptions(OpenAIClientOptions.ServiceVersion.V2023_09_01_Preview);
OpenAIClient client = new OpenAIClient(new Uri(_endPoint), new AzureKeyCredential(_apiKey), clientOptions);
string query = "your search query";
string indexName = "your index name";
string semanticConfiguration = "your semantic configuration name";
SearchOptions searchOptions = new SearchOptions();
searchOptions.QueryType = OpenAIQueryType.Semantic;
searchOptions.SemanticConfiguration = semanticConfiguration;
SearchRequest searchRequest = new SearchRequest(query, indexName, searchOptions);
Response response = await client.SearchAsync(searchRequest);
In this example, you need to replace "your search query", "your index name", and "your semantic configuration name" with the appropriate values for your search.
Regarding your question about the accuracy of the semantic search, it is difficult to determine the accuracy without more information about your data and configuration. However, if you are indexing documents in Japanese and the analyzer is not in Japanese, it is possible that the accuracy of the search results will be reduced. You may want to consider using a Japanese analyzer to improve the accuracy of the search results.