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
534 changes: 534 additions & 0 deletions src/Aiplatform.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* 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
*
* http://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.
*/

namespace Google\Service\Aiplatform;

class GoogleCloudAiplatformV1EvaluationParserConfig extends \Google\Model
{
protected $customCodeParserConfigType = GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig::class;
protected $customCodeParserConfigDataType = '';

/**
* Optional. Use custom code to parse the LLM response.
*
* @param GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig $customCodeParserConfig
*/
public function setCustomCodeParserConfig(GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig $customCodeParserConfig)
{
$this->customCodeParserConfig = $customCodeParserConfig;
}
/**
* @return GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig
*/
public function getCustomCodeParserConfig()
{
return $this->customCodeParserConfig;
}
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GoogleCloudAiplatformV1EvaluationParserConfig::class, 'Google_Service_Aiplatform_GoogleCloudAiplatformV1EvaluationParserConfig');
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* 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
*
* http://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.
*/

namespace Google\Service\Aiplatform;

class GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig extends \Google\Model
{
/**
* Required. Python function for parsing results. The function should be
* defined within this string. The function takes a list of strings (LLM
* responses) and should return either a list of dictionaries (for rubrics) or
* a single dictionary (for a metric result). Example function signature: def
* parse(responses: list[str]) -> list[dict[str, Any]] | dict[str, Any]: When
* parsing rubrics, return a list of dictionaries, where each dictionary
* represents a Rubric. Example for rubrics: [ { "content": {"property":
* {"description": "The response is factual."}}, "type": "FACTUALITY",
* "importance": "HIGH" }, { "content": {"property": {"description": "The
* response is fluent."}}, "type": "FLUENCY", "importance": "MEDIUM" } ] When
* parsing critique results, return a dictionary representing a MetricResult.
* Example for a metric result: { "score": 0.8, "explanation": "The model
* followed most instructions.", "rubric_verdicts": [...] } ... code for
* result extraction and aggregation
*
* @var string
*/
public $parsingFunction;

/**
* Required. Python function for parsing results. The function should be
* defined within this string. The function takes a list of strings (LLM
* responses) and should return either a list of dictionaries (for rubrics) or
* a single dictionary (for a metric result). Example function signature: def
* parse(responses: list[str]) -> list[dict[str, Any]] | dict[str, Any]: When
* parsing rubrics, return a list of dictionaries, where each dictionary
* represents a Rubric. Example for rubrics: [ { "content": {"property":
* {"description": "The response is factual."}}, "type": "FACTUALITY",
* "importance": "HIGH" }, { "content": {"property": {"description": "The
* response is fluent."}}, "type": "FLUENCY", "importance": "MEDIUM" } ] When
* parsing critique results, return a dictionary representing a MetricResult.
* Example for a metric result: { "score": 0.8, "explanation": "The model
* followed most instructions.", "rubric_verdicts": [...] } ... code for
* result extraction and aggregation
*
* @param string $parsingFunction
*/
public function setParsingFunction($parsingFunction)
{
$this->parsingFunction = $parsingFunction;
}
/**
* @return string
*/
public function getParsingFunction()
{
return $this->parsingFunction;
}
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig::class, 'Google_Service_Aiplatform_GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig');
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ class GoogleCloudAiplatformV1EvaluationRunInferenceConfig extends \Google\Model
* @var string
*/
public $model;
/**
* Optional. The parallelism of the evaluation run for the inference step. If
* not specified, the default parallelism will be used.
*
* @var int
*/
public $parallelism;

/**
* Optional. Agent run config.
Expand Down Expand Up @@ -94,6 +101,23 @@ public function getModel()
{
return $this->model;
}
/**
* Optional. The parallelism of the evaluation run for the inference step. If
* not specified, the default parallelism will be used.
*
* @param int $parallelism
*/
public function setParallelism($parallelism)
{
$this->parallelism = $parallelism;
}
/**
* @return int
*/
public function getParallelism()
{
return $this->parallelism;
}
}

// Adding a class alias for backwards compatibility with the previous class name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Google\Service\Aiplatform;

