Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified DialogflowCx/metadata/V3/Agent.php
Binary file not shown.
30 changes: 30 additions & 0 deletions DialogflowCx/metadata/V3/CodeBlock.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified DialogflowCx/metadata/V3/DataStoreConnection.php
Binary file not shown.
77 changes: 77 additions & 0 deletions DialogflowCx/metadata/V3/Example.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified DialogflowCx/metadata/V3/Flow.php
Binary file not shown.
13 changes: 9 additions & 4 deletions DialogflowCx/metadata/V3/GenerativeSettings.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified DialogflowCx/metadata/V3/Generator.php
Binary file not shown.
Binary file modified DialogflowCx/metadata/V3/Page.php
Binary file not shown.
Binary file not shown.
Binary file added DialogflowCx/metadata/V3/Playbook.php
Binary file not shown.
Binary file modified DialogflowCx/metadata/V3/ResponseMessage.php
Binary file not shown.
Binary file modified DialogflowCx/metadata/V3/SafetySettings.php
Binary file not shown.
Binary file modified DialogflowCx/metadata/V3/Session.php
Binary file not shown.
Binary file added DialogflowCx/metadata/V3/Tool.php
Binary file not shown.
Binary file added DialogflowCx/metadata/V3/ToolCall.php
Binary file not shown.
Binary file added DialogflowCx/metadata/V3/Trace.php
Binary file not shown.
Binary file modified DialogflowCx/metadata/V3/Webhook.php
Binary file not shown.
88 changes: 88 additions & 0 deletions DialogflowCx/samples/V3/ExamplesClient/create_example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?php
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START dialogflow_v3_generated_Examples_CreateExample_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Dialogflow\Cx\V3\Action;
use Google\Cloud\Dialogflow\Cx\V3\Client\ExamplesClient;
use Google\Cloud\Dialogflow\Cx\V3\CreateExampleRequest;
use Google\Cloud\Dialogflow\Cx\V3\Example;
use Google\Cloud\Dialogflow\Cx\V3\OutputState;

/**
* Creates an example in the specified playbook.
*
* @param string $formattedParent The playbook to create an example for.
* Format:
* `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`. Please see
* {@see ExamplesClient::playbookName()} for help formatting this field.
* @param string $exampleDisplayName The display name of the example.
* @param int $exampleConversationState Example's output state.
*/
function create_example_sample(
string $formattedParent,
string $exampleDisplayName,
int $exampleConversationState
): void {
// Create a client.
$examplesClient = new ExamplesClient();

// Prepare the request message.
$exampleActions = [new Action()];
$example = (new Example())
->setActions($exampleActions)
->setDisplayName($exampleDisplayName)
->setConversationState($exampleConversationState);
$request = (new CreateExampleRequest())
->setParent($formattedParent)
->setExample($example);

// Call the API and handle any network failures.
try {
/** @var Example $response */
$response = $examplesClient->createExample($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = ExamplesClient::playbookName('[PROJECT]', '[LOCATION]', '[AGENT]', '[PLAYBOOK]');
$exampleDisplayName = '[DISPLAY_NAME]';
$exampleConversationState = OutputState::OUTPUT_STATE_UNSPECIFIED;

create_example_sample($formattedParent, $exampleDisplayName, $exampleConversationState);
}
// [END dialogflow_v3_generated_Examples_CreateExample_sync]
77 changes: 77 additions & 0 deletions DialogflowCx/samples/V3/ExamplesClient/delete_example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START dialogflow_v3_generated_Examples_DeleteExample_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Dialogflow\Cx\V3\Client\ExamplesClient;
use Google\Cloud\Dialogflow\Cx\V3\DeleteExampleRequest;

/**
* Deletes the specified example.
*
* @param string $formattedName The name of the example to delete.
* Format:
* `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>/examples/<ExampleID>`. Please see
* {@see ExamplesClient::exampleName()} for help formatting this field.
*/
function delete_example_sample(string $formattedName): void
{
// Create a client.
$examplesClient = new ExamplesClient();

// Prepare the request message.
$request = (new DeleteExampleRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
$examplesClient->deleteExample($request);
printf('Call completed successfully.' . PHP_EOL);
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = ExamplesClient::exampleName(
'[PROJECT]',
'[LOCATION]',
'[AGENT]',
'[PLAYBOOK]',
'[EXAMPLE]'
);

delete_example_sample($formattedName);
}
// [END dialogflow_v3_generated_Examples_DeleteExample_sync]
79 changes: 79 additions & 0 deletions DialogflowCx/samples/V3/ExamplesClient/get_example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START dialogflow_v3_generated_Examples_GetExample_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Dialogflow\Cx\V3\Client\ExamplesClient;
use Google\Cloud\Dialogflow\Cx\V3\Example;
use Google\Cloud\Dialogflow\Cx\V3\GetExampleRequest;

/**
* Retrieves the specified example.
*
* @param string $formattedName The name of the example.
* Format:
* `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>/examples/<ExampleID>`. Please see
* {@see ExamplesClient::exampleName()} for help formatting this field.
*/
function get_example_sample(string $formattedName): void
{
// Create a client.
$examplesClient = new ExamplesClient();

// Prepare the request message.
$request = (new GetExampleRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var Example $response */
$response = $examplesClient->getExample($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = ExamplesClient::exampleName(
'[PROJECT]',
'[LOCATION]',
'[AGENT]',
'[PLAYBOOK]',
'[EXAMPLE]'
);

get_example_sample($formattedName);
}
// [END dialogflow_v3_generated_Examples_GetExample_sync]
Loading
Loading