Close httplib2 connections.
create(parent, body=None, x__xgafv=None)
Creates a new AlphaEvolveProgram.
Gets an existing AlphaEvolveProgram.
list(parent, orderBy=None, pageSize=None, pageToken=None, stateFilter=None, x__xgafv=None)
List all AlphaEvolvePrograms in a given experiment that follow the criteria provided in the request.
Retrieves the next page of results.
close()
Close httplib2 connections.
create(parent, body=None, x__xgafv=None)
Creates a new AlphaEvolveProgram.
Args:
parent: string, Required. The parent resource name (AlphaEvolveExperiment) of the AlphaEvolveProgram. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/alphaEvolveExperiments/{alpha_evolve_experiment}` (required)
body: object, The request body.
The object takes the form of:
{ # Represents a single program to be used within the context of an AlphaEvolve experiment.
"content": { # A self-contained message containing the content of a program. Can represent a collection of files. # Optional. Content of the program.
"description": "A String", # Optional. Description of the program.
"files": [ # Required. A list of source files that make up the overall program.
{ # A single source file with its path, content and metadata.
"content": "A String", # Required. The raw content of the file. This is a string and not bytes, because it should be ultimately processed by the LLM as text.
"description": "A String", # Optional. Additional description of the file.
"path": "A String", # Required. The relative path of the file, including the filename. e.g., "src/main.py", "utils/helpers.js", "README.md"
"programLanguage": "A String", # Optional. The programming language of the file.
},
],
},
"createTime": "A String", # Output only. Time when the program was created.
"evaluation": { # Evaluation results for a program candidate. # Optional. Evaluation results for the program.
"insights": { # Evaluation insights for a program. # Optional. Represents various insights about the candidate, which are not directly used as optimization target, but that can be used to improve subsequent generations, and as such can be used to construct the evolution prompt.
"insights": [ # Optional. List of evaluation insights.
{ # A single evaluation insight.
"label": "A String", # Optional. Label of the insight.
"text": "A String", # Optional. Text of the insight.
},
],
},
"scores": { # Contains the evaluation scores for the target metrics to optimize. # Optional. Contains the evaluation scores for the target metrics to optimize.
"scores": [ # Required. List of evaluation scores.
{ # Score for a single metric.
"metric": "A String", # Required. Name of the metric.
"score": 3.14, # Required. Score of a program for this metric.
},
],
},
},
"lockToken": "A String", # Optional. Lock token for the program.
"name": "A String", # Identifier. Unique identifier for the program. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/alphaEvolveExperiments/{alpha_evolve_experiment}/alphaEvolvePrograms/{alpha_evolve_program}`
"parentPrograms": [ # Output only. Optionally specifies which parent programs this program was evolved from. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/alphaEvolveExperiments/{alpha_evolve_experiment}/alphaEvolvePrograms/{alpha_evolve_program}`
"A String",
],
"state": "A String", # Output only. State of the program.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Represents a single program to be used within the context of an AlphaEvolve experiment.
"content": { # A self-contained message containing the content of a program. Can represent a collection of files. # Optional. Content of the program.
"description": "A String", # Optional. Description of the program.
"files": [ # Required. A list of source files that make up the overall program.
{ # A single source file with its path, content and metadata.
"content": "A String", # Required. The raw content of the file. This is a string and not bytes, because it should be ultimately processed by the LLM as text.
"description": "A String", # Optional. Additional description of the file.
"path": "A String", # Required. The relative path of the file, including the filename. e.g., "src/main.py", "utils/helpers.js", "README.md"
"programLanguage": "A String", # Optional. The programming language of the file.
},
],
},
"createTime": "A String", # Output only. Time when the program was created.
"evaluation": { # Evaluation results for a program candidate. # Optional. Evaluation results for the program.
"insights": { # Evaluation insights for a program. # Optional. Represents various insights about the candidate, which are not directly used as optimization target, but that can be used to improve subsequent generations, and as such can be used to construct the evolution prompt.
"insights": [ # Optional. List of evaluation insights.
{ # A single evaluation insight.
"label": "A String", # Optional. Label of the insight.
"text": "A String", # Optional. Text of the insight.
},
],
},
"scores": { # Contains the evaluation scores for the target metrics to optimize. # Optional. Contains the evaluation scores for the target metrics to optimize.
"scores": [ # Required. List of evaluation scores.
{ # Score for a single metric.
"metric": "A String", # Required. Name of the metric.
"score": 3.14, # Required. Score of a program for this metric.
},
],
},
},
"lockToken": "A String", # Optional. Lock token for the program.
"name": "A String", # Identifier. Unique identifier for the program. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/alphaEvolveExperiments/{alpha_evolve_experiment}/alphaEvolvePrograms/{alpha_evolve_program}`
"parentPrograms": [ # Output only. Optionally specifies which parent programs this program was evolved from. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/alphaEvolveExperiments/{alpha_evolve_experiment}/alphaEvolvePrograms/{alpha_evolve_program}`
"A String",
],
"state": "A String", # Output only. State of the program.
}
get(name, x__xgafv=None)
Gets an existing AlphaEvolveProgram.
Args:
name: string, Required. The full resource name of the program. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/alphaEvolveExperiments/{alpha_evolve_experiment}/alphaEvolvePrograms/{alpha_evolve_program}` (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Represents a single program to be used within the context of an AlphaEvolve experiment.
"content": { # A self-contained message containing the content of a program. Can represent a collection of files. # Optional. Content of the program.
"description": "A String", # Optional. Description of the program.
"files": [ # Required. A list of source files that make up the overall program.
{ # A single source file with its path, content and metadata.
"content": "A String", # Required. The raw content of the file. This is a string and not bytes, because it should be ultimately processed by the LLM as text.
"description": "A String", # Optional. Additional description of the file.
"path": "A String", # Required. The relative path of the file, including the filename. e.g., "src/main.py", "utils/helpers.js", "README.md"
"programLanguage": "A String", # Optional. The programming language of the file.
},
],
},
"createTime": "A String", # Output only. Time when the program was created.
"evaluation": { # Evaluation results for a program candidate. # Optional. Evaluation results for the program.
"insights": { # Evaluation insights for a program. # Optional. Represents various insights about the candidate, which are not directly used as optimization target, but that can be used to improve subsequent generations, and as such can be used to construct the evolution prompt.
"insights": [ # Optional. List of evaluation insights.
{ # A single evaluation insight.
"label": "A String", # Optional. Label of the insight.
"text": "A String", # Optional. Text of the insight.
},
],
},
"scores": { # Contains the evaluation scores for the target metrics to optimize. # Optional. Contains the evaluation scores for the target metrics to optimize.
"scores": [ # Required. List of evaluation scores.
{ # Score for a single metric.
"metric": "A String", # Required. Name of the metric.
"score": 3.14, # Required. Score of a program for this metric.
},
],
},
},
"lockToken": "A String", # Optional. Lock token for the program.
"name": "A String", # Identifier. Unique identifier for the program. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/alphaEvolveExperiments/{alpha_evolve_experiment}/alphaEvolvePrograms/{alpha_evolve_program}`
"parentPrograms": [ # Output only. Optionally specifies which parent programs this program was evolved from. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/alphaEvolveExperiments/{alpha_evolve_experiment}/alphaEvolvePrograms/{alpha_evolve_program}`
"A String",
],
"state": "A String", # Output only. State of the program.
}
list(parent, orderBy=None, pageSize=None, pageToken=None, stateFilter=None, x__xgafv=None)
List all AlphaEvolvePrograms in a given experiment that follow the criteria provided in the request.
Args:
parent: string, Required. The parent resource name (AlphaEvolveExperiment) of the experiment. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/alphaEvolveExperiments/{alpha_evolve_experiment}` (required)
orderBy: string, Optional. Sorting criterion for the programs. Comma separated list of metrics to sort by and optionally sort order, e.g. "score1 desc, score2". The criteria are applied in the order listed in the field. An implicit criterion of sorting by create_time descending is always applied as the final tie-breaker after all other specified criteria.
pageSize: integer, Optional. The maximum number of programs to return. The service may return fewer than this value.
pageToken: string, Optional. A page token, received from a previous `ListAlphaEvolvePrograms` call. Provide this to retrieve the subsequent page.
stateFilter: string, Optional. Filter to apply to the programs. Examples: "state_filter = \'COMPLETED\'" "state_filter = \'INITIALIZED\' OR "state_filter = \'EVALUATING\'" If empty, the behavior defaults to listing programs in REGISTRATION_COMPLETE state or processing state is NULL.
Allowed values
PROGRAM_STATE_UNSPECIFIED - Default value. This value is unused.
INITIALIZED - The program is initialized.
GENERATING - The program is in generation.
EVALUATING - The program is pending evaluation.
COMPLETED - The program is completed.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for AlphaEvolveService.ListAlphaEvolvePrograms.
"alphaEvolvePrograms": [ # Output only. List of programs matching the criteria provided in the request.
{ # Represents a single program to be used within the context of an AlphaEvolve experiment.
"content": { # A self-contained message containing the content of a program. Can represent a collection of files. # Optional. Content of the program.
"description": "A String", # Optional. Description of the program.
"files": [ # Required. A list of source files that make up the overall program.
{ # A single source file with its path, content and metadata.
"content": "A String", # Required. The raw content of the file. This is a string and not bytes, because it should be ultimately processed by the LLM as text.
"description": "A String", # Optional. Additional description of the file.
"path": "A String", # Required. The relative path of the file, including the filename. e.g., "src/main.py", "utils/helpers.js", "README.md"
"programLanguage": "A String", # Optional. The programming language of the file.
},
],
},
"createTime": "A String", # Output only. Time when the program was created.
"evaluation": { # Evaluation results for a program candidate. # Optional. Evaluation results for the program.
"insights": { # Evaluation insights for a program. # Optional. Represents various insights about the candidate, which are not directly used as optimization target, but that can be used to improve subsequent generations, and as such can be used to construct the evolution prompt.
"insights": [ # Optional. List of evaluation insights.
{ # A single evaluation insight.
"label": "A String", # Optional. Label of the insight.
"text": "A String", # Optional. Text of the insight.
},
],
},
"scores": { # Contains the evaluation scores for the target metrics to optimize. # Optional. Contains the evaluation scores for the target metrics to optimize.
"scores": [ # Required. List of evaluation scores.
{ # Score for a single metric.
"metric": "A String", # Required. Name of the metric.
"score": 3.14, # Required. Score of a program for this metric.
},
],
},
},
"lockToken": "A String", # Optional. Lock token for the program.
"name": "A String", # Identifier. Unique identifier for the program. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/alphaEvolveExperiments/{alpha_evolve_experiment}/alphaEvolvePrograms/{alpha_evolve_program}`
"parentPrograms": [ # Output only. Optionally specifies which parent programs this program was evolved from. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/alphaEvolveExperiments/{alpha_evolve_experiment}/alphaEvolvePrograms/{alpha_evolve_program}`
"A String",
],
"state": "A String", # Output only. State of the program.
},
],
"nextPageToken": "A String", # Output only. A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
}
list_next()
Retrieves the next page of results.
Args:
previous_request: The request for the previous page. (required)
previous_response: The response from the request for the previous page. (required)
Returns:
A request object that you can call 'execute()' on to request the next
page. Returns None if there are no more items in the collection.