Skip to content

Commit 13d2f52

Browse files
authored
Fix typos (#437)
* update_time defined twice hence removing once. * removed redundant parentheses from some test cases * removed multi-step list initialization * Removed unused import * Revert "Removed unused import" This reverts commit d1e6012. * fix black issue * fix typos
1 parent fb033db commit 13d2f52

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

google/generativeai/answer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def to_answer_style(x: AnswerStyleOptions) -> AnswerStyle:
8282
def _make_grounding_passages(source: GroundingPassagesOptions) -> protos.GroundingPassages:
8383
"""
8484
Converts the `source` into a `protos.GroundingPassage`. A `GroundingPassages` contains a list of
85-
`protos.GroundingPassage` objects, which each contain a `protos.Contant` and a string `id`.
85+
`protos.GroundingPassage` objects, which each contain a `protos.Content` and a string `id`.
8686
8787
Args:
8888
source: `Content` or a `GroundingPassagesOptions` that will be converted to protos.GroundingPassages.
@@ -191,7 +191,7 @@ def _make_generate_answer_request(
191191
single question to answer. For multi-turn queries, this is a repeated field that contains
192192
conversation history and the last `Content` in the list containing the question.
193193
inline_passages: Grounding passages (a list of `Content`-like objects or `(id, content)` pairs,
194-
or a `protos.GroundingPassages`) to send inline with the request. Exclusive with `semantic_retreiver`,
194+
or a `protos.GroundingPassages`) to send inline with the request. Exclusive with `semantic_retriever`,
195195
one must be set, but not both.
196196
semantic_retriever: A Corpus, Document, or `protos.SemanticRetrieverConfig` to use for grounding. Exclusive with
197197
`inline_passages`, one must be set, but not both.
@@ -267,7 +267,7 @@ def generate_answer(
267267
>>> my_corpus = retriever.get_corpus('my_corpus')
268268
>>> genai.generate_answer(
269269
... content=question,
270-
... semantic_retreiver=my_corpus
270+
... semantic_retriever=my_corpus
271271
... )
272272
273273
@@ -276,7 +276,7 @@ def generate_answer(
276276
contents: The question to be answered by the model, grounded in the
277277
provided source.
278278
inline_passages: Grounding passages (a list of `Content`-like objects or (id, content) pairs,
279-
or a `protos.GroundingPassages`) to send inline with the request. Exclusive with `semantic_retreiver`,
279+
or a `protos.GroundingPassages`) to send inline with the request. Exclusive with `semantic_retriever`,
280280
one must be set, but not both.
281281
semantic_retriever: A Corpus, Document, or `protos.SemanticRetrieverConfig` to use for grounding. Exclusive with
282282
`inline_passages`, one must be set, but not both.
@@ -330,7 +330,7 @@ async def generate_answer_async(
330330
contents: The question to be answered by the model, grounded in the
331331
provided source.
332332
inline_passages: Grounding passages (a list of `Content`-like objects or (id, content) pairs,
333-
or a `protos.GroundingPassages`) to send inline with the request. Exclusive with `semantic_retreiver`,
333+
or a `protos.GroundingPassages`) to send inline with the request. Exclusive with `semantic_retriever`,
334334
one must be set, but not both.
335335
semantic_retriever: A Corpus, Document, or `protos.SemanticRetrieverConfig` to use for grounding. Exclusive with
336336
`inline_passages`, one must be set, but not both.

google/generativeai/generative_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def _prepare_request(
139139
"""Creates a `protos.GenerateContentRequest` from raw inputs."""
140140
if hasattr(self, "_cached_content") and any([self._system_instruction, tools, tool_config]):
141141
raise ValueError(
142-
"`tools`, `tool_config`, `system_instruction` cannot be set on a model instantinated with `cached_content` as its context."
142+
"`tools`, `tool_config`, `system_instruction` cannot be set on a model instantiated with `cached_content` as its context."
143143
)
144144

145145
tools_lib = self._get_tools_lib(tools)

google/generativeai/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def update_tuned_model(
397397
client: glm.ModelServiceClient | None = None,
398398
request_options: helper_types.RequestOptionsType | None = None,
399399
) -> model_types.TunedModel:
400-
"""Calls the API to puch updates to a specified tuned model where only certain attributes are updatable."""
400+
"""Calls the API to push updates to a specified tuned model where only certain attributes are updatable."""
401401

402402
if request_options is None:
403403
request_options = {}

google/generativeai/notebook/flag_def.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def _has_non_default_value(
160160
161161
Args:
162162
namespace: The Namespace that is populated by ArgumentParser.
163-
dest: The attribute in the Namespacde to be populated.
163+
dest: The attribute in the Namespace to be populated.
164164
has_default: "None" is a valid default value so we use an additional
165165
`has_default` boolean to indicate that `default_value` is present.
166166
default_value: The default value to use when `has_default` is True.

google/generativeai/notebook/lib/llmfn_post_process_cmds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
def _convert_view_to_output_row(
3030
row: llmfn_output_row.LLMFnOutputRowView,
3131
) -> llmfn_output_row.LLMFnOutputRow:
32-
"""Convenience method to conert a LLMFnOutputRowView to LLMFnOutputRow.
32+
"""Convenience method to convert a LLMFnOutputRowView to LLMFnOutputRow.
3333
3434
If `row` is already a LLMFnOutputRow, return as-is for efficiency.
3535
This could potentially break encapsulation as it could let code to modify

google/generativeai/types/retriever_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,7 @@ def batch_update_chunks(
12351235
Update multiple chunks within the same document.
12361236
12371237
Args:
1238-
chunks: Data structure specifying which `Chunk`s to update and what the required updats are.
1238+
chunks: Data structure specifying which `Chunk`s to update and what the required updates are.
12391239
request_options: Options for the request.
12401240
12411241
Return:

0 commit comments

Comments
 (0)