diff --git a/google/generativeai/answer.py b/google/generativeai/answer.py index 4bfabbf23..4dd93feaf 100644 --- a/google/generativeai/answer.py +++ b/google/generativeai/answer.py @@ -82,7 +82,7 @@ def to_answer_style(x: AnswerStyleOptions) -> AnswerStyle: def _make_grounding_passages(source: GroundingPassagesOptions) -> protos.GroundingPassages: """ Converts the `source` into a `protos.GroundingPassage`. A `GroundingPassages` contains a list of - `protos.GroundingPassage` objects, which each contain a `protos.Contant` and a string `id`. + `protos.GroundingPassage` objects, which each contain a `protos.Content` and a string `id`. Args: source: `Content` or a `GroundingPassagesOptions` that will be converted to protos.GroundingPassages. @@ -191,7 +191,7 @@ def _make_generate_answer_request( single question to answer. For multi-turn queries, this is a repeated field that contains conversation history and the last `Content` in the list containing the question. inline_passages: Grounding passages (a list of `Content`-like objects or `(id, content)` pairs, - or a `protos.GroundingPassages`) to send inline with the request. Exclusive with `semantic_retreiver`, + or a `protos.GroundingPassages`) to send inline with the request. Exclusive with `semantic_retriever`, one must be set, but not both. semantic_retriever: A Corpus, Document, or `protos.SemanticRetrieverConfig` to use for grounding. Exclusive with `inline_passages`, one must be set, but not both. @@ -267,7 +267,7 @@ def generate_answer( >>> my_corpus = retriever.get_corpus('my_corpus') >>> genai.generate_answer( ... content=question, - ... semantic_retreiver=my_corpus + ... semantic_retriever=my_corpus ... ) @@ -276,7 +276,7 @@ def generate_answer( contents: The question to be answered by the model, grounded in the provided source. inline_passages: Grounding passages (a list of `Content`-like objects or (id, content) pairs, - or a `protos.GroundingPassages`) to send inline with the request. Exclusive with `semantic_retreiver`, + or a `protos.GroundingPassages`) to send inline with the request. Exclusive with `semantic_retriever`, one must be set, but not both. semantic_retriever: A Corpus, Document, or `protos.SemanticRetrieverConfig` to use for grounding. Exclusive with `inline_passages`, one must be set, but not both. @@ -330,7 +330,7 @@ async def generate_answer_async( contents: The question to be answered by the model, grounded in the provided source. inline_passages: Grounding passages (a list of `Content`-like objects or (id, content) pairs, - or a `protos.GroundingPassages`) to send inline with the request. Exclusive with `semantic_retreiver`, + or a `protos.GroundingPassages`) to send inline with the request. Exclusive with `semantic_retriever`, one must be set, but not both. semantic_retriever: A Corpus, Document, or `protos.SemanticRetrieverConfig` to use for grounding. Exclusive with `inline_passages`, one must be set, but not both. diff --git a/google/generativeai/generative_models.py b/google/generativeai/generative_models.py index e3387a64f..50b15261a 100644 --- a/google/generativeai/generative_models.py +++ b/google/generativeai/generative_models.py @@ -139,7 +139,7 @@ def _prepare_request( """Creates a `protos.GenerateContentRequest` from raw inputs.""" if hasattr(self, "_cached_content") and any([self._system_instruction, tools, tool_config]): raise ValueError( - "`tools`, `tool_config`, `system_instruction` cannot be set on a model instantinated with `cached_content` as its context." + "`tools`, `tool_config`, `system_instruction` cannot be set on a model instantiated with `cached_content` as its context." ) tools_lib = self._get_tools_lib(tools) diff --git a/google/generativeai/models.py b/google/generativeai/models.py index 9ba0745c1..4b95a2470 100644 --- a/google/generativeai/models.py +++ b/google/generativeai/models.py @@ -397,7 +397,7 @@ def update_tuned_model( client: glm.ModelServiceClient | None = None, request_options: helper_types.RequestOptionsType | None = None, ) -> model_types.TunedModel: - """Calls the API to puch updates to a specified tuned model where only certain attributes are updatable.""" + """Calls the API to push updates to a specified tuned model where only certain attributes are updatable.""" if request_options is None: request_options = {} diff --git a/google/generativeai/notebook/flag_def.py b/google/generativeai/notebook/flag_def.py index e34435b43..469dee711 100644 --- a/google/generativeai/notebook/flag_def.py +++ b/google/generativeai/notebook/flag_def.py @@ -160,7 +160,7 @@ def _has_non_default_value( Args: namespace: The Namespace that is populated by ArgumentParser. - dest: The attribute in the Namespacde to be populated. + dest: The attribute in the Namespace to be populated. has_default: "None" is a valid default value so we use an additional `has_default` boolean to indicate that `default_value` is present. default_value: The default value to use when `has_default` is True. diff --git a/google/generativeai/notebook/lib/llmfn_post_process_cmds.py b/google/generativeai/notebook/lib/llmfn_post_process_cmds.py index 3ab889a8c..8f97ac942 100644 --- a/google/generativeai/notebook/lib/llmfn_post_process_cmds.py +++ b/google/generativeai/notebook/lib/llmfn_post_process_cmds.py @@ -29,7 +29,7 @@ def _convert_view_to_output_row( row: llmfn_output_row.LLMFnOutputRowView, ) -> llmfn_output_row.LLMFnOutputRow: - """Convenience method to conert a LLMFnOutputRowView to LLMFnOutputRow. + """Convenience method to convert a LLMFnOutputRowView to LLMFnOutputRow. If `row` is already a LLMFnOutputRow, return as-is for efficiency. This could potentially break encapsulation as it could let code to modify diff --git a/google/generativeai/types/retriever_types.py b/google/generativeai/types/retriever_types.py index 5270c1e81..09d9060a8 100644 --- a/google/generativeai/types/retriever_types.py +++ b/google/generativeai/types/retriever_types.py @@ -1235,7 +1235,7 @@ def batch_update_chunks( Update multiple chunks within the same document. Args: - chunks: Data structure specifying which `Chunk`s to update and what the required updats are. + chunks: Data structure specifying which `Chunk`s to update and what the required updates are. request_options: Options for the request. Return: