Gemini.Types.Tuning (GeminiEx v0.11.0)

Copy Markdown View Source

Types for the Tunings API (fine-tuning/model tuning).

This module provides structs for tuning job configuration, status, and response parsing for Google's model tuning API.

Summary

Functions

Parses a tuning job from API response.

Checks if a tuning job has completed (terminal state).

Checks if a tuning job failed.

Checks if a tuning job is still running (non-terminal state).

Checks if a tuning job succeeded.

Parses job state string to atom.

Converts job state atom to API string.

Converts CreateTuningJobConfig to API request map.

Types

job_state()

@type job_state() ::
  :job_state_unspecified
  | :job_state_queued
  | :job_state_pending
  | :job_state_running
  | :job_state_succeeded
  | :job_state_failed
  | :job_state_cancelling
  | :job_state_cancelled
  | :job_state_paused
  | :job_state_expired

Functions

from_api_response(response)

@spec from_api_response(map()) :: Gemini.Types.Tuning.TuningJob.t()

Parses a tuning job from API response.

job_complete?(tuning_job)

@spec job_complete?(Gemini.Types.Tuning.TuningJob.t()) :: boolean()

Checks if a tuning job has completed (terminal state).

job_failed?(tuning_job)

@spec job_failed?(Gemini.Types.Tuning.TuningJob.t()) :: boolean()

Checks if a tuning job failed.

job_running?(tuning_job)

@spec job_running?(Gemini.Types.Tuning.TuningJob.t()) :: boolean()

Checks if a tuning job is still running (non-terminal state).

job_succeeded?(tuning_job)

@spec job_succeeded?(Gemini.Types.Tuning.TuningJob.t()) :: boolean()

Checks if a tuning job succeeded.

parse_state(arg1)

@spec parse_state(String.t() | nil) :: job_state() | nil

Parses job state string to atom.

state_to_api(atom)

@spec state_to_api(job_state()) :: String.t()

Converts job state atom to API string.

to_api_map(config)

Converts CreateTuningJobConfig to API request map.