Assistant class

Assistant

To get more information about Assistant, see:

Example Usage

Discoveryengine Assistant Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const basic = new gcp.discoveryengine.DataStore("basic", {
    location: "global",
    dataStoreId: "example-data-store-id",
    displayName: "tf-test-structured-datastore",
    industryVertical: "GENERIC",
    contentConfig: "NO_CONTENT",
    solutionTypes: ["SOLUTION_TYPE_SEARCH"],
    createAdvancedSiteSearch: false,
});
const basicSearchEngine = new gcp.discoveryengine.SearchEngine("basic", {
    location: "global",
    collectionId: "default_collection",
    engineId: "example-engine-id",
    displayName: "Example Display Name",
    dataStoreIds: [basic.dataStoreId],
    searchEngineConfig: {},
});
const basicAssistant = new gcp.discoveryengine.Assistant("basic", {
    location: "global",
    collectionId: "default_collection",
    engineId: basicSearchEngine.engineId,
    assistantId: "default_assistant",
    displayName: "updated-tf-test-Assistant",
    description: "Assistant Description",
    generationConfig: {
        systemInstruction: {
            additionalSystemInstruction: "foobar",
        },
        defaultLanguage: "en",
    },
    customerPolicy: {
        bannedPhrases: [{
            phrase: "foo",
            matchType: "SIMPLE_STRING_MATCH",
            ignoreDiacritics: false,
        }],
    },
    webGroundingType: "WEB_GROUNDING_TYPE_GOOGLE_SEARCH",
});
import pulumi
import pulumi_gcp as gcp

basic = gcp.discoveryengine.DataStore("basic",
    location="global",
    data_store_id="example-data-store-id",
    display_name="tf-test-structured-datastore",
    industry_vertical="GENERIC",
    content_config="NO_CONTENT",
    solution_types=["SOLUTION_TYPE_SEARCH"],
    create_advanced_site_search=False)
basic_search_engine = gcp.discoveryengine.SearchEngine("basic",
    location="global",
    collection_id="default_collection",
    engine_id="example-engine-id",
    display_name="Example Display Name",
    data_store_ids=[basic.data_store_id],
    search_engine_config={})
basic_assistant = gcp.discoveryengine.Assistant("basic",
    location="global",
    collection_id="default_collection",
    engine_id=basic_search_engine.engine_id,
    assistant_id="default_assistant",
    display_name="updated-tf-test-Assistant",
    description="Assistant Description",
    generation_config={
        "system_instruction": {
            "additional_system_instruction": "foobar",
        },
        "default_language": "en",
    },
    customer_policy={
        "banned_phrases": [{
            "phrase": "foo",
            "match_type": "SIMPLE_STRING_MATCH",
            "ignore_diacritics": False,
        }],
    },
    web_grounding_type="WEB_GROUNDING_TYPE_GOOGLE_SEARCH")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var basic = new Gcp.DiscoveryEngine.DataStore("basic", new()
    {
        Location = "global",
        DataStoreId = "example-data-store-id",
        DisplayName = "tf-test-structured-datastore",
        IndustryVertical = "GENERIC",
        ContentConfig = "NO_CONTENT",
        SolutionTypes = new[]
        {
            "SOLUTION_TYPE_SEARCH",
        },
        CreateAdvancedSiteSearch = false,
    });

    var basicSearchEngine = new Gcp.DiscoveryEngine.SearchEngine("basic", new()
    {
        Location = "global",
        CollectionId = "default_collection",
        EngineId = "example-engine-id",
        DisplayName = "Example Display Name",
        DataStoreIds = new[]
        {
            basic.DataStoreId,
        },
        SearchEngineConfig = new() { },
    });

    var basicAssistant = new Gcp.DiscoveryEngine.Assistant("basic", new()
    {
        Location = "global",
        CollectionId = "default_collection",
        EngineId = basicSearchEngine.EngineId,
        AssistantId = "default_assistant",
        DisplayName = "updated-tf-test-Assistant",
        Description = "Assistant Description",
        GenerationConfig = new Gcp.DiscoveryEngine.Inputs.AssistantGenerationConfigArgs
        {
            SystemInstruction = new Gcp.DiscoveryEngine.Inputs.AssistantGenerationConfigSystemInstructionArgs
            {
                AdditionalSystemInstruction = "foobar",
            },
            DefaultLanguage = "en",
        },
        CustomerPolicy = new Gcp.DiscoveryEngine.Inputs.AssistantCustomerPolicyArgs
        {
            BannedPhrases = new[]
            {
                new Gcp.DiscoveryEngine.Inputs.AssistantCustomerPolicyBannedPhraseArgs
                {
                    Phrase = "foo",
                    MatchType = "SIMPLE_STRING_MATCH",
                    IgnoreDiacritics = false,
                },
            },
        },
        WebGroundingType = "WEB_GROUNDING_TYPE_GOOGLE_SEARCH",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/discoveryengine"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		basic, err := discoveryengine.NewDataStore(ctx, "basic", &discoveryengine.DataStoreArgs{
			Location:         pulumi.String("global"),
			DataStoreId:      pulumi.String("example-data-store-id"),
			DisplayName:      pulumi.String("tf-test-structured-datastore"),
			IndustryVertical: pulumi.String("GENERIC"),
			ContentConfig:    pulumi.String("NO_CONTENT"),
			SolutionTypes: pulumi.StringArray{
				pulumi.String("SOLUTION_TYPE_SEARCH"),
			},
			CreateAdvancedSiteSearch: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		basicSearchEngine, err := discoveryengine.NewSearchEngine(ctx, "basic", &discoveryengine.SearchEngineArgs{
			Location:     pulumi.String("global"),
			CollectionId: pulumi.String("default_collection"),
			EngineId:     pulumi.String("example-engine-id"),
			DisplayName:  pulumi.String("Example Display Name"),
			DataStoreIds: pulumi.StringArray{
				basic.DataStoreId,
			},
			SearchEngineConfig: &discoveryengine.SearchEngineSearchEngineConfigArgs{},
		})
		if err != nil {
			return err
		}
		_, err = discoveryengine.NewAssistant(ctx, "basic", &discoveryengine.AssistantArgs{
			Location:     pulumi.String("global"),
			CollectionId: pulumi.String("default_collection"),
			EngineId:     basicSearchEngine.EngineId,
			AssistantId:  pulumi.String("default_assistant"),
			DisplayName:  pulumi.String("updated-tf-test-Assistant"),
			Description:  pulumi.String("Assistant Description"),
			GenerationConfig: &discoveryengine.AssistantGenerationConfigArgs{
				SystemInstruction: &discoveryengine.AssistantGenerationConfigSystemInstructionArgs{
					AdditionalSystemInstruction: pulumi.String("foobar"),
				},
				DefaultLanguage: pulumi.String("en"),
			},
			CustomerPolicy: &discoveryengine.AssistantCustomerPolicyArgs{
				BannedPhrases: discoveryengine.AssistantCustomerPolicyBannedPhraseArray{
					&discoveryengine.AssistantCustomerPolicyBannedPhraseArgs{
						Phrase:           pulumi.String("foo"),
						MatchType:        pulumi.String("SIMPLE_STRING_MATCH"),
						IgnoreDiacritics: pulumi.Bool(false),
					},
				},
			},
			WebGroundingType: pulumi.String("WEB_GROUNDING_TYPE_GOOGLE_SEARCH"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_discoveryengine_datastore" "basic" {
  location                    = "global"
  data_store_id               = "example-data-store-id"
  display_name                = "tf-test-structured-datastore"
  industry_vertical           = "GENERIC"
  content_config              = "NO_CONTENT"
  solution_types              = ["SOLUTION_TYPE_SEARCH"]
  create_advanced_site_search = false
}
resource "gcp_discoveryengine_searchengine" "basic" {
  location             = "global"
  collection_id        = "default_collection"
  engine_id            = "example-engine-id"
  display_name         = "Example Display Name"
  data_store_ids       = [gcp_discoveryengine_datastore.basic.data_store_id]
  search_engine_config = {}
}
resource "gcp_discoveryengine_assistant" "basic" {
  location      = "global"
  collection_id = "default_collection"
  engine_id     = gcp_discoveryengine_searchengine.basic.engine_id
  assistant_id  = "default_assistant"
  display_name  = "updated-tf-test-Assistant"
  description   = "Assistant Description"
  generation_config = {
    system_instruction = {
      additional_system_instruction = "foobar"
    }
    default_language = "en"
  }
  customer_policy = {
    banned_phrases = [{
      "phrase"           = "foo"
      "matchType"        = "SIMPLE_STRING_MATCH"
      "ignoreDiacritics" = false
    }]
  }
  web_grounding_type = "WEB_GROUNDING_TYPE_GOOGLE_SEARCH"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.discoveryengine.DataStore;
import com.pulumi.gcp.discoveryengine.DataStoreArgs;
import com.pulumi.gcp.discoveryengine.SearchEngine;
import com.pulumi.gcp.discoveryengine.SearchEngineArgs;
import com.pulumi.gcp.discoveryengine.inputs.SearchEngineSearchEngineConfigArgs;
import com.pulumi.gcp.discoveryengine.Assistant;
import com.pulumi.gcp.discoveryengine.AssistantArgs;
import com.pulumi.gcp.discoveryengine.inputs.AssistantGenerationConfigArgs;
import com.pulumi.gcp.discoveryengine.inputs.AssistantGenerationConfigSystemInstructionArgs;
import com.pulumi.gcp.discoveryengine.inputs.AssistantCustomerPolicyArgs;
import com.pulumi.gcp.discoveryengine.inputs.AssistantCustomerPolicyBannedPhraseArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var basic = new DataStore("basic", DataStoreArgs.builder()
            .location("global")
            .dataStoreId("example-data-store-id")
            .displayName("tf-test-structured-datastore")
            .industryVertical("GENERIC")
            .contentConfig("NO_CONTENT")
            .solutionTypes("SOLUTION_TYPE_SEARCH")
            .createAdvancedSiteSearch(false)
            .build());

        var basicSearchEngine = new SearchEngine("basicSearchEngine", SearchEngineArgs.builder()
            .location("global")
            .collectionId("default_collection")
            .engineId("example-engine-id")
            .displayName("Example Display Name")
            .dataStoreIds(basic.dataStoreId())
            .searchEngineConfig(SearchEngineSearchEngineConfigArgs.builder()
                .build())
            .build());

        var basicAssistant = new Assistant("basicAssistant", AssistantArgs.builder()
            .location("global")
            .collectionId("default_collection")
            .engineId(basicSearchEngine.engineId())
            .assistantId("default_assistant")
            .displayName("updated-tf-test-Assistant")
            .description("Assistant Description")
            .generationConfig(AssistantGenerationConfigArgs.builder()
                .systemInstruction(AssistantGenerationConfigSystemInstructionArgs.builder()
                    .additionalSystemInstruction("foobar")
                    .build())
                .defaultLanguage("en")
                .build())
            .customerPolicy(AssistantCustomerPolicyArgs.builder()
                .bannedPhrases(AssistantCustomerPolicyBannedPhraseArgs.builder()
                    .phrase("foo")
                    .matchType("SIMPLE_STRING_MATCH")
                    .ignoreDiacritics(false)
                    .build())
                .build())
            .webGroundingType("WEB_GROUNDING_TYPE_GOOGLE_SEARCH")
            .build());

    }
}
resources:
  basic:
    type: gcp:discoveryengine:DataStore
    properties:
      location: global
      dataStoreId: example-data-store-id
      displayName: tf-test-structured-datastore
      industryVertical: GENERIC
      contentConfig: NO_CONTENT
      solutionTypes:
        - SOLUTION_TYPE_SEARCH
      createAdvancedSiteSearch: false
  basicSearchEngine:
    type: gcp:discoveryengine:SearchEngine
    name: basic
    properties:
      location: global
      collectionId: default_collection
      engineId: example-engine-id
      displayName: Example Display Name
      dataStoreIds:
        - ${basic.dataStoreId}
      searchEngineConfig: {}
  basicAssistant:
    type: gcp:discoveryengine:Assistant
    name: basic
    properties:
      location: global
      collectionId: default_collection
      engineId: ${basicSearchEngine.engineId}
      assistantId: default_assistant
      displayName: updated-tf-test-Assistant
      description: Assistant Description
      generationConfig:
        systemInstruction:
          additionalSystemInstruction: foobar
        defaultLanguage: en
      customerPolicy:
        bannedPhrases:
          - phrase: foo
            matchType: SIMPLE_STRING_MATCH
            ignoreDiacritics: false
      webGroundingType: WEB_GROUNDING_TYPE_GOOGLE_SEARCH

Import

Assistant can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}/assistants/{{assistant_id}}
  • {{project}}/{{location}}/{{collection_id}}/{{engine_id}}/{{assistant_id}}
  • {{location}}/{{collection_id}}/{{engine_id}}/{{assistant_id}}

When using the pulumi import command, Assistant can be imported using one of the formats above. For example:

$ pulumi import gcp:discoveryengine/assistant:Assistant default projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}/assistants/{{assistant_id}}
$ pulumi import gcp:discoveryengine/assistant:Assistant default {{project}}/{{location}}/{{collection_id}}/{{engine_id}}/{{assistant_id}}
$ pulumi import gcp:discoveryengine/assistant:Assistant default {{location}}/{{collection_id}}/{{engine_id}}/{{assistant_id}}

Constructors

Assistant(String name, {AssistantArgs? args, CustomResourceOptions? options})
Creates a new Assistant. name The Pulumi resource name. args Arguments used to configure this Assistant. The set of arguments for Assistant. options Resource options controlling this resource's behavior.
Assistant.reference(String urn)
Creates a typed reference to an existing Assistant resource.

Properties

assistantId ↔ Output<String>
The unique id of the assistant.
latefinal
childResources → Set<Resource>
finalinherited
collectionId ↔ Output<String>
The unique id of the collection.
latefinal
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
customerPolicy ↔ Output<AssistantCustomerPolicy?>
Customer policy for the assistant. Structure is documented below.
latefinal
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
description ↔ Output<String?>
Description for additional information. Expected to be shown on the configuration UI, not to the users of the assistant.
latefinal
displayName ↔ Output<String>
The assistant display name. It must be a UTF-8 encoded string with a length limit of 128 characters.
latefinal
engineId ↔ Output<String>
The unique id of the engine.
latefinal
generationConfig ↔ Output<AssistantGenerationConfig?>
Configuration for the generation of the assistant response. Structure is documented below.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
location ↔ Output<String>
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
latefinal
name ↔ Output<String>
Resource name of the assistant. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant} It must be a UTF-8 encoded string with a length limit of 1024 characters.
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
webGroundingType ↔ Output<String?>
The type of web grounding to use. The supported values: 'WEB_GROUNDING_TYPE_DISABLED', 'WEB_GROUNDING_TYPE_GOOGLE_SEARCH', 'WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH'.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {AssistantState? state, CustomResourceOptions? options}) → Assistant
Gets an existing Assistant resource's state with the given name and id.