Shuts down any channels automatically created by Create() and
CreateAsync(CancellationToken). Channels which weren't automatically created are not
affected.
A task representing the asynchronous shutdown operation.
Remarks
After calling this method, further calls to Create() and
CreateAsync(CancellationToken) will create new channels, which could in turn be shut down
by another call to this method.
StreamAssist(StreamAssistRequest, CallSettings)
public virtual AssistantServiceClient.StreamAssistStream StreamAssist(StreamAssistRequest request, CallSettings callSettings = null)
Assists the user with a query in a streaming fashion.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Discovery Engine v1 API - Class AssistantServiceClient (1.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.8.0/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.7.0/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.6.0/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.5.0/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.4.0/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.3.0/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.2.0/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.1.0/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.0.0-beta06/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient) \n\n public abstract class AssistantServiceClient\n\nReference documentation and code samples for the Discovery Engine v1 API class AssistantServiceClient.\n\nAssistantService client wrapper, for convenient use. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AssistantServiceClient \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring) \n\nDerived Types\n-------------\n\n[AssistantServiceClientImpl](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClientImpl)\n\nNamespace\n---------\n\n[Google.Cloud.DiscoveryEngine.V1](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.DiscoveryEngine.V1.dll\n\nRemarks\n-------\n\nService for managing Assistant configuration and assisting users.\n\nProperties\n----------\n\n### DefaultEndpoint\n\n public static string DefaultEndpoint { get; }\n\nThe default endpoint for the AssistantService service, which is a host of \"discoveryengine.googleapis.com\"\nand a port of 443.\n\n### DefaultScopes\n\n public static IReadOnlyList\u003cstring\u003e DefaultScopes { get; }\n\nThe default AssistantService scopes.\n\n**Remarks** \nThe default AssistantService scopes are:\n\n- \u003chttps://www.googleapis.com/auth/cloud-platform\u003e\n\n\u003cbr /\u003e\n\n### GrpcClient\n\n public virtual AssistantService.AssistantServiceClient GrpcClient { get; }\n\nThe underlying gRPC AssistantService client\n\n### LocationsClient\n\n public virtual LocationsClient LocationsClient { get; }\n\nThe [LocationsClient](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html) associated with this client.\n\n### ServiceMetadata\n\n public static ServiceMetadata ServiceMetadata { get; }\n\nThe service metadata associated with this client type.\n\nMethods\n-------\n\n### Create()\n\n public static AssistantServiceClient Create()\n\nSynchronously creates a [AssistantServiceClient](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient) using the default credentials, endpoint and\nsettings. To specify custom credentials or other settings, use [AssistantServiceClientBuilder](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClientBuilder).\n\n### CreateAsync(CancellationToken)\n\n public static Task\u003cAssistantServiceClient\u003e CreateAsync(CancellationToken cancellationToken = default)\n\nAsynchronously creates a [AssistantServiceClient](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient) using the default credentials, endpoint and\nsettings. To specify custom credentials or other settings, use [AssistantServiceClientBuilder](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClientBuilder).\n\n### ShutdownDefaultChannelsAsync()\n\n public static Task ShutdownDefaultChannelsAsync()\n\nShuts down any channels automatically created by [Create()](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient#Google_Cloud_DiscoveryEngine_V1_AssistantServiceClient_Create) and\n[CreateAsync(CancellationToken)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient#Google_Cloud_DiscoveryEngine_V1_AssistantServiceClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not\naffected.\n\n**Remarks** \nAfter calling this method, further calls to [Create()](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient#Google_Cloud_DiscoveryEngine_V1_AssistantServiceClient_Create) and\n[CreateAsync(CancellationToken)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AssistantServiceClient#Google_Cloud_DiscoveryEngine_V1_AssistantServiceClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down\nby another call to this method.\n\n### StreamAssist(StreamAssistRequest, CallSettings)\n\n public virtual AssistantServiceClient.StreamAssistStream StreamAssist(StreamAssistRequest request, CallSettings callSettings = null)\n\nAssists the user with a query in a streaming fashion.\n\n**Example** \n\n // Create client\n AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();\n // Initialize request argument(s)\n StreamAssistRequest request = new StreamAssistRequest\n {\n AssistantName = AssistantName.FromProjectLocationCollectionEngineAssistant(\"[PROJECT]\", \"[LOCATION]\", \"[COLLECTION]\", \"[ENGINE]\", \"[ASSISTANT]\"),\n Query = new Query(),\n SessionAsSessionName = SessionName.FromProjectLocationDataStoreSession(\"[PROJECT]\", \"[LOCATION]\", \"[DATA_STORE]\", \"[SESSION]\"),\n UserMetadata = new AssistUserMetadata(),\n ToolsSpec = new StreamAssistRequest.Types.ToolsSpec(),\n GenerationSpec = new StreamAssistRequest.Types.GenerationSpec(),\n };\n // Make the request, returning a streaming response\n using AssistantServiceClient.StreamAssistStream response = assistantServiceClient.StreamAssist(request);\n\n // Read streaming responses from server until complete\n // Note that C# 8 code can use await foreach\n AsyncResponseStream\u003cStreamAssistResponse\u003e responseStream = response.GetResponseStream();\n while (await responseStream.MoveNextAsync())\n {\n StreamAssistResponse responseItem = responseStream.Current;\n // Do something with streamed response\n }\n // The response stream has completed"]]