generative-ai-python API reference
65 public APIs from generative-ai-python (google/generative-ai-python) — 38 classes, 12 functions, 15 methods. Signatures extracted by static analysis of the actual source.
Repository: google/generative-ai-python
| Kind | Count |
|---|---|
| Classes | 38 |
| Functions | 12 |
| Methods | 15 |
API list
class
google.generativeai.caching.CachedContentCached content resource.
method
google.generativeai.caching.CachedContent.delete() -> NoneDeletes `CachedContent` resource.
method
google.generativeai.caching.CachedContent.get(name:str) -> CachedContentFetches required `CachedContent` resource.
method
google.generativeai.caching.CachedContent.list(page_size:Optional[int]=1) -> Iterable[CachedContent]Lists `CachedContent` objects associated with the project.
class
google.generativeai.generative_models.ChatSessionContains an ongoing conversation with the model.
method
google.generativeai.generative_models.ChatSession.history() -> list[protos.Content]The chat history.
class
google.generativeai.notebook.argument_parser.ArgumentParserCustomized ArgumentParser for LLM Magics.
class
google.generativeai.notebook.argument_parser.ParserErrorException thrown when there is an error.
class
google.generativeai.notebook.argument_parser.ParserNormalExitException thrown when the parser exits normally.
class
google.generativeai.notebook.cmd_line_parser.CmdLineParserImplementation of Magics command line parser.
class
google.generativeai.notebook.compare_cmd.CompareCommandImplementation of "compare" command.
class
google.generativeai.notebook.compile_cmd.CompileCommandImplementation of the "compile" command.
class
google.generativeai.notebook.eval_cmd.EvalCommandImplementation of "eval" command.
class
google.generativeai.notebook.flag_def.BooleanFlagDefDefinition for a Boolean flag.
class
google.generativeai.notebook.flag_def.FlagDefAbstract base class for flag definitions.
method
google.generativeai.notebook.flag_def.FlagDef.add_argument_to_parser(parser:argparse.ArgumentParser) -> NoneAdds this flag as an argument to `parser`.
class
google.generativeai.notebook.flag_def.MultiValuesFlagDefDefinition for a flag that takes multiple values.
class
google.generativeai.notebook.flag_def.SingleValueFlagDefDefinition for a flag that takes a single value.
class
google.generativeai.notebook.gspread_client.GSpreadClientWrapper around gspread.client.Client.
class
google.generativeai.notebook.gspread_client.GSpreadClientImplConcrete implementation of GSpreadClient.
class
google.generativeai.notebook.gspread_client.NullGSpreadClientNull-object implementation of GSpreadClient.
func
google.generativeai.notebook.gspread_client.authorize(creds:credentials.Credentials, env:ipython_env.IPythonEnv | None) -> NoneSets up credential for gspreads.
func
google.generativeai.notebook.gspread_client.testonly_set_client(client:GSpreadClient) -> NoneOverrides the global client for testing.
func
google.generativeai.notebook.html_utils.get_anchor_tag(url:sheets_id.SheetsURL, text:str) -> strReturns a HTML string representing an anchor tag.
class
google.generativeai.notebook.ipython_env_impl.IPythonEnvImplConcrete implementation of IPythonEnv.
class
google.generativeai.notebook.lib.llm_function.LLMCompareFunctionLLMFunction for comparisons.
class
google.generativeai.notebook.lib.llmfn_output_row.LLMFnOutputRowViewImmutable view of LLMFnOutputRow.
method
google.generativeai.notebook.lib.llmfn_output_row.LLMFnOutputRowView.result_key() -> strGet the key of the result cell.
method
google.generativeai.notebook.lib.llmfn_output_row.LLMFnOutputRowView.result_value() -> AnyGet the value of the result cell.
class
google.generativeai.notebook.lib.llmfn_outputs.LLMFnOutputsA sequence of LLMFnOutputEntry instances.
method
google.generativeai.notebook.lib.llmfn_outputs.LLMFnOutputs.export(sink:LLMFnOutputsSink) -> NoneExport contents to `sink`.
class
google.generativeai.notebook.lib.llmfn_outputs.LLMFnOutputsBaseParent class for LLMFnOutputs.
method
google.generativeai.notebook.lib.llmfn_outputs.LLMFnOutputsBase.as_dict() -> Mapping[str, Sequence[Any]]Formats returned results as dictionary.
class
google.generativeai.notebook.lib.model.EchoModelModel that returns the original input.
class
google.generativeai.notebook.lib.model.ModelArgumentsCommon arguments for models.
class
google.generativeai.notebook.lib.model.ModelResultsResults from calling AbstractModel.call_model().
func
google.generativeai.notebook.lib.prompt_utils.get_placeholders(prompt:str) -> AbstractSet[str]Returns the placeholders for `prompt`.
class
google.generativeai.notebook.magics.AbstractMagicsDefines interface to Magics class.
class
google.generativeai.notebook.magics.MagicsClass to register the magic with Colab.
method
google.generativeai.notebook.magics.Magics.get_instance() -> AbstractMagicsRetrieve global instance of the Magics object.
class
google.generativeai.notebook.magics.MagicsImplActual class implementing the magics functionality.
func
google.generativeai.notebook.magics.authorize(creds:credentials.Credentials) -> NoneSets up credentials.
class
google.generativeai.notebook.magics_engine.MagicsEngineImplementation of functionality used by Magics.
class
google.generativeai.notebook.model_registry.ModelRegistryRegistry that instantiates and caches models.
func
google.generativeai.notebook.output_utils.write_to_outputs(results:llmfn_outputs.LLMFnOutputs, parsed_args:parsed_args_lib.ParsedArgs) -> NoneWrites `results` to the sinks provided.
class
google.generativeai.notebook.parsed_args_lib.ParsedArgsThe results of parsing the command line.
class
google.generativeai.notebook.post_process_utils.PostProcessParseErrorAn error parsing the post-processing tokens.
func
google.generativeai.notebook.py_utils.get_py_var(var_name:str) -> AnyRetrieves the value of `var_name` from the global environment.
func
google.generativeai.notebook.py_utils.set_py_var(var_name:str, val:Any) -> NoneSets the value of `var_name` in the global environment.
func
google.generativeai.notebook.py_utils.validate_var_name(var_name:str) -> NoneValidates that the variable name is a valid identifier.
class
google.generativeai.notebook.run_cmd.RunCommandImplementation of the "run" command.
func
google.generativeai.notebook.sheets_sanitize_url.sanitize_sheets_url(url:str) -> strSanitize a Sheets URL.
class
google.generativeai.notebook.sheets_utils.SheetsInputsInputs to an LLMFunction from Google Sheets.
func
google.generativeai.operations.get_operation(name:str, *client=None) -> CreateTunedModelOperationCalls the API to get a specific operation
func
google.generativeai.operations.list_operations(*client=None) -> Iterator[CreateTunedModelOperation]Calls the API to list all operations
class
google.generativeai.types.model_types.ModelA dataclass representation of a `protos.Model`.
class
google.generativeai.types.model_types.TunedModelA dataclass representation of a `protos.TunedModel`.
class
google.generativeai.types.permission_types.PermissionA permission to access a resource.
method
google.generativeai.types.permission_types.Permission.delete(client:glm.PermissionServiceClient | None=None) -> NoneDelete permission (self).
method
google.generativeai.types.permission_types.Permission.get(name:str, client:glm.PermissionServiceClient | None=None) -> PermissionGet information about a specific permission.
method
google.generativeai.types.permission_types.Permissions.get(name:str) -> PermissionGet information about a specific permission.
method
google.generativeai.types.permission_types.Permissions.get_async(name:str) -> PermissionGet information about a specific permission.
class
google.generativeai.types.retriever_types.CorpusA `Corpus` is a collection of `Documents`.
class
google.generativeai.types.retriever_types.DocumentA `Document` is a collection of `Chunk`s.
method
google.generativeai.types.retriever_types.Document.list_chunks(page_size:int | None=None, client:glm.RetrieverServiceClient | None=None, request_options:helper_types.RequestOptionsType | None=None) -> Iterable[Chunk]List chunks of a document.
About this data
These signatures were extracted from the public source of google/generative-ai-python
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.