Skip to content

Commit e2cf0c4

Browse files
feat: [google-ai-generativelanguage] Add QUESTION_ANSWERING and FACT_VERIFICATION to TaskType Enum (#12563)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE feat: Add `QUESTION_ANSWERING` and `FACT_VERIFICATION` to `TaskType` Enum feat: Add `output dimensionality` to `EmbedContentRequest` message feat: Add `response_mime_type` to `GenerationConfig` message docs: A bunch of small fixes END_COMMIT_OVERRIDE PiperOrigin-RevId: 623546647 Source-Link: googleapis/googleapis@33ae362 Source-Link: googleapis/googleapis-gen@c76a9c2 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFpLWdlbmVyYXRpdmVsYW5ndWFnZS8uT3dsQm90LnlhbWwiLCJoIjoiYzc2YTljMjY0YzY4NTk0YmY1ZDk2Y2RjYWUzYzc0YjdjYTBhYTQ0MyJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 30cf437 commit e2cf0c4

12 files changed

Lines changed: 50 additions & 17 deletions

File tree

packages/google-ai-generativelanguage/google/ai/generativelanguage/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.6.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.6.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.6.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,21 @@ class TaskType(proto.Enum):
6969
CLUSTERING (5):
7070
Specifies that the embeddings will be used
7171
for clustering.
72+
QUESTION_ANSWERING (6):
73+
Specifies that the given text will be used
74+
for question answering.
75+
FACT_VERIFICATION (7):
76+
Specifies that the given text will be used
77+
for fact verification.
7278
"""
7379
TASK_TYPE_UNSPECIFIED = 0
7480
RETRIEVAL_QUERY = 1
7581
RETRIEVAL_DOCUMENT = 2
7682
SEMANTIC_SIMILARITY = 3
7783
CLASSIFICATION = 4
7884
CLUSTERING = 5
85+
QUESTION_ANSWERING = 6
86+
FACT_VERIFICATION = 7
7987

8088

8189
class GenerateContentRequest(proto.Message):
@@ -212,7 +220,7 @@ class GenerationConfig(proto.Message):
212220
``Model.temperature`` attribute of the ``Model`` returned
213221
from the ``getModel`` function.
214222
215-
Values can range from [0.0, infinity).
223+
Values can range from [0.0, 2.0].
216224
217225
This field is a member of `oneof`_ ``_temperature``.
218226
top_p (float):
@@ -236,16 +244,23 @@ class GenerationConfig(proto.Message):
236244
Optional. The maximum number of tokens to consider when
237245
sampling.
238246
239-
The model uses combined Top-k and nucleus sampling.
240-
241-
Top-k sampling considers the set of ``top_k`` most probable
242-
tokens.
247+
Models use nucleus sampling or combined Top-k and nucleus
248+
sampling. Top-k sampling considers the set of ``top_k`` most
249+
probable tokens. Models running with nucleus sampling don't
250+
allow top_k setting.
243251
244252
Note: The default value varies by model, see the
245253
``Model.top_k`` attribute of the ``Model`` returned from the
246-
``getModel`` function.
254+
``getModel`` function. Empty ``top_k`` field in ``Model``
255+
indicates the model doesn't apply top-k sampling and doesn't
256+
allow setting ``top_k`` on requests.
247257
248258
This field is a member of `oneof`_ ``_top_k``.
259+
response_mime_type (str):
260+
Optional. Output response mimetype of the generated
261+
candidate text. Supported mimetype: ``text/plain``:
262+
(default) Text output. ``application/json``: JSON response
263+
in the candidates.
249264
"""
250265

251266
candidate_count: int = proto.Field(
@@ -277,6 +292,10 @@ class GenerationConfig(proto.Message):
277292
number=7,
278293
optional=True,
279294
)
295+
response_mime_type: str = proto.Field(
296+
proto.STRING,
297+
number=13,
298+
)
280299

281300

282301
class SemanticRetrieverConfig(proto.Message):
@@ -896,6 +915,13 @@ class EmbedContentRequest(proto.Message):
896915
provides better quality embeddings for retrieval.
897916
898917
This field is a member of `oneof`_ ``_title``.
918+
output_dimensionality (int):
919+
Optional. Optional reduced dimension for the output
920+
embedding. If set, excessive values in the output embedding
921+
are truncated from the end. Supported by
922+
``models/text-embedding-latest``.
923+
924+
This field is a member of `oneof`_ ``_output_dimensionality``.
899925
"""
900926

901927
model: str = proto.Field(
@@ -918,6 +944,11 @@ class EmbedContentRequest(proto.Message):
918944
number=4,
919945
optional=True,
920946
)
947+
output_dimensionality: int = proto.Field(
948+
proto.INT32,
949+
number=5,
950+
optional=True,
951+
)
921952

922953

923954
class ContentEmbedding(proto.Message):

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ class Model(proto.Message):
9898
9999
Top-k sampling considers the set of ``top_k`` most probable
100100
tokens. This value specifies default to be used by the
101-
backend while making the call to the model.
101+
backend while making the call to the model. If empty,
102+
indicates the model doesn't use top-k sampling, and
103+
``top_k`` isn't allowed as a generation parameter.
102104
103105
This field is a member of `oneof`_ ``_top_k``.
104106
"""

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta2/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.6.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta3/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.6.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-ai-generativelanguage/samples/generated_samples/snippet_metadata_google.ai.generativelanguage.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-ai-generativelanguage",
11-
"version": "0.6.1"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-ai-generativelanguage/samples/generated_samples/snippet_metadata_google.ai.generativelanguage.v1beta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-ai-generativelanguage",
11-
"version": "0.6.1"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-ai-generativelanguage/samples/generated_samples/snippet_metadata_google.ai.generativelanguage.v1beta2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-ai-generativelanguage",
11-
"version": "0.6.1"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)