KnowledgeBaseRetrievalClient Class
KnowledgeBaseRetrievalClient.
Constructor
KnowledgeBaseRetrievalClient(endpoint: str, credential: AzureKeyCredential | AsyncTokenCredential, **kwargs: Any)
Parameters
| Name | Description |
|---|---|
|
endpoint
Required
|
The endpoint URL of the search service. Required. |
|
credential
Required
|
Credential used to authenticate requests to the service. Is either a key credential type or a token credential type. Required. |
|
knowledge_base_name
Required
|
The name of the knowledge base. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
api_version
|
The API version to use for this operation. Known values are "2026-04-01" and None. Default value is "2026-04-01". Note that overriding this default value may result in unsupported behavior. |
|
audience
|
Sets the Audience to use for authentication with Microsoft Entra ID. The audience is not considered when using a shared key. If audience is not provided, the public cloud audience will be assumed. |
Methods
| close | |
| retrieve |
KnowledgeBase retrieves relevant data from backing stores. |
| send_request |
Runs the network request through the client's chained policies.
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request |
close
async close() -> None
retrieve
KnowledgeBase retrieves relevant data from backing stores.
async retrieve(retrieval_request: KnowledgeBaseRetrievalRequest | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) -> KnowledgeBaseRetrievalResponse
Parameters
| Name | Description |
|---|---|
|
retrieval_request
Required
|
The retrieval request to process. Is one of the following types: KnowledgeBaseRetrievalRequest, JSON, IO[bytes] Required. |
Returns
| Type | Description |
|---|---|
|
KnowledgeBaseRetrievalResponse. The KnowledgeBaseRetrievalResponse is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
send_request
Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = await client.send_request(request)
<AsyncHttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
send_request(request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> Awaitable[AsyncHttpResponse]
Parameters
| Name | Description |
|---|---|
|
request
Required
|
The network request you want to make. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
stream
|
Whether the response payload will be streamed. Defaults to False. Default value: False
|
Returns
| Type | Description |
|---|---|
|
The response of your network call. Does not do error handling on your response. |