Class SearchKnowledgeAgentClient
Overview
The SearchKnowledgeAgentClient provides a synchronous API for interacting with Azure AI Search knowledge agents. This client enables you to send retrieval requests to a knowledge agent, which can aggregate and return relevant data from various backing stores configured in your Azure AI Search instance.
The client is designed to be instantiated via the SearchKnowledgeAgentClientBuilder, which allows for fluent configuration of credentials, endpoints, agent names, and other client options. Once built, the client exposes methods to perform retrieval operations, returning structured responses that include the agent's results and any associated metadata.
Getting Started
To get started, configure and build an instance of this client using the SearchKnowledgeAgentClientBuilder. Authentication can be performed using either an API key or Azure Active Directory credentials, and the builder allows you to specify the agent name, endpoint, and API version as required by your scenario.
Thread Safety
This client is thread-safe and intended to be shared across threads and reused for multiple requests.
Additional Information
For more information about Azure AI Search knowledge agents, see the Azure documentation. For advanced scenarios, such as customizing the HTTP pipeline or integrating with other Azure SDK components, refer to the Azure SDK for Java design guidelines and the documentation for SearchKnowledgeAgentClientBuilder.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGets the agent name.Gets the endpoint for the Azure AI Search service.com.azure.core.http.HttpPipelineGets theHttpPipelinepowering this client.Gets the API version.retrieve(KnowledgeAgentRetrievalRequest retrievalRequest, String xMsQuerySourceAuthorization) Retrieves relevant data from backing stores synchronously.com.azure.core.http.rest.Response<KnowledgeAgentRetrievalResponse> retrieveWithResponse(KnowledgeAgentRetrievalRequest retrievalRequest, String xMsQuerySourceAuthorization, com.azure.core.util.Context context) Retrieves relevant data from backing stores synchronously, with a full HTTP response.
-
Method Details
-
getEndpoint
Gets the endpoint for the Azure AI Search service.- Returns:
- the endpoint value.
-
getAgentName
Gets the agent name.- Returns:
- the agentName value.
-
getServiceVersion
Gets the API version.- Returns:
- the apiVersion value.
-
getHttpPipeline
public com.azure.core.http.HttpPipeline getHttpPipeline()Gets theHttpPipelinepowering this client.- Returns:
- the pipeline.
-
retrieve
public KnowledgeAgentRetrievalResponse retrieve(KnowledgeAgentRetrievalRequest retrievalRequest, String xMsQuerySourceAuthorization) Retrieves relevant data from backing stores synchronously.- Parameters:
retrievalRequest- The retrieval request to process.xMsQuerySourceAuthorization- Token identifying the user for which the query is being executed.- Returns:
- the output contract for the retrieval response.
-
retrieveWithResponse
public com.azure.core.http.rest.Response<KnowledgeAgentRetrievalResponse> retrieveWithResponse(KnowledgeAgentRetrievalRequest retrievalRequest, String xMsQuerySourceAuthorization, com.azure.core.util.Context context) Retrieves relevant data from backing stores synchronously, with a full HTTP response.- Parameters:
retrievalRequest- The retrieval request to process.xMsQuerySourceAuthorization- Token identifying the user for which the query is being executed.context- The context to associate with this operation.- Returns:
- the output contract for the retrieval response along with
Response.
-