genai.schema package

pydantic model genai.schema.AIMessage[source]

Bases: BaseMessage

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field role: ChatRole = ChatRole.ASSISTANT
class genai.schema.ApiEndpoint[source]

Bases: object

class_name: str
method: str
path: str
version: str
class genai.schema.ApiKeyRegenerateCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/api_key/regenerate'
version: str = '2023-11-22'
pydantic model genai.schema.ApiKeyRegenerateCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: ApiKeyResult | None = None
pydantic model genai.schema.ApiKeyResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: AwareDatetime [Required]
field generated_at: AwareDatetime [Required]
field last_used_at: AwareDatetime | None = None
field value: str [Required]
class genai.schema.ApiKeyRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/api_key'
version: str = '2023-11-22'
pydantic model genai.schema.ApiKeyRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: ApiKeyResult | None = None
pydantic model genai.schema.BadRequestResponse[source]

Bases: BaseErrorResponse

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field extensions: Extensions [Required]
field status_code: Literal[400] = 400
pydantic model genai.schema.BaseErrorExtension[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field code: str [Required]
field state: dict[str, Any] | None = None
pydantic model genai.schema.BaseErrorResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field error: str [Required]
field extensions: BaseErrorExtension [Required]
field message: str [Required]
field status_code: int [Required]
pydantic model genai.schema.BaseMessage[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field content: str [Required]
field files: list[MessageFile] | None = None
field role: ChatRole [Required]
pydantic model genai.schema.BaseTokens[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field logprob: float | str | None = None
field rank: int | None = None
field text: str | None = None
field top_tokens: list[GeneratedToken] | None = None
class genai.schema.ChatRole[source]

Bases: str, Enum

An enumeration.

ASSISTANT = 'assistant'
SYSTEM = 'system'
USER = 'user'
pydantic model genai.schema.ConcurrencyLimit[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field limit: int [Required]
field remaining: int [Required]
class genai.schema.DecodingMethod[source]

Bases: str, Enum

An enumeration.

GREEDY = 'greedy'
SAMPLE = 'sample'
class genai.schema.DeploymentCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/deployments'
version: str = '2023-11-22'
pydantic model genai.schema.DeploymentCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: DeploymentResult [Required]
class genai.schema.DeploymentIdDeleteEndpoint[source]

Bases: ApiEndpoint

method: str = 'DELETE'
path: str = '/v2/deployments/{id}'
version: str = '2023-11-22'
class genai.schema.DeploymentIdRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/deployments/{id}'
version: str = '2023-11-22'
pydantic model genai.schema.DeploymentIdRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: DeploymentResult [Required]
pydantic model genai.schema.DeploymentResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: AwareDatetime [Required]
field deployed_at: AwareDatetime | None = None
field expires_at: AwareDatetime | None = None
field id: str [Required]
field status: DeploymentStatus [Required]
field tune_id: str | None = None
field updated_at: AwareDatetime [Required]
class genai.schema.DeploymentRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/deployments'
version: str = '2023-11-22'
pydantic model genai.schema.DeploymentRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[DeploymentResult] [Required]
field total_count: float [Required]
class genai.schema.DeploymentStatus[source]

Bases: str, Enum

An enumeration.

EXPIRED = 'expired'
FAILED = 'failed'
INITIALIZING = 'initializing'
QUEUED = 'queued'
READY = 'ready'
class genai.schema.EvaluationCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/beta/evaluations'
version: str = '2023-11-22'
pydantic model genai.schema.EvaluationCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: EvaluationResult [Required]
pydantic model genai.schema.EvaluationExperiment[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: AwareDatetime [Required]
field description: str | None = None
field evaluations_count: float [Required]
field file: EvaluationFile | None = None
field id: str [Required]
field name: str [Required]
field task: EvaluationTask [Required]
field template_id: str [Required]
class genai.schema.EvaluationExperimentCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/beta/evaluations/experiments'
version: str = '2023-11-22'
pydantic model genai.schema.EvaluationExperimentCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: EvaluationExperiment [Required]
class genai.schema.EvaluationExperimentIdDeleteEndpoint[source]

Bases: ApiEndpoint

method: str = 'DELETE'
path: str = '/v2/beta/evaluations/experiments/{id}'
version: str = '2023-11-22'
class genai.schema.EvaluationExperimentIdRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/beta/evaluations/experiments/{id}'
version: str = '2023-11-22'
pydantic model genai.schema.EvaluationExperimentIdRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: EvaluationResult [Required]
class genai.schema.EvaluationExperimentRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/beta/evaluations/experiments'
version: str = '2023-11-22'
pydantic model genai.schema.EvaluationExperimentRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[EvaluationExperiment] [Required]
field total_count: int [Required]
class genai.schema.EvaluationExperimentSortBy[source]

Bases: str, Enum

An enumeration.

ID = 'id'
NAME = 'name'
TEMPLATE = 'template'
pydantic model genai.schema.EvaluationFieldOperation[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field type: EvaluationOperationType [Required]
pydantic model genai.schema.EvaluationFile[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field bytes: int [Required]
field created_at: AwareDatetime [Required]
field file_name: str [Required]
field id: str [Required]
field metadata: FileMetadata | None = None
class genai.schema.EvaluationIdDeleteEndpoint[source]

Bases: ApiEndpoint

method: str = 'DELETE'
path: str = '/v2/beta/evaluations/{id}'
version: str = '2023-11-22'
class genai.schema.EvaluationIdInstanceResultRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/beta/evaluations/{id}/instance_results'
version: str = '2023-11-22'
pydantic model genai.schema.EvaluationIdInstanceResultRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[EvaluationInstanceResult] [Required]
field total_count: int [Required]
class genai.schema.EvaluationIdRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/beta/evaluations/{id}'
version: str = '2023-11-22'
pydantic model genai.schema.EvaluationIdRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: EvaluationResult [Required]
pydantic model genai.schema.EvaluationInstanceResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field generation_info: dict[str, Any] | None = None
field score: dict[str, Any] [Required]
pydantic model genai.schema.EvaluationLimit[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field concurrency: ConcurrencyLimit [Required]
class genai.schema.EvaluationLimitRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/beta/evaluations/limits'
version: str = '2023-11-22'
pydantic model genai.schema.EvaluationLimitRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: EvaluationLimit [Required]
class genai.schema.EvaluationOperationType[source]

Bases: str, Enum

An enumeration.

ADD_FIELDS = 'add_fields'
RENAME_FIELDS = 'rename_fields'
SHUFFLE = 'shuffle'
pydantic model genai.schema.EvaluationParentTask[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field id: str [Required]
field name: str [Required]
class genai.schema.EvaluationPreviewCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/beta/evaluations/preview'
version: str = '2023-11-22'
pydantic model genai.schema.EvaluationPreviewCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[EvaluationInstanceResult] [Required]
field total_count: int [Required]
pydantic model genai.schema.EvaluationPrompt[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field id: str [Required]
field input: str | None = None
field metadata: dict[str, Any] | None = None
field name: str [Required]
pydantic model genai.schema.EvaluationResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: AwareDatetime [Required]
field description: str | None = None
field experiment_id: str [Required]
field file: EvaluationFile | None = None
field finished_at: AwareDatetime | None = None
field id: str [Required]
field model_id: str [Required]
field name: str [Required]
field parameters: dict[str, Any] | None = None
field prompt: EvaluationPrompt [Required]
field result: dict[str, Any] [Required]
field started_at: AwareDatetime | None = None
field status: EvaluationStatus [Required]
field status_message: str | None = None
field task_id: str [Required]
field template_id: str [Required]
field template_name: str [Required]
class genai.schema.EvaluationRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/beta/evaluations'
version: str = '2023-11-22'
pydantic model genai.schema.EvaluationRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[EvaluationResult] [Required]
field total_count: int [Required]
class genai.schema.EvaluationSortBy[source]

Bases: str, Enum

An enumeration.

ID = 'id'
NAME = 'name'
TEMPLATE = 'template'
class genai.schema.EvaluationStatus[source]

Bases: str, Enum

An enumeration.

COMPLETED = 'completed'
FAILED = 'failed'
PENDING = 'pending'
QUEUED = 'queued'
RUNNING = 'running'
pydantic model genai.schema.EvaluationTask[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field id: str [Required]
field name: str [Required]
field parent_task: EvaluationParentTask | None = None
pydantic model genai.schema.EvaluationTemplate[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field dataset_fields: dict[str, Any] [Required]
field default_prompt_ids: list[str] | None = None
field id: str [Required]
field metrics: list[list[Metric] | Metrics] [Required]
field name: str [Required]
field postprocessors: list[str] [Required]
field task: EvaluationTask | None = None
class genai.schema.EvaluationTemplateIdRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/beta/evaluations/templates/{id}'
version: str = '2023-11-22'
pydantic model genai.schema.EvaluationTemplateIdRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: EvaluationTemplate [Required]
class genai.schema.EvaluationTemplateRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/beta/evaluations/templates'
version: str = '2023-11-22'
pydantic model genai.schema.EvaluationTemplateRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[EvaluationTemplate] [Required]
pydantic model genai.schema.Extensions[source]

Bases: BaseErrorExtension

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field code: Literal['INVALID_INPUT'] = 'INVALID_INPUT'
pydantic model genai.schema.Extensions1[source]

Bases: BaseErrorExtension

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field code: Literal['INTERNAL_SERVER_ERROR'] = 'INTERNAL_SERVER_ERROR'
pydantic model genai.schema.Extensions2[source]

Bases: BaseErrorExtension

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field code: Literal['NOT_FOUND'] = 'NOT_FOUND'
pydantic model genai.schema.Extensions3[source]

Bases: BaseErrorExtension

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field code: Literal['TOO_MANY_REQUESTS'] = 'TOO_MANY_REQUESTS'
pydantic model genai.schema.Extensions4[source]

Bases: BaseErrorExtension

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field code: Literal['AUTH_ERROR'] = 'AUTH_ERROR'
pydantic model genai.schema.Extensions5[source]

Bases: BaseErrorExtension

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field code: Literal['SERVICE_UNAVAILABLE'] = 'SERVICE_UNAVAILABLE'
class genai.schema.FileCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/files'
version: str = '2024-05-13'
pydantic model genai.schema.FileCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: FileResult [Required]
pydantic model genai.schema.FileDescendant[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field id: str [Required]
pydantic model genai.schema.FileFormat[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field id: int [Required]
field name: str [Required]
class genai.schema.FileIdContentRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/files/{id}/content'
version: str = '2023-11-22'
class genai.schema.FileIdDeleteEndpoint[source]

Bases: ApiEndpoint

method: str = 'DELETE'
path: str = '/v2/files/{id}'
version: str = '2023-11-22'
class genai.schema.FileIdPatchEndpoint[source]

Bases: ApiEndpoint

method: str = 'PATCH'
path: str = '/v2/files/{id}'
version: str = '2023-11-22'
pydantic model genai.schema.FileIdPatchResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: FileResult [Required]
class genai.schema.FileIdRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/files/{id}'
version: str = '2024-05-13'
pydantic model genai.schema.FileIdRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: FileResult [Required]
class genai.schema.FileListSortBy[source]

Bases: str, Enum

An enumeration.

CREATED_AT = 'created_at'
NAME = 'name'
pydantic model genai.schema.FileMetadata[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field stats: FileMetadataStats [Required]
pydantic model genai.schema.FileMetadataStats[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field columns: list[str] [Required]
field records_count: float [Required]
class genai.schema.FilePurpose[source]

Bases: str, Enum

An enumeration.

EXTRACTION = 'extraction'
GENERIC_STRUCTURED = 'generic_structured'
TEMPLATE = 'template'
TUNE = 'tune'
TUNE_IMPORT = 'tune_import'
pydantic model genai.schema.FileResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field bytes: int [Required]
field created_at: AwareDatetime [Required]
field descendants: list[FileDescendant] | None = None
field file_formats: list[FileFormat] | None = None
field file_name: str [Required]
field id: str [Required]
field metadata: FileMetadata | None = None
field origin: FileDescendant | None = None
field purpose: FilePurpose [Required]
field storage_provider_location: StorageProviderLocation [Required]
field updated_at: AwareDatetime [Required]
class genai.schema.FileRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/files'
version: str = '2024-05-13'
pydantic model genai.schema.FileRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[FileResult] [Required]
field total_count: int [Required]
class genai.schema.FolderCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/folders'
version: str = '2023-11-22'
pydantic model genai.schema.FolderCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: FolderResult [Required]
class genai.schema.FolderIdDeleteEndpoint[source]

Bases: ApiEndpoint

method: str = 'DELETE'
path: str = '/v2/folders/{id}'
version: str = '2023-11-22'
class genai.schema.FolderIdPatchEndpoint[source]

Bases: ApiEndpoint

method: str = 'PATCH'
path: str = '/v2/folders/{id}'
version: str = '2024-01-10'
pydantic model genai.schema.FolderIdPatchResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: FolderResult [Required]
class genai.schema.FolderIdRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/folders/{id}'
version: str = '2023-11-22'
pydantic model genai.schema.FolderIdRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: FolderResult [Required]
class genai.schema.FolderIdUpdateEndpoint[source]

Bases: ApiEndpoint

method: str = 'PUT'
path: str = '/v2/folders/{id}'
version: str = '2023-11-22'
pydantic model genai.schema.FolderIdUpdateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: FolderResult [Required]
pydantic model genai.schema.FolderResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: AwareDatetime [Required]
field id: str [Required]
field name: str [Required]
field prompt_ids: list[str] | None = None
class genai.schema.FolderRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/folders'
version: str = '2023-11-22'
pydantic model genai.schema.FolderRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[FolderResult] [Required]
field total_count: int [Required]
pydantic model genai.schema.GeneratedToken[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field logprob: float | str | None = None
field text: str | None = None
pydantic model genai.schema.HAPOptions[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field send_tokens: bool | None = False
field threshold: float | None = 0.75
Constraints:
  • gt = 0.0

  • lt = 1.0

pydantic model genai.schema.HumanMessage[source]

Bases: BaseMessage

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field role: ChatRole = ChatRole.USER
pydantic model genai.schema.Input[source]

Bases: RootModel[list[Any]]

field root: list[Any] [Required]
Constraints:
  • max_length = 20

pydantic model genai.schema.InternalServerErrorResponse[source]

Bases: BaseErrorResponse

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field extensions: Extensions1 [Required]
field status_code: Literal[500] = 500
pydantic model genai.schema.LengthPenalty[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field decay_factor: float | None = None

Represents the factor of exponential decay and must be > 1.0. Larger values correspond to more aggressive decay.

Constraints:
  • gt = 1.0

field start_index: int | None = None

A number of generated tokens after which this should take effect.

Constraints:
  • ge = 1

pydantic model genai.schema.MessageFile[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field content: str | None = None
field id: str | None = None
pydantic model genai.schema.Metric[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field description: str [Required]
field id: str [Required]
field name: str [Required]
pydantic model genai.schema.Metrics[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

pydantic model genai.schema.ModelFacet[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field id: str [Required]
field name: str [Required]
field type: ModelFacetType [Required]
class genai.schema.ModelFacetType[source]

Bases: str, Enum

An enumeration.

INDUSTRY = 'industry'
LANGUAGE = 'language'
MODEL_TYPE = 'model_type'
pydantic model genai.schema.ModelFamily[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field description: str | None = None
field id: int [Required]
field name: str [Required]
field prompt_example: str | None = None
field short_description: str | None = None
field system_prompt: str | None = None
class genai.schema.ModelIdRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/models/{id}'
version: str = '2024-01-30'
pydantic model genai.schema.ModelIdRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: ModelIdRetrieveResult [Required]
pydantic model genai.schema.ModelIdRetrieveResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field description: str | None = None
field developer: str | None = None
field disabled: bool [Required]
field facets: list[ModelFacet] | None = None
field id: str [Required]
field is_live: bool [Required]
field label: str [Required]
field model_family: ModelFamily [Required]
field name: str [Required]
field preferred: bool [Required]
field prompt_builder_example: dict[str, Any] | None = None
field size: str [Required]
field source_model_id: str | None = None
field system_prompt: str | None = None
field system_prompt_id: int | None = None
field tags: list[str] [Required]
field tasks: list[Tasks] [Required]
field token_limits: list[ModelTokenLimits] [Required]
field warning: str | None = None
class genai.schema.ModelRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/models'
version: str = '2023-11-22'
pydantic model genai.schema.ModelRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[ModelRetrieveResults] [Required]
field total_count: int [Required]
pydantic model genai.schema.ModelRetrieveResults[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field facets: list[ModelFacet] | None = None
field id: str [Required]
field is_live: bool [Required]
field label: str [Required]
field name: str [Required]
field size: str [Required]
field source_model_id: str | None = None
field task_ids: list[str] [Required]
field token_limits: list[ModelTokenLimits] [Required]
field warning: str | None = None
pydantic model genai.schema.ModelTokenLimits[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field beam_width: int [Required]
field token_limit: int [Required]
class genai.schema.ModelType[source]

Bases: str, Enum

An enumeration.

MODEL = 'model'
TUNE = 'tune'
pydantic model genai.schema.ModerationHAP[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field input: ModerationHAPInput | None = None
field output: ModerationHAPOutput | None = None
pydantic model genai.schema.ModerationHAPInput[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field enabled: bool | None = False

Detects HAP (hateful, abusive, or profane language).

field send_tokens: bool | None = False
field threshold: float | None = 0.75

The higher the number, the more confidence that the sentence contains HAP. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing HAP.

Constraints:
  • ge = 0.01

  • le = 0.99

  • multiple_of = 0.01

pydantic model genai.schema.ModerationHAPOutput[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field enabled: bool | None = False

Detects HAP (hateful, abusive, or profane language).

field send_tokens: bool | None = False
field threshold: float | None = 0.75

The higher the number, the more confidence that the sentence contains HAP. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing HAP.

Constraints:
  • ge = 0.01

  • le = 0.99

  • multiple_of = 0.01

pydantic model genai.schema.ModerationImplicitHate[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field input: ModerationImplicitHateInput | None = None
field output: ModerationImplicitHateOutput | None = None
pydantic model genai.schema.ModerationImplicitHateInput[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field enabled: bool [Required]
field send_tokens: bool | None = None
field threshold: float | None = 0.75
Constraints:
  • gt = 0.0

  • lt = 1.0

pydantic model genai.schema.ModerationImplicitHateOutput[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field enabled: bool [Required]
field send_tokens: bool | None = None
field threshold: float | None = 0.75
Constraints:
  • gt = 0.0

  • lt = 1.0

pydantic model genai.schema.ModerationParameters[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field hap: ModerationHAP | None = None
field social_bias: ModerationSocialBias | None = None
pydantic model genai.schema.ModerationPosition[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field end: int [Required]
field start: int [Required]
pydantic model genai.schema.ModerationSocialBias[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field input: ModerationSocialBiasInput | None = None
field output: ModerationSocialBiasOutput | None = None
pydantic model genai.schema.ModerationSocialBiasInput[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field enabled: bool | None = False

Detects social bias.

field send_tokens: bool | None = False
field threshold: float | None = 0.75

The higher the number, the more confidence that the sentence contains social bias. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing social bias.

Constraints:
  • ge = 0.01

  • le = 0.99

  • multiple_of = 0.01

pydantic model genai.schema.ModerationSocialBiasOutput[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field enabled: bool | None = False

Detects social bias.

field send_tokens: bool | None = False
field threshold: float | None = 0.75

The higher the number, the more confidence that the sentence contains social bias. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing social bias.

Constraints:
  • ge = 0.01

  • le = 0.99

  • multiple_of = 0.01

pydantic model genai.schema.ModerationStigma[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field input: ModerationStigmaInput | None = None
field output: ModerationStigmaOutput | None = None
pydantic model genai.schema.ModerationStigmaInput[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field enabled: bool [Required]
field send_tokens: bool | None = None
field threshold: float | None = 0.75
Constraints:
  • gt = 0.0

  • lt = 1.0

pydantic model genai.schema.ModerationStigmaOutput[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field enabled: bool [Required]
field send_tokens: bool | None = None
field threshold: float | None = 0.75
Constraints:
  • gt = 0.0

  • lt = 1.0

pydantic model genai.schema.ModerationTokens[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field index: int | None = None
field score: float | None = None
field token: str | None = None
pydantic model genai.schema.NotFoundResponse[source]

Bases: BaseErrorResponse

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field extensions: Extensions2 [Required]
field status_code: Literal[404] = 404
class genai.schema.PromptCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/prompts'
version: str = '2024-03-19'
pydantic model genai.schema.PromptCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: PromptResult [Required]
class genai.schema.PromptIdDeleteEndpoint[source]

Bases: ApiEndpoint

method: str = 'DELETE'
path: str = '/v2/prompts/{id}'
version: str = '2023-11-22'
class genai.schema.PromptIdPatchEndpoint[source]

Bases: ApiEndpoint

method: str = 'PATCH'
path: str = '/v2/prompts/{id}'
version: str = '2024-03-19'
pydantic model genai.schema.PromptIdPatchResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: PromptResult [Required]
class genai.schema.PromptIdRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/prompts/{id}'
version: str = '2024-03-19'
pydantic model genai.schema.PromptIdRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: PromptResult [Required]
class genai.schema.PromptIdUpdateEndpoint[source]

Bases: ApiEndpoint

method: str = 'PUT'
path: str = '/v2/prompts/{id}'
version: str = '2024-03-19'
pydantic model genai.schema.PromptIdUpdateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: PromptResult [Required]
class genai.schema.PromptListSortBy[source]

Bases: str, Enum

An enumeration.

CREATED_AT = 'created_at'
ID = 'id'
MODEL = 'model'
MODEL_TASK = 'model_task'
NAME = 'name'
TYPE = 'type'
UPDATED_AT = 'updated_at'
USAGE_COUNT = 'usage_count'
class genai.schema.PromptListSource[source]

Bases: str, Enum

An enumeration.

COMMUNITY = 'community'
EXAMPLE = 'example'
USER = 'user'
pydantic model genai.schema.PromptModerationParameters[source]

Bases: ModerationParameters

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field hap: ModerationHAP | None = None
field implicit_hate: ModerationImplicitHate | None = None
field social_bias: ModerationSocialBias | None = None
field stigma: ModerationStigma | None = None
pydantic model genai.schema.PromptResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field author: PromptResultAuthor | None = None
field created_at: AwareDatetime [Required]
field data: dict[str, Any] | None = None
field description: str | None = None
field folder_id: str | None = None
field id: str [Required]
field input: str | None = None
field messages: list[BaseMessage] | None = None
field metadata: dict[str, Any] | None = None
field model_id: str | None = None
field moderations: PromptModerationParameters | None = None
field name: str [Required]
field output: str | None = None
field parameters: TextGenerationParameters | None = None
field prompt_id: str | None = None
field public: bool | None = None
field tags: list[PromptTag] | None = None
field task: PromptResultTask | None = None
field type: PromptType [Required]
field updated_at: AwareDatetime | None = None
field usage_count: int [Required]
pydantic model genai.schema.PromptResultAuthor[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field first_name: str | None = None
field id: int | None = None
field last_name: str | None = None
pydantic model genai.schema.PromptResultTask[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field icon: str | None = None
field id: str | None = None
field name: str | None = None
class genai.schema.PromptRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/prompts'
version: str = '2024-03-19'
pydantic model genai.schema.PromptRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[PromptResult] [Required]
field total_count: int [Required]
pydantic model genai.schema.PromptTag[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field id: str [Required]
field name: str [Required]
field type: PromptTagType [Required]
class genai.schema.PromptTagType[source]

Bases: str, Enum

An enumeration.

INDUSTRY = 'industry'
LANGUAGE = 'language'
MODEL_TYPE = 'model_type'
pydantic model genai.schema.PromptTemplateData[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field example_file_ids: list[str] | None = None
Constraints:
  • min_length = 0

  • max_length = 5

class genai.schema.PromptType[source]

Bases: str, Enum

An enumeration.

COMMUNITY = 'community'
EXAMPLE = 'example'
PRIVATE = 'private'
PUBLIC = 'public'
class genai.schema.RequestApiVersion[source]

Bases: str, Enum

An enumeration.

V0 = 'v0'
V1 = 'v1'
V2 = 'v2'
class genai.schema.RequestChatConversationIdDeleteEndpoint[source]

Bases: ApiEndpoint

method: str = 'DELETE'
path: str = '/v2/requests/chat/{conversation_id}'
version: str = '2023-11-22'
class genai.schema.RequestChatConversationIdRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/requests/chat/{conversation_id}'
version: str = '2024-03-19'
pydantic model genai.schema.RequestChatConversationIdRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[RequestChatConversationIdRetrieveResults] [Required]
pydantic model genai.schema.RequestChatConversationIdRetrieveResults[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: AwareDatetime [Required]
field duration: int [Required]
field id: str [Required]
field parent_id: str | None = None
field request: RequestChatConversationIdRetrieveResultsRequest | None = None
field response: RequestChatConversationIdRetrieveResultsResponse | None = None
field status: RequestStatus [Required]
field version: RequestResultVersion | None = None
pydantic model genai.schema.RequestChatConversationIdRetrieveResultsRequest[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

pydantic model genai.schema.RequestChatConversationIdRetrieveResultsResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

class genai.schema.RequestEndpoint[source]

Bases: str, Enum

An enumeration.

CHAT = 'chat'
COMPARE = 'compare'
GENERATE = 'generate'
class genai.schema.RequestFeedbackCategory[source]

Bases: str, Enum

An enumeration.

CORRECT_CONTENT = 'correct_content'
CORRECT_STYLE = 'correct_style'
INACCURATE = 'inaccurate'
KNOWLEDGE_GAP = 'knowledge_gap'
NOT_RELEVANT = 'not_relevant'
OFFENSIVE_HARMFUL = 'offensive_harmful'
OTHER_CONTENT = 'other_content'
OTHER_STYLE = 'other_style'
TOO_LONG = 'too_long'
TOO_SHORT = 'too_short'
WRONG_FORMAT = 'wrong_format'
WRONG_TONE = 'wrong_tone'
pydantic model genai.schema.RequestFeedbackResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field api_request: str [Required]
field categories: list[str] [Required]
field comment: str | None = None
field created_at: AwareDatetime [Required]
field id: int [Required]
field updated_at: AwareDatetime [Required]
field vote: RequestFeedbackVote | None = None
class genai.schema.RequestFeedbackVote[source]

Bases: str, Enum

An enumeration.

DOWN = 'down'
UP = 'up'
class genai.schema.RequestIdDeleteEndpoint[source]

Bases: ApiEndpoint

method: str = 'DELETE'
path: str = '/v2/requests/{id}'
version: str = '2023-11-22'
class genai.schema.RequestIdFeedbackCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/requests/{id}/feedback'
version: str = '2023-11-22'
pydantic model genai.schema.RequestIdFeedbackCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: RequestFeedbackResult [Required]
class genai.schema.RequestIdFeedbackRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/requests/{id}/feedback'
version: str = '2023-11-22'
pydantic model genai.schema.RequestIdFeedbackRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: RequestFeedbackResult [Required]
class genai.schema.RequestIdFeedbackUpdateEndpoint[source]

Bases: ApiEndpoint

method: str = 'PUT'
path: str = '/v2/requests/{id}/feedback'
version: str = '2023-11-22'
pydantic model genai.schema.RequestIdFeedbackUpdateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: RequestFeedbackResult [Required]
class genai.schema.RequestOrigin[source]

Bases: str, Enum

An enumeration.

API = 'api'
UI = 'ui'
pydantic model genai.schema.RequestResultVersion[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field api: str | None = None
field date_: date | None = None (alias 'date')
class genai.schema.RequestRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/requests'
version: str = '2023-11-22'
pydantic model genai.schema.RequestRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[RequestRetrieveResults] [Required]
field total_count: int [Required]
pydantic model genai.schema.RequestRetrieveResults[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: AwareDatetime [Required]
field duration: int [Required]
field id: str [Required]
field request: dict[str, Any] | None = None
field response: dict[str, Any] | None = None
field status: RequestStatus [Required]
field version: RequestResultVersion | None = None
class genai.schema.RequestStatus[source]

Bases: str, Enum

An enumeration.

ERROR = 'error'
SUCCESS = 'success'
pydantic model genai.schema.SocialBiasOptions[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field send_tokens: bool | None = False
field threshold: float | None = 0.75
Constraints:
  • gt = 0.0

  • lt = 1.0

class genai.schema.SortDirection[source]

Bases: str, Enum

An enumeration.

ASC = 'asc'
DESC = 'desc'
class genai.schema.StopReason[source]

Bases: str, Enum

An enumeration.

CANCELLED = 'cancelled'
EOS_TOKEN = 'eos_token'
ERROR = 'error'
MAX_TOKENS = 'max_tokens'
NOT_FINISHED = 'not_finished'
STOP_SEQUENCE = 'stop_sequence'
TIME_LIMIT = 'time_limit'
TOKEN_LIMIT = 'token_limit'
class genai.schema.StorageProviderLocation[source]

Bases: str, Enum

An enumeration.

US_EAST = 'us-east'
US_SOUTH = 'us-south'
pydantic model genai.schema.SystemMessage[source]

Bases: BaseMessage

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field role: ChatRole = ChatRole.SYSTEM
pydantic model genai.schema.SystemPrompt[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field author: SystemPromptAuthor | None = None
field content: str [Required]
field created_at: AwareDatetime [Required]
field id: int [Required]
field name: str [Required]
field type: SystemPromptType [Required]
pydantic model genai.schema.SystemPromptAuthor[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field first_name: str | None = None
field id: int [Required]
field last_name: str | None = None
class genai.schema.SystemPromptCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/system_prompts'
version: str = '2023-11-22'
pydantic model genai.schema.SystemPromptCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: SystemPrompt [Required]
class genai.schema.SystemPromptIdDeleteEndpoint[source]

Bases: ApiEndpoint

method: str = 'DELETE'
path: str = '/v2/system_prompts/{id}'
version: str = '2023-11-22'
class genai.schema.SystemPromptIdRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/system_prompts/{id}'
version: str = '2023-11-22'
pydantic model genai.schema.SystemPromptIdRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: SystemPrompt [Required]
class genai.schema.SystemPromptIdUpdateEndpoint[source]

Bases: ApiEndpoint

method: str = 'PUT'
path: str = '/v2/system_prompts/{id}'
version: str = '2023-11-22'
pydantic model genai.schema.SystemPromptIdUpdateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: SystemPrompt [Required]
class genai.schema.SystemPromptRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/system_prompts'
version: str = '2023-11-22'
pydantic model genai.schema.SystemPromptRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[SystemPrompt] [Required]
field total_count: int [Required]
class genai.schema.SystemPromptType[source]

Bases: str, Enum

An enumeration.

PRIVATE = 'private'
SYSTEM = 'system'
pydantic model genai.schema.Tag[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field id: str [Required]
field name: str [Required]
field type: TagType [Required]
class genai.schema.TagRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/tags'
version: str = '2023-11-22'
pydantic model genai.schema.TagRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[Tag] [Required]
class genai.schema.TagType[source]

Bases: str, Enum

An enumeration.

INDUSTRY = 'industry'
LANGUAGE = 'language'
MODEL_TYPE = 'model_type'
class genai.schema.TaskRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/tasks'
version: str = '2023-11-22'
pydantic model genai.schema.TaskRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[Tasks] [Required]
pydantic model genai.schema.Tasks[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field categorization: bool [Required]
field csv_example: str | None = None
field file_format_id: int | None = None
field id: str [Required]
field json_example: str | None = None
field jsonl_example: str | None = None
field name: str [Required]
field tune: bool [Required]
field verbalizer: str | None = None
class genai.schema.TextChatCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/text/chat'
version: str = '2024-03-19'
pydantic model genai.schema.TextChatCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field conversation_id: str [Required]
field created_at: AwareDatetime | None = None
field id: str | None = None
field input_parameters: dict[str, Any] | None = None
field model_id: str | None = None
field results: list[TextGenerationResult] [Required]
pydantic model genai.schema.TextChatGenerationStreamResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field generated_text: str [Required]
field generated_token_count: int [Required]
field generated_tokens: list[BaseTokens] | None = None
field input_text: str | None = None
field input_token_count: int | None = None
field input_tokens: list[BaseTokens] | None = None
field seed: float | None = None
field stop_reason: StopReason [Required]
field stop_sequence: str | None = None
class genai.schema.TextChatOutputCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/text/chat/output'
version: str = '2024-03-19'
pydantic model genai.schema.TextChatOutputCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: str [Required]
class genai.schema.TextChatStreamCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/text/chat_stream'
version: str = '2024-03-19'
pydantic model genai.schema.TextChatStreamCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field conversation_id: str [Required]
field created_at: AwareDatetime | None = None
field id: str | None = None
field input_parameters: dict[str, Any] | None = None
field model_id: str | None = None
field moderations: TextCreateResponseModeration | None = None
field results: list[TextChatGenerationStreamResult] | None = None
pydantic model genai.schema.TextClassificationCreateData[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field labels: list[str] [Required]
field text: str [Required]
class genai.schema.TextClassificationCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/beta/text/classification'
version: str = '2023-11-22'
pydantic model genai.schema.TextClassificationCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: TextClassificationResult [Required]
pydantic model genai.schema.TextClassificationResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field classification_type: TextClassificationType [Required]
field log_likelihood: dict[str, float] [Required]
field model_input: str [Required]
field model_output: str [Required]
field predictions: list[str] [Required]
class genai.schema.TextClassificationType[source]

Bases: str, Enum

An enumeration.

BINARY = 'binary'
MULTI_CLASS = 'multi_class'
MULTI_LABEL = 'multi_label'
pydantic model genai.schema.TextCreateResponseModeration[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field hap: list[TextModeration] | None = None
field social_bias: list[TextModeration] | None = None
class genai.schema.TextEmbeddingCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/text/embeddings'
version: str = '2024-04-15'
pydantic model genai.schema.TextEmbeddingCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: AwareDatetime [Required]
field model_id: str [Required]
field results: list[_TextEmbeddingCreateResults] [Required]
pydantic model genai.schema.TextEmbeddingLimit[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field concurrency: ConcurrencyLimit [Required]
class genai.schema.TextEmbeddingLimitRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/text/embeddings/limits'
version: str = '2023-11-22'
pydantic model genai.schema.TextEmbeddingLimitRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: TextEmbeddingLimit [Required]
pydantic model genai.schema.TextEmbeddingParameters[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field return_options: _TextEmbeddingCreateRequestParametersReturnOptions | None = None
field truncate_input_tokens: bool | None = None
class genai.schema.TextExtractionLimitRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/text/extraction/limits'
version: str = '2023-11-22'
class genai.schema.TextGenerationComparisonCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/text/generation/comparison'
version: str = '2024-03-19'
pydantic model genai.schema.TextGenerationComparisonCreateRequestRequest[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field data: PromptTemplateData | None = None
field input: str [Required]
field model_id: str | None = None
field moderations: ModerationParameters | None = None
field parameters: TextGenerationParameters | None = None
field prompt_id: str | None = None
field use_default: bool | None = None
pydantic model genai.schema.TextGenerationComparisonCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[TextGenerationComparisonCreateResults] [Required]
pydantic model genai.schema.TextGenerationComparisonCreateResults[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field error: Any | None = None
field parameters: TextGenerationComparisonCreateResultsParameters [Required]
field result: TextGenerationComparisonCreateResultsResult | None = None
pydantic model genai.schema.TextGenerationComparisonCreateResultsParameters[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field length_penalty: dict[str, Any] | None = None
field model_id: str | None = None
field repetition_penalty: float | None = None
field temperature: float | None = None
field top_k: int | None = None
field top_p: float | None = None
field typical_p: float | None = None
pydantic model genai.schema.TextGenerationComparisonCreateResultsResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: AwareDatetime [Required]
field id: str [Required]
field input_parameters: dict[str, Any] | None = None
field model_id: str [Required]
field results: list[TextGenerationResult] [Required]
pydantic model genai.schema.TextGenerationComparisonParameters[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field length_penalty: list[dict[str, Any]] | None = None
Constraints:
  • min_length = 1

  • max_length = 10

field model_id: list[str] | None = None
Constraints:
  • min_length = 1

  • max_length = 10

field repetition_penalty: list[float] | None = None
Constraints:
  • min_length = 1

  • max_length = 10

field temperature: list[float] | None = None
Constraints:
  • min_length = 1

  • max_length = 10

field top_k: list[int] | None = None
Constraints:
  • min_length = 1

  • max_length = 10

field top_p: list[float] | None = None
Constraints:
  • min_length = 1

  • max_length = 10

field typical_p: list[float] | None = None
Constraints:
  • min_length = 1

  • max_length = 10

class genai.schema.TextGenerationCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/text/generation'
version: str = '2024-03-19'
pydantic model genai.schema.TextGenerationCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: AwareDatetime [Required]
field id: str [Required]
field input_parameters: dict[str, Any] | None = None
field model_id: str [Required]
field results: list[TextGenerationResult] [Required]
class genai.schema.TextGenerationFeedbackCategory[source]

Bases: str, Enum

An enumeration.

CORRECT_CONTENT = 'correct_content'
CORRECT_STYLE = 'correct_style'
INACCURATE = 'inaccurate'
KNOWLEDGE_GAP = 'knowledge_gap'
NOT_RELEVANT = 'not_relevant'
OFFENSIVE_HARMFUL = 'offensive_harmful'
OTHER_CONTENT = 'other_content'
OTHER_STYLE = 'other_style'
TOO_LONG = 'too_long'
TOO_SHORT = 'too_short'
WRONG_FORMAT = 'wrong_format'
WRONG_TONE = 'wrong_tone'
pydantic model genai.schema.TextGenerationFeedbackResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field api_request: str [Required]
field categories: list[str] [Required]
field comment: str | None = None
field created_at: AwareDatetime [Required]
field id: int [Required]
field updated_at: AwareDatetime [Required]
field vote: TextGenerationFeedbackVote | None = None
class genai.schema.TextGenerationFeedbackVote[source]

Bases: str, Enum

An enumeration.

DOWN = 'down'
UP = 'up'
class genai.schema.TextGenerationIdFeedbackCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/text/generation/{id}/feedback'
version: str = '2024-02-20'
pydantic model genai.schema.TextGenerationIdFeedbackCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: TextGenerationFeedbackResult [Required]
class genai.schema.TextGenerationIdFeedbackRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/text/generation/{id}/feedback'
version: str = '2023-11-22'
pydantic model genai.schema.TextGenerationIdFeedbackRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: TextGenerationFeedbackResult [Required]
class genai.schema.TextGenerationIdFeedbackUpdateEndpoint[source]

Bases: ApiEndpoint

method: str = 'PUT'
path: str = '/v2/text/generation/{id}/feedback'
version: str = '2024-02-20'
pydantic model genai.schema.TextGenerationIdFeedbackUpdateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: TextGenerationFeedbackResult [Required]
pydantic model genai.schema.TextGenerationLimit[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field concurrency: ConcurrencyLimit [Required]
class genai.schema.TextGenerationLimitRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/text/generation/limits'
version: str = '2023-11-22'
pydantic model genai.schema.TextGenerationLimitRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: TextGenerationLimit [Required]
class genai.schema.TextGenerationOutputCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/text/generation/output'
version: str = '2024-03-19'
pydantic model genai.schema.TextGenerationOutputCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[str] [Required]
pydantic model genai.schema.TextGenerationParameters[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field beam_width: int | None = None

At each step, or token, the algorithm keeps track of the n (off=1, 2, or 3) most probable sequences (beams) and selects the one with the highest probability. This continues until the stop sequence is met.

Constraints:
  • ge = 0

  • le = 3

field decoding_method: DecodingMethod | None = None
field include_stop_sequence: bool | None = None
field length_penalty: LengthPenalty | None = None
field max_new_tokens: int | None = None

Define the maximum number of tokens to generate.

Constraints:
  • ge = 0

field min_new_tokens: int | None = None

If stop sequences are given, they are ignored until minimum tokens are generated.

Constraints:
  • ge = 0

field random_seed: int | None = None

Controls the random sampling of the generated tokens when sampling is enabled. Setting the random seed to a the same number for each generation ensures experimental repeatability.

Constraints:
  • ge = 1

  • le = 4294967295

field repetition_penalty: float | None = None

The parameter for repetition penalty. 1.00 means no penalty.

Constraints:
  • ge = 1.0

  • le = 2.0

  • multiple_of = 0.01

field return_options: TextGenerationReturnOptions | None = None
field stop_sequences: list[str] | None = None

Stop sequences are one or more strings which will cause the text generation to stop if/when they are produced as part of the output. Stop sequences encountered prior to the minimum number of tokens being generated will be ignored.

Constraints:
  • min_length = 1

  • max_length = 6

field temperature: float | None = None

Control the creativity of generated text. Higher values will lead to more randomly generated outputs.

Constraints:
  • ge = 0.0

  • le = 2.0

  • multiple_of = 0.01

field time_limit: int | None = None

Time limit in milliseconds - if not completed within this time, generation will stop. The text generated so far will be returned along with the TIME_LIMIT stop reason.

field top_k: int | None = None

Set the number of highest probability vocabulary tokens to keep for top-k-filtering. Lower values make it less likely the model will go off topic.

Constraints:
  • ge = 1

  • le = 100

field top_p: float | None = None

If < 1.0, only the smallest set of most probable tokens with probabilities that add up to top_p or higher are used.

Constraints:
  • ge = 0.0

  • le = 1.0

  • multiple_of = 0.01

field truncate_input_tokens: int | None = None

Truncate to this many input tokens. Can be used to avoid requests failing due to input being longer than configured limits. Zero means don’t truncate.

Constraints:
  • ge = 0

field typical_p: float | None = None

Local typicality measures how similar the conditional probability of predicting a target token next is to the expected conditional probability of predicting a random token next, given the partial text already generated. If set to float < 1, the smallest set of the most locally typical tokens with probabilities that add up to typical_p or higher are kept for generation. 1.00 means a neutral value.

Constraints:
  • ge = 0.01

  • le = 1.0

  • multiple_of = 0.01

pydantic model genai.schema.TextGenerationResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field generated_text: str [Required]
field generated_token_count: int [Required]
field generated_tokens: list[BaseTokens] | None = None
field input_text: str | None = None
field input_token_count: int | None = None
field input_tokens: list[BaseTokens] | None = None
field moderations: TextCreateResponseModeration | None = None
field seed: float | None = None
field stop_reason: StopReason [Required]
field stop_sequence: str | None = None
pydantic model genai.schema.TextGenerationReturnOptions[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field generated_tokens: bool | None = False

Include list of individual generated tokens

field input_parameters: bool | None = None
field input_text: bool | None = False

Include input text

field input_tokens: bool | None = False

Include list of input tokens

field token_logprobs: bool | None = False

Include logprob for each returned token

field token_ranks: bool | None = False

Include rank of each returned token

field top_n_tokens: int | None = None

Include top n candidate tokens at the position of each returned token

Constraints:
  • ge = 0

  • le = 5

class genai.schema.TextGenerationStreamCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/text/generation_stream'
version: str = '2024-03-19'
pydantic model genai.schema.TextGenerationStreamCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: AwareDatetime | None = None
field id: str | None = None
field input_parameters: dict[str, Any] | None = None
field model_id: str [Required]
field moderations: TextCreateResponseModeration | None = None
field results: list[TextGenerationStreamResult] | None = None
pydantic model genai.schema.TextGenerationStreamResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field generated_text: str [Required]
field generated_token_count: int [Required]
field generated_tokens: list[BaseTokens] | None = None
field input_text: str | None = None
field input_token_count: int | None = None
field input_tokens: list[BaseTokens] | None = None
field seed: float | None = None
field stop_reason: StopReason [Required]
field stop_sequence: str | None = None
pydantic model genai.schema.TextModeration[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field flagged: bool [Required]
field position: ModerationPosition [Required]
field score: float [Required]
field success: bool [Required]
field tokens: list[ModerationTokens] | None = None
class genai.schema.TextModerationCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/text/moderations'
version: str = '2024-03-19'
pydantic model genai.schema.TextModerationCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[TextCreateResponseModeration] [Required]
class genai.schema.TextRerankCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/beta/text/rerank'
version: str = '2023-11-22'
pydantic model genai.schema.TextRerankCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: _TextRerankCreateResult [Required]
pydantic model genai.schema.TextRerankParameters[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field return_options: TextRerankReturnOptions | None = None
field truncate_input_tokens: bool | None = None
pydantic model genai.schema.TextRerankResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field score: float [Required]
pydantic model genai.schema.TextRerankReturnOptions[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field documents: bool | None = None
field query: bool | None = None
field top_n: float | None = None
Constraints:
  • ge = 1.0

class genai.schema.TextSentenceSimilarityCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/beta/text/sentence-similarity'
version: str = '2023-11-22'
pydantic model genai.schema.TextSentenceSimilarityCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[TextSentenceSimilarityCreateResult] [Required]
pydantic model genai.schema.TextSentenceSimilarityCreateResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field score: float [Required]
pydantic model genai.schema.TextSentenceSimilarityParameters[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field truncate_input_tokens: bool | None = None
class genai.schema.TextTokenizationCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/text/tokenization'
version: str = '2024-01-10'
pydantic model genai.schema.TextTokenizationCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: str [Required]
field model_id: str [Required]
field results: list[TextTokenizationCreateResults] [Required]
pydantic model genai.schema.TextTokenizationCreateResults[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field input_text: str | None = None
field token_count: int [Required]
field tokens: list[str] | None = None
pydantic model genai.schema.TextTokenizationParameters[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field return_options: TextTokenizationReturnOptions | None = None
pydantic model genai.schema.TextTokenizationReturnOptions[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field input_text: bool | None = None
field tokens: bool | None = None
class genai.schema.TimeSerieForecastingCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/beta/time_series/forecasting'
version: str = '2023-11-22'
pydantic model genai.schema.TimeSerieForecastingCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: _TimeSerieForecastingCreateResult [Required]
class genai.schema.TimeSerieLimitRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/beta/time_series/limits'
version: str = '2023-11-22'
pydantic model genai.schema.TimeSerieLimitRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: TimeSeriesLimit [Required]
pydantic model genai.schema.TimeSeriesLimit[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field concurrency: ConcurrencyLimit [Required]
pydantic model genai.schema.TooManyRequestsResponse[source]

Bases: BaseErrorResponse

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field extensions: Extensions3 [Required]
field status_code: Literal[429] = 429
class genai.schema.TrimMethod[source]

Bases: str, Enum

An enumeration.

FLOATING_WINDOW = 'floating_window'
NONE = 'none'
class genai.schema.TuneAssetType[source]

Bases: str, Enum

An enumeration.

EXPORT = 'export'
LOGS = 'logs'
VECTORS = 'vectors'
class genai.schema.TuneCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/tunes'
version: str = '2023-11-22'
pydantic model genai.schema.TuneCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: TuneResult [Required]
class genai.schema.TuneFromFileCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/tunes/import'
version: str = '2023-11-22'
pydantic model genai.schema.TuneFromFileCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: TuneResult [Required]
class genai.schema.TuneIdContentRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/tunes/{id}/content'
version: str = '2023-11-22'
class genai.schema.TuneIdContentTypeRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/tunes/{id}/content/{type}'
version: str = '2023-12-15'
class genai.schema.TuneIdDeleteEndpoint[source]

Bases: ApiEndpoint

method: str = 'DELETE'
path: str = '/v2/tunes/{id}'
version: str = '2023-11-22'
class genai.schema.TuneIdPatchEndpoint[source]

Bases: ApiEndpoint

method: str = 'PATCH'
path: str = '/v2/tunes/{id}'
version: str = '2023-11-22'
pydantic model genai.schema.TuneIdPatchResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: TuneResult [Required]
class genai.schema.TuneIdRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/tunes/{id}'
version: str = '2023-11-22'
pydantic model genai.schema.TuneIdRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: TuneResult [Required]
class genai.schema.TuneListSortBy[source]

Bases: str, Enum

An enumeration.

CREATED_AT = 'created_at'
ID = 'id'
MODEL = 'model'
NAME = 'name'
STATUS = 'status'
pydantic model genai.schema.TuneParameters[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field accumulate_steps: int | None = None
field batch_size: int | None = None
field learning_rate: float | None = None
field max_input_tokens: int | None = None
field max_output_tokens: int | None = None
field num_epochs: int | None = None
field num_virtual_tokens: int | None = None
field verbalizer: str | None = None
class genai.schema.TunePreflightCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/tunes/preflight'
version: str = '2023-11-22'
pydantic model genai.schema.TunePreflightCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: _TunePreflightCreateResult [Required]
pydantic model genai.schema.TuneResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field contents: list[TuneResultContent] | None = None
field created_at: AwareDatetime [Required]
field datapoints: TuneResultDatapoint | None = None
field evaluation_files: list[TuneResultFiles] | None = None
field finished_at: AwareDatetime | None = None
field id: str [Required]
field last_used_at: AwareDatetime | None = None
field model_id: str [Required]
field model_name: str [Required]
field name: str [Required]
field parameters: dict[str, Any] | None = None
field preferred: bool [Required]
field started_at: AwareDatetime | None = None
field status: TuneStatus [Required]
field status_message: str | None = None
field task_id: str [Required]
field task_name: str [Required]
field training_files: list[TuneResultFiles] | None = None
field tuning_type: str [Required]
field validation_files: list[TuneResultFiles] | None = None
field vectors: str | None = None
pydantic model genai.schema.TuneResultContent[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field name: str [Required]
pydantic model genai.schema.TuneResultDatapoint[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field loss: list[TunesResultDatapointLoss] [Required]
field validation_loss: list[TuneResultDatapointValidationLoss] | None = None
pydantic model genai.schema.TuneResultDatapointLossData[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

Validators:
  • _validate_epoch » epoch

field epoch: int [Required]
Validated by:
  • _validate_epoch

field step: int | None = None
field value: float [Required]
pydantic model genai.schema.TuneResultDatapointValidationLoss[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field data: TuneResultDatapointValidationLossData [Required]
field timestamp: AwareDatetime [Required]
pydantic model genai.schema.TuneResultDatapointValidationLossData[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

Validators:
  • _validate_epoch » epoch

field epoch: int [Required]
Validated by:
  • _validate_epoch

field step: int | None = None
field value: float [Required]
pydantic model genai.schema.TuneResultFiles[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: AwareDatetime | None = None
field file_name: str [Required]
field id: str [Required]
class genai.schema.TuneRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/tunes'
version: str = '2023-11-22'
pydantic model genai.schema.TuneRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[TuneResult] [Required]
field total_count: int [Required]
class genai.schema.TuneStatus[source]

Bases: str, Enum

An enumeration.

COMPLETED = 'completed'
FAILED = 'failed'
HALTED = 'halted'
INITIALIZING = 'initializing'
NOT_STARTED = 'not_started'
PENDING = 'pending'
QUEUED = 'queued'
RUNNING = 'running'
pydantic model genai.schema.TunesResultDatapointLoss[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field data: TuneResultDatapointLossData [Required]
field timestamp: AwareDatetime [Required]
class genai.schema.TuningTypeRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/tuning_types'
version: str = '2024-01-30'
pydantic model genai.schema.TuningTypeRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field results: list[TuningTypeRetrieveResults] [Required]
pydantic model genai.schema.TuningTypeRetrieveResults[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field id: str | None = None
field model_ids: list[str] | None = None
field name: str | None = None
field schema_: dict[str, Any] | None = None (alias 'schema')

JSON Schema

pydantic model genai.schema.UnauthorizedResponse[source]

Bases: BaseErrorResponse

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field extensions: Extensions4 [Required]
field status_code: Literal[401] = 401
pydantic model genai.schema.UnavailableResponse[source]

Bases: BaseErrorResponse

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field extensions: Extensions5 [Required]
field status_code: Literal[503] = 503
pydantic model genai.schema.UserApiKey[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field created_at: str [Required]
field generated_at: str [Required]
field last_used_at: str | None = None
field value: str [Required]
class genai.schema.UserCreateEndpoint[source]

Bases: ApiEndpoint

method: str = 'POST'
path: str = '/v2/user'
version: str = '2023-11-22'
pydantic model genai.schema.UserCreateResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: UserCreateResult [Required]
pydantic model genai.schema.UserCreateResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field api_key: UserApiKey [Required]
field email: str [Required]
field first_name: str | None = None
field generate_default: UserGenerationDefault | None = None
field id: int [Required]
field last_name: str | None = None
field tou_accepted: bool [Required]
field tou_accepted_at: str | None = None
field user_id: str [Required]
class genai.schema.UserDeleteEndpoint[source]

Bases: ApiEndpoint

method: str = 'DELETE'
path: str = '/v2/user'
version: str = '2023-11-22'
pydantic model genai.schema.UserGenerationDefault[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field model_id: str | None = None
field parameters: TextGenerationParameters | None = None
class genai.schema.UserPatchEndpoint[source]

Bases: ApiEndpoint

method: str = 'PATCH'
path: str = '/v2/user'
version: str = '2023-11-22'
pydantic model genai.schema.UserPatchResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: UserResult [Required]
pydantic model genai.schema.UserResult[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field email: str [Required]
field first_name: str | None = None
field generate_default: UserGenerationDefault | None = None
field id: int [Required]
field last_name: str | None = None
field tou_accepted: bool [Required]
field tou_accepted_at: str | None = None
class genai.schema.UserRetrieveEndpoint[source]

Bases: ApiEndpoint

method: str = 'GET'
path: str = '/v2/user'
version: str = '2023-11-22'
pydantic model genai.schema.UserRetrieveResponse[source]

Bases: ApiBaseModel

Config:
  • extra: str = allow

  • use_enum_values: bool = True

  • protected_namespaces: tuple = ()

  • validate_assignment: bool = True

  • allow_inf_nan: bool = False

  • validate_default: bool = True

field result: UserResult [Required]