KnowledgeBaseRetrievalClient Class
- java.
lang. Object - com.
azure. search. documents. knowledgebases. KnowledgeBaseRetrievalClient
- com.
public final class KnowledgeBaseRetrievalClient
Initializes a new instance of the synchronous KnowledgeBaseRetrievalClient type.
Method Summary
Methods inherited from java.lang.Object
Method Details
getEndpoint
public String getEndpoint()
Gets the endpoint used to communicate with the Azure AI Search service.
Returns:
getServiceVersion
public SearchServiceVersion getServiceVersion()
Gets the SearchServiceVersion used to communicate with the Azure AI Search service.
Returns:
retrieve
public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retrievalRequest)
KnowledgeBase retrieves relevant data from backing stores.
Parameters:
Returns:
retrieve
public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization)
Retrieves relevant data from backing stores.
Parameters:
Returns:
retrieve
public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization, String queryWorkIQSourceAuthorization)
KnowledgeBase retrieves relevant data from backing stores.
Parameters:
Returns:
retrieveStream
public CloseableIterableStream<KnowledgeBaseRetrievalStreamEvent> retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest)
Retrieves relevant data from backing stores and streams progress and results as server-sent events. Events are polymorphic: see KnowledgeBaseRetrievalStreamEvent for the known subtypes. Use a known subtype's getValue() to access its typed payload, for example getValue(). Unrecognized events expose only their names through getEventName(); their payloads are not available. Events are decoded lazily by a single iterator. Use try-with-resources to close the stream when iteration ends early. The response is also closed on end-of-stream, a terminal event, or an iteration failure. Closing the stream is idempotent and may throw IOException. If received, the terminal error or response.completed event is emitted before iteration ends. A failure while closing after a terminal event is reported by the next iterator access or explicit close, after the terminal event is delivered. End-of-stream without a terminal event completes normally. Transport and decoding failures are thrown during iteration. The client does not reconnect automatically.
Parameters:
Returns:
retrieveStream
public CloseableIterableStream<KnowledgeBaseRetrievalStreamEvent> retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization)
Retrieves relevant data from backing stores and streams progress and results as server-sent events. Events are polymorphic: see KnowledgeBaseRetrievalStreamEvent for the known subtypes. Use a known subtype's getValue() to access its typed payload, for example getValue(). Unrecognized events expose only their names through getEventName(); their payloads are not available. Events are decoded lazily by a single iterator. Use try-with-resources to close the stream when iteration ends early. The response is also closed on end-of-stream, a terminal event, or an iteration failure. Closing the stream is idempotent and may throw IOException. If received, the terminal error or response.completed event is emitted before iteration ends. A failure while closing after a terminal event is reported by the next iterator access or explicit close, after the terminal event is delivered. End-of-stream without a terminal event completes normally. Transport and decoding failures are thrown during iteration. The client does not reconnect automatically.
Parameters:
Returns:
retrieveStream
public CloseableIterableStream<KnowledgeBaseRetrievalStreamEvent> retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization, String queryWorkIQSourceAuthorization)
Retrieves relevant data from backing stores and streams progress and results as server-sent events. Events are polymorphic: see KnowledgeBaseRetrievalStreamEvent for the known subtypes. Use a known subtype's getValue() to access its typed payload, for example getValue(). Unrecognized events expose only their names through getEventName(); their payloads are not available. Events are decoded lazily by a single iterator. Use try-with-resources to close the stream when iteration ends early. The response is also closed on end-of-stream, a terminal event, or an iteration failure. Closing the stream is idempotent and may throw IOException. If received, the terminal error or response.completed event is emitted before iteration ends. A failure while closing after a terminal event is reported by the next iterator access or explicit close, after the terminal event is delivered. End-of-stream without a terminal event completes normally. Transport and decoding failures are thrown during iteration. The client does not reconnect automatically.
Parameters:
Returns:
retrieveWithResponse
public Response<KnowledgeBaseRetrievalResult> retrieveWithResponse(KnowledgeBaseRetrievalOptions retrievalRequest, RequestOptions requestOptions)
KnowledgeBase retrieves relevant data from backing stores.
Header Parameters
| ------------------------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Name | Type | Required | Description |
| x-ms-query-source-authorization | String | No | Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents. |
You can add these to a request with RequestOptions#addHeader
Parameters:
Returns: