Skip to content

Commit

Permalink
fix: Pass along model_version in GenerateContentResponse.
Browse files Browse the repository at this point in the history
  • Loading branch information
Annhiluc committed Nov 9, 2024
1 parent 0e5c5f2 commit 94eb16e
Show file tree
Hide file tree
Showing 51 changed files with 399 additions and 148 deletions.
45 changes: 36 additions & 9 deletions docs/api/google/generativeai/_api_cache.json
Original file line number Diff line number Diff line change
Expand Up @@ -2404,6 +2404,7 @@
"google.generativeai.types.GenerateContentResponse.__ne__": "google.generativeai.caching.CachedContent.__ne__",
"google.generativeai.types.GenerateContentResponse.__new__": "google.generativeai.caching.CachedContent.__new__",
"google.generativeai.types.GenerateContentResponse.candidates": "google.generativeai.types.AsyncGenerateContentResponse.candidates",
"google.generativeai.types.GenerateContentResponse.model_version": "google.generativeai.types.AsyncGenerateContentResponse.model_version",
"google.generativeai.types.GenerateContentResponse.parts": "google.generativeai.types.AsyncGenerateContentResponse.parts",
"google.generativeai.types.GenerateContentResponse.prompt_feedback": "google.generativeai.types.AsyncGenerateContentResponse.prompt_feedback",
"google.generativeai.types.GenerateContentResponse.text": "google.generativeai.types.AsyncGenerateContentResponse.text",
Expand Down Expand Up @@ -2723,6 +2724,11 @@
"google.generativeai.types.SafetySettingDict.setdefault": "google.generativeai.types.BlobDict.setdefault",
"google.generativeai.types.SafetySettingDict.update": "google.generativeai.types.BlobDict.update",
"google.generativeai.types.SafetySettingDict.values": "google.generativeai.types.BlobDict.values",
"google.generativeai.types.Status.__ge__": "google.generativeai.caching.CachedContent.__ge__",
"google.generativeai.types.Status.__gt__": "google.generativeai.caching.CachedContent.__gt__",
"google.generativeai.types.Status.__le__": "google.generativeai.caching.CachedContent.__le__",
"google.generativeai.types.Status.__lt__": "google.generativeai.caching.CachedContent.__lt__",
"google.generativeai.types.Status.__new__": "google.generativeai.caching.CachedContent.__new__",
"google.generativeai.types.StopCandidateException.__eq__": "google.generativeai.caching.CachedContent.__eq__",
"google.generativeai.types.StopCandidateException.__ge__": "google.generativeai.caching.CachedContent.__ge__",
"google.generativeai.types.StopCandidateException.__gt__": "google.generativeai.caching.CachedContent.__gt__",
Expand Down Expand Up @@ -2852,13 +2858,10 @@
"google.generativeai.GenerationConfig.__new__": true,
"google.generativeai.GenerationConfig.candidate_count": true,
"google.generativeai.GenerationConfig.frequency_penalty": true,
"google.generativeai.GenerationConfig.logprobs": true,
"google.generativeai.GenerationConfig.max_output_tokens": true,
"google.generativeai.GenerationConfig.presence_penalty": true,
"google.generativeai.GenerationConfig.response_logprobs": true,
"google.generativeai.GenerationConfig.response_mime_type": true,
"google.generativeai.GenerationConfig.response_schema": true,
"google.generativeai.GenerationConfig.seed": true,
"google.generativeai.GenerationConfig.stop_sequences": true,
"google.generativeai.GenerationConfig.temperature": true,
"google.generativeai.GenerationConfig.top_k": true,
Expand Down Expand Up @@ -5325,6 +5328,7 @@
"google.generativeai.protos.GenerateContentResponse.copy_from": true,
"google.generativeai.protos.GenerateContentResponse.deserialize": true,
"google.generativeai.protos.GenerateContentResponse.from_json": true,
"google.generativeai.protos.GenerateContentResponse.model_version": true,
"google.generativeai.protos.GenerateContentResponse.mro": true,
"google.generativeai.protos.GenerateContentResponse.pb": true,
"google.generativeai.protos.GenerateContentResponse.prompt_feedback": true,
Expand Down Expand Up @@ -7796,6 +7800,7 @@
"google.generativeai.types.AsyncGenerateContentResponse.candidates": true,
"google.generativeai.types.AsyncGenerateContentResponse.from_aiterator": true,
"google.generativeai.types.AsyncGenerateContentResponse.from_response": true,
"google.generativeai.types.AsyncGenerateContentResponse.model_version": true,
"google.generativeai.types.AsyncGenerateContentResponse.parts": true,
"google.generativeai.types.AsyncGenerateContentResponse.prompt_feedback": true,
"google.generativeai.types.AsyncGenerateContentResponse.resolve": true,
Expand Down Expand Up @@ -8125,6 +8130,7 @@
"google.generativeai.types.GenerateContentResponse.candidates": true,
"google.generativeai.types.GenerateContentResponse.from_iterator": true,
"google.generativeai.types.GenerateContentResponse.from_response": true,
"google.generativeai.types.GenerateContentResponse.model_version": true,
"google.generativeai.types.GenerateContentResponse.parts": true,
"google.generativeai.types.GenerateContentResponse.prompt_feedback": true,
"google.generativeai.types.GenerateContentResponse.resolve": true,
Expand All @@ -8142,13 +8148,10 @@
"google.generativeai.types.GenerationConfig.__new__": true,
"google.generativeai.types.GenerationConfig.candidate_count": true,
"google.generativeai.types.GenerationConfig.frequency_penalty": true,
"google.generativeai.types.GenerationConfig.logprobs": true,
"google.generativeai.types.GenerationConfig.max_output_tokens": true,
"google.generativeai.types.GenerationConfig.presence_penalty": true,
"google.generativeai.types.GenerationConfig.response_logprobs": true,
"google.generativeai.types.GenerationConfig.response_mime_type": true,
"google.generativeai.types.GenerationConfig.response_schema": true,
"google.generativeai.types.GenerationConfig.seed": true,
"google.generativeai.types.GenerationConfig.stop_sequences": true,
"google.generativeai.types.GenerationConfig.temperature": true,
"google.generativeai.types.GenerationConfig.top_k": true,
Expand Down Expand Up @@ -8543,28 +8546,30 @@
"google.generativeai.types.SafetySettingDict.values": true,
"google.generativeai.types.Status": false,
"google.generativeai.types.Status.ByteSize": true,
"google.generativeai.types.Status.CODE_FIELD_NUMBER": true,
"google.generativeai.types.Status.Clear": true,
"google.generativeai.types.Status.ClearExtension": true,
"google.generativeai.types.Status.ClearField": true,
"google.generativeai.types.Status.CopyFrom": true,
"google.generativeai.types.Status.DESCRIPTOR": true,
"google.generativeai.types.Status.DETAILS_FIELD_NUMBER": true,
"google.generativeai.types.Status.DiscardUnknownFields": true,
"google.generativeai.types.Status.Extensions": true,
"google.generativeai.types.Status.FindInitializationErrors": true,
"google.generativeai.types.Status.FromString": true,
"google.generativeai.types.Status.HasExtension": true,
"google.generativeai.types.Status.HasField": true,
"google.generativeai.types.Status.IsInitialized": true,
"google.generativeai.types.Status.ListFields": true,
"google.generativeai.types.Status.MESSAGE_FIELD_NUMBER": true,
"google.generativeai.types.Status.MergeFrom": true,
"google.generativeai.types.Status.MergeFromString": true,
"google.generativeai.types.Status.ParseFromString": true,
"google.generativeai.types.Status.RegisterExtension": true,
"google.generativeai.types.Status.SerializePartialToString": true,
"google.generativeai.types.Status.SerializeToString": true,
"google.generativeai.types.Status.SetInParent": true,
"google.generativeai.types.Status.UnknownFields": true,
"google.generativeai.types.Status.WhichOneof": true,
"google.generativeai.types.Status.__contains__": true,
"google.generativeai.types.Status.__eq__": true,
"google.generativeai.types.Status.__ge__": true,
"google.generativeai.types.Status.__gt__": true,
Expand Down Expand Up @@ -10359,7 +10364,29 @@
"google.generativeai.types.SafetyRatingDict": "google.generativeai.types.safety_types.SafetyRatingDict",
"google.generativeai.types.SafetySettingDict": "google.generativeai.types.safety_types.SafetySettingDict",
"google.generativeai.types.Status": "google.rpc.status_pb2.Status",
"google.generativeai.types.Status.RegisterExtension": "google.protobuf.message.Message.RegisterExtension",
"google.generativeai.types.Status.ByteSize": "google.protobuf.internal.python_message._AddByteSizeMethod.<locals>.ByteSize",
"google.generativeai.types.Status.Clear": "google.protobuf.internal.python_message._Clear",
"google.generativeai.types.Status.ClearExtension": "google.protobuf.message.Message.ClearExtension",
"google.generativeai.types.Status.ClearField": "google.protobuf.internal.python_message._AddClearFieldMethod.<locals>.ClearField",
"google.generativeai.types.Status.CopyFrom": "google.protobuf.message.Message.CopyFrom",
"google.generativeai.types.Status.DiscardUnknownFields": "google.protobuf.internal.python_message._DiscardUnknownFields",
"google.generativeai.types.Status.FindInitializationErrors": "google.protobuf.internal.python_message._AddIsInitializedMethod.<locals>.FindInitializationErrors",
"google.generativeai.types.Status.FromString": "google.protobuf.internal.python_message._AddStaticMethods.<locals>.FromString",
"google.generativeai.types.Status.HasExtension": "google.protobuf.message.Message.HasExtension",
"google.generativeai.types.Status.HasField": "google.protobuf.internal.python_message._AddHasFieldMethod.<locals>.HasField",
"google.generativeai.types.Status.IsInitialized": "google.protobuf.internal.python_message._AddIsInitializedMethod.<locals>.IsInitialized",
"google.generativeai.types.Status.ListFields": "google.protobuf.internal.python_message._AddListFieldsMethod.<locals>.ListFields",
"google.generativeai.types.Status.MergeFrom": "google.protobuf.internal.python_message._AddMergeFromMethod.<locals>.MergeFrom",
"google.generativeai.types.Status.MergeFromString": "google.protobuf.internal.python_message._AddMergeFromStringMethod.<locals>.MergeFromString",
"google.generativeai.types.Status.ParseFromString": "google.protobuf.message.Message.ParseFromString",
"google.generativeai.types.Status.SerializePartialToString": "google.protobuf.internal.python_message._AddSerializePartialToStringMethod.<locals>.SerializePartialToString",
"google.generativeai.types.Status.SerializeToString": "google.protobuf.internal.python_message._AddSerializeToStringMethod.<locals>.SerializeToString",
"google.generativeai.types.Status.SetInParent": "google.protobuf.internal.python_message._AddPrivateHelperMethods.<locals>.Modified",
"google.generativeai.types.Status.UnknownFields": "google.protobuf.message.Message.UnknownFields",
"google.generativeai.types.Status.WhichOneof": "google.protobuf.internal.python_message._AddWhichOneofMethod.<locals>.WhichOneof",
"google.generativeai.types.Status.__contains__": "google.protobuf.internal.python_message._AddContainsMethod.<locals>.__contains__",
"google.generativeai.types.Status.__eq__": "google.protobuf.internal.python_message._AddEqualsMethod.<locals>.__eq__",
"google.generativeai.types.Status.__ne__": "google.protobuf.message.Message.__ne__",
"google.generativeai.types.StopCandidateException": "google.generativeai.types.generation_types.StopCandidateException",
"google.generativeai.types.Tool": "google.generativeai.types.content_types.Tool",
"google.generativeai.types.Tool.__call__": "google.generativeai.types.content_types.Tool.__call__",
Expand Down
Binary file modified docs/api/google/generativeai/api_report.pb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/google/generative-ai-python/blob/master/google/generativeai/client.py#L345-L346">
<a target="_blank" href="https://github.com/google/generative-ai-python/blob/master/google/generativeai/client.py#L347-L348">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/google/generativeai/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/google/generative-ai-python/blob/master/google/generativeai/client.py#L300-L338">
<a target="_blank" href="https://github.com/google/generative-ai-python/blob/master/google/generativeai/client.py#L302-L340">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/google/generativeai/get_tuned_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Calls the API to fetch a tuned model by name.

```
import pprint
model = genai.get_tuned_model('tunedModels/gemini-1.0-pro-001')
model = genai.get_tuned_model('tunedModels/gemini-1.5-flash')
pprint.pprint(model)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/google/generativeai/protos/AttributionSourceId.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L834-L911">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L840-L917">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L855-L874">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L861-L880">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L876-L898">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L882-L904">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1495-L1522">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1501-L1528">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1525-L1539">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1531-L1545">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/google/generativeai/protos/Candidate.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L610-L757">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L616-L763">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L659-L706">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L665-L712">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/google/generativeai/protos/ContentEmbedding.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1465-L1476">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1471-L1482">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/google/generativeai/protos/CountTokensRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1542-L1586">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1548-L1592">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/google/generativeai/protos/CountTokensResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1589-L1610">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1595-L1616">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/google/generativeai/protos/EmbedContentRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1398-L1462">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1404-L1468">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1479-L1492">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1485-L1498">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<table class="tfo-notebook-buttons tfo-api nocontent">
<td>
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1151-L1280">
<a target="_blank" href="https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py#L1157-L1286">
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
View source on GitHub
</a>
Expand Down
Loading

0 comments on commit 94eb16e

Please sign in to comment.