Content-Length: 361638 | pFad | https://github.com/googleapis/python-aiplatform/commit/b7968d8fb303e6c0ae2e5a1f5e51a824ed04e42e

D4 chore: Update Gen AI types · googleapis/python-aiplatform@b7968d8 · GitHub
Skip to content

Commit b7968d8

Browse files
sasha-gitgcopybara-github
authored andcommitted
chore: Update Gen AI types
PiperOrigin-RevId: 764924433
1 parent 17a6385 commit b7968d8

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

vertexai/_genai/evals.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,7 @@ def _EvaluationDataset_to_vertex(
690690
parent_object: Optional[dict[str, Any]] = None,
691691
) -> dict[str, Any]:
692692
to_object: dict[str, Any] = {}
693+
693694
if getv(from_object, ["bigquery_source"]) is not None:
694695
setv(
695696
to_object,
@@ -966,6 +967,7 @@ def _EvaluationDataset_from_vertex(
966967
parent_object: Optional[dict[str, Any]] = None,
967968
) -> dict[str, Any]:
968969
to_object: dict[str, Any] = {}
970+
969971
if getv(from_object, ["bigquerySource"]) is not None:
970972
setv(
971973
to_object,

vertexai/_genai/types.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,6 +1804,25 @@ class EvaluateInstancesResponseDict(TypedDict, total=False):
18041804
]
18051805

18061806

1807+
class EvalCase(_common.BaseModel):
1808+
"""A comprehensive representation of a GenAI interaction for evaluation."""
1809+
1810+
prompt: Optional[genai_types.Content] = Field(
1811+
default=None,
1812+
description="""The most recent user message (current input).""",
1813+
)
1814+
1815+
1816+
class EvalCaseDict(TypedDict, total=False):
1817+
"""A comprehensive representation of a GenAI interaction for evaluation."""
1818+
1819+
prompt: Optional[genai_types.Content]
1820+
"""The most recent user message (current input)."""
1821+
1822+
1823+
EvalCaseOrDict = Union[EvalCase, EvalCaseDict]
1824+
1825+
18071826
class BigQuerySource(_common.BaseModel):
18081827
"""The BigQuery location for the input content."""
18091828

@@ -1845,6 +1864,9 @@ class GcsSourceDict(TypedDict, total=False):
18451864
class EvaluationDataset(_common.BaseModel):
18461865
"""The dataset used for evaluation."""
18471866

1867+
eval_cases: Optional[list[EvalCase]] = Field(
1868+
default=None, description="""The evaluation cases to be evaluated."""
1869+
)
18481870
bigquery_source: Optional[BigQuerySource] = Field(
18491871
default=None, description="""BigQuery source holds the dataset."""
18501872
)
@@ -1857,6 +1879,9 @@ class EvaluationDataset(_common.BaseModel):
18571879
class EvaluationDatasetDict(TypedDict, total=False):
18581880
"""The dataset used for evaluation."""
18591881

1882+
eval_cases: Optional[list[EvalCaseDict]]
1883+
"""The evaluation cases to be evaluated."""
1884+
18601885
bigquery_source: Optional[BigQuerySourceDict]
18611886
"""BigQuery source holds the dataset."""
18621887

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/python-aiplatform/commit/b7968d8fb303e6c0ae2e5a1f5e51a824ed04e42e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy