bigframes.ml.llm.GeminiTextGenerator#

class bigframes.ml.llm.GeminiTextGenerator(*, model_name: Literal['gemini-1.5-pro-preview-0514', 'gemini-1.5-flash-preview-0514', 'gemini-1.5-pro-001', 'gemini-1.5-pro-002', 'gemini-1.5-flash-001', 'gemini-1.5-flash-002', 'gemini-2.0-flash-exp', 'gemini-2.0-flash-001', 'gemini-2.0-flash-lite-001', 'gemini-2.5-pro', 'gemini-2.5-flash', 'gemini-2.5-flash-lite'] | None = None, session: Session | None = None, connection_name: str | None = None, max_iterations: int = 300)[source]#

Gemini text generator LLM model.

Note

gemini-1.5-X are going to be deprecated. Use gemini-2.5-X (https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.ml.llm.GeminiTextGenerator) instead.

Parameters:
  • model_name (str, Default to "gemini-2.0-flash-001") – The model for natural language tasks. Accepted values are “gemini-1.5-pro-preview-0514”, “gemini-1.5-flash-preview-0514”, “gemini-1.5-pro-001”, “gemini-1.5-pro-002”, “gemini-1.5-flash-001”, “gemini-1.5-flash-002”, “gemini-2.0-flash-exp”, “gemini-2.0-flash-lite-001”, “gemini-2.0-flash-001”, “gemini-2.5-pro”, “gemini-2.5-flash” and “gemini-2.5-flash-lite”. If no setting is provided, “gemini-2.0-flash-001” will be used by default and a warning will be issued.

  • note:: (..) – “gemini-1.5-X” is going to be deprecated. Please use gemini-2.5-X instead. For example, “gemini-2.5-flash”. “gemini-2.0-flash-exp”, “gemini-1.5-pro-preview-0514” and “gemini-1.5-flash-preview-0514” is subject to the “Pre-GA Offerings Terms” in the General Service Terms section of the Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available “as is” and might have limited support. For more information, see the launch stage descriptions (https://cloud.google.com/products#product-launch-stages).

  • session (bigframes.Session or None) – BQ session to create the model. If None, use the global default session.

  • connection_name (str or None) – Connection to connect with remote service. str of the format <PROJECT_NUMBER/PROJECT_ID>.<LOCATION>.<CONNECTION_ID>. If None, use default connection in session context. BigQuery DataFrame will try to create the connection and attach permission if the connection isn’t fully set up.

  • max_iterations (Optional[int], Default to 300) – The number of steps to run when performing supervised tuning.

Methods

__init__(*[, model_name, session, ...])

fit(X, y)

Fine tune GeminiTextGenerator model. Only support "gemini-1.5-pro-002",

get_params([deep])

Get parameters for this estimator.

predict(X, *[, temperature, ...])

Predict the result from input DataFrame.

score(X, y[, task_type])

Calculate evaluation metrics of the model. Only support

to_gbq(model_name[, replace])

Save the model to BigQuery.