Azure Discovery client library for Java - version 1.0.0-beta.1

This package contains Microsoft Azure Discovery client library.

Documentation

Various documentation is available to help you get started

Getting started

Prerequisites

Adding the package to your product

<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-ai-discovery</artifactId>
    <version>1.0.0-beta.1</version>
</dependency>

Authentication

Azure Identity package provides the default implementation for authenticating the client.

Key concepts

The Discovery data-plane library is organized around two service endpoints, each with its own client builder:

  • WorkspaceWorkspaceClientBuilder builds operation-group clients for a Discovery workspace: ConversationsClient, InvestigationsClient, TasksClient, and ToolsClient (each with an asynchronous variant) to manage conversations, investigations, tasks, and long-running tool runs.
  • BookshelfBookshelfClientBuilder builds BookshelfClient / BookshelfAsyncClient to manage knowledge bases, including long-running create/update, indexing, and search.

Each client is created with its service endpoint and a TokenCredential such as DefaultAzureCredential. The Workspace and Bookshelf endpoints are distinct, so build the client that matches the operation you need.

Examples

ConversationsClient conversationsClient = new WorkspaceClientBuilder()
    .endpoint("https://<workspace-name>.discovery.azure.com")
    .credential(new DefaultAzureCredentialBuilder().build())
    .buildConversationsClient();

PagedConversation conversations = conversationsClient.list();
for (Conversation conversation : conversations.getValue()) {
    System.out.println(conversation.getName());
}

List knowledge bases with a BookshelfClient:

BookshelfClient bookshelfClient = new BookshelfClientBuilder()
    .endpoint("https://<bookshelf-name>.discovery.azure.com")
    .credential(new DefaultAzureCredentialBuilder().build())
    .buildClient();

for (KnowledgeBase knowledgeBase : bookshelfClient.list()) {
    System.out.println(knowledgeBase.getName());
}

Service API versions

The client library targets the latest service API version by default. The service client builder accepts an optional service API version parameter to specify which API version to communicate.

Select a service API version

You have the flexibility to explicitly select a supported service API version when initializing a service client via the service client builder. This ensures that the client can communicate with services using the specified API version.

When selecting an API version, it is important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility.

Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy.

Troubleshooting

  • Authentication — ensure your TokenCredential (for example DefaultAzureCredential) can obtain a token and that the identity has access to the target workspace or bookshelf resource.
  • Endpoints — Workspace and Bookshelf operations use different endpoints; pointing a client at the wrong endpoint typically results in 403/404 responses.
  • HTTP logging — set httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) on the client builder to inspect the underlying requests and responses. See the logging wiki for details.

Next steps

Contributing

For details on contributing to this repository, see the contributing guide.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request