class GoogleCloudAiplatformV1GenerateMemoriesRequest extends \Google\Model
class GoogleCloudAiplatformV1GenerateMemoriesRequest extends \Google\Collection
{
/**
* Unspecified metadata merge strategy. If unspecified, the default behavior
Expand All @@ -39,6 +39,9 @@ class GoogleCloudAiplatformV1GenerateMemoriesRequest extends \Google\Model
* for consolidation.
*/
public const METADATA_MERGE_STRATEGY_REQUIRE_EXACT_MATCH = 'REQUIRE_EXACT_MATCH';
protected $collection_key = 'allowedTopics';
protected $allowedTopicsType = GoogleCloudAiplatformV1MemoryTopicId::class;
protected $allowedTopicsDataType = 'array';
protected $directContentsSourceType = GoogleCloudAiplatformV1GenerateMemoriesRequestDirectContentsSource::class;
protected $directContentsSourceDataType = '';
protected $directMemoriesSourceType = GoogleCloudAiplatformV1GenerateMemoriesRequestDirectMemoriesSource::class;
Expand Down Expand Up @@ -100,6 +103,22 @@ class GoogleCloudAiplatformV1GenerateMemoriesRequest extends \Google\Model
protected $vertexSessionSourceType = GoogleCloudAiplatformV1GenerateMemoriesRequestVertexSessionSource::class;
protected $vertexSessionSourceDataType = '';

/**
* Optional. Restricts memory generation to a subset of memory topics.
*
* @param GoogleCloudAiplatformV1MemoryTopicId[] $allowedTopics
*/
public function setAllowedTopics($allowedTopics)
{
$this->allowedTopics = $allowedTopics;
}
/**
* @return GoogleCloudAiplatformV1MemoryTopicId[]
*/
public function getAllowedTopics()
{
return $this->allowedTopics;
}
/**
* Defines a direct source of content as the source content from which to
* generate memories.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,44 @@
class GoogleCloudAiplatformV1IntermediateExtractedMemory extends \Google\Model
{
/**
* Output only. The fact of the extracted memory.
* Output only. Represents the explanation of why the information was
* extracted from the source content.
*
* @var string
*/
public $context;
/**
* Output only. Represents the fact of the extracted memory.
*
* @var string
*/
public $fact;
/**
* Output only. Represents the structured value of the extracted memory.
*
* @var array[]
*/
public $structuredData;

/**
* Output only. The fact of the extracted memory.
* Output only. Represents the explanation of why the information was
* extracted from the source content.
*
* @param string $context
*/
public function setContext($context)
{
$this->context = $context;
}
/**
* @return string
*/
public function getContext()
{
return $this->context;
}
/**
* Output only. Represents the fact of the extracted memory.
*
* @param string $fact
*/
Expand All @@ -42,6 +72,22 @@ public function getFact()
{
return $this->fact;
}
/**
* Output only. Represents the structured value of the extracted memory.
*
* @param array[] $structuredData
*/
public function setStructuredData($structuredData)
{
$this->structuredData = $structuredData;
}
/**
* @return array[]
*/
public function getStructuredData()
{
return $this->structuredData;
}
}

// Adding a class alias for backwards compatibility with the previous class name.
Expand Down
18 changes: 18 additions & 0 deletions src/Aiplatform/GoogleCloudAiplatformV1LLMBasedMetricSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class GoogleCloudAiplatformV1LLMBasedMetricSpec extends \Google\Model
public $metricPromptTemplate;
protected $predefinedRubricGenerationSpecType = GoogleCloudAiplatformV1PredefinedMetricSpec::class;
protected $predefinedRubricGenerationSpecDataType = '';
protected $resultParserConfigType = GoogleCloudAiplatformV1EvaluationParserConfig::class;
protected $resultParserConfigDataType = '';
protected $rubricGenerationSpecType = GoogleCloudAiplatformV1RubricGenerationSpec::class;
protected $rubricGenerationSpecDataType = '';
/**
Expand Down Expand Up @@ -115,6 +117,22 @@ public function getPredefinedRubricGenerationSpec()
{
return $this->predefinedRubricGenerationSpec;
}
/**
* Optional. The parser config for the metric result.
*
* @param GoogleCloudAiplatformV1EvaluationParserConfig $resultParserConfig
*/
public function setResultParserConfig(GoogleCloudAiplatformV1EvaluationParserConfig $resultParserConfig)
{
$this->resultParserConfig = $resultParserConfig;
}
/**
* @return GoogleCloudAiplatformV1EvaluationParserConfig
*/
public function getResultParserConfig()
{
return $this->resultParserConfig;
}
/**
* Dynamically generate rubrics using this specification.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* 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
*
* http://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.
*/

namespace Google\Service\Aiplatform;

class GoogleCloudAiplatformV1ListSandboxEnvironmentSnapshotsResponse extends \Google\Collection
{
protected $collection_key = 'sandboxEnvironmentSnapshots';
/**
* A token, which can be sent as
* ListSandboxEnvironmentSnapshotsRequest.page_token to retrieve the next
* page. Absence of this field indicates there are no subsequent pages.
*
* @var string
*/
public $nextPageToken;
protected $sandboxEnvironmentSnapshotsType = GoogleCloudAiplatformV1SandboxEnvironmentSnapshot::class;
protected $sandboxEnvironmentSnapshotsDataType = 'array';

/**
* A token, which can be sent as
* ListSandboxEnvironmentSnapshotsRequest.page_token to retrieve the next
* page. Absence of this field indicates there are no subsequent pages.
*
* @param string $nextPageToken
*/
public function setNextPageToken($nextPageToken)
{
$this->nextPageToken = $nextPageToken;
}
/**
* @return string
*/
public function getNextPageToken()
{
return $this->nextPageToken;
}
/**
* The SandboxEnvironmentSnapshots matching the request.
*
* @param GoogleCloudAiplatformV1SandboxEnvironmentSnapshot[] $sandboxEnvironmentSnapshots
*/
public function setSandboxEnvironmentSnapshots($sandboxEnvironmentSnapshots)
{
$this->sandboxEnvironmentSnapshots = $sandboxEnvironmentSnapshots;
}
/**
* @return GoogleCloudAiplatformV1SandboxEnvironmentSnapshot[]
*/
public function getSandboxEnvironmentSnapshots()
{
return $this->sandboxEnvironmentSnapshots;
}
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GoogleCloudAiplatformV1ListSandboxEnvironmentSnapshotsResponse::class, 'Google_Service_Aiplatform_GoogleCloudAiplatformV1ListSandboxEnvironmentSnapshotsResponse');
Loading
Loading