# Data QnA v1alpha API - Class AutoSuggestionService (2.0.0-alpha02)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.0.0-alpha02 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionService)
- [2.0.0-alpha01](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/2.0.0-alpha01/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionService)
- [1.0.0-alpha03](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/1.0.0-alpha03/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionService)

    public static class AutoSuggestionService

Reference documentation and code samples for the Data QnA v1alpha API class AutoSuggestionService.

This stateless API provides automatic suggestions for natural language
queries for the data sources in the provided project and location.

The service provides a resourceless operation `suggestQueries` that can be
called to get a list of suggestions for a given incomplete query and scope
(or list of scopes) under which the query is to be interpreted.

There are two types of suggestions, ENTITY for single entity suggestions
and TEMPLATE for full sentences. By default, both types are returned.

Example Request:

    GetSuggestions({
      parent: "locations/us/projects/my-project"
      scopes:
      "//bigquery.googleapis.com/projects/my-project/datasets/my-dataset/tables/my-table"
      query: "top it"
    })

The service will retrieve information based on the given scope(s) and give
suggestions based on that (e.g. "top item" for "top it" if "item" is a known
dimension for the provided scope).

    suggestions {
      suggestion_info {
        annotated_suggestion {
          text_formatted: "top item by sum of usd_revenue_net"
          markups {
            type: DIMENSION
            start_char_index: 4
            length: 4
          }
          markups {
            type: METRIC
            start_char_index: 19
            length: 15
          }
        }
        query_matches {
          start_char_index: 0
          length: 6
        }
      }
      suggestion_type: TEMPLATE
      ranking_score: 0.9
    }
    suggestions {
      suggestion_info {
        annotated_suggestion {
          text_formatted: "item"
          markups {
            type: DIMENSION
            start_char_index: 4
            length: 2
          }
        }
        query_matches {
          start_char_index: 0
          length: 6
        }
      }
      suggestion_type: ENTITY
      ranking_score: 0.8
    }

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> AutoSuggestionService

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.DataQnA.V1Alpha](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha)

## Assembly

Google.Cloud.DataQnA.V1Alpha.dll

## Methods

### BindService(AutoSuggestionServiceBase)

    public static ServerServiceDefinition BindService(AutoSuggestionService.AutoSuggestionServiceBase serviceImpl)

Creates service definition that can be registered with a server

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `serviceImpl` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionService.AutoSuggestionServiceBase` An object implementing the server-side handling logic. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://github.com/grpc/grpc-dotnet/blob/6eccb614c532d52c1569ce9f14754fdc826609ef/src/Grpc.Core.Api/ServerServiceDefinition.cs` |   |

### BindService(ServiceBinderBase, AutoSuggestionServiceBase)

    public static void BindService(ServiceBinderBase serviceBinder, AutoSuggestionService.AutoSuggestionServiceBase serviceImpl)

Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
Note: this method is part of an experimental API that can change or be removed without any prior notice.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `serviceBinder` | `https://github.com/grpc/grpc-dotnet/blob/6eccb614c532d52c1569ce9f14754fdc826609ef/src/Grpc.Core.Api/ServiceBinderBase.cs` Service methods will be bound by calling `AddMethod` on this object. |
| `serviceImpl` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionService.AutoSuggestionServiceBase` An object implementing the server-side handling logic. |