haskell-google-genai-client (empty) → 0.1.0
raw patch · 20 files changed
+29538/−0 lines, 20 filesdep +QuickCheckdep +aesondep +basesetup-changed
Dependencies added: QuickCheck, aeson, base, base64-bytestring, bytestring, case-insensitive, containers, deepseq, exceptions, haskell-google-genai-client, hspec, http-api-data, http-client, http-client-tls, http-media, http-types, iso8601-time, katip, microlens, monad-logger, mtl, network, random, safe-exceptions, semigroups, text, time, transformers, unordered-containers, vector
Files
- LICENSE +21/−0
- README.md +99/−0
- Setup.hs +3/−0
- haskell-google-genai-client.cabal +121/−0
- lib/GenAI/Client.hs +30/−0
- lib/GenAI/Client/API.hs +18/−0
- lib/GenAI/Client/API/Generativelanguage.hs +3477/−0
- lib/GenAI/Client/Client.hs +263/−0
- lib/GenAI/Client/Core.hs +617/−0
- lib/GenAI/Client/Logging.hs +33/−0
- lib/GenAI/Client/LoggingKatip.hs +121/−0
- lib/GenAI/Client/LoggingMonadLogger.hs +130/−0
- lib/GenAI/Client/MimeTypes.hs +213/−0
- lib/GenAI/Client/Model.hs +7723/−0
- lib/GenAI/Client/ModelLens.hs +2599/−0
- openapi.yaml +12063/−0
- tests/ApproxEq.hs +98/−0
- tests/Instances.hs +1682/−0
- tests/PropMime.hs +55/−0
- tests/Test.hs +172/−0
+ LICENSE view
@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2025 SoonHo Seo++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.
+ README.md view
@@ -0,0 +1,99 @@+# Haskell Google GenAI Client++Unofficial low-level Haskell client for the Google Gemini API (also known as GenAI API or Generative Language API).++This library provides a type-safe way to interact with Google's Gemini API services directly from your Haskell code.++## Note+- The code is **automatically generated** from the OpenAPI specification using [openapi-generator](https://openapi-generator.tech/).+- APIs include text/image/audio generation, embeddings, model tuning, semantic retrieval API, and more. See [Google API reference](https://ai.google.dev/api) for full details.+++# Development++First, run `nix develop` to enter the development shell. Non-Nix users should install the dependencies such as openapi-generator and pre-commit.++```bash+# Generate the Haskell client code from the OpenAPI specification+./run-generator.sh+# Format the code and check for linting issues+pre-commit run --all-files+# Build the project+cabal build+# Run the tests+cabal test+```++# Example Usage++Here is a working example that uses 'generateContent' API to generate text using Gemini model:++```haskell+{-# LANGUAGE OverloadedStrings #-}+import GenAI.Client+import Network.HTTP.Client (responseBody)+import Network.HTTP.Client.TLS (newTlsManager)+import Network.HTTP.Types (QueryItem)+import Data.ByteString.Lazy qualified as LBS++apiKeyParam :: QueryItem+apiKeyParam = ("key", Just "<GEMINI_API_KEY>")++model :: Model2+model = Model2 "gemini-2.0-flash-001"++requestBody :: GenerateContentRequest+requestBody = mkGenerateContentRequest [content] "gemini-2.0-flash-001" where+ content = mkContent { contentParts = Just [textPart] }+ textPart = mkPart { partText = Just query }+ query = "What is the capital of Korea?"++request :: ClientRequest GenerateContent MimeJSON GenerateContentResponse MimeJSON+request = flip addQuery [apiKeyParam] $ flip setBodyParam requestBody $ generateContent model++main :: IO ()+main = do+ config <- withStdoutLogging =<< newConfig+ manager <- newTlsManager+ response <- dispatchLbs manager config request+ LBS.putStr $ responseBody response+```++Running code above will produce:+```json+{+ "candidates": [+ {+ "content": {+ "parts": [+ {+ "text": "The capital of South Korea is **Seoul**.\n"+ }+ ],+ "role": "model"+ },+ "finishReason": "STOP",+ "avgLogprobs": -0.024313041940331459+ }+ ],+ "usageMetadata": {+ "promptTokenCount": 7,+ "candidatesTokenCount": 8,+ "totalTokenCount": 15,+ "promptTokensDetails": [+ {+ "modality": "TEXT",+ "tokenCount": 7+ }+ ],+ "candidatesTokensDetails": [+ {+ "modality": "TEXT",+ "tokenCount": 8+ }+ ]+ },+ "modelVersion": "gemini-2.0-flash-001",+ "responseId": "ZQc_aPa7JcXWnvgP3LDNsAw"+}+```
+ Setup.hs view
@@ -0,0 +1,3 @@+import Distribution.Simple++main = defaultMain
+ haskell-google-genai-client.cabal view
@@ -0,0 +1,121 @@+cabal-version: 3.0+name: haskell-google-genai-client+version: 0.1.0+synopsis: Auto-generated Gemini API Client for Haskell+description:+ Unofficial Haskell client for Google GenAI API, including Gemini.++ This library is auto-generated from the OpenAPI specification, using <https://openapi-generator.tech/ openapi-generator>.++ Google API reference: <https://ai.google.dev/api>++category: API+homepage:+ https://github.com/sonowz/haskell-google-genai-client#readme++bug-reports:+ https://github.com/sonowz/haskell-google-genai-client/issues++author: SoonHo Seo+maintainer: dnsdhrj123@gmail.com+copyright: 2025 Sonowz+license: MIT+license-file: LICENSE+build-type: Simple+extra-source-files:+ openapi.yaml+ README.md++source-repository head+ type: git+ location: https://github.com/sonowz/haskell-google-genai-client++flag UseKatip+ description:+ Use the katip package to provide logging (if false, use the default monad-logger package)++ default: False+ manual: True++library+ hs-source-dirs: lib+ ghc-options: -Wall -funbox-strict-fields+ build-depends:+ , aeson >=2.0 && <3+ , base >=4.16 && <5+ , base64-bytestring >=1.0.0 && <2+ , bytestring >=0.11.0 && <1+ , case-insensitive >=1.2 && <2+ , containers >=0.6 && <0.8+ , deepseq >=1.4 && <1.6+ , exceptions >=0.10 && <1+ , http-api-data >=0.4 && <0.7+ , http-client >=0.7 && <0.8+ , http-client-tls >=0.3 && <1+ , http-media >=0.8 && <0.9+ , http-types >=0.12 && <0.13+ , iso8601-time >=0.1.3 && <0.2+ , microlens >=0.4.3 && <1+ , mtl >=2.2.1 && <3+ , network >=3.0 && <3.9+ , random >=1.1 && <2+ , safe-exceptions >=0.1 && <0.2+ , text >=1.2 && <3+ , time >=1.5 && <2+ , transformers >=0.5.0.0 && <1+ , unordered-containers >=0.2 && <1+ , vector >=0.12 && <0.14++ other-modules: Paths_haskell_google_genai_client+ autogen-modules: Paths_haskell_google_genai_client+ exposed-modules:+ GenAI.Client+ GenAI.Client.API+ GenAI.Client.API.Generativelanguage+ GenAI.Client.Client+ GenAI.Client.Core+ GenAI.Client.Logging+ GenAI.Client.MimeTypes+ GenAI.Client.Model+ GenAI.Client.ModelLens++ default-language: GHC2021++ if flag(usekatip)+ build-depends: katip >=0.8 && <1.0+ other-modules: GenAI.Client.LoggingKatip+ cpp-options: -DUSE_KATIP++ else+ build-depends: monad-logger >=0.3 && <0.4+ other-modules: GenAI.Client.LoggingMonadLogger+ cpp-options: -DUSE_MONAD_LOGGER++test-suite tests+ type: exitcode-stdio-1.0+ main-is: Test.hs+ hs-source-dirs: tests+ ghc-options: -Wall -fno-warn-orphans+ build-depends:+ , aeson+ , base+ , bytestring+ , containers+ , haskell-google-genai-client+ , hspec+ , iso8601-time+ , mtl+ , QuickCheck+ , semigroups+ , text+ , time+ , transformers+ , unordered-containers+ , vector++ other-modules:+ ApproxEq+ Instances+ PropMime++ default-language: GHC2021
+ lib/GenAI/Client.hs view
@@ -0,0 +1,30 @@+{-+ Generative Language API++ The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.++ OpenAPI Version: 3.0.3+ Generative Language API API version: v1beta+ Generated by OpenAPI Generator (https://openapi-generator.tech)+-}++{- |+Module : GenAI.Client+-}+module GenAI.Client (+ module GenAI.Client.API,+ module GenAI.Client.Client,+ module GenAI.Client.Core,+ module GenAI.Client.Logging,+ module GenAI.Client.MimeTypes,+ module GenAI.Client.Model,+ module GenAI.Client.ModelLens,+) where++import GenAI.Client.API+import GenAI.Client.Client+import GenAI.Client.Core+import GenAI.Client.Logging+import GenAI.Client.MimeTypes+import GenAI.Client.Model+import GenAI.Client.ModelLens
+ lib/GenAI/Client/API.hs view
@@ -0,0 +1,18 @@+{-+ Generative Language API++ The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.++ OpenAPI Version: 3.0.3+ Generative Language API API version: v1beta+ Generated by OpenAPI Generator (https://openapi-generator.tech)+-}++{- |+Module : GenAI.Client.API+-}+module GenAI.Client.API (+ module GenAI.Client.API.Generativelanguage,+) where++import GenAI.Client.API.Generativelanguage
+ lib/GenAI/Client/API/Generativelanguage.hs view
@@ -0,0 +1,3477 @@+{-+ Generative Language API++ The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.++ OpenAPI Version: 3.0.3+ Generative Language API API version: v1beta+ Generated by OpenAPI Generator (https://openapi-generator.tech)+-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MonoLocalBinds #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE OverloadedStrings #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}++{- |+Module : GenAI.Client.API.Generativelanguage+-}+module GenAI.Client.API.Generativelanguage where++import GenAI.Client.Core+import GenAI.Client.MimeTypes+import GenAI.Client.Model as M++import Data.Aeson qualified as A+import Data.ByteString qualified as B+import Data.ByteString.Lazy qualified as BL+import Data.Data qualified as P (TypeRep, Typeable, typeOf, typeRep)+import Data.Foldable qualified as P+import Data.Map qualified as Map+import Data.Maybe qualified as P+import Data.Proxy qualified as P (Proxy (..))+import Data.Set qualified as Set+import Data.String qualified as P+import Data.Text qualified as T+import Data.Text.Encoding qualified as T+import Data.Text.Lazy qualified as TL+import Data.Text.Lazy.Encoding qualified as TL+import Data.Time qualified as TI+import Network.HTTP.Client.MultipartFormData qualified as NH+import Network.HTTP.Media qualified as ME+import Network.HTTP.Types qualified as NH+import Web.FormUrlEncoded qualified as WH+import Web.HttpApiData qualified as WH++import Data.Text (Text)+import GHC.Base ((<|>))++import Prelude (Applicative, Bool (..), Char, Double, FilePath, Float, Functor, Int, Integer, Maybe (..), Monad, String, fmap, maybe, mempty, pure, undefined, ($), (.), (/=), (<$>), (<*>), (==), (>>=))+import Prelude qualified as P++-- * Operations++-- ** Generativelanguage++-- *** batchCreateChunks++{- | @POST \/v1beta\/corpora\/{corpus}\/documents\/{document}\/chunks:batchCreate@++Batch create `Chunk`s.+-}+batchCreateChunks ::+ (Consumes BatchCreateChunks MimeJSON) =>+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "document" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Document2 ->+ ClientRequest BatchCreateChunks MimeJSON BatchCreateChunksResponse MimeJSON+batchCreateChunks (Corpus2 corpus) (Document2 document) =+ _mkRequest "POST" ["/v1beta/corpora/", toPath corpus, "/documents/", toPath document, "/chunks:batchCreate"]++data BatchCreateChunks++-- | /Body Param/ "BatchCreateChunksRequest" - The request body.+instance HasBodyParam BatchCreateChunks BatchCreateChunksRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam BatchCreateChunks Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam BatchCreateChunks Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam BatchCreateChunks PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam BatchCreateChunks Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes BatchCreateChunks MimeJSON++-- | @application/json@+instance Produces BatchCreateChunks MimeJSON++-- *** batchDeleteChunks++{- | @POST \/v1beta\/corpora\/{corpus}\/documents\/{document}\/chunks:batchDelete@++Batch delete `Chunk`s.+-}+batchDeleteChunks ::+ (Consumes BatchDeleteChunks MimeJSON) =>+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "document" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Document2 ->+ ClientRequest BatchDeleteChunks MimeJSON A.Value MimeJSON+batchDeleteChunks (Corpus2 corpus) (Document2 document) =+ _mkRequest "POST" ["/v1beta/corpora/", toPath corpus, "/documents/", toPath document, "/chunks:batchDelete"]++data BatchDeleteChunks++-- | /Body Param/ "BatchDeleteChunksRequest" - The request body.+instance HasBodyParam BatchDeleteChunks BatchDeleteChunksRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam BatchDeleteChunks Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam BatchDeleteChunks Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam BatchDeleteChunks PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam BatchDeleteChunks Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes BatchDeleteChunks MimeJSON++-- | @application/json@+instance Produces BatchDeleteChunks MimeJSON++-- *** batchEmbedContents++{- | @POST \/v1beta\/models\/{model}:batchEmbedContents@++Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.+-}+batchEmbedContents ::+ (Consumes BatchEmbedContents MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest BatchEmbedContents MimeJSON BatchEmbedContentsResponse MimeJSON+batchEmbedContents (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":batchEmbedContents"]++data BatchEmbedContents++-- | /Body Param/ "BatchEmbedContentsRequest" - The request body.+instance HasBodyParam BatchEmbedContents BatchEmbedContentsRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam BatchEmbedContents Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam BatchEmbedContents Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam BatchEmbedContents PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam BatchEmbedContents Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes BatchEmbedContents MimeJSON++-- | @application/json@+instance Produces BatchEmbedContents MimeJSON++-- *** batchEmbedText++{- | @POST \/v1beta\/models\/{model}:batchEmbedText@++Generates multiple embeddings from the model given input text in a synchronous call.+-}+batchEmbedText ::+ (Consumes BatchEmbedText MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest BatchEmbedText MimeJSON BatchEmbedTextResponse MimeJSON+batchEmbedText (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":batchEmbedText"]++data BatchEmbedText++-- | /Body Param/ "BatchEmbedTextRequest" - The request body.+instance HasBodyParam BatchEmbedText BatchEmbedTextRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam BatchEmbedText Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam BatchEmbedText Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam BatchEmbedText PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam BatchEmbedText Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes BatchEmbedText MimeJSON++-- | @application/json@+instance Produces BatchEmbedText MimeJSON++-- *** batchUpdateChunks++{- | @POST \/v1beta\/corpora\/{corpus}\/documents\/{document}\/chunks:batchUpdate@++Batch update `Chunk`s.+-}+batchUpdateChunks ::+ (Consumes BatchUpdateChunks MimeJSON) =>+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "document" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Document2 ->+ ClientRequest BatchUpdateChunks MimeJSON BatchUpdateChunksResponse MimeJSON+batchUpdateChunks (Corpus2 corpus) (Document2 document) =+ _mkRequest "POST" ["/v1beta/corpora/", toPath corpus, "/documents/", toPath document, "/chunks:batchUpdate"]++data BatchUpdateChunks++-- | /Body Param/ "BatchUpdateChunksRequest" - The request body.+instance HasBodyParam BatchUpdateChunks BatchUpdateChunksRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam BatchUpdateChunks Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam BatchUpdateChunks Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam BatchUpdateChunks PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam BatchUpdateChunks Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes BatchUpdateChunks MimeJSON++-- | @application/json@+instance Produces BatchUpdateChunks MimeJSON++-- *** cancelOperation++{- | @POST \/v1beta\/batches\/{generateContentBatch}:cancel@++Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.+-}+cancelOperation ::+ -- | "generateContentBatch" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ GenerateContentBatch ->+ ClientRequest CancelOperation MimeNoContent A.Value MimeJSON+cancelOperation (GenerateContentBatch generateContentBatch) =+ _mkRequest "POST" ["/v1beta/batches/", toPath generateContentBatch, ":cancel"]++data CancelOperation++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam CancelOperation Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam CancelOperation Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam CancelOperation PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam CancelOperation Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces CancelOperation MimeJSON++-- *** countMessageTokens++{- | @POST \/v1beta\/models\/{model}:countMessageTokens@++Runs a model's tokenizer on a string and returns the token count.+-}+countMessageTokens ::+ (Consumes CountMessageTokens MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest CountMessageTokens MimeJSON CountMessageTokensResponse MimeJSON+countMessageTokens (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":countMessageTokens"]++data CountMessageTokens++-- | /Body Param/ "CountMessageTokensRequest" - The request body.+instance HasBodyParam CountMessageTokens CountMessageTokensRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam CountMessageTokens Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam CountMessageTokens Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam CountMessageTokens PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam CountMessageTokens Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes CountMessageTokens MimeJSON++-- | @application/json@+instance Produces CountMessageTokens MimeJSON++-- *** countTextTokens++{- | @POST \/v1beta\/models\/{model}:countTextTokens@++Runs a model's tokenizer on a text and returns the token count.+-}+countTextTokens ::+ (Consumes CountTextTokens MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest CountTextTokens MimeJSON CountTextTokensResponse MimeJSON+countTextTokens (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":countTextTokens"]++data CountTextTokens++-- | /Body Param/ "CountTextTokensRequest" - The request body.+instance HasBodyParam CountTextTokens CountTextTokensRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam CountTextTokens Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam CountTextTokens Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam CountTextTokens PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam CountTextTokens Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes CountTextTokens MimeJSON++-- | @application/json@+instance Produces CountTextTokens MimeJSON++-- *** countTokens++{- | @POST \/v1beta\/models\/{model}:countTokens@++Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens.+-}+countTokens ::+ (Consumes CountTokens MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest CountTokens MimeJSON CountTokensResponse MimeJSON+countTokens (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":countTokens"]++data CountTokens++-- | /Body Param/ "CountTokensRequest" - The request body.+instance HasBodyParam CountTokens CountTokensRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam CountTokens Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam CountTokens Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam CountTokens PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam CountTokens Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes CountTokens MimeJSON++-- | @application/json@+instance Produces CountTokens MimeJSON++-- *** createCachedContent++{- | @POST \/v1beta\/cachedContents@++Creates CachedContent resource.+-}+createCachedContent ::+ (Consumes CreateCachedContent MimeJSON) =>+ ClientRequest CreateCachedContent MimeJSON CachedContent MimeJSON+createCachedContent =+ _mkRequest "POST" ["/v1beta/cachedContents"]++data CreateCachedContent++-- | /Body Param/ "CachedContent" - Required. The cached content to create.+instance HasBodyParam CreateCachedContent CachedContent++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam CreateCachedContent Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam CreateCachedContent Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam CreateCachedContent PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam CreateCachedContent Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes CreateCachedContent MimeJSON++-- | @application/json@+instance Produces CreateCachedContent MimeJSON++-- *** createChunk++{- | @POST \/v1beta\/corpora\/{corpus}\/documents\/{document}\/chunks@++Creates a `Chunk`.+-}+createChunk ::+ (Consumes CreateChunk MimeJSON) =>+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "document" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Document2 ->+ ClientRequest CreateChunk MimeJSON Chunk MimeJSON+createChunk (Corpus2 corpus) (Document2 document) =+ _mkRequest "POST" ["/v1beta/corpora/", toPath corpus, "/documents/", toPath document, "/chunks"]++data CreateChunk++-- | /Body Param/ "Chunk" - Required. The `Chunk` to create.+instance HasBodyParam CreateChunk Chunk++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam CreateChunk Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam CreateChunk Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam CreateChunk PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam CreateChunk Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes CreateChunk MimeJSON++-- | @application/json@+instance Produces CreateChunk MimeJSON++-- *** createCorpus++{- | @POST \/v1beta\/corpora@++Creates an empty `Corpus`.+-}+createCorpus ::+ (Consumes CreateCorpus MimeJSON) =>+ ClientRequest CreateCorpus MimeJSON Corpus MimeJSON+createCorpus =+ _mkRequest "POST" ["/v1beta/corpora"]++data CreateCorpus++-- | /Body Param/ "Corpus" - Required. The `Corpus` to create.+instance HasBodyParam CreateCorpus Corpus++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam CreateCorpus Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam CreateCorpus Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam CreateCorpus PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam CreateCorpus Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes CreateCorpus MimeJSON++-- | @application/json@+instance Produces CreateCorpus MimeJSON++-- *** createDocument++{- | @POST \/v1beta\/corpora\/{corpus}\/documents@++Creates an empty `Document`.+-}+createDocument ::+ (Consumes CreateDocument MimeJSON) =>+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ ClientRequest CreateDocument MimeJSON Document MimeJSON+createDocument (Corpus2 corpus) =+ _mkRequest "POST" ["/v1beta/corpora/", toPath corpus, "/documents"]++data CreateDocument++-- | /Body Param/ "Document" - Required. The `Document` to create.+instance HasBodyParam CreateDocument Document++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam CreateDocument Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam CreateDocument Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam CreateDocument PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam CreateDocument Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes CreateDocument MimeJSON++-- | @application/json@+instance Produces CreateDocument MimeJSON++-- *** createFile++{- | @POST \/v1beta\/files@++Creates a `File`.+-}+createFile ::+ (Consumes CreateFile MimeJSON) =>+ ClientRequest CreateFile MimeJSON CreateFileResponse MimeJSON+createFile =+ _mkRequest "POST" ["/v1beta/files"]++data CreateFile++-- | /Body Param/ "CreateFileRequest" - The request body.+instance HasBodyParam CreateFile CreateFileRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam CreateFile Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam CreateFile Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam CreateFile PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam CreateFile Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes CreateFile MimeJSON++-- | @application/json@+instance Produces CreateFile MimeJSON++-- *** createPermission++{- | @POST \/v1beta\/tunedModels\/{tunedModel}\/permissions@++Create a permission to a specific resource.+-}+createPermission ::+ (Consumes CreatePermission MimeJSON) =>+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ ClientRequest CreatePermission MimeJSON Permission MimeJSON+createPermission (TunedModel2 tunedModel) =+ _mkRequest "POST" ["/v1beta/tunedModels/", toPath tunedModel, "/permissions"]++data CreatePermission++-- | /Body Param/ "Permission" - Required. The permission to create.+instance HasBodyParam CreatePermission Permission++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam CreatePermission Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam CreatePermission Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam CreatePermission PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam CreatePermission Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes CreatePermission MimeJSON++-- | @application/json@+instance Produces CreatePermission MimeJSON++-- *** createPermissionByCorpus++{- | @POST \/v1beta\/corpora\/{corpus}\/permissions@++Create a permission to a specific resource.+-}+createPermissionByCorpus ::+ (Consumes CreatePermissionByCorpus MimeJSON) =>+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ ClientRequest CreatePermissionByCorpus MimeJSON Permission MimeJSON+createPermissionByCorpus (Corpus2 corpus) =+ _mkRequest "POST" ["/v1beta/corpora/", toPath corpus, "/permissions"]++data CreatePermissionByCorpus++-- | /Body Param/ "Permission" - Required. The permission to create.+instance HasBodyParam CreatePermissionByCorpus Permission++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam CreatePermissionByCorpus Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam CreatePermissionByCorpus Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam CreatePermissionByCorpus PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam CreatePermissionByCorpus Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes CreatePermissionByCorpus MimeJSON++-- | @application/json@+instance Produces CreatePermissionByCorpus MimeJSON++-- *** createTunedModel++{- | @POST \/v1beta\/tunedModels@++Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222+-}+createTunedModel ::+ (Consumes CreateTunedModel MimeJSON) =>+ ClientRequest CreateTunedModel MimeJSON CreateTunedModelOperation MimeJSON+createTunedModel =+ _mkRequest "POST" ["/v1beta/tunedModels"]++data CreateTunedModel++-- | /Body Param/ "TunedModel" - Required. The tuned model to create.+instance HasBodyParam CreateTunedModel TunedModel++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam CreateTunedModel Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam CreateTunedModel Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam CreateTunedModel PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam CreateTunedModel Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "tunedModelId" - Optional. The unique id for the tuned model if specified. This value should be up to 40 characters, the first character must be a letter, the last could be a letter or a number. The id must match the regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`.+instance HasOptionalParam CreateTunedModel TunedModelId where+ applyOptionalParam req (TunedModelId xs) =+ req `addQuery` toQuery ("tunedModelId", Just xs)++-- | @application/json@+instance Consumes CreateTunedModel MimeJSON++-- | @application/json@+instance Produces CreateTunedModel MimeJSON++-- *** deleteCachedContent++{- | @DELETE \/v1beta\/cachedContents\/{id}@++Deletes CachedContent resource.+-}+deleteCachedContent ::+ -- | "id" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Id ->+ ClientRequest DeleteCachedContent MimeNoContent A.Value MimeJSON+deleteCachedContent (Id id) =+ _mkRequest "DELETE" ["/v1beta/cachedContents/", toPath id]++data DeleteCachedContent++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam DeleteCachedContent Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam DeleteCachedContent Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam DeleteCachedContent PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam DeleteCachedContent Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces DeleteCachedContent MimeJSON++-- *** deleteChunk++{- | @DELETE \/v1beta\/corpora\/{corpus}\/documents\/{document}\/chunks\/{chunk}@++Deletes a `Chunk`.+-}+deleteChunk ::+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "document" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Document2 ->+ -- | "chunk" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Chunk2 ->+ ClientRequest DeleteChunk MimeNoContent A.Value MimeJSON+deleteChunk (Corpus2 corpus) (Document2 document) (Chunk2 chunk) =+ _mkRequest "DELETE" ["/v1beta/corpora/", toPath corpus, "/documents/", toPath document, "/chunks/", toPath chunk]++data DeleteChunk++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam DeleteChunk Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam DeleteChunk Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam DeleteChunk PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam DeleteChunk Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces DeleteChunk MimeJSON++-- *** deleteCorpus++{- | @DELETE \/v1beta\/corpora\/{corpus}@++Deletes a `Corpus`.+-}+deleteCorpus ::+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ ClientRequest DeleteCorpus MimeNoContent A.Value MimeJSON+deleteCorpus (Corpus2 corpus) =+ _mkRequest "DELETE" ["/v1beta/corpora/", toPath corpus]++data DeleteCorpus++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam DeleteCorpus Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam DeleteCorpus Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam DeleteCorpus PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam DeleteCorpus Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "force" - Optional. If set to true, any `Document`s and objects related to this `Corpus` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Corpus` contains any `Document`s.+instance HasOptionalParam DeleteCorpus Force where+ applyOptionalParam req (Force xs) =+ req `addQuery` toQuery ("force", Just xs)++-- | @application/json@+instance Produces DeleteCorpus MimeJSON++-- *** deleteDocument++{- | @DELETE \/v1beta\/corpora\/{corpus}\/documents\/{document}@++Deletes a `Document`.+-}+deleteDocument ::+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "document" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Document2 ->+ ClientRequest DeleteDocument MimeNoContent A.Value MimeJSON+deleteDocument (Corpus2 corpus) (Document2 document) =+ _mkRequest "DELETE" ["/v1beta/corpora/", toPath corpus, "/documents/", toPath document]++data DeleteDocument++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam DeleteDocument Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam DeleteDocument Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam DeleteDocument PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam DeleteDocument Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "force" - Optional. If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s.+instance HasOptionalParam DeleteDocument Force where+ applyOptionalParam req (Force xs) =+ req `addQuery` toQuery ("force", Just xs)++-- | @application/json@+instance Produces DeleteDocument MimeJSON++-- *** deleteFile++{- | @DELETE \/v1beta\/files\/{file}@++Deletes the `File`.+-}+deleteFile ::+ -- | "file" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ File2 ->+ ClientRequest DeleteFile MimeNoContent A.Value MimeJSON+deleteFile (File2 file) =+ _mkRequest "DELETE" ["/v1beta/files/", toPath file]++data DeleteFile++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam DeleteFile Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam DeleteFile Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam DeleteFile PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam DeleteFile Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces DeleteFile MimeJSON++-- *** deletePermission++{- | @DELETE \/v1beta\/tunedModels\/{tunedModel}\/permissions\/{permission}@++Deletes the permission.+-}+deletePermission ::+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ -- | "permission" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Permission2 ->+ ClientRequest DeletePermission MimeNoContent A.Value MimeJSON+deletePermission (TunedModel2 tunedModel) (Permission2 permission) =+ _mkRequest "DELETE" ["/v1beta/tunedModels/", toPath tunedModel, "/permissions/", toPath permission]++data DeletePermission++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam DeletePermission Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam DeletePermission Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam DeletePermission PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam DeletePermission Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces DeletePermission MimeJSON++-- *** deletePermissionByCorpusAndPermission++{- | @DELETE \/v1beta\/corpora\/{corpus}\/permissions\/{permission}@++Deletes the permission.+-}+deletePermissionByCorpusAndPermission ::+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "permission" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Permission2 ->+ ClientRequest DeletePermissionByCorpusAndPermission MimeNoContent A.Value MimeJSON+deletePermissionByCorpusAndPermission (Corpus2 corpus) (Permission2 permission) =+ _mkRequest "DELETE" ["/v1beta/corpora/", toPath corpus, "/permissions/", toPath permission]++data DeletePermissionByCorpusAndPermission++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam DeletePermissionByCorpusAndPermission Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam DeletePermissionByCorpusAndPermission Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam DeletePermissionByCorpusAndPermission PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam DeletePermissionByCorpusAndPermission Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces DeletePermissionByCorpusAndPermission MimeJSON++-- *** deleteTunedModel++{- | @DELETE \/v1beta\/tunedModels\/{tunedModel}@++Deletes a tuned model.+-}+deleteTunedModel ::+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ ClientRequest DeleteTunedModel MimeNoContent A.Value MimeJSON+deleteTunedModel (TunedModel2 tunedModel) =+ _mkRequest "DELETE" ["/v1beta/tunedModels/", toPath tunedModel]++data DeleteTunedModel++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam DeleteTunedModel Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam DeleteTunedModel Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam DeleteTunedModel PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam DeleteTunedModel Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces DeleteTunedModel MimeJSON++-- *** downloadFile++{- | @GET \/v1beta\/files\/{file}:download@++Download the `File`.+-}+downloadFile ::+ -- | "file" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ File2 ->+ ClientRequest DownloadFile MimeNoContent A.Value MimeJSON+downloadFile (File2 file) =+ _mkRequest "GET" ["/v1beta/files/", toPath file, ":download"]++data DownloadFile++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam DownloadFile Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam DownloadFile Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam DownloadFile PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam DownloadFile Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces DownloadFile MimeJSON++-- *** embedContent++{- | @POST \/v1beta\/models\/{model}:embedContent@++Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding).+-}+embedContent ::+ (Consumes EmbedContent MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest EmbedContent MimeJSON EmbedContentResponse MimeJSON+embedContent (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":embedContent"]++data EmbedContent++-- | /Body Param/ "EmbedContentRequest" - The request body.+instance HasBodyParam EmbedContent EmbedContentRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam EmbedContent Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam EmbedContent Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam EmbedContent PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam EmbedContent Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes EmbedContent MimeJSON++-- | @application/json@+instance Produces EmbedContent MimeJSON++-- *** embedText++{- | @POST \/v1beta\/models\/{model}:embedText@++Generates an embedding from the model given an input message.+-}+embedText ::+ (Consumes EmbedText MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest EmbedText MimeJSON EmbedTextResponse MimeJSON+embedText (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":embedText"]++data EmbedText++-- | /Body Param/ "EmbedTextRequest" - The request body.+instance HasBodyParam EmbedText EmbedTextRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam EmbedText Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam EmbedText Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam EmbedText PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam EmbedText Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes EmbedText MimeJSON++-- | @application/json@+instance Produces EmbedText MimeJSON++-- *** generateAnswer++{- | @POST \/v1beta\/models\/{model}:generateAnswer@++Generates a grounded answer from the model given an input `GenerateAnswerRequest`.+-}+generateAnswer ::+ (Consumes GenerateAnswer MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest GenerateAnswer MimeJSON GenerateAnswerResponse MimeJSON+generateAnswer (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":generateAnswer"]++data GenerateAnswer++-- | /Body Param/ "GenerateAnswerRequest" - The request body.+instance HasBodyParam GenerateAnswer GenerateAnswerRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GenerateAnswer Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GenerateAnswer Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GenerateAnswer PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GenerateAnswer Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes GenerateAnswer MimeJSON++-- | @application/json@+instance Produces GenerateAnswer MimeJSON++-- *** generateContent++{- | @POST \/v1beta\/models\/{model}:generateContent@++Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.+-}+generateContent ::+ (Consumes GenerateContent MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest GenerateContent MimeJSON GenerateContentResponse MimeJSON+generateContent (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":generateContent"]++data GenerateContent++-- | /Body Param/ "GenerateContentRequest" - The request body.+instance HasBodyParam GenerateContent GenerateContentRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GenerateContent Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GenerateContent Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GenerateContent PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GenerateContent Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes GenerateContent MimeJSON++-- | @application/json@+instance Produces GenerateContent MimeJSON++-- *** generateContentByDynamicId++{- | @POST \/v1beta\/dynamic\/{dynamicId}:generateContent@++Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.+-}+generateContentByDynamicId ::+ (Consumes GenerateContentByDynamicId MimeJSON) =>+ -- | "dynamicId" - Part of `model`. Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.+ DynamicId ->+ ClientRequest GenerateContentByDynamicId MimeJSON GenerateContentResponse MimeJSON+generateContentByDynamicId (DynamicId dynamicId) =+ _mkRequest "POST" ["/v1beta/dynamic/", toPath dynamicId, ":generateContent"]++data GenerateContentByDynamicId++-- | /Body Param/ "GenerateContentRequest" - The request body.+instance HasBodyParam GenerateContentByDynamicId GenerateContentRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GenerateContentByDynamicId Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GenerateContentByDynamicId Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GenerateContentByDynamicId PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GenerateContentByDynamicId Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes GenerateContentByDynamicId MimeJSON++-- | @application/json@+instance Produces GenerateContentByDynamicId MimeJSON++-- *** generateContentByTunedModel++{- | @POST \/v1beta\/tunedModels\/{tunedModel}:generateContent@++Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.+-}+generateContentByTunedModel ::+ (Consumes GenerateContentByTunedModel MimeJSON) =>+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ ClientRequest GenerateContentByTunedModel MimeJSON GenerateContentResponse MimeJSON+generateContentByTunedModel (TunedModel2 tunedModel) =+ _mkRequest "POST" ["/v1beta/tunedModels/", toPath tunedModel, ":generateContent"]++data GenerateContentByTunedModel++-- | /Body Param/ "GenerateContentRequest" - The request body.+instance HasBodyParam GenerateContentByTunedModel GenerateContentRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GenerateContentByTunedModel Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GenerateContentByTunedModel Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GenerateContentByTunedModel PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GenerateContentByTunedModel Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes GenerateContentByTunedModel MimeJSON++-- | @application/json@+instance Produces GenerateContentByTunedModel MimeJSON++-- *** generateMessage++{- | @POST \/v1beta\/models\/{model}:generateMessage@++Generates a response from the model given an input `MessagePrompt`.+-}+generateMessage ::+ (Consumes GenerateMessage MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest GenerateMessage MimeJSON GenerateMessageResponse MimeJSON+generateMessage (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":generateMessage"]++data GenerateMessage++-- | /Body Param/ "GenerateMessageRequest" - The request body.+instance HasBodyParam GenerateMessage GenerateMessageRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GenerateMessage Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GenerateMessage Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GenerateMessage PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GenerateMessage Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes GenerateMessage MimeJSON++-- | @application/json@+instance Produces GenerateMessage MimeJSON++-- *** generateText++{- | @POST \/v1beta\/models\/{model}:generateText@++Generates a response from the model given an input message.+-}+generateText ::+ (Consumes GenerateText MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest GenerateText MimeJSON GenerateTextResponse MimeJSON+generateText (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":generateText"]++data GenerateText++-- | /Body Param/ "GenerateTextRequest" - The request body.+instance HasBodyParam GenerateText GenerateTextRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GenerateText Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GenerateText Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GenerateText PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GenerateText Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes GenerateText MimeJSON++-- | @application/json@+instance Produces GenerateText MimeJSON++-- *** generateTextByTunedModel++{- | @POST \/v1beta\/tunedModels\/{tunedModel}:generateText@++Generates a response from the model given an input message.+-}+generateTextByTunedModel ::+ (Consumes GenerateTextByTunedModel MimeJSON) =>+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ ClientRequest GenerateTextByTunedModel MimeJSON GenerateTextResponse MimeJSON+generateTextByTunedModel (TunedModel2 tunedModel) =+ _mkRequest "POST" ["/v1beta/tunedModels/", toPath tunedModel, ":generateText"]++data GenerateTextByTunedModel++-- | /Body Param/ "GenerateTextRequest" - The request body.+instance HasBodyParam GenerateTextByTunedModel GenerateTextRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GenerateTextByTunedModel Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GenerateTextByTunedModel Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GenerateTextByTunedModel PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GenerateTextByTunedModel Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes GenerateTextByTunedModel MimeJSON++-- | @application/json@+instance Produces GenerateTextByTunedModel MimeJSON++-- *** getCachedContent++{- | @GET \/v1beta\/cachedContents\/{id}@++Reads CachedContent resource.+-}+getCachedContent ::+ -- | "id" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Id ->+ ClientRequest GetCachedContent MimeNoContent CachedContent MimeJSON+getCachedContent (Id id) =+ _mkRequest "GET" ["/v1beta/cachedContents/", toPath id]++data GetCachedContent++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetCachedContent Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetCachedContent Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetCachedContent PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetCachedContent Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetCachedContent MimeJSON++-- *** getChunk++{- | @GET \/v1beta\/corpora\/{corpus}\/documents\/{document}\/chunks\/{chunk}@++Gets information about a specific `Chunk`.+-}+getChunk ::+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "document" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Document2 ->+ -- | "chunk" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Chunk2 ->+ ClientRequest GetChunk MimeNoContent Chunk MimeJSON+getChunk (Corpus2 corpus) (Document2 document) (Chunk2 chunk) =+ _mkRequest "GET" ["/v1beta/corpora/", toPath corpus, "/documents/", toPath document, "/chunks/", toPath chunk]++data GetChunk++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetChunk Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetChunk Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetChunk PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetChunk Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetChunk MimeJSON++-- *** getCorpus++{- | @GET \/v1beta\/corpora\/{corpus}@++Gets information about a specific `Corpus`.+-}+getCorpus ::+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ ClientRequest GetCorpus MimeNoContent Corpus MimeJSON+getCorpus (Corpus2 corpus) =+ _mkRequest "GET" ["/v1beta/corpora/", toPath corpus]++data GetCorpus++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetCorpus Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetCorpus Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetCorpus PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetCorpus Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetCorpus MimeJSON++-- *** getDocument++{- | @GET \/v1beta\/corpora\/{corpus}\/documents\/{document}@++Gets information about a specific `Document`.+-}+getDocument ::+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "document" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Document2 ->+ ClientRequest GetDocument MimeNoContent Document MimeJSON+getDocument (Corpus2 corpus) (Document2 document) =+ _mkRequest "GET" ["/v1beta/corpora/", toPath corpus, "/documents/", toPath document]++data GetDocument++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetDocument Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetDocument Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetDocument PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetDocument Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetDocument MimeJSON++-- *** getFile++{- | @GET \/v1beta\/files\/{file}@++Gets the metadata for the given `File`.+-}+getFile ::+ -- | "file" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ File2 ->+ ClientRequest GetFile MimeNoContent File MimeJSON+getFile (File2 file) =+ _mkRequest "GET" ["/v1beta/files/", toPath file]++data GetFile++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetFile Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetFile Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetFile PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetFile Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetFile MimeJSON++-- *** getGeneratedFile++{- | @GET \/v1beta\/generatedFiles\/{generatedFile}@++Gets a generated file. When calling this method via REST, only the metadata of the generated file is returned. To retrieve the file content via REST, add alt=media as a query parameter.+-}+getGeneratedFile ::+ -- | "generatedFile" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ GeneratedFile2 ->+ ClientRequest GetGeneratedFile MimeNoContent GeneratedFile MimeJSON+getGeneratedFile (GeneratedFile2 generatedFile) =+ _mkRequest "GET" ["/v1beta/generatedFiles/", toPath generatedFile]++data GetGeneratedFile++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetGeneratedFile Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetGeneratedFile Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetGeneratedFile PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetGeneratedFile Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetGeneratedFile MimeJSON++-- *** getModel++{- | @GET \/v1beta\/models\/{model}@++Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information.+-}+getModel ::+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest GetModel MimeNoContent Model MimeJSON+getModel (Model2 model) =+ _mkRequest "GET" ["/v1beta/models/", toPath model]++data GetModel++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetModel Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetModel Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetModel PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetModel Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetModel MimeJSON++-- *** getOperation++{- | @GET \/v1beta\/tunedModels\/{tunedModel}\/operations\/{operation}@++Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.+-}+getOperation ::+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ -- | "operation" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Operation2 ->+ ClientRequest GetOperation MimeNoContent Operation MimeJSON+getOperation (TunedModel2 tunedModel) (Operation2 operation) =+ _mkRequest "GET" ["/v1beta/tunedModels/", toPath tunedModel, "/operations/", toPath operation]++data GetOperation++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetOperation Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetOperation Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetOperation PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetOperation Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetOperation MimeJSON++-- *** getOperationByGenerateContentBatch++{- | @GET \/v1beta\/batches\/{generateContentBatch}@++Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.+-}+getOperationByGenerateContentBatch ::+ -- | "generateContentBatch" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ GenerateContentBatch ->+ ClientRequest GetOperationByGenerateContentBatch MimeNoContent Operation MimeJSON+getOperationByGenerateContentBatch (GenerateContentBatch generateContentBatch) =+ _mkRequest "GET" ["/v1beta/batches/", toPath generateContentBatch]++data GetOperationByGenerateContentBatch++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetOperationByGenerateContentBatch Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetOperationByGenerateContentBatch Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetOperationByGenerateContentBatch PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetOperationByGenerateContentBatch Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetOperationByGenerateContentBatch MimeJSON++-- *** getOperationByGeneratedFileAndOperation++{- | @GET \/v1beta\/generatedFiles\/{generatedFile}\/operations\/{operation}@++Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.+-}+getOperationByGeneratedFileAndOperation ::+ -- | "generatedFile" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ GeneratedFile2 ->+ -- | "operation" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Operation2 ->+ ClientRequest GetOperationByGeneratedFileAndOperation MimeNoContent Operation MimeJSON+getOperationByGeneratedFileAndOperation (GeneratedFile2 generatedFile) (Operation2 operation) =+ _mkRequest "GET" ["/v1beta/generatedFiles/", toPath generatedFile, "/operations/", toPath operation]++data GetOperationByGeneratedFileAndOperation++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetOperationByGeneratedFileAndOperation Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetOperationByGeneratedFileAndOperation Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetOperationByGeneratedFileAndOperation PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetOperationByGeneratedFileAndOperation Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetOperationByGeneratedFileAndOperation MimeJSON++-- *** getOperationByModelAndOperation++{- | @GET \/v1beta\/models\/{model}\/operations\/{operation}@++Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.+-}+getOperationByModelAndOperation ::+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ -- | "operation" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Operation2 ->+ ClientRequest GetOperationByModelAndOperation MimeNoContent Operation MimeJSON+getOperationByModelAndOperation (Model2 model) (Operation2 operation) =+ _mkRequest "GET" ["/v1beta/models/", toPath model, "/operations/", toPath operation]++data GetOperationByModelAndOperation++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetOperationByModelAndOperation Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetOperationByModelAndOperation Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetOperationByModelAndOperation PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetOperationByModelAndOperation Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetOperationByModelAndOperation MimeJSON++-- *** getPermission++{- | @GET \/v1beta\/tunedModels\/{tunedModel}\/permissions\/{permission}@++Gets information about a specific Permission.+-}+getPermission ::+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ -- | "permission" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Permission2 ->+ ClientRequest GetPermission MimeNoContent Permission MimeJSON+getPermission (TunedModel2 tunedModel) (Permission2 permission) =+ _mkRequest "GET" ["/v1beta/tunedModels/", toPath tunedModel, "/permissions/", toPath permission]++data GetPermission++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetPermission Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetPermission Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetPermission PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetPermission Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetPermission MimeJSON++-- *** getPermissionByCorpusAndPermission++{- | @GET \/v1beta\/corpora\/{corpus}\/permissions\/{permission}@++Gets information about a specific Permission.+-}+getPermissionByCorpusAndPermission ::+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "permission" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Permission2 ->+ ClientRequest GetPermissionByCorpusAndPermission MimeNoContent Permission MimeJSON+getPermissionByCorpusAndPermission (Corpus2 corpus) (Permission2 permission) =+ _mkRequest "GET" ["/v1beta/corpora/", toPath corpus, "/permissions/", toPath permission]++data GetPermissionByCorpusAndPermission++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetPermissionByCorpusAndPermission Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetPermissionByCorpusAndPermission Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetPermissionByCorpusAndPermission PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetPermissionByCorpusAndPermission Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetPermissionByCorpusAndPermission MimeJSON++-- *** getTunedModel++{- | @GET \/v1beta\/tunedModels\/{tunedModel}@++Gets information about a specific TunedModel.+-}+getTunedModel ::+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ ClientRequest GetTunedModel MimeNoContent TunedModel MimeJSON+getTunedModel (TunedModel2 tunedModel) =+ _mkRequest "GET" ["/v1beta/tunedModels/", toPath tunedModel]++data GetTunedModel++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam GetTunedModel Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam GetTunedModel Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam GetTunedModel PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam GetTunedModel Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Produces GetTunedModel MimeJSON++-- *** listCachedContents++{- | @GET \/v1beta\/cachedContents@++Lists CachedContents.+-}+listCachedContents ::+ ClientRequest ListCachedContents MimeNoContent ListCachedContentsResponse MimeJSON+listCachedContents =+ _mkRequest "GET" ["/v1beta/cachedContents"]++data ListCachedContents++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListCachedContents Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListCachedContents Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListCachedContents PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListCachedContents Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "pageSize" - Optional. The maximum number of cached contents to return. The service may return fewer than this value. If unspecified, some default (under maximum) number of items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.+instance HasOptionalParam ListCachedContents PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - Optional. A page token, received from a previous `ListCachedContents` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCachedContents` must match the call that provided the page token.+instance HasOptionalParam ListCachedContents PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | @application/json@+instance Produces ListCachedContents MimeJSON++-- *** listChunks++{- | @GET \/v1beta\/corpora\/{corpus}\/documents\/{document}\/chunks@++Lists all `Chunk`s in a `Document`.+-}+listChunks ::+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "document" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Document2 ->+ ClientRequest ListChunks MimeNoContent ListChunksResponse MimeJSON+listChunks (Corpus2 corpus) (Document2 document) =+ _mkRequest "GET" ["/v1beta/corpora/", toPath corpus, "/documents/", toPath document, "/chunks"]++data ListChunks++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListChunks Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListChunks Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListChunks PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListChunks Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "pageSize" - Optional. The maximum number of `Chunk`s to return (per page). The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum size limit is 100 `Chunk`s per page.+instance HasOptionalParam ListChunks PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - Optional. A page token, received from a previous `ListChunks` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListChunks` must match the call that provided the page token.+instance HasOptionalParam ListChunks PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | @application/json@+instance Produces ListChunks MimeJSON++-- *** listCorpora++{- | @GET \/v1beta\/corpora@++Lists all `Corpora` owned by the user.+-}+listCorpora ::+ ClientRequest ListCorpora MimeNoContent ListCorporaResponse MimeJSON+listCorpora =+ _mkRequest "GET" ["/v1beta/corpora"]++data ListCorpora++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListCorpora Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListCorpora Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListCorpora PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListCorpora Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "pageSize" - Optional. The maximum number of `Corpora` to return (per page). The service may return fewer `Corpora`. If unspecified, at most 10 `Corpora` will be returned. The maximum size limit is 20 `Corpora` per page.+instance HasOptionalParam ListCorpora PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - Optional. A page token, received from a previous `ListCorpora` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListCorpora` must match the call that provided the page token.+instance HasOptionalParam ListCorpora PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | @application/json@+instance Produces ListCorpora MimeJSON++-- *** listDocuments++{- | @GET \/v1beta\/corpora\/{corpus}\/documents@++Lists all `Document`s in a `Corpus`.+-}+listDocuments ::+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ ClientRequest ListDocuments MimeNoContent ListDocumentsResponse MimeJSON+listDocuments (Corpus2 corpus) =+ _mkRequest "GET" ["/v1beta/corpora/", toPath corpus, "/documents"]++data ListDocuments++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListDocuments Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListDocuments Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListDocuments PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListDocuments Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "pageSize" - Optional. The maximum number of `Document`s to return (per page). The service may return fewer `Document`s. If unspecified, at most 10 `Document`s will be returned. The maximum size limit is 20 `Document`s per page.+instance HasOptionalParam ListDocuments PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - Optional. A page token, received from a previous `ListDocuments` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListDocuments` must match the call that provided the page token.+instance HasOptionalParam ListDocuments PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | @application/json@+instance Produces ListDocuments MimeJSON++-- *** listFiles++{- | @GET \/v1beta\/files@++Lists the metadata for `File`s owned by the requesting project.+-}+listFiles ::+ ClientRequest ListFiles MimeNoContent ListFilesResponse MimeJSON+listFiles =+ _mkRequest "GET" ["/v1beta/files"]++data ListFiles++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListFiles Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListFiles Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListFiles PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListFiles Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "pageSize" - Optional. Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100.+instance HasOptionalParam ListFiles PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - Optional. A page token from a previous `ListFiles` call.+instance HasOptionalParam ListFiles PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | @application/json@+instance Produces ListFiles MimeJSON++-- *** listGeneratedFiles++{- | @GET \/v1beta\/generatedFiles@++Lists the generated files owned by the requesting project.+-}+listGeneratedFiles ::+ ClientRequest ListGeneratedFiles MimeNoContent ListGeneratedFilesResponse MimeJSON+listGeneratedFiles =+ _mkRequest "GET" ["/v1beta/generatedFiles"]++data ListGeneratedFiles++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListGeneratedFiles Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListGeneratedFiles Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListGeneratedFiles PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListGeneratedFiles Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "pageSize" - Optional. Maximum number of `GeneratedFile`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 50.+instance HasOptionalParam ListGeneratedFiles PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - Optional. A page token from a previous `ListGeneratedFiles` call.+instance HasOptionalParam ListGeneratedFiles PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | @application/json@+instance Produces ListGeneratedFiles MimeJSON++-- *** listModels++{- | @GET \/v1beta\/models@++Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API.+-}+listModels ::+ ClientRequest ListModels MimeNoContent ListModelsResponse MimeJSON+listModels =+ _mkRequest "GET" ["/v1beta/models"]++data ListModels++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListModels Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListModels Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListModels PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListModels Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "pageSize" - The maximum number of `Models` to return (per page). If unspecified, 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.+instance HasOptionalParam ListModels PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.+instance HasOptionalParam ListModels PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | @application/json@+instance Produces ListModels MimeJSON++-- *** listOperations++{- | @GET \/v1beta\/tunedModels\/{tunedModel}\/operations@++Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.+-}+listOperations ::+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ ClientRequest ListOperations MimeNoContent ListOperationsResponse MimeJSON+listOperations (TunedModel2 tunedModel) =+ _mkRequest "GET" ["/v1beta/tunedModels/", toPath tunedModel, "/operations"]++data ListOperations++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListOperations Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListOperations Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListOperations PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListOperations Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "filter" - The standard list filter.+instance HasOptionalParam ListOperations Filter where+ applyOptionalParam req (Filter xs) =+ req `addQuery` toQuery ("filter", Just xs)++-- | /Optional Param/ "pageSize" - The standard list page size.+instance HasOptionalParam ListOperations PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - The standard list page token.+instance HasOptionalParam ListOperations PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | @application/json@+instance Produces ListOperations MimeJSON++-- *** listOperationsBy++{- | @GET \/v1beta\/batches@++Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.+-}+listOperationsBy ::+ ClientRequest ListOperationsBy MimeNoContent ListOperationsResponse MimeJSON+listOperationsBy =+ _mkRequest "GET" ["/v1beta/batches"]++data ListOperationsBy++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListOperationsBy Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListOperationsBy Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListOperationsBy PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListOperationsBy Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "filter" - The standard list filter.+instance HasOptionalParam ListOperationsBy Filter where+ applyOptionalParam req (Filter xs) =+ req `addQuery` toQuery ("filter", Just xs)++-- | /Optional Param/ "pageSize" - The standard list page size.+instance HasOptionalParam ListOperationsBy PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - The standard list page token.+instance HasOptionalParam ListOperationsBy PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | @application/json@+instance Produces ListOperationsBy MimeJSON++-- *** listOperationsByModel++{- | @GET \/v1beta\/models\/{model}\/operations@++Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.+-}+listOperationsByModel ::+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest ListOperationsByModel MimeNoContent ListOperationsResponse MimeJSON+listOperationsByModel (Model2 model) =+ _mkRequest "GET" ["/v1beta/models/", toPath model, "/operations"]++data ListOperationsByModel++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListOperationsByModel Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListOperationsByModel Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListOperationsByModel PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListOperationsByModel Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "filter" - The standard list filter.+instance HasOptionalParam ListOperationsByModel Filter where+ applyOptionalParam req (Filter xs) =+ req `addQuery` toQuery ("filter", Just xs)++-- | /Optional Param/ "pageSize" - The standard list page size.+instance HasOptionalParam ListOperationsByModel PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - The standard list page token.+instance HasOptionalParam ListOperationsByModel PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | @application/json@+instance Produces ListOperationsByModel MimeJSON++-- *** listPermissions++{- | @GET \/v1beta\/tunedModels\/{tunedModel}\/permissions@++Lists permissions for the specific resource.+-}+listPermissions ::+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ ClientRequest ListPermissions MimeNoContent ListPermissionsResponse MimeJSON+listPermissions (TunedModel2 tunedModel) =+ _mkRequest "GET" ["/v1beta/tunedModels/", toPath tunedModel, "/permissions"]++data ListPermissions++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListPermissions Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListPermissions Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListPermissions PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListPermissions Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "pageSize" - Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.+instance HasOptionalParam ListPermissions PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.+instance HasOptionalParam ListPermissions PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | @application/json@+instance Produces ListPermissions MimeJSON++-- *** listPermissionsByCorpus++{- | @GET \/v1beta\/corpora\/{corpus}\/permissions@++Lists permissions for the specific resource.+-}+listPermissionsByCorpus ::+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ ClientRequest ListPermissionsByCorpus MimeNoContent ListPermissionsResponse MimeJSON+listPermissionsByCorpus (Corpus2 corpus) =+ _mkRequest "GET" ["/v1beta/corpora/", toPath corpus, "/permissions"]++data ListPermissionsByCorpus++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListPermissionsByCorpus Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListPermissionsByCorpus Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListPermissionsByCorpus PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListPermissionsByCorpus Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "pageSize" - Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.+instance HasOptionalParam ListPermissionsByCorpus PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.+instance HasOptionalParam ListPermissionsByCorpus PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | @application/json@+instance Produces ListPermissionsByCorpus MimeJSON++-- *** listTunedModels++{- | @GET \/v1beta\/tunedModels@++Lists created tuned models.+-}+listTunedModels ::+ ClientRequest ListTunedModels MimeNoContent ListTunedModelsResponse MimeJSON+listTunedModels =+ _mkRequest "GET" ["/v1beta/tunedModels"]++data ListTunedModels++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam ListTunedModels Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam ListTunedModels Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam ListTunedModels PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam ListTunedModels Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "pageSize" - Optional. The maximum number of `TunedModels` to return (per page). The service may return fewer tuned models. If unspecified, at most 10 tuned models will be returned. This method returns at most 1000 models per page, even if you pass a larger page_size.+instance HasOptionalParam ListTunedModels PageSize where+ applyOptionalParam req (PageSize xs) =+ req `addQuery` toQuery ("pageSize", Just xs)++-- | /Optional Param/ "pageToken" - Optional. A page token, received from a previous `ListTunedModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListTunedModels` must match the call that provided the page token.+instance HasOptionalParam ListTunedModels PageToken where+ applyOptionalParam req (PageToken xs) =+ req `addQuery` toQuery ("pageToken", Just xs)++-- | /Optional Param/ "filter" - Optional. A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone Examples: \"owner:me\" returns all tuned models to which caller has owner role \"readers:me\" returns all tuned models to which caller has reader role \"readers:everyone\" returns all tuned models that are shared with everyone+instance HasOptionalParam ListTunedModels Filter where+ applyOptionalParam req (Filter xs) =+ req `addQuery` toQuery ("filter", Just xs)++-- | @application/json@+instance Produces ListTunedModels MimeJSON++-- *** predict++{- | @POST \/v1beta\/models\/{model}:predict@++Performs a prediction request.+-}+predict ::+ (Consumes Predict MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest Predict MimeJSON PredictResponse MimeJSON+predict (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":predict"]++data Predict++-- | /Body Param/ "PredictRequest" - The request body.+instance HasBodyParam Predict PredictRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam Predict Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam Predict Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam Predict PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam Predict Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes Predict MimeJSON++-- | @application/json@+instance Produces Predict MimeJSON++-- *** predictLongRunning++{- | @POST \/v1beta\/models\/{model}:predictLongRunning@++Same as Predict but returns an LRO.+-}+predictLongRunning ::+ (Consumes PredictLongRunning MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest PredictLongRunning MimeJSON PredictLongRunningOperation MimeJSON+predictLongRunning (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":predictLongRunning"]++data PredictLongRunning++-- | /Body Param/ "PredictLongRunningRequest" - The request body.+instance HasBodyParam PredictLongRunning PredictLongRunningRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam PredictLongRunning Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam PredictLongRunning Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam PredictLongRunning PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam PredictLongRunning Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes PredictLongRunning MimeJSON++-- | @application/json@+instance Produces PredictLongRunning MimeJSON++-- *** queryCorpus++{- | @POST \/v1beta\/corpora\/{corpus}:query@++Performs semantic search over a `Corpus`.+-}+queryCorpus ::+ (Consumes QueryCorpus MimeJSON) =>+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ ClientRequest QueryCorpus MimeJSON QueryCorpusResponse MimeJSON+queryCorpus (Corpus2 corpus) =+ _mkRequest "POST" ["/v1beta/corpora/", toPath corpus, ":query"]++data QueryCorpus++-- | /Body Param/ "QueryCorpusRequest" - The request body.+instance HasBodyParam QueryCorpus QueryCorpusRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam QueryCorpus Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam QueryCorpus Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam QueryCorpus PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam QueryCorpus Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes QueryCorpus MimeJSON++-- | @application/json@+instance Produces QueryCorpus MimeJSON++-- *** queryDocument++{- | @POST \/v1beta\/corpora\/{corpus}\/documents\/{document}:query@++Performs semantic search over a `Document`.+-}+queryDocument ::+ (Consumes QueryDocument MimeJSON) =>+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "document" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Document2 ->+ ClientRequest QueryDocument MimeJSON QueryDocumentResponse MimeJSON+queryDocument (Corpus2 corpus) (Document2 document) =+ _mkRequest "POST" ["/v1beta/corpora/", toPath corpus, "/documents/", toPath document, ":query"]++data QueryDocument++-- | /Body Param/ "QueryDocumentRequest" - The request body.+instance HasBodyParam QueryDocument QueryDocumentRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam QueryDocument Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam QueryDocument Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam QueryDocument PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam QueryDocument Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes QueryDocument MimeJSON++-- | @application/json@+instance Produces QueryDocument MimeJSON++-- *** streamGenerateContent++{- | @POST \/v1beta\/models\/{model}:streamGenerateContent@++Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.+-}+streamGenerateContent ::+ (Consumes StreamGenerateContent MimeJSON) =>+ -- | "model" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Model2 ->+ ClientRequest StreamGenerateContent MimeJSON GenerateContentResponse MimeJSON+streamGenerateContent (Model2 model) =+ _mkRequest "POST" ["/v1beta/models/", toPath model, ":streamGenerateContent"]++data StreamGenerateContent++-- | /Body Param/ "GenerateContentRequest" - The request body.+instance HasBodyParam StreamGenerateContent GenerateContentRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam StreamGenerateContent Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam StreamGenerateContent Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam StreamGenerateContent PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam StreamGenerateContent Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes StreamGenerateContent MimeJSON++-- | @application/json@+instance Produces StreamGenerateContent MimeJSON++-- *** streamGenerateContentByDynamicId++{- | @POST \/v1beta\/dynamic\/{dynamicId}:streamGenerateContent@++Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.+-}+streamGenerateContentByDynamicId ::+ (Consumes StreamGenerateContentByDynamicId MimeJSON) =>+ -- | "dynamicId" - Part of `model`. Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.+ DynamicId ->+ ClientRequest StreamGenerateContentByDynamicId MimeJSON GenerateContentResponse MimeJSON+streamGenerateContentByDynamicId (DynamicId dynamicId) =+ _mkRequest "POST" ["/v1beta/dynamic/", toPath dynamicId, ":streamGenerateContent"]++data StreamGenerateContentByDynamicId++-- | /Body Param/ "GenerateContentRequest" - The request body.+instance HasBodyParam StreamGenerateContentByDynamicId GenerateContentRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam StreamGenerateContentByDynamicId Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam StreamGenerateContentByDynamicId Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam StreamGenerateContentByDynamicId PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam StreamGenerateContentByDynamicId Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes StreamGenerateContentByDynamicId MimeJSON++-- | @application/json@+instance Produces StreamGenerateContentByDynamicId MimeJSON++-- *** streamGenerateContentByTunedModel++{- | @POST \/v1beta\/tunedModels\/{tunedModel}:streamGenerateContent@++Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.+-}+streamGenerateContentByTunedModel ::+ (Consumes StreamGenerateContentByTunedModel MimeJSON) =>+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ ClientRequest StreamGenerateContentByTunedModel MimeJSON GenerateContentResponse MimeJSON+streamGenerateContentByTunedModel (TunedModel2 tunedModel) =+ _mkRequest "POST" ["/v1beta/tunedModels/", toPath tunedModel, ":streamGenerateContent"]++data StreamGenerateContentByTunedModel++-- | /Body Param/ "GenerateContentRequest" - The request body.+instance HasBodyParam StreamGenerateContentByTunedModel GenerateContentRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam StreamGenerateContentByTunedModel Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam StreamGenerateContentByTunedModel Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam StreamGenerateContentByTunedModel PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam StreamGenerateContentByTunedModel Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes StreamGenerateContentByTunedModel MimeJSON++-- | @application/json@+instance Produces StreamGenerateContentByTunedModel MimeJSON++-- *** transferOwnership++{- | @POST \/v1beta\/tunedModels\/{tunedModel}:transferOwnership@++Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role.+-}+transferOwnership ::+ (Consumes TransferOwnership MimeJSON) =>+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ ClientRequest TransferOwnership MimeJSON A.Value MimeJSON+transferOwnership (TunedModel2 tunedModel) =+ _mkRequest "POST" ["/v1beta/tunedModels/", toPath tunedModel, ":transferOwnership"]++data TransferOwnership++-- | /Body Param/ "TransferOwnershipRequest" - The request body.+instance HasBodyParam TransferOwnership TransferOwnershipRequest++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam TransferOwnership Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam TransferOwnership Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam TransferOwnership PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam TransferOwnership Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes TransferOwnership MimeJSON++-- | @application/json@+instance Produces TransferOwnership MimeJSON++-- *** updateCachedContent++{- | @PATCH \/v1beta\/cachedContents\/{id}@++Updates CachedContent resource (only expiration is updatable).+-}+updateCachedContent ::+ (Consumes UpdateCachedContent MimeJSON) =>+ -- | "id" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Id ->+ ClientRequest UpdateCachedContent MimeJSON CachedContent MimeJSON+updateCachedContent (Id id) =+ _mkRequest "PATCH" ["/v1beta/cachedContents/", toPath id]++data UpdateCachedContent++-- | /Body Param/ "CachedContent" - Required. The content cache entry to update+instance HasBodyParam UpdateCachedContent CachedContent++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam UpdateCachedContent Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam UpdateCachedContent Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam UpdateCachedContent PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam UpdateCachedContent Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "updateMask" - The list of fields to update.+instance HasOptionalParam UpdateCachedContent UpdateMask where+ applyOptionalParam req (UpdateMask xs) =+ req `addQuery` toQuery ("updateMask", Just xs)++-- | @application/json@+instance Consumes UpdateCachedContent MimeJSON++-- | @application/json@+instance Produces UpdateCachedContent MimeJSON++-- *** updateChunk++{- | @PATCH \/v1beta\/corpora\/{corpus}\/documents\/{document}\/chunks\/{chunk}@++Updates a `Chunk`.+-}+updateChunk ::+ (Consumes UpdateChunk MimeJSON) =>+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "document" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Document2 ->+ -- | "chunk2" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Chunk2 ->+ -- | "updateMask" - Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.+ UpdateMask ->+ ClientRequest UpdateChunk MimeJSON Chunk MimeJSON+updateChunk (Corpus2 corpus) (Document2 document) (Chunk2 chunk2) (UpdateMask updateMask) =+ _mkRequest "PATCH" ["/v1beta/corpora/", toPath corpus, "/documents/", toPath document, "/chunks/", toPath chunk2]+ `addQuery` toQuery ("updateMask", Just updateMask)++data UpdateChunk++-- | /Body Param/ "Chunk" - Required. The `Chunk` to update.+instance HasBodyParam UpdateChunk Chunk++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam UpdateChunk Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam UpdateChunk Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam UpdateChunk PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam UpdateChunk Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes UpdateChunk MimeJSON++-- | @application/json@+instance Produces UpdateChunk MimeJSON++-- *** updateCorpus++{- | @PATCH \/v1beta\/corpora\/{corpus}@++Updates a `Corpus`.+-}+updateCorpus ::+ (Consumes UpdateCorpus MimeJSON) =>+ -- | "corpus2" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "updateMask" - Required. The list of fields to update. Currently, this only supports updating `display_name`.+ UpdateMask ->+ ClientRequest UpdateCorpus MimeJSON Corpus MimeJSON+updateCorpus (Corpus2 corpus2) (UpdateMask updateMask) =+ _mkRequest "PATCH" ["/v1beta/corpora/", toPath corpus2]+ `addQuery` toQuery ("updateMask", Just updateMask)++data UpdateCorpus++-- | /Body Param/ "Corpus" - Required. The `Corpus` to update.+instance HasBodyParam UpdateCorpus Corpus++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam UpdateCorpus Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam UpdateCorpus Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam UpdateCorpus PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam UpdateCorpus Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes UpdateCorpus MimeJSON++-- | @application/json@+instance Produces UpdateCorpus MimeJSON++-- *** updateDocument++{- | @PATCH \/v1beta\/corpora\/{corpus}\/documents\/{document}@++Updates a `Document`.+-}+updateDocument ::+ (Consumes UpdateDocument MimeJSON) =>+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "document2" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Document2 ->+ -- | "updateMask" - Required. The list of fields to update. Currently, this only supports updating `display_name` and `custom_metadata`.+ UpdateMask ->+ ClientRequest UpdateDocument MimeJSON Document MimeJSON+updateDocument (Corpus2 corpus) (Document2 document2) (UpdateMask updateMask) =+ _mkRequest "PATCH" ["/v1beta/corpora/", toPath corpus, "/documents/", toPath document2]+ `addQuery` toQuery ("updateMask", Just updateMask)++data UpdateDocument++-- | /Body Param/ "Document" - Required. The `Document` to update.+instance HasBodyParam UpdateDocument Document++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam UpdateDocument Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam UpdateDocument Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam UpdateDocument PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam UpdateDocument Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes UpdateDocument MimeJSON++-- | @application/json@+instance Produces UpdateDocument MimeJSON++-- *** updatePermission++{- | @PATCH \/v1beta\/tunedModels\/{tunedModel}\/permissions\/{permission}@++Updates the permission.+-}+updatePermission ::+ (Consumes UpdatePermission MimeJSON) =>+ -- | "tunedModel" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ -- | "permission2" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Permission2 ->+ -- | "updateMask" - Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)+ UpdateMask ->+ ClientRequest UpdatePermission MimeJSON Permission MimeJSON+updatePermission (TunedModel2 tunedModel) (Permission2 permission2) (UpdateMask updateMask) =+ _mkRequest "PATCH" ["/v1beta/tunedModels/", toPath tunedModel, "/permissions/", toPath permission2]+ `addQuery` toQuery ("updateMask", Just updateMask)++data UpdatePermission++-- | /Body Param/ "Permission" - Required. The permission to update. The permission's `name` field is used to identify the permission to update.+instance HasBodyParam UpdatePermission Permission++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam UpdatePermission Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam UpdatePermission Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam UpdatePermission PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam UpdatePermission Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes UpdatePermission MimeJSON++-- | @application/json@+instance Produces UpdatePermission MimeJSON++-- *** updatePermissionByCorpusAndPermission++{- | @PATCH \/v1beta\/corpora\/{corpus}\/permissions\/{permission}@++Updates the permission.+-}+updatePermissionByCorpusAndPermission ::+ (Consumes UpdatePermissionByCorpusAndPermission MimeJSON) =>+ -- | "corpus" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Corpus2 ->+ -- | "permission2" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ Permission2 ->+ -- | "updateMask" - Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)+ UpdateMask ->+ ClientRequest UpdatePermissionByCorpusAndPermission MimeJSON Permission MimeJSON+updatePermissionByCorpusAndPermission (Corpus2 corpus) (Permission2 permission2) (UpdateMask updateMask) =+ _mkRequest "PATCH" ["/v1beta/corpora/", toPath corpus, "/permissions/", toPath permission2]+ `addQuery` toQuery ("updateMask", Just updateMask)++data UpdatePermissionByCorpusAndPermission++-- | /Body Param/ "Permission" - Required. The permission to update. The permission's `name` field is used to identify the permission to update.+instance HasBodyParam UpdatePermissionByCorpusAndPermission Permission++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam UpdatePermissionByCorpusAndPermission Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam UpdatePermissionByCorpusAndPermission Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam UpdatePermissionByCorpusAndPermission PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam UpdatePermissionByCorpusAndPermission Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | @application/json@+instance Consumes UpdatePermissionByCorpusAndPermission MimeJSON++-- | @application/json@+instance Produces UpdatePermissionByCorpusAndPermission MimeJSON++-- *** updateTunedModel++{- | @PATCH \/v1beta\/tunedModels\/{tunedModel}@++Updates a tuned model.+-}+updateTunedModel ::+ (Consumes UpdateTunedModel MimeJSON) =>+ -- | "tunedModel2" - Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.+ TunedModel2 ->+ ClientRequest UpdateTunedModel MimeJSON TunedModel MimeJSON+updateTunedModel (TunedModel2 tunedModel2) =+ _mkRequest "PATCH" ["/v1beta/tunedModels/", toPath tunedModel2]++data UpdateTunedModel++-- | /Body Param/ "TunedModel" - Required. The tuned model to update.+instance HasBodyParam UpdateTunedModel TunedModel++-- | /Optional Param/ "$alt" - Data format for response.+instance HasOptionalParam UpdateTunedModel Alt where+ applyOptionalParam req (Alt xs) =+ req `addQuery` toQuery ("$alt", Just xs)++-- | /Optional Param/ "$callback" - JSONP+instance HasOptionalParam UpdateTunedModel Callback where+ applyOptionalParam req (Callback xs) =+ req `addQuery` toQuery ("$callback", Just xs)++-- | /Optional Param/ "$prettyPrint" - Returns response with indentations and line breaks.+instance HasOptionalParam UpdateTunedModel PrettyPrint where+ applyOptionalParam req (PrettyPrint xs) =+ req `addQuery` toQuery ("$prettyPrint", Just xs)++-- | /Optional Param/ "$.xgafv" - V1 error format.+instance HasOptionalParam UpdateTunedModel Xgafv where+ applyOptionalParam req (Xgafv xs) =+ req `addQuery` toQuery ("$.xgafv", Just xs)++-- | /Optional Param/ "updateMask" - Optional. The list of fields to update.+instance HasOptionalParam UpdateTunedModel UpdateMask where+ applyOptionalParam req (UpdateMask xs) =+ req `addQuery` toQuery ("updateMask", Just xs)++-- | @application/json@+instance Consumes UpdateTunedModel MimeJSON++-- | @application/json@+instance Produces UpdateTunedModel MimeJSON
+ lib/GenAI/Client/Client.hs view
@@ -0,0 +1,263 @@+{-# LANGUAGE DeriveFoldable #-}+{-# LANGUAGE DeriveFunctor #-}+{-# LANGUAGE DeriveTraversable #-}+{-# LANGUAGE FlexibleContexts #-}+{-+ Generative Language API++ The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.++ OpenAPI Version: 3.0.3+ Generative Language API API version: v1beta+ Generated by OpenAPI Generator (https://openapi-generator.tech)+-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}++{- |+Module : GenAI.Client.Client+-}+module GenAI.Client.Client where++import GenAI.Client.Core+import GenAI.Client.Logging+import GenAI.Client.MimeTypes++import Control.Exception.Safe qualified as E+import Control.Monad qualified as P+import Control.Monad.IO.Class qualified as P+import Data.Aeson.Types qualified as A+import Data.ByteString qualified as B+import Data.ByteString.Char8 qualified as BC+import Data.ByteString.Lazy qualified as BL+import Data.ByteString.Lazy.Char8 qualified as BCL+import Data.Proxy qualified as P (Proxy (..))+import Data.Text qualified as T+import Data.Text.Encoding qualified as T+import Network.HTTP.Client qualified as NH+import Network.HTTP.Client.MultipartFormData qualified as NH+import Network.HTTP.Types qualified as NH+import Web.FormUrlEncoded qualified as WH+import Web.HttpApiData qualified as WH++import Data.Function ((&))+import Data.Monoid ((<>))+import Data.Text (Text)+import GHC.Exts (IsString (..))++-- * Dispatch++-- ** Lbs++-- | send a request returning the raw http response+dispatchLbs ::+ (Produces req accept, MimeType contentType) =>+ -- | http-client Connection manager+ NH.Manager ->+ -- | config+ GenAIClientConfig ->+ -- | request+ ClientRequest req contentType res accept ->+ -- | response+ IO (NH.Response BCL.ByteString)+dispatchLbs manager config request = do+ initReq <- _toInitRequest config request+ dispatchInitUnsafe manager config initReq++-- ** Mime++-- | pair of decoded http body and http response+data MimeResult res+ = MimeResult+ { mimeResult :: Either MimeError res+ -- ^ decoded http body+ , mimeResultResponse :: NH.Response BCL.ByteString+ -- ^ http response+ }+ deriving (Show, Functor, Foldable, Traversable)++-- | pair of unrender/parser error and http response+data MimeError+ = MimeError+ { mimeError :: String+ -- ^ unrender/parser error+ , mimeErrorResponse :: NH.Response BCL.ByteString+ -- ^ http response+ }+ deriving (Show)++-- | send a request returning the 'MimeResult'+dispatchMime ::+ forall req contentType res accept.+ (Produces req accept, MimeUnrender accept res, MimeType contentType) =>+ -- | http-client Connection manager+ NH.Manager ->+ -- | config+ GenAIClientConfig ->+ -- | request+ ClientRequest req contentType res accept ->+ -- | response+ IO (MimeResult res)+dispatchMime manager config request = do+ httpResponse <- dispatchLbs manager config request+ let statusCode = NH.statusCode . NH.responseStatus $ httpResponse+ parsedResult <-+ runConfigLogWithExceptions "Client" config $+ do+ if (statusCode >= 400 && statusCode < 600)+ then do+ let s = "error statusCode: " ++ show statusCode+ _log "Client" levelError (T.pack s)+ pure (Left (MimeError s httpResponse))+ else case mimeUnrender (P.Proxy :: P.Proxy accept) (NH.responseBody httpResponse) of+ Left s -> do+ _log "Client" levelError (T.pack s)+ pure (Left (MimeError s httpResponse))+ Right r -> pure (Right r)+ return (MimeResult parsedResult httpResponse)++-- | like 'dispatchMime', but only returns the decoded http body+dispatchMime' ::+ (Produces req accept, MimeUnrender accept res, MimeType contentType) =>+ -- | http-client Connection manager+ NH.Manager ->+ -- | config+ GenAIClientConfig ->+ -- | request+ ClientRequest req contentType res accept ->+ -- | response+ IO (Either MimeError res)+dispatchMime' manager config request = do+ MimeResult parsedResult _ <- dispatchMime manager config request+ return parsedResult++-- ** Unsafe++-- | like 'dispatchReqLbs', but does not validate the operation is a 'Producer' of the "accept" 'MimeType'. (Useful if the server's response is undocumented)+dispatchLbsUnsafe ::+ (MimeType accept, MimeType contentType) =>+ -- | http-client Connection manager+ NH.Manager ->+ -- | config+ GenAIClientConfig ->+ -- | request+ ClientRequest req contentType res accept ->+ -- | response+ IO (NH.Response BCL.ByteString)+dispatchLbsUnsafe manager config request = do+ initReq <- _toInitRequest config request+ dispatchInitUnsafe manager config initReq++-- | dispatch an InitRequest+dispatchInitUnsafe ::+ -- | http-client Connection manager+ NH.Manager ->+ -- | config+ GenAIClientConfig ->+ -- | init request+ InitRequest req contentType res accept ->+ -- | response+ IO (NH.Response BCL.ByteString)+dispatchInitUnsafe manager config (InitRequest req) = do+ runConfigLogWithExceptions src config $+ do+ _log src levelInfo requestLogMsg+ _log src levelDebug requestDbgLogMsg+ res <- P.liftIO $ NH.httpLbs req manager+ _log src levelInfo (responseLogMsg res)+ _log src levelDebug ((T.pack . show) res)+ return res+ where+ src = "Client"+ endpoint =+ T.pack $+ BC.unpack $+ NH.method req <> " " <> NH.host req <> NH.path req <> NH.queryString req+ requestLogMsg = "REQ:" <> endpoint+ requestDbgLogMsg =+ "Headers="+ <> (T.pack . show) (NH.requestHeaders req)+ <> " Body="+ <> ( case NH.requestBody req of+ NH.RequestBodyLBS xs -> T.decodeUtf8 (BL.toStrict xs)+ _ -> "<RequestBody>"+ )+ responseStatusCode = (T.pack . show) . NH.statusCode . NH.responseStatus+ responseLogMsg res =+ "RES:statusCode=" <> responseStatusCode res <> " (" <> endpoint <> ")"++-- * InitRequest++-- | wraps an http-client 'Request' with request/response type parameters+newtype InitRequest req contentType res accept = InitRequest+ { unInitRequest :: NH.Request+ }+ deriving (Show)++-- | Build an http-client 'Request' record from the supplied config and request+_toInitRequest ::+ (MimeType accept, MimeType contentType) =>+ -- | config+ GenAIClientConfig ->+ -- | request+ ClientRequest req contentType res accept ->+ -- | initialized request+ IO (InitRequest req contentType res accept)+_toInitRequest config req0 =+ runConfigLogWithExceptions "Client" config $ do+ parsedReq <- P.liftIO $ NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0))+ req1 <- P.liftIO $ _applyAuthMethods req0 config+ P.when+ (configValidateAuthMethods config && (not . null . rAuthTypes) req1)+ (E.throw $ AuthMethodException $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1)+ let req2 = req1 & _setContentTypeHeader & _setAcceptHeader+ params = rParams req2+ reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders params+ reqQuery =+ let query = paramsQuery params+ queryExtraUnreserved = configQueryExtraUnreserved config+ in if B.null queryExtraUnreserved+ then NH.renderQuery True query+ else NH.renderQueryPartialEscape True (toPartialEscapeQuery queryExtraUnreserved query)+ pReq =+ parsedReq+ { NH.method = rMethod req2+ , NH.requestHeaders = reqHeaders+ , NH.queryString = reqQuery+ }+ outReq <- case paramsBody params of+ ParamBodyNone -> pure (pReq {NH.requestBody = mempty})+ ParamBodyB bs -> pure (pReq {NH.requestBody = NH.RequestBodyBS bs})+ ParamBodyBL bl -> pure (pReq {NH.requestBody = NH.RequestBodyLBS bl})+ ParamBodyFormUrlEncoded form -> pure (pReq {NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form)})+ ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq++ pure (InitRequest outReq)++-- | modify the underlying Request+modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept+modifyInitRequest (InitRequest req) f = InitRequest (f req)++-- | modify the underlying Request (monadic)+modifyInitRequestM :: (Monad m) => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept)+modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req)++-- ** Logging++-- | Run a block using the configured logger instance+runConfigLog ::+ (P.MonadIO m) =>+ GenAIClientConfig ->+ LogExec m a+runConfigLog config = configLogExecWithContext config (configLogContext config)++-- | Run a block using the configured logger instance (logs exceptions)+runConfigLogWithExceptions ::+ (E.MonadCatch m, P.MonadIO m) =>+ T.Text ->+ GenAIClientConfig ->+ LogExec m a+runConfigLogWithExceptions src config = runConfigLog config . logExceptions src
+ lib/GenAI/Client/Core.hs view
@@ -0,0 +1,617 @@+{-# LANGUAGE CPP #-}+{-+ Generative Language API++ The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.++ OpenAPI Version: 3.0.3+ Generative Language API API version: v1beta+ Generated by OpenAPI Generator (https://openapi-generator.tech)+-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE ExistentialQuantification #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TupleSections #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}++{- |+Module : GenAI.Client.Core+-}+module GenAI.Client.Core where++import GenAI.Client.Logging+import GenAI.Client.MimeTypes++import Control.Arrow qualified as P (left)+import Control.DeepSeq qualified as NF+import Control.Exception.Safe qualified as E+import Data.Aeson qualified as A+import Data.ByteString qualified as B+import Data.ByteString.Base64.Lazy qualified as BL64+import Data.ByteString.Builder qualified as BB+import Data.ByteString.Char8 qualified as BC+import Data.ByteString.Lazy qualified as BL+import Data.ByteString.Lazy.Char8 qualified as BCL+import Data.CaseInsensitive qualified as CI+import Data.Data qualified as P (Data, TypeRep, Typeable, typeRep)+import Data.Foldable qualified as P+import Data.Ix qualified as P+import Data.Kind qualified as K (Type)+import Data.Maybe qualified as P+import Data.Proxy qualified as P (Proxy (..))+import Data.Text qualified as T+import Data.Text.Encoding qualified as T+import Data.Text.Lazy.Encoding qualified as TL+import Data.Time qualified as TI+import Data.Time.ISO8601 qualified as TI+import GHC.Base qualified as P (Alternative)+import Lens.Micro qualified as L+import Network.HTTP.Client.MultipartFormData qualified as NH+import Network.HTTP.Types qualified as NH+import Text.Printf qualified as T+import Web.FormUrlEncoded qualified as WH+import Web.HttpApiData qualified as WH+import Prelude qualified as P++import Control.Applicative (Alternative, (<|>))+import Control.Monad.Fail (MonadFail)+import Data.Foldable (foldlM)+import Data.Function ((&))+import Data.Monoid ((<>))+import Data.Text (Text)+import Prelude (Bool (..), Char, Functor, IO, Maybe (..), Monad, String, fmap, maybe, mempty, pure, return, show, ($), (&&), (.), (<$>), (<*>))++-- * GenAIClientConfig++data GenAIClientConfig = GenAIClientConfig+ { configHost :: BCL.ByteString+ -- ^ host supplied in the Request+ , configUserAgent :: Text+ -- ^ user-agent supplied in the Request+ , configLogExecWithContext :: LogExecWithContext+ -- ^ Run a block using a Logger instance+ , configLogContext :: LogContext+ -- ^ Configures the logger+ , configAuthMethods :: [AnyAuthMethod]+ -- ^ List of configured auth methods+ , configValidateAuthMethods :: Bool+ -- ^ throw exceptions if auth methods are not configured+ , configQueryExtraUnreserved :: B.ByteString+ -- ^ Configures additional querystring characters which must not be URI encoded, e.g. '+' or ':'+ }++-- | display the config+instance P.Show GenAIClientConfig where+ show c =+ T.printf+ "{ configHost = %v, configUserAgent = %v, ..}"+ (show (configHost c))+ (show (configUserAgent c))++{- | constructs a default GenAIClientConfig++configHost:++@https://generativelanguage.googleapis.com@++configUserAgent:++@"haskell-google-genai-client/0.1.0.0"@+-}+newConfig :: IO GenAIClientConfig+newConfig = do+ logCxt <- initLogContext+ return $+ GenAIClientConfig+ { configHost = "https://generativelanguage.googleapis.com"+ , configUserAgent = "haskell-google-genai-client/0.1.0.0"+ , configLogExecWithContext = runDefaultLogExecWithContext+ , configLogContext = logCxt+ , configAuthMethods = []+ , configValidateAuthMethods = True+ , configQueryExtraUnreserved = ""+ }++-- | updates config use AuthMethod on matching requests+addAuthMethod :: (AuthMethod auth) => GenAIClientConfig -> auth -> GenAIClientConfig+addAuthMethod config@GenAIClientConfig {configAuthMethods = as} a =+ config {configAuthMethods = AnyAuthMethod a : as}++-- | updates the config to use stdout logging+withStdoutLogging :: GenAIClientConfig -> IO GenAIClientConfig+withStdoutLogging p = do+ logCxt <- stdoutLoggingContext (configLogContext p)+ return $ p {configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt}++-- | updates the config to use stderr logging+withStderrLogging :: GenAIClientConfig -> IO GenAIClientConfig+withStderrLogging p = do+ logCxt <- stderrLoggingContext (configLogContext p)+ return $ p {configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt}++-- | updates the config to disable logging+withNoLogging :: GenAIClientConfig -> GenAIClientConfig+withNoLogging p = p {configLogExecWithContext = runNullLogExec}++-- * ClientRequest++{- | Represents a request.++ Type Variables:++ * req - request operation+ * contentType - 'MimeType' associated with request body+ * res - response model+ * accept - 'MimeType' associated with response body+-}+data ClientRequest req contentType res accept = ClientRequest+ { rMethod :: NH.Method+ -- ^ Method of ClientRequest+ , rUrlPath :: [BCL.ByteString]+ -- ^ Endpoint of ClientRequest+ , rParams :: Params+ -- ^ params of ClientRequest+ , rAuthTypes :: [P.TypeRep]+ -- ^ types of auth methods+ }+ deriving (P.Show)++-- | 'rMethod' Lens+rMethodL :: Lens_' (ClientRequest req contentType res accept) NH.Method+rMethodL f ClientRequest {..} = (\rMethod -> ClientRequest {rMethod, ..}) <$> f rMethod+{-# INLINE rMethodL #-}++-- | 'rUrlPath' Lens+rUrlPathL :: Lens_' (ClientRequest req contentType res accept) [BCL.ByteString]+rUrlPathL f ClientRequest {..} = (\rUrlPath -> ClientRequest {rUrlPath, ..}) <$> f rUrlPath+{-# INLINE rUrlPathL #-}++-- | 'rParams' Lens+rParamsL :: Lens_' (ClientRequest req contentType res accept) Params+rParamsL f ClientRequest {..} = (\rParams -> ClientRequest {rParams, ..}) <$> f rParams+{-# INLINE rParamsL #-}++-- | 'rParams' Lens+rAuthTypesL :: Lens_' (ClientRequest req contentType res accept) [P.TypeRep]+rAuthTypesL f ClientRequest {..} = (\rAuthTypes -> ClientRequest {rAuthTypes, ..}) <$> f rAuthTypes+{-# INLINE rAuthTypesL #-}++-- * HasBodyParam++-- | Designates the body parameter of a request+class HasBodyParam req param where+ setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => ClientRequest req contentType res accept -> param -> ClientRequest req contentType res accept+ setBodyParam req xs =+ req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader++-- * HasOptionalParam++-- | Designates the optional parameters of a request+class HasOptionalParam req param where+ {-# MINIMAL applyOptionalParam | (-&-) #-}++ -- | Apply an optional parameter to a request+ applyOptionalParam :: ClientRequest req contentType res accept -> param -> ClientRequest req contentType res accept+ applyOptionalParam = (-&-)+ {-# INLINE applyOptionalParam #-}++ -- | infix operator \/ alias for 'addOptionalParam'+ (-&-) :: ClientRequest req contentType res accept -> param -> ClientRequest req contentType res accept+ (-&-) = applyOptionalParam+ {-# INLINE (-&-) #-}++infixl 2 -&-++-- | Request Params+data Params = Params+ { paramsQuery :: NH.Query+ , paramsHeaders :: NH.RequestHeaders+ , paramsBody :: ParamBody+ }+ deriving (P.Show)++-- | 'paramsQuery' Lens+paramsQueryL :: Lens_' Params NH.Query+paramsQueryL f Params {..} = (\paramsQuery -> Params {paramsQuery, ..}) <$> f paramsQuery+{-# INLINE paramsQueryL #-}++-- | 'paramsHeaders' Lens+paramsHeadersL :: Lens_' Params NH.RequestHeaders+paramsHeadersL f Params {..} = (\paramsHeaders -> Params {paramsHeaders, ..}) <$> f paramsHeaders+{-# INLINE paramsHeadersL #-}++-- | 'paramsBody' Lens+paramsBodyL :: Lens_' Params ParamBody+paramsBodyL f Params {..} = (\paramsBody -> Params {paramsBody, ..}) <$> f paramsBody+{-# INLINE paramsBodyL #-}++-- | Request Body+data ParamBody+ = ParamBodyNone+ | ParamBodyB B.ByteString+ | ParamBodyBL BL.ByteString+ | ParamBodyFormUrlEncoded WH.Form+ | ParamBodyMultipartFormData [NH.Part]+ deriving (P.Show)++-- ** ClientRequest Utils++_mkRequest ::+ -- | Method+ NH.Method ->+ -- | Endpoint+ [BCL.ByteString] ->+ -- | req: Request Type, res: Response Type+ ClientRequest req contentType res accept+_mkRequest m u = ClientRequest m u _mkParams []++_mkParams :: Params+_mkParams = Params [] [] ParamBodyNone++setHeader ::+ ClientRequest req contentType res accept ->+ [NH.Header] ->+ ClientRequest req contentType res accept+setHeader req header =+ req `removeHeader` P.fmap P.fst header+ & (`addHeader` header)++addHeader ::+ ClientRequest req contentType res accept ->+ [NH.Header] ->+ ClientRequest req contentType res accept+addHeader req header = L.over (rParamsL . paramsHeadersL) (header P.++) req++removeHeader :: ClientRequest req contentType res accept -> [NH.HeaderName] -> ClientRequest req contentType res accept+removeHeader req header =+ req+ & L.over+ (rParamsL . paramsHeadersL)+ (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header))+ where+ cifst = CI.mk . P.fst++_setContentTypeHeader :: forall req contentType res accept. (MimeType contentType) => ClientRequest req contentType res accept -> ClientRequest req contentType res accept+_setContentTypeHeader req =+ case mimeType (P.Proxy :: P.Proxy contentType) of+ Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)]+ Nothing -> req `removeHeader` ["content-type"]++_setAcceptHeader :: forall req contentType res accept. (MimeType accept) => ClientRequest req contentType res accept -> ClientRequest req contentType res accept+_setAcceptHeader req =+ case mimeType (P.Proxy :: P.Proxy accept) of+ Just m -> req `setHeader` [("accept", BC.pack $ P.show m)]+ Nothing -> req `removeHeader` ["accept"]++setQuery ::+ ClientRequest req contentType res accept ->+ [NH.QueryItem] ->+ ClientRequest req contentType res accept+setQuery req query =+ req+ & L.over+ (rParamsL . paramsQueryL)+ (P.filter (\q -> cifst q `P.notElem` P.fmap cifst query))+ & (`addQuery` query)+ where+ cifst = CI.mk . P.fst++addQuery ::+ ClientRequest req contentType res accept ->+ [NH.QueryItem] ->+ ClientRequest req contentType res accept+addQuery req query = req & L.over (rParamsL . paramsQueryL) (query P.++)++addForm :: ClientRequest req contentType res accept -> WH.Form -> ClientRequest req contentType res accept+addForm req newform =+ let form = case paramsBody (rParams req) of+ ParamBodyFormUrlEncoded _form -> _form+ _ -> mempty+ in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form))++_addMultiFormPart :: ClientRequest req contentType res accept -> NH.Part -> ClientRequest req contentType res accept+_addMultiFormPart req newpart =+ let parts = case paramsBody (rParams req) of+ ParamBodyMultipartFormData _parts -> _parts+ _ -> []+ in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts))++_setBodyBS :: ClientRequest req contentType res accept -> B.ByteString -> ClientRequest req contentType res accept+_setBodyBS req body =+ req & L.set (rParamsL . paramsBodyL) (ParamBodyB body)++_setBodyLBS :: ClientRequest req contentType res accept -> BL.ByteString -> ClientRequest req contentType res accept+_setBodyLBS req body =+ req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body)++_hasAuthType :: (AuthMethod authMethod) => ClientRequest req contentType res accept -> P.Proxy authMethod -> ClientRequest req contentType res accept+_hasAuthType req proxy =+ req & L.over rAuthTypesL (P.typeRep proxy :)++-- ** Params Utils++toPath ::+ (WH.ToHttpApiData a) =>+ a ->+ BCL.ByteString+toPath = BB.toLazyByteString . WH.toEncodedUrlPiece++toHeader :: (WH.ToHttpApiData a) => (NH.HeaderName, a) -> [NH.Header]+toHeader x = [fmap WH.toHeader x]++toForm :: (WH.ToHttpApiData v) => (BC.ByteString, v) -> WH.Form+toForm (k, v) = WH.toForm [(BC.unpack k, v)]++toQuery :: (WH.ToHttpApiData a) => (BC.ByteString, Maybe a) -> [NH.QueryItem]+toQuery x = [(fmap . fmap) toQueryParam x]+ where+ toQueryParam = T.encodeUtf8 . WH.toQueryParam++toJsonQuery :: (A.ToJSON a) => (BC.ByteString, Maybe a) -> [NH.QueryItem]+toJsonQuery = toQuery . (fmap . fmap) (TL.decodeUtf8 . A.encode)++toPartialEscapeQuery :: B.ByteString -> NH.Query -> NH.PartialEscapeQuery+toPartialEscapeQuery extraUnreserved query = fmap (\(k, v) -> (k, maybe [] go v)) query+ where+ go :: B.ByteString -> [NH.EscapeItem]+ go v =+ v+ & B.groupBy (\a b -> a `B.notElem` extraUnreserved && b `B.notElem` extraUnreserved)+ & fmap+ ( \xs ->+ if B.null xs+ then NH.QN xs+ else+ if B.head xs `B.elem` extraUnreserved+ then NH.QN xs -- Not Encoded+ else NH.QE xs -- Encoded+ )++-- *** OpenAPI `CollectionFormat` Utils++-- | Determines the format of the array if type array is used.+data CollectionFormat+ = -- | CSV format for multiple parameters.+ CommaSeparated+ | -- | Also called "SSV"+ SpaceSeparated+ | -- | Also called "TSV"+ TabSeparated+ | -- | `value1|value2|value2`+ PipeSeparated+ | -- | Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" ('NH.Query') or "formData" ('WH.Form')+ MultiParamArray++toHeaderColl :: (WH.ToHttpApiData a) => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header]+toHeaderColl c xs = _toColl c toHeader xs++toFormColl :: (WH.ToHttpApiData v) => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form+toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs+ where+ pack (k, v) = (CI.mk k, v)+ unpack (k, v) = (BC.unpack (CI.original k), BC.unpack v)++toQueryColl :: (WH.ToHttpApiData a) => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query+toQueryColl c xs = _toCollA c toQuery xs++toJsonQueryColl :: (A.ToJSON a) => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query+toJsonQueryColl c xs = _toCollA c toJsonQuery xs++_toColl :: (P.Traversable f) => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)]+_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs))+ where+ fencode = fmap (fmap Just) . encode . fmap P.fromJust+ {-# INLINE fencode #-}++_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)]+_toCollA c encode xs = _toCollA' c encode BC.singleton xs++_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)]+_toCollA' c encode one xs = case c of+ CommaSeparated -> go (one ',')+ SpaceSeparated -> go (one ' ')+ TabSeparated -> go (one '\t')+ PipeSeparated -> go (one '|')+ MultiParamArray -> expandList+ where+ go sep =+ [P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList]+ combine sep x y = x <> sep <> y+ expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs+ {-# INLINE go #-}+ {-# INLINE expandList #-}+ {-# INLINE combine #-}++-- * AuthMethods++-- | Provides a method to apply auth methods to requests+class+ (P.Typeable a) =>+ AuthMethod a+ where+ applyAuthMethod ::+ GenAIClientConfig ->+ a ->+ ClientRequest req contentType res accept ->+ IO (ClientRequest req contentType res accept)++-- | An existential wrapper for any AuthMethod+data AnyAuthMethod = forall a. (AuthMethod a) => AnyAuthMethod a deriving (P.Typeable)++instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req++-- | indicates exceptions related to AuthMethods+data AuthMethodException = AuthMethodException String deriving (P.Show, P.Typeable)++instance E.Exception AuthMethodException++-- | apply all matching AuthMethods in config to request+_applyAuthMethods ::+ ClientRequest req contentType res accept ->+ GenAIClientConfig ->+ IO (ClientRequest req contentType res accept)+_applyAuthMethods req config@(GenAIClientConfig {configAuthMethods = as}) =+ foldlM go req as+ where+ go r (AnyAuthMethod a) = applyAuthMethod config a r++-- * Utils++-- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)+#if MIN_VERSION_aeson(2,0,0)+_omitNulls :: [(A.Key, A.Value)] -> A.Value+#else+_omitNulls :: [(Text, A.Value)] -> A.Value+#endif+_omitNulls = A.object . P.filter notNull+ where+ notNull (_, A.Null) = False+ notNull _ = True++-- | Encodes fields using WH.toQueryParam+_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text])+_toFormItem name x = (name,) . (: []) . WH.toQueryParam <$> x++-- | Collapse (Just "") to Nothing+_emptyToNothing :: Maybe String -> Maybe String+_emptyToNothing (Just "") = Nothing+_emptyToNothing x = x+{-# INLINE _emptyToNothing #-}++-- | Collapse (Just mempty) to Nothing+_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a+_memptyToNothing (Just x) | x P.== P.mempty = Nothing+_memptyToNothing x = x+{-# INLINE _memptyToNothing #-}++-- * DateTime Formatting++newtype DateTime = DateTime {unDateTime :: TI.UTCTime}+ deriving (P.Eq, P.Data, P.Ord, P.Typeable, NF.NFData)+instance A.FromJSON DateTime where+ parseJSON = A.withText "DateTime" (_readDateTime . T.unpack)+instance A.ToJSON DateTime where+ toJSON (DateTime t) = A.toJSON (_showDateTime t)+instance WH.FromHttpApiData DateTime where+ parseUrlPiece = P.maybe (P.Left "parseUrlPiece @DateTime") P.Right . _readDateTime . T.unpack+instance WH.ToHttpApiData DateTime where+ toUrlPiece (DateTime t) = T.pack (_showDateTime t)+instance P.Show DateTime where+ show (DateTime t) = _showDateTime t+instance MimeRender MimeMultipartFormData DateTime where+ mimeRender _ = mimeRenderDefaultMultipartFormData++-- | @_parseISO8601@+_readDateTime :: (MonadFail m, Alternative m) => String -> m DateTime+_readDateTime s =+ DateTime <$> _parseISO8601 s+{-# INLINE _readDateTime #-}++-- | @TI.formatISO8601Millis@+_showDateTime :: (t ~ TI.UTCTime, TI.FormatTime t) => t -> String+_showDateTime =+ TI.formatISO8601Millis+{-# INLINE _showDateTime #-}++-- | parse an ISO8601 date-time string+_parseISO8601 :: (TI.ParseTime t, MonadFail m, Alternative m) => String -> m t+_parseISO8601 t =+ P.asum $+ P.flip (TI.parseTimeM True TI.defaultTimeLocale) t+ <$> ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"]+{-# INLINE _parseISO8601 #-}++-- * Date Formatting++newtype Date = Date {unDate :: TI.Day}+ deriving (P.Enum, P.Eq, P.Data, P.Ord, P.Ix, NF.NFData)+instance A.FromJSON Date where+ parseJSON = A.withText "Date" (_readDate . T.unpack)+instance A.ToJSON Date where+ toJSON (Date t) = A.toJSON (_showDate t)+instance WH.FromHttpApiData Date where+ parseUrlPiece = P.maybe (P.Left "parseUrlPiece @Date") P.Right . _readDate . T.unpack+instance WH.ToHttpApiData Date where+ toUrlPiece (Date t) = T.pack (_showDate t)+instance P.Show Date where+ show (Date t) = _showDate t+instance MimeRender MimeMultipartFormData Date where+ mimeRender _ = mimeRenderDefaultMultipartFormData++-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@+_readDate :: (MonadFail m) => String -> m Date+_readDate s = Date <$> TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d" s+{-# INLINE _readDate #-}++-- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@+_showDate :: (TI.FormatTime t) => t -> String+_showDate =+ TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"+{-# INLINE _showDate #-}++-- * Byte/Binary Formatting++-- | base64 encoded characters+newtype ByteArray = ByteArray {unByteArray :: BL.ByteString}+ deriving (P.Eq, P.Data, P.Ord, P.Typeable, NF.NFData)++instance A.FromJSON ByteArray where+ parseJSON = A.withText "ByteArray" _readByteArray+instance A.ToJSON ByteArray where+ toJSON = A.toJSON . _showByteArray+instance WH.FromHttpApiData ByteArray where+ parseUrlPiece = P.maybe (P.Left "parseUrlPiece @ByteArray") P.Right . _readByteArray+instance WH.ToHttpApiData ByteArray where+ toUrlPiece = _showByteArray+instance P.Show ByteArray where+ show = T.unpack . _showByteArray+instance MimeRender MimeMultipartFormData ByteArray where+ mimeRender _ = mimeRenderDefaultMultipartFormData++-- | read base64 encoded characters+_readByteArray :: (MonadFail m) => Text -> m ByteArray+_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8+{-# INLINE _readByteArray #-}++-- | show base64 encoded characters+_showByteArray :: ByteArray -> Text+_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray+{-# INLINE _showByteArray #-}++-- | any sequence of octets+newtype Binary = Binary {unBinary :: BL.ByteString}+ deriving (P.Eq, P.Data, P.Ord, P.Typeable, NF.NFData)++instance A.FromJSON Binary where+ parseJSON = A.withText "Binary" _readBinaryBase64+instance A.ToJSON Binary where+ toJSON = A.toJSON . _showBinaryBase64+instance WH.FromHttpApiData Binary where+ parseUrlPiece = P.maybe (P.Left "parseUrlPiece @Binary") P.Right . _readBinaryBase64+instance WH.ToHttpApiData Binary where+ toUrlPiece = _showBinaryBase64+instance P.Show Binary where+ show = T.unpack . _showBinaryBase64+instance MimeRender MimeMultipartFormData Binary where+ mimeRender _ = unBinary++_readBinaryBase64 :: (MonadFail m) => Text -> m Binary+_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8+{-# INLINE _readBinaryBase64 #-}++_showBinaryBase64 :: Binary -> Text+_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary+{-# INLINE _showBinaryBase64 #-}++-- * Lens Type Aliases++type Lens_' s a = Lens_ s s a a+type Lens_ s t a b = forall (f :: K.Type -> K.Type). (Functor f) => (a -> f b) -> s -> f t
+ lib/GenAI/Client/Logging.hs view
@@ -0,0 +1,33 @@+{-+ Generative Language API++ The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.++ OpenAPI Version: 3.0.3+ Generative Language API API version: v1beta+ Generated by OpenAPI Generator (https://openapi-generator.tech)+-}+{-# LANGUAGE CPP #-}++{- |+Module : GenAI.Client.Logging+Logging functions+-}++#ifdef USE_KATIP++module GenAI.Client.Logging+ ( module GenAI.Client.LoggingKatip+ ) where++import GenAI.Client.LoggingKatip++#else++module GenAI.Client.Logging+ ( module GenAI.Client.LoggingMonadLogger+ ) where++import GenAI.Client.LoggingMonadLogger++#endif
+ lib/GenAI/Client/LoggingKatip.hs view
@@ -0,0 +1,121 @@+{-+ Generative Language API++ The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.++ OpenAPI Version: 3.0.3+ Generative Language API API version: v1beta+ Generated by OpenAPI Generator (https://openapi-generator.tech)+-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE ScopedTypeVariables #-}++{- |+Module : GenAI.Client.LoggingKatip+Katip Logging functions+-}+module GenAI.Client.LoggingKatip where++import Control.Exception.Safe qualified as E+import Control.Monad.IO.Class qualified as P+import Control.Monad.Trans.Reader qualified as P+import Data.Text qualified as T+import Lens.Micro qualified as L+import System.IO qualified as IO++import Data.Text (Text)+import GHC.Exts (IsString (..))++import Katip qualified as LG++-- * Type Aliases (for compatibility)++-- | Runs a Katip logging block with the Log environment+type LogExecWithContext =+ forall m a.+ (P.MonadIO m) =>+ LogContext ->+ LogExec m a++-- | A Katip logging block+type LogExec m a = LG.KatipT m a -> m a++-- | A Katip Log environment+type LogContext = LG.LogEnv++-- | A Katip Log severity+type LogLevel = LG.Severity++-- * default logger++-- | the default log environment+initLogContext :: IO LogContext+initLogContext = LG.initLogEnv "GenAI.Client" "dev"++-- | Runs a Katip logging block with the Log environment+runDefaultLogExecWithContext :: LogExecWithContext+runDefaultLogExecWithContext = LG.runKatipT++-- * stdout logger++-- | Runs a Katip logging block with the Log environment+stdoutLoggingExec :: LogExecWithContext+stdoutLoggingExec = runDefaultLogExecWithContext++-- | A Katip Log environment which targets stdout+stdoutLoggingContext :: LogContext -> IO LogContext+stdoutLoggingContext cxt = do+ handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout (LG.permitItem LG.InfoS) LG.V2+ LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt++-- * stderr logger++-- | Runs a Katip logging block with the Log environment+stderrLoggingExec :: LogExecWithContext+stderrLoggingExec = runDefaultLogExecWithContext++-- | A Katip Log environment which targets stderr+stderrLoggingContext :: LogContext -> IO LogContext+stderrLoggingContext cxt = do+ handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr (LG.permitItem LG.InfoS) LG.V2+ LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt++-- * Null logger++-- | Disables Katip logging+runNullLogExec :: LogExecWithContext+runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le)++-- * Log Msg++-- | Log a katip message+_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m ()+_log src level msg = do+ LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg)++-- * Log Exceptions++-- | re-throws exceptions after logging them+logExceptions ::+ (LG.Katip m, E.MonadCatch m, Applicative m) =>+ Text ->+ m a ->+ m a+logExceptions src =+ E.handle+ ( \(e :: E.SomeException) -> do+ _log src LG.ErrorS ((T.pack . show) e)+ E.throw e+ )++-- * Log Level++levelInfo :: LogLevel+levelInfo = LG.InfoS++levelError :: LogLevel+levelError = LG.ErrorS++levelDebug :: LogLevel+levelDebug = LG.DebugS
+ lib/GenAI/Client/LoggingMonadLogger.hs view
@@ -0,0 +1,130 @@+{-+ Generative Language API++ The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.++ OpenAPI Version: 3.0.3+ Generative Language API API version: v1beta+ Generated by OpenAPI Generator (https://openapi-generator.tech)+-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE ScopedTypeVariables #-}++{- |+Module : GenAI.Client.LoggingMonadLogger+monad-logger Logging functions+-}+module GenAI.Client.LoggingMonadLogger where++import Control.Exception.Safe qualified as E+import Control.Monad.IO.Class qualified as P+import Data.Text qualified as T+import Data.Time qualified as TI++import Data.Text (Text)++import Control.Monad.Logger qualified as LG++-- * Type Aliases (for compatibility)++-- | Runs a monad-logger block with the filter predicate+type LogExecWithContext =+ forall m a.+ (P.MonadIO m) =>+ LogContext ->+ LogExec m a++-- | A monad-logger block+type LogExec m a = LG.LoggingT m a -> m a++-- | A monad-logger filter predicate+type LogContext = LG.LogSource -> LG.LogLevel -> Bool++-- | A monad-logger log level+type LogLevel = LG.LogLevel++-- * default logger++-- | the default log environment+initLogContext :: IO LogContext+initLogContext = pure infoLevelFilter++-- | Runs a monad-logger block with the filter predicate+runDefaultLogExecWithContext :: LogExecWithContext+runDefaultLogExecWithContext = runNullLogExec++-- * stdout logger++-- | Runs a monad-logger block targeting stdout, with the filter predicate+stdoutLoggingExec :: LogExecWithContext+stdoutLoggingExec cxt = LG.runStdoutLoggingT . LG.filterLogger cxt++-- | @pure@+stdoutLoggingContext :: LogContext -> IO LogContext+stdoutLoggingContext = pure++-- * stderr logger++-- | Runs a monad-logger block targeting stderr, with the filter predicate+stderrLoggingExec :: LogExecWithContext+stderrLoggingExec cxt = LG.runStderrLoggingT . LG.filterLogger cxt++-- | @pure@+stderrLoggingContext :: LogContext -> IO LogContext+stderrLoggingContext = pure++-- * Null logger++-- | Disables monad-logger logging+runNullLogExec :: LogExecWithContext+runNullLogExec = const (`LG.runLoggingT` nullLogger)++-- | monad-logger which does nothing+nullLogger :: LG.Loc -> LG.LogSource -> LG.LogLevel -> LG.LogStr -> IO ()+nullLogger _ _ _ _ = return ()++-- * Log Msg++-- | Log a message using the current time+_log :: (P.MonadIO m, LG.MonadLogger m) => Text -> LG.LogLevel -> Text -> m ()+_log src level msg = do+ now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime)+ LG.logOtherNS ("GenAI.Client." <> src) level ("[" <> now <> "] " <> msg)+ where+ formatTimeLog =+ T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z"++-- * Log Exceptions++-- | re-throws exceptions after logging them+logExceptions ::+ (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) =>+ Text ->+ m a ->+ m a+logExceptions src =+ E.handle+ ( \(e :: E.SomeException) -> do+ _log src LG.LevelError ((T.pack . show) e)+ E.throw e+ )++-- * Log Level++levelInfo :: LogLevel+levelInfo = LG.LevelInfo++levelError :: LogLevel+levelError = LG.LevelError++levelDebug :: LogLevel+levelDebug = LG.LevelDebug++-- * Level Filter++minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool+minLevelFilter l _ l' = l' >= l++infoLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool+infoLevelFilter = minLevelFilter LG.LevelInfo
+ lib/GenAI/Client/MimeTypes.hs view
@@ -0,0 +1,213 @@+{-+ Generative Language API++ The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.++ OpenAPI Version: 3.0.3+ Generative Language API API version: v1beta+ Generated by OpenAPI Generator (https://openapi-generator.tech)+-}+{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE ExistentialQuantification #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}++{- |+Module : GenAI.Client.MimeTypes+-}+module GenAI.Client.MimeTypes where++import Control.Arrow qualified as P (left)+import Data.Aeson qualified as A+import Data.ByteString qualified as B+import Data.ByteString.Builder qualified as BB+import Data.ByteString.Char8 qualified as BC+import Data.ByteString.Lazy qualified as BL+import Data.ByteString.Lazy.Char8 qualified as BCL+import Data.Data qualified as P (Typeable)+import Data.Proxy qualified as P (Proxy (..))+import Data.String qualified as P+import Data.Text qualified as T+import Data.Text.Encoding qualified as T+import Network.HTTP.Media qualified as ME+import Web.FormUrlEncoded qualified as WH+import Web.HttpApiData qualified as WH++import Prelude (Bool (..), Char, Double, FilePath, Float, Int, Integer, Maybe (..), String, fmap, mempty, undefined, ($), (.), (<$>), (<*>))+import Prelude qualified as P++-- * ContentType MimeType++data ContentType a = (MimeType a) => ContentType {unContentType :: a}++-- * Accept MimeType++data Accept a = (MimeType a) => Accept {unAccept :: a}++-- * Consumes Class++class (MimeType mtype) => Consumes req mtype++-- * Produces Class++class (MimeType mtype) => Produces req mtype++-- * Default Mime Types++data MimeJSON = MimeJSON deriving (P.Typeable)+data MimeXML = MimeXML deriving (P.Typeable)+data MimePlainText = MimePlainText deriving (P.Typeable)+data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable)+data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable)+data MimeOctetStream = MimeOctetStream deriving (P.Typeable)+data MimeNoContent = MimeNoContent deriving (P.Typeable)+data MimeAny = MimeAny deriving (P.Typeable)++-- | A type for responses without content-body.+data NoContent = NoContent+ deriving (P.Show, P.Eq, P.Typeable)++-- * MimeType Class++class (P.Typeable mtype) => MimeType mtype where+ {-# MINIMAL mimeType | mimeTypes #-}++ mimeTypes :: P.Proxy mtype -> [ME.MediaType]+ mimeTypes p =+ case mimeType p of+ Just x -> [x]+ Nothing -> []++ mimeType :: P.Proxy mtype -> Maybe ME.MediaType+ mimeType p =+ case mimeTypes p of+ [] -> Nothing+ (x : _) -> Just x++ mimeType' :: mtype -> Maybe ME.MediaType+ mimeType' _ = mimeType (P.Proxy :: P.Proxy mtype)+ mimeTypes' :: mtype -> [ME.MediaType]+ mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype)++-- Default MimeType Instances++-- | @application/json; charset=utf-8@+instance MimeType MimeJSON where+ mimeType _ = Just $ P.fromString "application/json"++-- | @application/xml; charset=utf-8@+instance MimeType MimeXML where+ mimeType _ = Just $ P.fromString "application/xml"++-- | @application/x-www-form-urlencoded@+instance MimeType MimeFormUrlEncoded where+ mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded"++-- | @multipart/form-data@+instance MimeType MimeMultipartFormData where+ mimeType _ = Just $ P.fromString "multipart/form-data"++-- | @text/plain; charset=utf-8@+instance MimeType MimePlainText where+ mimeType _ = Just $ P.fromString "text/plain"++-- | @application/octet-stream@+instance MimeType MimeOctetStream where+ mimeType _ = Just $ P.fromString "application/octet-stream"++-- | @"*/*"@+instance MimeType MimeAny where+ mimeType _ = Just $ P.fromString "*/*"++instance MimeType MimeNoContent where+ mimeType _ = Nothing++-- * MimeRender Class++class (MimeType mtype) => MimeRender mtype x where+ mimeRender :: P.Proxy mtype -> x -> BL.ByteString+ mimeRender' :: mtype -> x -> BL.ByteString+ mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x++mimeRenderDefaultMultipartFormData :: (WH.ToHttpApiData a) => a -> BL.ByteString+mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam++-- Default MimeRender Instances++-- | `A.encode`+instance (A.ToJSON a) => MimeRender MimeJSON a where mimeRender _ = A.encode++-- | @WH.urlEncodeAsForm@+instance (WH.ToForm a) => MimeRender MimeFormUrlEncoded a where mimeRender _ = WH.urlEncodeAsForm++-- | @P.id@+instance MimeRender MimePlainText BL.ByteString where mimeRender _ = P.id++-- | @BL.fromStrict . T.encodeUtf8@+instance MimeRender MimePlainText T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8++-- | @BCL.pack@+instance MimeRender MimePlainText String where mimeRender _ = BCL.pack++-- | @P.id@+instance MimeRender MimeOctetStream BL.ByteString where mimeRender _ = P.id++-- | @BL.fromStrict . T.encodeUtf8@+instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8++-- | @BCL.pack@+instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack++instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id++instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData+instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData+instance MimeRender MimeMultipartFormData Double where mimeRender _ = mimeRenderDefaultMultipartFormData+instance MimeRender MimeMultipartFormData Float where mimeRender _ = mimeRenderDefaultMultipartFormData+instance MimeRender MimeMultipartFormData Int where mimeRender _ = mimeRenderDefaultMultipartFormData+instance MimeRender MimeMultipartFormData Integer where mimeRender _ = mimeRenderDefaultMultipartFormData+instance MimeRender MimeMultipartFormData String where mimeRender _ = mimeRenderDefaultMultipartFormData+instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | @P.Right . P.const NoContent@+instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty++-- * MimeUnrender Class++class (MimeType mtype) => MimeUnrender mtype o where+ mimeUnrender :: P.Proxy mtype -> BL.ByteString -> P.Either String o+ mimeUnrender' :: mtype -> BL.ByteString -> P.Either String o+ mimeUnrender' _ x = mimeUnrender (P.Proxy :: P.Proxy mtype) x++-- Default MimeUnrender Instances++-- | @A.eitherDecode@+instance (A.FromJSON a) => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode++-- | @P.left T.unpack . WH.urlDecodeAsForm@+instance (WH.FromForm a) => MimeUnrender MimeFormUrlEncoded a where mimeUnrender _ = P.left T.unpack . WH.urlDecodeAsForm++-- | @P.Right . P.id@+instance MimeUnrender MimePlainText BL.ByteString where mimeUnrender _ = P.Right . P.id++-- | @P.left P.show . TL.decodeUtf8'@+instance MimeUnrender MimePlainText T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict++-- | @P.Right . BCL.unpack@+instance MimeUnrender MimePlainText String where mimeUnrender _ = P.Right . BCL.unpack++-- | @P.Right . P.id@+instance MimeUnrender MimeOctetStream BL.ByteString where mimeUnrender _ = P.Right . P.id++-- | @P.left P.show . T.decodeUtf8' . BL.toStrict@+instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict++-- | @P.Right . BCL.unpack@+instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BCL.unpack++-- | @P.Right . P.const NoContent@+instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent
+ lib/GenAI/Client/Model.hs view
@@ -0,0 +1,7723 @@+{-+ Generative Language API++ The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.++ OpenAPI Version: 3.0.3+ Generative Language API API version: v1beta+ Generated by OpenAPI Generator (https://openapi-generator.tech)+-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveFoldable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DeriveTraversable #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TupleSections #-}+{-# LANGUAGE TypeFamilies #-}+{-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}++{- |+Module : GenAI.Client.Model+-}+module GenAI.Client.Model where++import GenAI.Client.Core+import GenAI.Client.MimeTypes++import Data.Aeson ((.:), (.:!), (.:?), (.=))++import Control.Arrow qualified as P (left)+import Data.Aeson qualified as A+import Data.ByteString qualified as B+import Data.ByteString.Base64 qualified as B64+import Data.ByteString.Char8 qualified as BC+import Data.ByteString.Lazy qualified as BL+import Data.Data qualified as P (TypeRep, Typeable, typeOf, typeRep)+import Data.Foldable qualified as P+import Data.HashMap.Lazy qualified as HM+import Data.Map qualified as Map+import Data.Maybe qualified as P+import Data.Set qualified as Set+import Data.Text qualified as T+import Data.Text.Encoding qualified as T+import Data.Time qualified as TI+import Lens.Micro qualified as L+import Web.FormUrlEncoded qualified as WH+import Web.HttpApiData qualified as WH++import Control.Applicative (Alternative, (<|>))+import Data.Function ((&))+import Data.Monoid ((<>))+import Data.Text (Text)+import Prelude (Applicative, Bool (..), Char, Double, FilePath, Float, Functor, Int, Integer, Maybe (..), Monad, String, fmap, maybe, mempty, pure, undefined, ($), (.), (/=), (<$>), (<*>), (=<<), (>>=))++import Prelude qualified as P++-- * Parameter newtypes++-- ** Alt+newtype Alt = Alt {unAlt :: E'Alt} deriving (P.Eq, P.Show)++-- ** Callback+newtype Callback = Callback {unCallback :: Text} deriving (P.Eq, P.Show)++-- ** Chunk2+newtype Chunk2 = Chunk2 {unChunk2 :: Text} deriving (P.Eq, P.Show)++-- ** Corpus2+newtype Corpus2 = Corpus2 {unCorpus2 :: Text} deriving (P.Eq, P.Show)++-- ** Document2+newtype Document2 = Document2 {unDocument2 :: Text} deriving (P.Eq, P.Show)++-- ** DynamicId+newtype DynamicId = DynamicId {unDynamicId :: Text} deriving (P.Eq, P.Show)++-- ** File2+newtype File2 = File2 {unFile2 :: Text} deriving (P.Eq, P.Show)++-- ** Filter+newtype Filter = Filter {unFilter :: Text} deriving (P.Eq, P.Show)++-- ** Force+newtype Force = Force {unForce :: Bool} deriving (P.Eq, P.Show)++-- ** GenerateContentBatch+newtype GenerateContentBatch = GenerateContentBatch {unGenerateContentBatch :: Text} deriving (P.Eq, P.Show)++-- ** GeneratedFile2+newtype GeneratedFile2 = GeneratedFile2 {unGeneratedFile2 :: Text} deriving (P.Eq, P.Show)++-- ** Id+newtype Id = Id {unId :: Text} deriving (P.Eq, P.Show)++-- ** Model2+newtype Model2 = Model2 {unModel2 :: Text} deriving (P.Eq, P.Show)++-- ** Operation2+newtype Operation2 = Operation2 {unOperation2 :: Text} deriving (P.Eq, P.Show)++-- ** PageSize+newtype PageSize = PageSize {unPageSize :: Int} deriving (P.Eq, P.Show)++-- ** PageToken+newtype PageToken = PageToken {unPageToken :: Text} deriving (P.Eq, P.Show)++-- ** Permission2+newtype Permission2 = Permission2 {unPermission2 :: Text} deriving (P.Eq, P.Show)++-- ** PrettyPrint+newtype PrettyPrint = PrettyPrint {unPrettyPrint :: Bool} deriving (P.Eq, P.Show)++-- ** TunedModel2+newtype TunedModel2 = TunedModel2 {unTunedModel2 :: Text} deriving (P.Eq, P.Show)++-- ** TunedModelId+newtype TunedModelId = TunedModelId {unTunedModelId :: Text} deriving (P.Eq, P.Show)++-- ** UpdateMask+newtype UpdateMask = UpdateMask {unUpdateMask :: Text} deriving (P.Eq, P.Show)++-- ** Xgafv+newtype Xgafv = Xgafv {unXgafv :: E'Xgafv} deriving (P.Eq, P.Show)++-- * Models++-- ** AttributionSourceId++{- | AttributionSourceId+Identifier for the source contributing to this attribution.+-}+data AttributionSourceId = AttributionSourceId+ { attributionSourceIdGroundingPassage :: !(Maybe GroundingPassageId)+ -- ^ "groundingPassage" - Identifier for an inline passage.+ , attributionSourceIdSemanticRetrieverChunk :: !(Maybe SemanticRetrieverChunk)+ -- ^ "semanticRetrieverChunk" - Identifier for a `Chunk` fetched via Semantic Retriever.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON AttributionSourceId+instance A.FromJSON AttributionSourceId where+ parseJSON = A.withObject "AttributionSourceId" $ \o ->+ AttributionSourceId+ <$> (o .:? "groundingPassage")+ <*> (o .:? "semanticRetrieverChunk")++-- | ToJSON AttributionSourceId+instance A.ToJSON AttributionSourceId where+ toJSON AttributionSourceId {..} =+ _omitNulls+ [ "groundingPassage" .= attributionSourceIdGroundingPassage+ , "semanticRetrieverChunk" .= attributionSourceIdSemanticRetrieverChunk+ ]++-- | Construct a value of type 'AttributionSourceId' (by applying it's required fields, if any)+mkAttributionSourceId ::+ AttributionSourceId+mkAttributionSourceId =+ AttributionSourceId+ { attributionSourceIdGroundingPassage = Nothing+ , attributionSourceIdSemanticRetrieverChunk = Nothing+ }++-- ** BaseOperation++{- | BaseOperation+This resource represents a long-running operation that is the result of a network API call.+-}+data BaseOperation = BaseOperation+ { baseOperationDone :: !(Maybe Bool)+ -- ^ "done" - If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.+ , baseOperationName :: !(Maybe Text)+ -- ^ "name" - The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.+ , baseOperationError :: !(Maybe Status)+ -- ^ "error" - The error result of the operation in case of failure or cancellation.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON BaseOperation+instance A.FromJSON BaseOperation where+ parseJSON = A.withObject "BaseOperation" $ \o ->+ BaseOperation+ <$> (o .:? "done")+ <*> (o .:? "name")+ <*> (o .:? "error")++-- | ToJSON BaseOperation+instance A.ToJSON BaseOperation where+ toJSON BaseOperation {..} =+ _omitNulls+ [ "done" .= baseOperationDone+ , "name" .= baseOperationName+ , "error" .= baseOperationError+ ]++-- | Construct a value of type 'BaseOperation' (by applying it's required fields, if any)+mkBaseOperation ::+ BaseOperation+mkBaseOperation =+ BaseOperation+ { baseOperationDone = Nothing+ , baseOperationName = Nothing+ , baseOperationError = Nothing+ }++-- ** BatchCreateChunksRequest++{- | BatchCreateChunksRequest+Request to batch create `Chunk`s.+-}+data BatchCreateChunksRequest = BatchCreateChunksRequest+ { batchCreateChunksRequestRequests :: !([CreateChunkRequest])+ -- ^ /Required/ "requests" - Required. The request messages specifying the `Chunk`s to create. A maximum of 100 `Chunk`s can be created in a batch.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON BatchCreateChunksRequest+instance A.FromJSON BatchCreateChunksRequest where+ parseJSON = A.withObject "BatchCreateChunksRequest" $ \o ->+ BatchCreateChunksRequest+ <$> (o .: "requests")++-- | ToJSON BatchCreateChunksRequest+instance A.ToJSON BatchCreateChunksRequest where+ toJSON BatchCreateChunksRequest {..} =+ _omitNulls+ [ "requests" .= batchCreateChunksRequestRequests+ ]++-- | Construct a value of type 'BatchCreateChunksRequest' (by applying it's required fields, if any)+mkBatchCreateChunksRequest ::+ -- | 'batchCreateChunksRequestRequests': Required. The request messages specifying the `Chunk`s to create. A maximum of 100 `Chunk`s can be created in a batch.+ [CreateChunkRequest] ->+ BatchCreateChunksRequest+mkBatchCreateChunksRequest batchCreateChunksRequestRequests =+ BatchCreateChunksRequest+ { batchCreateChunksRequestRequests+ }++-- ** BatchCreateChunksResponse++{- | BatchCreateChunksResponse+Response from `BatchCreateChunks` containing a list of created `Chunk`s.+-}+data BatchCreateChunksResponse = BatchCreateChunksResponse+ { batchCreateChunksResponseChunks :: !(Maybe [Chunk])+ -- ^ "chunks" - `Chunk`s created.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON BatchCreateChunksResponse+instance A.FromJSON BatchCreateChunksResponse where+ parseJSON = A.withObject "BatchCreateChunksResponse" $ \o ->+ BatchCreateChunksResponse+ <$> (o .:? "chunks")++-- | ToJSON BatchCreateChunksResponse+instance A.ToJSON BatchCreateChunksResponse where+ toJSON BatchCreateChunksResponse {..} =+ _omitNulls+ [ "chunks" .= batchCreateChunksResponseChunks+ ]++-- | Construct a value of type 'BatchCreateChunksResponse' (by applying it's required fields, if any)+mkBatchCreateChunksResponse ::+ BatchCreateChunksResponse+mkBatchCreateChunksResponse =+ BatchCreateChunksResponse+ { batchCreateChunksResponseChunks = Nothing+ }++-- ** BatchDeleteChunksRequest++{- | BatchDeleteChunksRequest+Request to batch delete `Chunk`s.+-}+data BatchDeleteChunksRequest = BatchDeleteChunksRequest+ { batchDeleteChunksRequestRequests :: !([DeleteChunkRequest])+ -- ^ /Required/ "requests" - Required. The request messages specifying the `Chunk`s to delete.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON BatchDeleteChunksRequest+instance A.FromJSON BatchDeleteChunksRequest where+ parseJSON = A.withObject "BatchDeleteChunksRequest" $ \o ->+ BatchDeleteChunksRequest+ <$> (o .: "requests")++-- | ToJSON BatchDeleteChunksRequest+instance A.ToJSON BatchDeleteChunksRequest where+ toJSON BatchDeleteChunksRequest {..} =+ _omitNulls+ [ "requests" .= batchDeleteChunksRequestRequests+ ]++-- | Construct a value of type 'BatchDeleteChunksRequest' (by applying it's required fields, if any)+mkBatchDeleteChunksRequest ::+ -- | 'batchDeleteChunksRequestRequests': Required. The request messages specifying the `Chunk`s to delete.+ [DeleteChunkRequest] ->+ BatchDeleteChunksRequest+mkBatchDeleteChunksRequest batchDeleteChunksRequestRequests =+ BatchDeleteChunksRequest+ { batchDeleteChunksRequestRequests+ }++-- ** BatchEmbedContentsRequest++{- | BatchEmbedContentsRequest+Batch request to get embeddings from the model for a list of prompts.+-}+data BatchEmbedContentsRequest = BatchEmbedContentsRequest+ { batchEmbedContentsRequestRequests :: !([EmbedContentRequest])+ -- ^ /Required/ "requests" - Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON BatchEmbedContentsRequest+instance A.FromJSON BatchEmbedContentsRequest where+ parseJSON = A.withObject "BatchEmbedContentsRequest" $ \o ->+ BatchEmbedContentsRequest+ <$> (o .: "requests")++-- | ToJSON BatchEmbedContentsRequest+instance A.ToJSON BatchEmbedContentsRequest where+ toJSON BatchEmbedContentsRequest {..} =+ _omitNulls+ [ "requests" .= batchEmbedContentsRequestRequests+ ]++-- | Construct a value of type 'BatchEmbedContentsRequest' (by applying it's required fields, if any)+mkBatchEmbedContentsRequest ::+ -- | 'batchEmbedContentsRequestRequests': Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`.+ [EmbedContentRequest] ->+ BatchEmbedContentsRequest+mkBatchEmbedContentsRequest batchEmbedContentsRequestRequests =+ BatchEmbedContentsRequest+ { batchEmbedContentsRequestRequests+ }++-- ** BatchEmbedContentsResponse++{- | BatchEmbedContentsResponse+The response to a `BatchEmbedContentsRequest`.+-}+data BatchEmbedContentsResponse = BatchEmbedContentsResponse+ { batchEmbedContentsResponseEmbeddings :: !(Maybe [ContentEmbedding])+ -- ^ /ReadOnly/ "embeddings" - Output only. The embeddings for each request, in the same order as provided in the batch request.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON BatchEmbedContentsResponse+instance A.FromJSON BatchEmbedContentsResponse where+ parseJSON = A.withObject "BatchEmbedContentsResponse" $ \o ->+ BatchEmbedContentsResponse+ <$> (o .:? "embeddings")++-- | ToJSON BatchEmbedContentsResponse+instance A.ToJSON BatchEmbedContentsResponse where+ toJSON BatchEmbedContentsResponse {..} =+ _omitNulls+ [ "embeddings" .= batchEmbedContentsResponseEmbeddings+ ]++-- | Construct a value of type 'BatchEmbedContentsResponse' (by applying it's required fields, if any)+mkBatchEmbedContentsResponse ::+ BatchEmbedContentsResponse+mkBatchEmbedContentsResponse =+ BatchEmbedContentsResponse+ { batchEmbedContentsResponseEmbeddings = Nothing+ }++-- ** BatchEmbedTextRequest++{- | BatchEmbedTextRequest+Batch request to get a text embedding from the model.+-}+data BatchEmbedTextRequest = BatchEmbedTextRequest+ { batchEmbedTextRequestRequests :: !(Maybe [EmbedTextRequest])+ -- ^ "requests" - Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set.+ , batchEmbedTextRequestTexts :: !(Maybe [Text])+ -- ^ "texts" - Optional. The free-form input texts that the model will turn into an embedding. The current limit is 100 texts, over which an error will be thrown.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON BatchEmbedTextRequest+instance A.FromJSON BatchEmbedTextRequest where+ parseJSON = A.withObject "BatchEmbedTextRequest" $ \o ->+ BatchEmbedTextRequest+ <$> (o .:? "requests")+ <*> (o .:? "texts")++-- | ToJSON BatchEmbedTextRequest+instance A.ToJSON BatchEmbedTextRequest where+ toJSON BatchEmbedTextRequest {..} =+ _omitNulls+ [ "requests" .= batchEmbedTextRequestRequests+ , "texts" .= batchEmbedTextRequestTexts+ ]++-- | Construct a value of type 'BatchEmbedTextRequest' (by applying it's required fields, if any)+mkBatchEmbedTextRequest ::+ BatchEmbedTextRequest+mkBatchEmbedTextRequest =+ BatchEmbedTextRequest+ { batchEmbedTextRequestRequests = Nothing+ , batchEmbedTextRequestTexts = Nothing+ }++-- ** BatchEmbedTextResponse++{- | BatchEmbedTextResponse+The response to a EmbedTextRequest.+-}+data BatchEmbedTextResponse = BatchEmbedTextResponse+ { batchEmbedTextResponseEmbeddings :: !(Maybe [Embedding])+ -- ^ /ReadOnly/ "embeddings" - Output only. The embeddings generated from the input text.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON BatchEmbedTextResponse+instance A.FromJSON BatchEmbedTextResponse where+ parseJSON = A.withObject "BatchEmbedTextResponse" $ \o ->+ BatchEmbedTextResponse+ <$> (o .:? "embeddings")++-- | ToJSON BatchEmbedTextResponse+instance A.ToJSON BatchEmbedTextResponse where+ toJSON BatchEmbedTextResponse {..} =+ _omitNulls+ [ "embeddings" .= batchEmbedTextResponseEmbeddings+ ]++-- | Construct a value of type 'BatchEmbedTextResponse' (by applying it's required fields, if any)+mkBatchEmbedTextResponse ::+ BatchEmbedTextResponse+mkBatchEmbedTextResponse =+ BatchEmbedTextResponse+ { batchEmbedTextResponseEmbeddings = Nothing+ }++-- ** BatchUpdateChunksRequest++{- | BatchUpdateChunksRequest+Request to batch update `Chunk`s.+-}+data BatchUpdateChunksRequest = BatchUpdateChunksRequest+ { batchUpdateChunksRequestRequests :: !([UpdateChunkRequest])+ -- ^ /Required/ "requests" - Required. The request messages specifying the `Chunk`s to update. A maximum of 100 `Chunk`s can be updated in a batch.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON BatchUpdateChunksRequest+instance A.FromJSON BatchUpdateChunksRequest where+ parseJSON = A.withObject "BatchUpdateChunksRequest" $ \o ->+ BatchUpdateChunksRequest+ <$> (o .: "requests")++-- | ToJSON BatchUpdateChunksRequest+instance A.ToJSON BatchUpdateChunksRequest where+ toJSON BatchUpdateChunksRequest {..} =+ _omitNulls+ [ "requests" .= batchUpdateChunksRequestRequests+ ]++-- | Construct a value of type 'BatchUpdateChunksRequest' (by applying it's required fields, if any)+mkBatchUpdateChunksRequest ::+ -- | 'batchUpdateChunksRequestRequests': Required. The request messages specifying the `Chunk`s to update. A maximum of 100 `Chunk`s can be updated in a batch.+ [UpdateChunkRequest] ->+ BatchUpdateChunksRequest+mkBatchUpdateChunksRequest batchUpdateChunksRequestRequests =+ BatchUpdateChunksRequest+ { batchUpdateChunksRequestRequests+ }++-- ** BatchUpdateChunksResponse++{- | BatchUpdateChunksResponse+Response from `BatchUpdateChunks` containing a list of updated `Chunk`s.+-}+data BatchUpdateChunksResponse = BatchUpdateChunksResponse+ { batchUpdateChunksResponseChunks :: !(Maybe [Chunk])+ -- ^ "chunks" - `Chunk`s updated.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON BatchUpdateChunksResponse+instance A.FromJSON BatchUpdateChunksResponse where+ parseJSON = A.withObject "BatchUpdateChunksResponse" $ \o ->+ BatchUpdateChunksResponse+ <$> (o .:? "chunks")++-- | ToJSON BatchUpdateChunksResponse+instance A.ToJSON BatchUpdateChunksResponse where+ toJSON BatchUpdateChunksResponse {..} =+ _omitNulls+ [ "chunks" .= batchUpdateChunksResponseChunks+ ]++-- | Construct a value of type 'BatchUpdateChunksResponse' (by applying it's required fields, if any)+mkBatchUpdateChunksResponse ::+ BatchUpdateChunksResponse+mkBatchUpdateChunksResponse =+ BatchUpdateChunksResponse+ { batchUpdateChunksResponseChunks = Nothing+ }++-- ** Blob++{- | Blob+Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.+-}+data Blob = Blob+ { blobData :: !(Maybe ByteArray)+ -- ^ "data" - Raw bytes for media formats.+ , blobMimeType :: !(Maybe Text)+ -- ^ "mimeType" - The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Blob+instance A.FromJSON Blob where+ parseJSON = A.withObject "Blob" $ \o ->+ Blob+ <$> (o .:? "data")+ <*> (o .:? "mimeType")++-- | ToJSON Blob+instance A.ToJSON Blob where+ toJSON Blob {..} =+ _omitNulls+ [ "data" .= blobData+ , "mimeType" .= blobMimeType+ ]++-- | Construct a value of type 'Blob' (by applying it's required fields, if any)+mkBlob ::+ Blob+mkBlob =+ Blob+ { blobData = Nothing+ , blobMimeType = Nothing+ }++-- ** CachedContent++{- | CachedContent+Content that has been preprocessed and can be used in subsequent request to GenerativeService. Cached content can be only used with model it was created for.+-}+data CachedContent = CachedContent+ { cachedContentTools :: !(Maybe [Tool])+ -- ^ "tools" - Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response+ , cachedContentDisplayName :: !(Maybe Text)+ -- ^ "displayName" - Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.+ , cachedContentModel :: !(Text)+ -- ^ /Required/ "model" - Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`+ , cachedContentExpireTime :: !(Maybe DateTime)+ -- ^ "expireTime" - Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.+ , cachedContentUsageMetadata :: !(Maybe CachedContentUsageMetadata)+ -- ^ /ReadOnly/ "usageMetadata" - Output only. Metadata on the usage of the cached content.+ , cachedContentName :: !(Maybe Text)+ -- ^ /ReadOnly/ "name" - Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`+ , cachedContentContents :: !(Maybe [Content])+ -- ^ "contents" - Optional. Input only. Immutable. The content to cache.+ , cachedContentSystemInstruction :: !(Maybe Content)+ -- ^ "systemInstruction" - Optional. Input only. Immutable. Developer set system instruction. Currently text only.+ , cachedContentToolConfig :: !(Maybe ToolConfig)+ -- ^ "toolConfig" - Optional. Input only. Immutable. Tool config. This config is shared for all tools.+ , cachedContentCreateTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "createTime" - Output only. Creation time of the cache entry.+ , cachedContentTtl :: !(Maybe Text)+ -- ^ "ttl" - Input only. New TTL for this resource, input only.+ , cachedContentUpdateTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "updateTime" - Output only. When the cache entry was last updated in UTC time.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CachedContent+instance A.FromJSON CachedContent where+ parseJSON = A.withObject "CachedContent" $ \o ->+ CachedContent+ <$> (o .:? "tools")+ <*> (o .:? "displayName")+ <*> (o .: "model")+ <*> (o .:? "expireTime")+ <*> (o .:? "usageMetadata")+ <*> (o .:? "name")+ <*> (o .:? "contents")+ <*> (o .:? "systemInstruction")+ <*> (o .:? "toolConfig")+ <*> (o .:? "createTime")+ <*> (o .:? "ttl")+ <*> (o .:? "updateTime")++-- | ToJSON CachedContent+instance A.ToJSON CachedContent where+ toJSON CachedContent {..} =+ _omitNulls+ [ "tools" .= cachedContentTools+ , "displayName" .= cachedContentDisplayName+ , "model" .= cachedContentModel+ , "expireTime" .= cachedContentExpireTime+ , "usageMetadata" .= cachedContentUsageMetadata+ , "name" .= cachedContentName+ , "contents" .= cachedContentContents+ , "systemInstruction" .= cachedContentSystemInstruction+ , "toolConfig" .= cachedContentToolConfig+ , "createTime" .= cachedContentCreateTime+ , "ttl" .= cachedContentTtl+ , "updateTime" .= cachedContentUpdateTime+ ]++-- | Construct a value of type 'CachedContent' (by applying it's required fields, if any)+mkCachedContent ::+ -- | 'cachedContentModel': Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`+ Text ->+ CachedContent+mkCachedContent cachedContentModel =+ CachedContent+ { cachedContentTools = Nothing+ , cachedContentDisplayName = Nothing+ , cachedContentModel+ , cachedContentExpireTime = Nothing+ , cachedContentUsageMetadata = Nothing+ , cachedContentName = Nothing+ , cachedContentContents = Nothing+ , cachedContentSystemInstruction = Nothing+ , cachedContentToolConfig = Nothing+ , cachedContentCreateTime = Nothing+ , cachedContentTtl = Nothing+ , cachedContentUpdateTime = Nothing+ }++-- ** CachedContentUsageMetadata++{- | CachedContentUsageMetadata+Metadata on the usage of the cached content.+-}+data CachedContentUsageMetadata = CachedContentUsageMetadata+ { cachedContentUsageMetadataTotalTokenCount :: !(Maybe Int)+ -- ^ "totalTokenCount" - Total number of tokens that the cached content consumes.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CachedContentUsageMetadata+instance A.FromJSON CachedContentUsageMetadata where+ parseJSON = A.withObject "CachedContentUsageMetadata" $ \o ->+ CachedContentUsageMetadata+ <$> (o .:? "totalTokenCount")++-- | ToJSON CachedContentUsageMetadata+instance A.ToJSON CachedContentUsageMetadata where+ toJSON CachedContentUsageMetadata {..} =+ _omitNulls+ [ "totalTokenCount" .= cachedContentUsageMetadataTotalTokenCount+ ]++-- | Construct a value of type 'CachedContentUsageMetadata' (by applying it's required fields, if any)+mkCachedContentUsageMetadata ::+ CachedContentUsageMetadata+mkCachedContentUsageMetadata =+ CachedContentUsageMetadata+ { cachedContentUsageMetadataTotalTokenCount = Nothing+ }++-- ** Candidate++{- | Candidate+A response candidate generated from the model.+-}+data Candidate = Candidate+ { candidateCitationMetadata :: !(Maybe CitationMetadata)+ -- ^ /ReadOnly/ "citationMetadata" - Output only. Citation information for model-generated candidate. This field may be populated with recitation information for any text included in the `content`. These are passages that are \"recited\" from copyrighted material in the foundational LLM's training data.+ , candidateGroundingMetadata :: !(Maybe GroundingMetadata)+ -- ^ /ReadOnly/ "groundingMetadata" - Output only. Grounding metadata for the candidate. This field is populated for `GenerateContent` calls.+ , candidateUrlContextMetadata :: !(Maybe UrlContextMetadata)+ -- ^ /ReadOnly/ "urlContextMetadata" - Output only. Metadata related to url context retrieval tool.+ , candidateGroundingAttributions :: !(Maybe [GroundingAttribution])+ -- ^ /ReadOnly/ "groundingAttributions" - Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.+ , candidateLogprobsResult :: !(Maybe LogprobsResult)+ -- ^ /ReadOnly/ "logprobsResult" - Output only. Log-likelihood scores for the response tokens and top tokens+ , candidateContent :: !(Maybe Content)+ -- ^ /ReadOnly/ "content" - Output only. Generated content returned from the model.+ , candidateAvgLogprobs :: !(Maybe Double)+ -- ^ /ReadOnly/ "avgLogprobs" - Output only. Average log probability score of the candidate.+ , candidateIndex :: !(Maybe Int)+ -- ^ /ReadOnly/ "index" - Output only. Index of the candidate in the list of response candidates.+ , candidateFinishReason :: !(Maybe E'FinishReason)+ -- ^ /ReadOnly/ "finishReason" - Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.+ , candidateSafetyRatings :: !(Maybe [SafetyRating])+ -- ^ "safetyRatings" - List of ratings for the safety of a response candidate. There is at most one rating per category.+ , candidateTokenCount :: !(Maybe Int)+ -- ^ /ReadOnly/ "tokenCount" - Output only. Token count for this candidate.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Candidate+instance A.FromJSON Candidate where+ parseJSON = A.withObject "Candidate" $ \o ->+ Candidate+ <$> (o .:? "citationMetadata")+ <*> (o .:? "groundingMetadata")+ <*> (o .:? "urlContextMetadata")+ <*> (o .:? "groundingAttributions")+ <*> (o .:? "logprobsResult")+ <*> (o .:? "content")+ <*> (o .:? "avgLogprobs")+ <*> (o .:? "index")+ <*> (o .:? "finishReason")+ <*> (o .:? "safetyRatings")+ <*> (o .:? "tokenCount")++-- | ToJSON Candidate+instance A.ToJSON Candidate where+ toJSON Candidate {..} =+ _omitNulls+ [ "citationMetadata" .= candidateCitationMetadata+ , "groundingMetadata" .= candidateGroundingMetadata+ , "urlContextMetadata" .= candidateUrlContextMetadata+ , "groundingAttributions" .= candidateGroundingAttributions+ , "logprobsResult" .= candidateLogprobsResult+ , "content" .= candidateContent+ , "avgLogprobs" .= candidateAvgLogprobs+ , "index" .= candidateIndex+ , "finishReason" .= candidateFinishReason+ , "safetyRatings" .= candidateSafetyRatings+ , "tokenCount" .= candidateTokenCount+ ]++-- | Construct a value of type 'Candidate' (by applying it's required fields, if any)+mkCandidate ::+ Candidate+mkCandidate =+ Candidate+ { candidateCitationMetadata = Nothing+ , candidateGroundingMetadata = Nothing+ , candidateUrlContextMetadata = Nothing+ , candidateGroundingAttributions = Nothing+ , candidateLogprobsResult = Nothing+ , candidateContent = Nothing+ , candidateAvgLogprobs = Nothing+ , candidateIndex = Nothing+ , candidateFinishReason = Nothing+ , candidateSafetyRatings = Nothing+ , candidateTokenCount = Nothing+ }++-- ** Chunk++{- | Chunk+A `Chunk` is a subpart of a `Document` that is treated as an independent unit for the purposes of vector representation and storage. A `Corpus` can have a maximum of 1 million `Chunk`s.+-}+data Chunk = Chunk+ { chunkCreateTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "createTime" - Output only. The Timestamp of when the `Chunk` was created.+ , chunkCustomMetadata :: !(Maybe [CustomMetadata])+ -- ^ "customMetadata" - Optional. User provided custom metadata stored as key-value pairs. The maximum number of `CustomMetadata` per chunk is 20.+ , chunkData :: !(ChunkData)+ -- ^ /Required/ "data" - Required. The content for the `Chunk`, such as the text string. The maximum number of tokens per chunk is 2043.+ , chunkUpdateTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "updateTime" - Output only. The Timestamp of when the `Chunk` was last updated.+ , chunkState :: !(Maybe E'State4)+ -- ^ /ReadOnly/ "state" - Output only. Current state of the `Chunk`.+ , chunkName :: !(Maybe Text)+ -- ^ "name" - Immutable. Identifier. The `Chunk` resource name. The ID (name excluding the \"corpora/*/documents/*/chunks/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a random 12-character unique ID will be generated. Example: `corpora/{corpus_id}/documents/{document_id}/chunks/123a456b789c`+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Chunk+instance A.FromJSON Chunk where+ parseJSON = A.withObject "Chunk" $ \o ->+ Chunk+ <$> (o .:? "createTime")+ <*> (o .:? "customMetadata")+ <*> (o .: "data")+ <*> (o .:? "updateTime")+ <*> (o .:? "state")+ <*> (o .:? "name")++-- | ToJSON Chunk+instance A.ToJSON Chunk where+ toJSON Chunk {..} =+ _omitNulls+ [ "createTime" .= chunkCreateTime+ , "customMetadata" .= chunkCustomMetadata+ , "data" .= chunkData+ , "updateTime" .= chunkUpdateTime+ , "state" .= chunkState+ , "name" .= chunkName+ ]++-- | Construct a value of type 'Chunk' (by applying it's required fields, if any)+mkChunk ::+ -- | 'chunkData': Required. The content for the `Chunk`, such as the text string. The maximum number of tokens per chunk is 2043.+ ChunkData ->+ Chunk+mkChunk chunkData =+ Chunk+ { chunkCreateTime = Nothing+ , chunkCustomMetadata = Nothing+ , chunkData+ , chunkUpdateTime = Nothing+ , chunkState = Nothing+ , chunkName = Nothing+ }++-- ** ChunkData++{- | ChunkData+Extracted data that represents the `Chunk` content.+-}+data ChunkData = ChunkData+ { chunkDataStringValue :: !(Maybe Text)+ -- ^ "stringValue" - The `Chunk` content as a string. The maximum number of tokens per chunk is 2043.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ChunkData+instance A.FromJSON ChunkData where+ parseJSON = A.withObject "ChunkData" $ \o ->+ ChunkData+ <$> (o .:? "stringValue")++-- | ToJSON ChunkData+instance A.ToJSON ChunkData where+ toJSON ChunkData {..} =+ _omitNulls+ [ "stringValue" .= chunkDataStringValue+ ]++-- | Construct a value of type 'ChunkData' (by applying it's required fields, if any)+mkChunkData ::+ ChunkData+mkChunkData =+ ChunkData+ { chunkDataStringValue = Nothing+ }++-- ** CitationMetadata++{- | CitationMetadata+A collection of source attributions for a piece of content.+-}+data CitationMetadata = CitationMetadata+ { citationMetadataCitationSources :: !(Maybe [CitationSource])+ -- ^ "citationSources" - Citations to sources for a specific response.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CitationMetadata+instance A.FromJSON CitationMetadata where+ parseJSON = A.withObject "CitationMetadata" $ \o ->+ CitationMetadata+ <$> (o .:? "citationSources")++-- | ToJSON CitationMetadata+instance A.ToJSON CitationMetadata where+ toJSON CitationMetadata {..} =+ _omitNulls+ [ "citationSources" .= citationMetadataCitationSources+ ]++-- | Construct a value of type 'CitationMetadata' (by applying it's required fields, if any)+mkCitationMetadata ::+ CitationMetadata+mkCitationMetadata =+ CitationMetadata+ { citationMetadataCitationSources = Nothing+ }++-- ** CitationSource++{- | CitationSource+A citation to a source for a portion of a specific response.+-}+data CitationSource = CitationSource+ { citationSourceStartIndex :: !(Maybe Int)+ -- ^ "startIndex" - Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.+ , citationSourceUri :: !(Maybe Text)+ -- ^ "uri" - Optional. URI that is attributed as a source for a portion of the text.+ , citationSourceEndIndex :: !(Maybe Int)+ -- ^ "endIndex" - Optional. End of the attributed segment, exclusive.+ , citationSourceLicense :: !(Maybe Text)+ -- ^ "license" - Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CitationSource+instance A.FromJSON CitationSource where+ parseJSON = A.withObject "CitationSource" $ \o ->+ CitationSource+ <$> (o .:? "startIndex")+ <*> (o .:? "uri")+ <*> (o .:? "endIndex")+ <*> (o .:? "license")++-- | ToJSON CitationSource+instance A.ToJSON CitationSource where+ toJSON CitationSource {..} =+ _omitNulls+ [ "startIndex" .= citationSourceStartIndex+ , "uri" .= citationSourceUri+ , "endIndex" .= citationSourceEndIndex+ , "license" .= citationSourceLicense+ ]++-- | Construct a value of type 'CitationSource' (by applying it's required fields, if any)+mkCitationSource ::+ CitationSource+mkCitationSource =+ CitationSource+ { citationSourceStartIndex = Nothing+ , citationSourceUri = Nothing+ , citationSourceEndIndex = Nothing+ , citationSourceLicense = Nothing+ }++-- ** CodeExecutionResult++{- | CodeExecutionResult+Result of executing the `ExecutableCode`. Only generated when using the `CodeExecution`, and always follows a `part` containing the `ExecutableCode`.+-}+data CodeExecutionResult = CodeExecutionResult+ { codeExecutionResultOutcome :: !(E'Outcome)+ -- ^ /Required/ "outcome" - Required. Outcome of the code execution.+ , codeExecutionResultOutput :: !(Maybe Text)+ -- ^ "output" - Optional. Contains stdout when code execution is successful, stderr or other description otherwise.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CodeExecutionResult+instance A.FromJSON CodeExecutionResult where+ parseJSON = A.withObject "CodeExecutionResult" $ \o ->+ CodeExecutionResult+ <$> (o .: "outcome")+ <*> (o .:? "output")++-- | ToJSON CodeExecutionResult+instance A.ToJSON CodeExecutionResult where+ toJSON CodeExecutionResult {..} =+ _omitNulls+ [ "outcome" .= codeExecutionResultOutcome+ , "output" .= codeExecutionResultOutput+ ]++-- | Construct a value of type 'CodeExecutionResult' (by applying it's required fields, if any)+mkCodeExecutionResult ::+ -- | 'codeExecutionResultOutcome': Required. Outcome of the code execution.+ E'Outcome ->+ CodeExecutionResult+mkCodeExecutionResult codeExecutionResultOutcome =+ CodeExecutionResult+ { codeExecutionResultOutcome+ , codeExecutionResultOutput = Nothing+ }++-- ** Condition++{- | Condition+Filter condition applicable to a single key.+-}+data Condition = Condition+ { conditionNumericValue :: !(Maybe Float)+ -- ^ "numericValue" - The numeric value to filter the metadata on.+ , conditionOperation :: !(E'Operation)+ -- ^ /Required/ "operation" - Required. Operator applied to the given key-value pair to trigger the condition.+ , conditionStringValue :: !(Maybe Text)+ -- ^ "stringValue" - The string value to filter the metadata on.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Condition+instance A.FromJSON Condition where+ parseJSON = A.withObject "Condition" $ \o ->+ Condition+ <$> (o .:? "numericValue")+ <*> (o .: "operation")+ <*> (o .:? "stringValue")++-- | ToJSON Condition+instance A.ToJSON Condition where+ toJSON Condition {..} =+ _omitNulls+ [ "numericValue" .= conditionNumericValue+ , "operation" .= conditionOperation+ , "stringValue" .= conditionStringValue+ ]++-- | Construct a value of type 'Condition' (by applying it's required fields, if any)+mkCondition ::+ -- | 'conditionOperation': Required. Operator applied to the given key-value pair to trigger the condition.+ E'Operation ->+ Condition+mkCondition conditionOperation =+ Condition+ { conditionNumericValue = Nothing+ , conditionOperation+ , conditionStringValue = Nothing+ }++-- ** Content++{- | Content+The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.+-}+data Content = Content+ { contentParts :: !(Maybe [Part])+ -- ^ "parts" - Ordered `Parts` that constitute a single message. Parts may have different MIME types.+ , contentRole :: !(Maybe Text)+ -- ^ "role" - Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Content+instance A.FromJSON Content where+ parseJSON = A.withObject "Content" $ \o ->+ Content+ <$> (o .:? "parts")+ <*> (o .:? "role")++-- | ToJSON Content+instance A.ToJSON Content where+ toJSON Content {..} =+ _omitNulls+ [ "parts" .= contentParts+ , "role" .= contentRole+ ]++-- | Construct a value of type 'Content' (by applying it's required fields, if any)+mkContent ::+ Content+mkContent =+ Content+ { contentParts = Nothing+ , contentRole = Nothing+ }++-- ** ContentEmbedding++{- | ContentEmbedding+A list of floats representing an embedding.+-}+data ContentEmbedding = ContentEmbedding+ { contentEmbeddingValues :: !(Maybe [Float])+ -- ^ "values" - The embedding values.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ContentEmbedding+instance A.FromJSON ContentEmbedding where+ parseJSON = A.withObject "ContentEmbedding" $ \o ->+ ContentEmbedding+ <$> (o .:? "values")++-- | ToJSON ContentEmbedding+instance A.ToJSON ContentEmbedding where+ toJSON ContentEmbedding {..} =+ _omitNulls+ [ "values" .= contentEmbeddingValues+ ]++-- | Construct a value of type 'ContentEmbedding' (by applying it's required fields, if any)+mkContentEmbedding ::+ ContentEmbedding+mkContentEmbedding =+ ContentEmbedding+ { contentEmbeddingValues = Nothing+ }++-- ** ContentFilter++{- | ContentFilter+Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified.+-}+data ContentFilter = ContentFilter+ { contentFilterReason :: !(Maybe E'Reason)+ -- ^ "reason" - The reason content was blocked during request processing.+ , contentFilterMessage :: !(Maybe Text)+ -- ^ "message" - A string that describes the filtering behavior in more detail.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ContentFilter+instance A.FromJSON ContentFilter where+ parseJSON = A.withObject "ContentFilter" $ \o ->+ ContentFilter+ <$> (o .:? "reason")+ <*> (o .:? "message")++-- | ToJSON ContentFilter+instance A.ToJSON ContentFilter where+ toJSON ContentFilter {..} =+ _omitNulls+ [ "reason" .= contentFilterReason+ , "message" .= contentFilterMessage+ ]++-- | Construct a value of type 'ContentFilter' (by applying it's required fields, if any)+mkContentFilter ::+ ContentFilter+mkContentFilter =+ ContentFilter+ { contentFilterReason = Nothing+ , contentFilterMessage = Nothing+ }++-- ** Corpus++{- | Corpus+A `Corpus` is a collection of `Document`s. A project can create up to 5 corpora.+-}+data Corpus = Corpus+ { corpusUpdateTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "updateTime" - Output only. The Timestamp of when the `Corpus` was last updated.+ , corpusCreateTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "createTime" - Output only. The Timestamp of when the `Corpus` was created.+ , corpusDisplayName :: !(Maybe Text)+ -- ^ "displayName" - Optional. The human-readable display name for the `Corpus`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\"+ , corpusName :: !(Maybe Text)+ -- ^ "name" - Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the \"corpora/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Corpus+instance A.FromJSON Corpus where+ parseJSON = A.withObject "Corpus" $ \o ->+ Corpus+ <$> (o .:? "updateTime")+ <*> (o .:? "createTime")+ <*> (o .:? "displayName")+ <*> (o .:? "name")++-- | ToJSON Corpus+instance A.ToJSON Corpus where+ toJSON Corpus {..} =+ _omitNulls+ [ "updateTime" .= corpusUpdateTime+ , "createTime" .= corpusCreateTime+ , "displayName" .= corpusDisplayName+ , "name" .= corpusName+ ]++-- | Construct a value of type 'Corpus' (by applying it's required fields, if any)+mkCorpus ::+ Corpus+mkCorpus =+ Corpus+ { corpusUpdateTime = Nothing+ , corpusCreateTime = Nothing+ , corpusDisplayName = Nothing+ , corpusName = Nothing+ }++-- ** CountMessageTokensRequest++{- | CountMessageTokensRequest+Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.+-}+data CountMessageTokensRequest = CountMessageTokensRequest+ { countMessageTokensRequestPrompt :: !(MessagePrompt)+ -- ^ /Required/ "prompt" - Required. The prompt, whose token count is to be returned.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CountMessageTokensRequest+instance A.FromJSON CountMessageTokensRequest where+ parseJSON = A.withObject "CountMessageTokensRequest" $ \o ->+ CountMessageTokensRequest+ <$> (o .: "prompt")++-- | ToJSON CountMessageTokensRequest+instance A.ToJSON CountMessageTokensRequest where+ toJSON CountMessageTokensRequest {..} =+ _omitNulls+ [ "prompt" .= countMessageTokensRequestPrompt+ ]++-- | Construct a value of type 'CountMessageTokensRequest' (by applying it's required fields, if any)+mkCountMessageTokensRequest ::+ -- | 'countMessageTokensRequestPrompt': Required. The prompt, whose token count is to be returned.+ MessagePrompt ->+ CountMessageTokensRequest+mkCountMessageTokensRequest countMessageTokensRequestPrompt =+ CountMessageTokensRequest+ { countMessageTokensRequestPrompt+ }++-- ** CountMessageTokensResponse++{- | CountMessageTokensResponse+A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.+-}+data CountMessageTokensResponse = CountMessageTokensResponse+ { countMessageTokensResponseTokenCount :: !(Maybe Int)+ -- ^ "tokenCount" - The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CountMessageTokensResponse+instance A.FromJSON CountMessageTokensResponse where+ parseJSON = A.withObject "CountMessageTokensResponse" $ \o ->+ CountMessageTokensResponse+ <$> (o .:? "tokenCount")++-- | ToJSON CountMessageTokensResponse+instance A.ToJSON CountMessageTokensResponse where+ toJSON CountMessageTokensResponse {..} =+ _omitNulls+ [ "tokenCount" .= countMessageTokensResponseTokenCount+ ]++-- | Construct a value of type 'CountMessageTokensResponse' (by applying it's required fields, if any)+mkCountMessageTokensResponse ::+ CountMessageTokensResponse+mkCountMessageTokensResponse =+ CountMessageTokensResponse+ { countMessageTokensResponseTokenCount = Nothing+ }++-- ** CountTextTokensRequest++{- | CountTextTokensRequest+Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.+-}+data CountTextTokensRequest = CountTextTokensRequest+ { countTextTokensRequestPrompt :: !(TextPrompt)+ -- ^ /Required/ "prompt" - Required. The free-form input text given to the model as a prompt.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CountTextTokensRequest+instance A.FromJSON CountTextTokensRequest where+ parseJSON = A.withObject "CountTextTokensRequest" $ \o ->+ CountTextTokensRequest+ <$> (o .: "prompt")++-- | ToJSON CountTextTokensRequest+instance A.ToJSON CountTextTokensRequest where+ toJSON CountTextTokensRequest {..} =+ _omitNulls+ [ "prompt" .= countTextTokensRequestPrompt+ ]++-- | Construct a value of type 'CountTextTokensRequest' (by applying it's required fields, if any)+mkCountTextTokensRequest ::+ -- | 'countTextTokensRequestPrompt': Required. The free-form input text given to the model as a prompt.+ TextPrompt ->+ CountTextTokensRequest+mkCountTextTokensRequest countTextTokensRequestPrompt =+ CountTextTokensRequest+ { countTextTokensRequestPrompt+ }++-- ** CountTextTokensResponse++{- | CountTextTokensResponse+A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`.+-}+data CountTextTokensResponse = CountTextTokensResponse+ { countTextTokensResponseTokenCount :: !(Maybe Int)+ -- ^ "tokenCount" - The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CountTextTokensResponse+instance A.FromJSON CountTextTokensResponse where+ parseJSON = A.withObject "CountTextTokensResponse" $ \o ->+ CountTextTokensResponse+ <$> (o .:? "tokenCount")++-- | ToJSON CountTextTokensResponse+instance A.ToJSON CountTextTokensResponse where+ toJSON CountTextTokensResponse {..} =+ _omitNulls+ [ "tokenCount" .= countTextTokensResponseTokenCount+ ]++-- | Construct a value of type 'CountTextTokensResponse' (by applying it's required fields, if any)+mkCountTextTokensResponse ::+ CountTextTokensResponse+mkCountTextTokensResponse =+ CountTextTokensResponse+ { countTextTokensResponseTokenCount = Nothing+ }++-- ** CountTokensRequest++{- | CountTokensRequest+Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.+-}+data CountTokensRequest = CountTokensRequest+ { countTokensRequestContents :: !(Maybe [Content])+ -- ^ "contents" - Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set.+ , countTokensRequestGenerateContentRequest :: !(Maybe GenerateContentRequest)+ -- ^ "generateContentRequest" - Optional. The overall input given to the `Model`. This includes the prompt as well as other model steering information like [system instructions](https://ai.google.dev/gemini-api/docs/system-instructions), and/or function declarations for [function calling](https://ai.google.dev/gemini-api/docs/function-calling). `Model`s/`Content`s and `generate_content_request`s are mutually exclusive. You can either send `Model` + `Content`s or a `generate_content_request`, but never both.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CountTokensRequest+instance A.FromJSON CountTokensRequest where+ parseJSON = A.withObject "CountTokensRequest" $ \o ->+ CountTokensRequest+ <$> (o .:? "contents")+ <*> (o .:? "generateContentRequest")++-- | ToJSON CountTokensRequest+instance A.ToJSON CountTokensRequest where+ toJSON CountTokensRequest {..} =+ _omitNulls+ [ "contents" .= countTokensRequestContents+ , "generateContentRequest" .= countTokensRequestGenerateContentRequest+ ]++-- | Construct a value of type 'CountTokensRequest' (by applying it's required fields, if any)+mkCountTokensRequest ::+ CountTokensRequest+mkCountTokensRequest =+ CountTokensRequest+ { countTokensRequestContents = Nothing+ , countTokensRequestGenerateContentRequest = Nothing+ }++-- ** CountTokensResponse++{- | CountTokensResponse+A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.+-}+data CountTokensResponse = CountTokensResponse+ { countTokensResponseCacheTokensDetails :: !(Maybe [ModalityTokenCount])+ -- ^ /ReadOnly/ "cacheTokensDetails" - Output only. List of modalities that were processed in the cached content.+ , countTokensResponsePromptTokensDetails :: !(Maybe [ModalityTokenCount])+ -- ^ /ReadOnly/ "promptTokensDetails" - Output only. List of modalities that were processed in the request input.+ , countTokensResponseTotalTokens :: !(Maybe Int)+ -- ^ "totalTokens" - The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative.+ , countTokensResponseCachedContentTokenCount :: !(Maybe Int)+ -- ^ "cachedContentTokenCount" - Number of tokens in the cached part of the prompt (the cached content).+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CountTokensResponse+instance A.FromJSON CountTokensResponse where+ parseJSON = A.withObject "CountTokensResponse" $ \o ->+ CountTokensResponse+ <$> (o .:? "cacheTokensDetails")+ <*> (o .:? "promptTokensDetails")+ <*> (o .:? "totalTokens")+ <*> (o .:? "cachedContentTokenCount")++-- | ToJSON CountTokensResponse+instance A.ToJSON CountTokensResponse where+ toJSON CountTokensResponse {..} =+ _omitNulls+ [ "cacheTokensDetails" .= countTokensResponseCacheTokensDetails+ , "promptTokensDetails" .= countTokensResponsePromptTokensDetails+ , "totalTokens" .= countTokensResponseTotalTokens+ , "cachedContentTokenCount" .= countTokensResponseCachedContentTokenCount+ ]++-- | Construct a value of type 'CountTokensResponse' (by applying it's required fields, if any)+mkCountTokensResponse ::+ CountTokensResponse+mkCountTokensResponse =+ CountTokensResponse+ { countTokensResponseCacheTokensDetails = Nothing+ , countTokensResponsePromptTokensDetails = Nothing+ , countTokensResponseTotalTokens = Nothing+ , countTokensResponseCachedContentTokenCount = Nothing+ }++-- ** CreateChunkRequest++{- | CreateChunkRequest+Request to create a `Chunk`.+-}+data CreateChunkRequest = CreateChunkRequest+ { createChunkRequestParent :: !(Text)+ -- ^ /Required/ "parent" - Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`+ , createChunkRequestChunk :: !(Chunk)+ -- ^ /Required/ "chunk" - Required. The `Chunk` to create.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CreateChunkRequest+instance A.FromJSON CreateChunkRequest where+ parseJSON = A.withObject "CreateChunkRequest" $ \o ->+ CreateChunkRequest+ <$> (o .: "parent")+ <*> (o .: "chunk")++-- | ToJSON CreateChunkRequest+instance A.ToJSON CreateChunkRequest where+ toJSON CreateChunkRequest {..} =+ _omitNulls+ [ "parent" .= createChunkRequestParent+ , "chunk" .= createChunkRequestChunk+ ]++-- | Construct a value of type 'CreateChunkRequest' (by applying it's required fields, if any)+mkCreateChunkRequest ::+ -- | 'createChunkRequestParent': Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`+ Text ->+ -- | 'createChunkRequestChunk': Required. The `Chunk` to create.+ Chunk ->+ CreateChunkRequest+mkCreateChunkRequest createChunkRequestParent createChunkRequestChunk =+ CreateChunkRequest+ { createChunkRequestParent+ , createChunkRequestChunk+ }++-- ** CreateFileRequest++{- | CreateFileRequest+Request for `CreateFile`.+-}+data CreateFileRequest = CreateFileRequest+ { createFileRequestFile :: !(Maybe File)+ -- ^ "file" - Optional. Metadata for the file to create.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CreateFileRequest+instance A.FromJSON CreateFileRequest where+ parseJSON = A.withObject "CreateFileRequest" $ \o ->+ CreateFileRequest+ <$> (o .:? "file")++-- | ToJSON CreateFileRequest+instance A.ToJSON CreateFileRequest where+ toJSON CreateFileRequest {..} =+ _omitNulls+ [ "file" .= createFileRequestFile+ ]++-- | Construct a value of type 'CreateFileRequest' (by applying it's required fields, if any)+mkCreateFileRequest ::+ CreateFileRequest+mkCreateFileRequest =+ CreateFileRequest+ { createFileRequestFile = Nothing+ }++-- ** CreateFileResponse++{- | CreateFileResponse+Response for `CreateFile`.+-}+data CreateFileResponse = CreateFileResponse+ { createFileResponseFile :: !(Maybe File)+ -- ^ "file" - Metadata for the created file.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CreateFileResponse+instance A.FromJSON CreateFileResponse where+ parseJSON = A.withObject "CreateFileResponse" $ \o ->+ CreateFileResponse+ <$> (o .:? "file")++-- | ToJSON CreateFileResponse+instance A.ToJSON CreateFileResponse where+ toJSON CreateFileResponse {..} =+ _omitNulls+ [ "file" .= createFileResponseFile+ ]++-- | Construct a value of type 'CreateFileResponse' (by applying it's required fields, if any)+mkCreateFileResponse ::+ CreateFileResponse+mkCreateFileResponse =+ CreateFileResponse+ { createFileResponseFile = Nothing+ }++-- ** CreateTunedModelMetadata++{- | CreateTunedModelMetadata+Metadata about the state and progress of creating a tuned model returned from the long-running operation+-}+data CreateTunedModelMetadata = CreateTunedModelMetadata+ { createTunedModelMetadataCompletedPercent :: !(Maybe Float)+ -- ^ "completedPercent" - The completed percentage for the tuning operation.+ , createTunedModelMetadataCompletedSteps :: !(Maybe Int)+ -- ^ "completedSteps" - The number of steps completed.+ , createTunedModelMetadataTotalSteps :: !(Maybe Int)+ -- ^ "totalSteps" - The total number of tuning steps.+ , createTunedModelMetadataSnapshots :: !(Maybe [TuningSnapshot])+ -- ^ "snapshots" - Metrics collected during tuning.+ , createTunedModelMetadataTunedModel :: !(Maybe Text)+ -- ^ "tunedModel" - Name of the tuned model associated with the tuning operation.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CreateTunedModelMetadata+instance A.FromJSON CreateTunedModelMetadata where+ parseJSON = A.withObject "CreateTunedModelMetadata" $ \o ->+ CreateTunedModelMetadata+ <$> (o .:? "completedPercent")+ <*> (o .:? "completedSteps")+ <*> (o .:? "totalSteps")+ <*> (o .:? "snapshots")+ <*> (o .:? "tunedModel")++-- | ToJSON CreateTunedModelMetadata+instance A.ToJSON CreateTunedModelMetadata where+ toJSON CreateTunedModelMetadata {..} =+ _omitNulls+ [ "completedPercent" .= createTunedModelMetadataCompletedPercent+ , "completedSteps" .= createTunedModelMetadataCompletedSteps+ , "totalSteps" .= createTunedModelMetadataTotalSteps+ , "snapshots" .= createTunedModelMetadataSnapshots+ , "tunedModel" .= createTunedModelMetadataTunedModel+ ]++-- | Construct a value of type 'CreateTunedModelMetadata' (by applying it's required fields, if any)+mkCreateTunedModelMetadata ::+ CreateTunedModelMetadata+mkCreateTunedModelMetadata =+ CreateTunedModelMetadata+ { createTunedModelMetadataCompletedPercent = Nothing+ , createTunedModelMetadataCompletedSteps = Nothing+ , createTunedModelMetadataTotalSteps = Nothing+ , createTunedModelMetadataSnapshots = Nothing+ , createTunedModelMetadataTunedModel = Nothing+ }++-- ** CreateTunedModelOperation++{- | CreateTunedModelOperation+This resource represents a long-running operation where metadata and response fields are strongly typed.+-}+data CreateTunedModelOperation = CreateTunedModelOperation+ { createTunedModelOperationDone :: !(Maybe Bool)+ -- ^ "done" - If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.+ , createTunedModelOperationName :: !(Maybe Text)+ -- ^ "name" - The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.+ , createTunedModelOperationError :: !(Maybe Status)+ -- ^ "error" - The error result of the operation in case of failure or cancellation.+ , createTunedModelOperationMetadata :: !(Maybe CreateTunedModelMetadata)+ -- ^ "metadata"+ , createTunedModelOperationResponse :: !(Maybe TunedModel)+ -- ^ "response"+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CreateTunedModelOperation+instance A.FromJSON CreateTunedModelOperation where+ parseJSON = A.withObject "CreateTunedModelOperation" $ \o ->+ CreateTunedModelOperation+ <$> (o .:? "done")+ <*> (o .:? "name")+ <*> (o .:? "error")+ <*> (o .:? "metadata")+ <*> (o .:? "response")++-- | ToJSON CreateTunedModelOperation+instance A.ToJSON CreateTunedModelOperation where+ toJSON CreateTunedModelOperation {..} =+ _omitNulls+ [ "done" .= createTunedModelOperationDone+ , "name" .= createTunedModelOperationName+ , "error" .= createTunedModelOperationError+ , "metadata" .= createTunedModelOperationMetadata+ , "response" .= createTunedModelOperationResponse+ ]++-- | Construct a value of type 'CreateTunedModelOperation' (by applying it's required fields, if any)+mkCreateTunedModelOperation ::+ CreateTunedModelOperation+mkCreateTunedModelOperation =+ CreateTunedModelOperation+ { createTunedModelOperationDone = Nothing+ , createTunedModelOperationName = Nothing+ , createTunedModelOperationError = Nothing+ , createTunedModelOperationMetadata = Nothing+ , createTunedModelOperationResponse = Nothing+ }++-- ** CustomMetadata++{- | CustomMetadata+User provided metadata stored as key-value pairs.+-}+data CustomMetadata = CustomMetadata+ { customMetadataStringListValue :: !(Maybe StringList)+ -- ^ "stringListValue" - The StringList value of the metadata to store.+ , customMetadataStringValue :: !(Maybe Text)+ -- ^ "stringValue" - The string value of the metadata to store.+ , customMetadataKey :: !(Text)+ -- ^ /Required/ "key" - Required. The key of the metadata to store.+ , customMetadataNumericValue :: !(Maybe Float)+ -- ^ "numericValue" - The numeric value of the metadata to store.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON CustomMetadata+instance A.FromJSON CustomMetadata where+ parseJSON = A.withObject "CustomMetadata" $ \o ->+ CustomMetadata+ <$> (o .:? "stringListValue")+ <*> (o .:? "stringValue")+ <*> (o .: "key")+ <*> (o .:? "numericValue")++-- | ToJSON CustomMetadata+instance A.ToJSON CustomMetadata where+ toJSON CustomMetadata {..} =+ _omitNulls+ [ "stringListValue" .= customMetadataStringListValue+ , "stringValue" .= customMetadataStringValue+ , "key" .= customMetadataKey+ , "numericValue" .= customMetadataNumericValue+ ]++-- | Construct a value of type 'CustomMetadata' (by applying it's required fields, if any)+mkCustomMetadata ::+ -- | 'customMetadataKey': Required. The key of the metadata to store.+ Text ->+ CustomMetadata+mkCustomMetadata customMetadataKey =+ CustomMetadata+ { customMetadataStringListValue = Nothing+ , customMetadataStringValue = Nothing+ , customMetadataKey+ , customMetadataNumericValue = Nothing+ }++-- ** Dataset++{- | Dataset+Dataset for training or validation.+-}+data Dataset = Dataset+ { datasetExamples :: !(Maybe TuningExamples)+ -- ^ "examples" - Optional. Inline examples with simple input/output text.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Dataset+instance A.FromJSON Dataset where+ parseJSON = A.withObject "Dataset" $ \o ->+ Dataset+ <$> (o .:? "examples")++-- | ToJSON Dataset+instance A.ToJSON Dataset where+ toJSON Dataset {..} =+ _omitNulls+ [ "examples" .= datasetExamples+ ]++-- | Construct a value of type 'Dataset' (by applying it's required fields, if any)+mkDataset ::+ Dataset+mkDataset =+ Dataset+ { datasetExamples = Nothing+ }++-- ** DeleteChunkRequest++{- | DeleteChunkRequest+Request to delete a `Chunk`.+-}+data DeleteChunkRequest = DeleteChunkRequest+ { deleteChunkRequestName :: !(Text)+ -- ^ /Required/ "name" - Required. The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON DeleteChunkRequest+instance A.FromJSON DeleteChunkRequest where+ parseJSON = A.withObject "DeleteChunkRequest" $ \o ->+ DeleteChunkRequest+ <$> (o .: "name")++-- | ToJSON DeleteChunkRequest+instance A.ToJSON DeleteChunkRequest where+ toJSON DeleteChunkRequest {..} =+ _omitNulls+ [ "name" .= deleteChunkRequestName+ ]++-- | Construct a value of type 'DeleteChunkRequest' (by applying it's required fields, if any)+mkDeleteChunkRequest ::+ -- | 'deleteChunkRequestName': Required. The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`+ Text ->+ DeleteChunkRequest+mkDeleteChunkRequest deleteChunkRequestName =+ DeleteChunkRequest+ { deleteChunkRequestName+ }++-- ** Document++{- | Document+A `Document` is a collection of `Chunk`s. A `Corpus` can have a maximum of 10,000 `Document`s.+-}+data Document = Document+ { documentUpdateTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "updateTime" - Output only. The Timestamp of when the `Document` was last updated.+ , documentName :: !(Maybe Text)+ -- ^ "name" - Immutable. Identifier. The `Document` resource name. The ID (name excluding the \"corpora/*/documents/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/{corpus_id}/documents/my-awesome-doc-123a456b789c`+ , documentCustomMetadata :: !(Maybe [CustomMetadata])+ -- ^ "customMetadata" - Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.+ , documentCreateTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "createTime" - Output only. The Timestamp of when the `Document` was created.+ , documentDisplayName :: !(Maybe Text)+ -- ^ "displayName" - Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: \"Semantic Retriever Documentation\"+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Document+instance A.FromJSON Document where+ parseJSON = A.withObject "Document" $ \o ->+ Document+ <$> (o .:? "updateTime")+ <*> (o .:? "name")+ <*> (o .:? "customMetadata")+ <*> (o .:? "createTime")+ <*> (o .:? "displayName")++-- | ToJSON Document+instance A.ToJSON Document where+ toJSON Document {..} =+ _omitNulls+ [ "updateTime" .= documentUpdateTime+ , "name" .= documentName+ , "customMetadata" .= documentCustomMetadata+ , "createTime" .= documentCreateTime+ , "displayName" .= documentDisplayName+ ]++-- | Construct a value of type 'Document' (by applying it's required fields, if any)+mkDocument ::+ Document+mkDocument =+ Document+ { documentUpdateTime = Nothing+ , documentName = Nothing+ , documentCustomMetadata = Nothing+ , documentCreateTime = Nothing+ , documentDisplayName = Nothing+ }++-- ** DynamicRetrievalConfig++{- | DynamicRetrievalConfig+Describes the options to customize dynamic retrieval.+-}+data DynamicRetrievalConfig = DynamicRetrievalConfig+ { dynamicRetrievalConfigDynamicThreshold :: !(Maybe Float)+ -- ^ "dynamicThreshold" - The threshold to be used in dynamic retrieval. If not set, a system default value is used.+ , dynamicRetrievalConfigMode :: !(Maybe E'Mode)+ -- ^ "mode" - The mode of the predictor to be used in dynamic retrieval.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON DynamicRetrievalConfig+instance A.FromJSON DynamicRetrievalConfig where+ parseJSON = A.withObject "DynamicRetrievalConfig" $ \o ->+ DynamicRetrievalConfig+ <$> (o .:? "dynamicThreshold")+ <*> (o .:? "mode")++-- | ToJSON DynamicRetrievalConfig+instance A.ToJSON DynamicRetrievalConfig where+ toJSON DynamicRetrievalConfig {..} =+ _omitNulls+ [ "dynamicThreshold" .= dynamicRetrievalConfigDynamicThreshold+ , "mode" .= dynamicRetrievalConfigMode+ ]++-- | Construct a value of type 'DynamicRetrievalConfig' (by applying it's required fields, if any)+mkDynamicRetrievalConfig ::+ DynamicRetrievalConfig+mkDynamicRetrievalConfig =+ DynamicRetrievalConfig+ { dynamicRetrievalConfigDynamicThreshold = Nothing+ , dynamicRetrievalConfigMode = Nothing+ }++-- ** EmbedContentRequest++{- | EmbedContentRequest+Request containing the `Content` for the model to embed.+-}+data EmbedContentRequest = EmbedContentRequest+ { embedContentRequestTaskType :: !(Maybe TaskType)+ -- ^ "taskType" - Optional. Optional task type for which the embeddings will be used. Not supported on earlier models (`models/embedding-001`).+ , embedContentRequestContent :: !(Content)+ -- ^ /Required/ "content" - Required. The content to embed. Only the `parts.text` fields will be counted.+ , embedContentRequestOutputDimensionality :: !(Maybe Int)+ -- ^ "outputDimensionality" - Optional. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (`models/embedding-001`).+ , embedContentRequestModel :: !(Text)+ -- ^ /Required/ "model" - Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`+ , embedContentRequestTitle :: !(Maybe Text)+ -- ^ "title" - Optional. An optional title for the text. Only applicable when TaskType is `RETRIEVAL_DOCUMENT`. Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality embeddings for retrieval.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON EmbedContentRequest+instance A.FromJSON EmbedContentRequest where+ parseJSON = A.withObject "EmbedContentRequest" $ \o ->+ EmbedContentRequest+ <$> (o .:? "taskType")+ <*> (o .: "content")+ <*> (o .:? "outputDimensionality")+ <*> (o .: "model")+ <*> (o .:? "title")++-- | ToJSON EmbedContentRequest+instance A.ToJSON EmbedContentRequest where+ toJSON EmbedContentRequest {..} =+ _omitNulls+ [ "taskType" .= embedContentRequestTaskType+ , "content" .= embedContentRequestContent+ , "outputDimensionality" .= embedContentRequestOutputDimensionality+ , "model" .= embedContentRequestModel+ , "title" .= embedContentRequestTitle+ ]++-- | Construct a value of type 'EmbedContentRequest' (by applying it's required fields, if any)+mkEmbedContentRequest ::+ -- | 'embedContentRequestContent': Required. The content to embed. Only the `parts.text` fields will be counted.+ Content ->+ -- | 'embedContentRequestModel': Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`+ Text ->+ EmbedContentRequest+mkEmbedContentRequest embedContentRequestContent embedContentRequestModel =+ EmbedContentRequest+ { embedContentRequestTaskType = Nothing+ , embedContentRequestContent+ , embedContentRequestOutputDimensionality = Nothing+ , embedContentRequestModel+ , embedContentRequestTitle = Nothing+ }++-- ** EmbedContentResponse++{- | EmbedContentResponse+The response to an `EmbedContentRequest`.+-}+data EmbedContentResponse = EmbedContentResponse+ { embedContentResponseEmbedding :: !(Maybe ContentEmbedding)+ -- ^ /ReadOnly/ "embedding" - Output only. The embedding generated from the input content.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON EmbedContentResponse+instance A.FromJSON EmbedContentResponse where+ parseJSON = A.withObject "EmbedContentResponse" $ \o ->+ EmbedContentResponse+ <$> (o .:? "embedding")++-- | ToJSON EmbedContentResponse+instance A.ToJSON EmbedContentResponse where+ toJSON EmbedContentResponse {..} =+ _omitNulls+ [ "embedding" .= embedContentResponseEmbedding+ ]++-- | Construct a value of type 'EmbedContentResponse' (by applying it's required fields, if any)+mkEmbedContentResponse ::+ EmbedContentResponse+mkEmbedContentResponse =+ EmbedContentResponse+ { embedContentResponseEmbedding = Nothing+ }++-- ** EmbedTextRequest++{- | EmbedTextRequest+Request to get a text embedding from the model.+-}+data EmbedTextRequest = EmbedTextRequest+ { embedTextRequestText :: !(Maybe Text)+ -- ^ "text" - Optional. The free-form input text that the model will turn into an embedding.+ , embedTextRequestModel :: !(Text)+ -- ^ /Required/ "model" - Required. The model name to use with the format model=models/{model}.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON EmbedTextRequest+instance A.FromJSON EmbedTextRequest where+ parseJSON = A.withObject "EmbedTextRequest" $ \o ->+ EmbedTextRequest+ <$> (o .:? "text")+ <*> (o .: "model")++-- | ToJSON EmbedTextRequest+instance A.ToJSON EmbedTextRequest where+ toJSON EmbedTextRequest {..} =+ _omitNulls+ [ "text" .= embedTextRequestText+ , "model" .= embedTextRequestModel+ ]++-- | Construct a value of type 'EmbedTextRequest' (by applying it's required fields, if any)+mkEmbedTextRequest ::+ -- | 'embedTextRequestModel': Required. The model name to use with the format model=models/{model}.+ Text ->+ EmbedTextRequest+mkEmbedTextRequest embedTextRequestModel =+ EmbedTextRequest+ { embedTextRequestText = Nothing+ , embedTextRequestModel+ }++-- ** EmbedTextResponse++{- | EmbedTextResponse+The response to a EmbedTextRequest.+-}+data EmbedTextResponse = EmbedTextResponse+ { embedTextResponseEmbedding :: !(Maybe Embedding)+ -- ^ /ReadOnly/ "embedding" - Output only. The embedding generated from the input text.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON EmbedTextResponse+instance A.FromJSON EmbedTextResponse where+ parseJSON = A.withObject "EmbedTextResponse" $ \o ->+ EmbedTextResponse+ <$> (o .:? "embedding")++-- | ToJSON EmbedTextResponse+instance A.ToJSON EmbedTextResponse where+ toJSON EmbedTextResponse {..} =+ _omitNulls+ [ "embedding" .= embedTextResponseEmbedding+ ]++-- | Construct a value of type 'EmbedTextResponse' (by applying it's required fields, if any)+mkEmbedTextResponse ::+ EmbedTextResponse+mkEmbedTextResponse =+ EmbedTextResponse+ { embedTextResponseEmbedding = Nothing+ }++-- ** Embedding++{- | Embedding+A list of floats representing the embedding.+-}+data Embedding = Embedding+ { embeddingValue :: !(Maybe [Float])+ -- ^ "value" - The embedding values.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Embedding+instance A.FromJSON Embedding where+ parseJSON = A.withObject "Embedding" $ \o ->+ Embedding+ <$> (o .:? "value")++-- | ToJSON Embedding+instance A.ToJSON Embedding where+ toJSON Embedding {..} =+ _omitNulls+ [ "value" .= embeddingValue+ ]++-- | Construct a value of type 'Embedding' (by applying it's required fields, if any)+mkEmbedding ::+ Embedding+mkEmbedding =+ Embedding+ { embeddingValue = Nothing+ }++-- ** Example++{- | Example+An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.+-}+data Example = Example+ { exampleOutput :: !(Message)+ -- ^ /Required/ "output" - Required. An example of what the model should output given the input.+ , exampleInput :: !(Message)+ -- ^ /Required/ "input" - Required. An example of an input `Message` from the user.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Example+instance A.FromJSON Example where+ parseJSON = A.withObject "Example" $ \o ->+ Example+ <$> (o .: "output")+ <*> (o .: "input")++-- | ToJSON Example+instance A.ToJSON Example where+ toJSON Example {..} =+ _omitNulls+ [ "output" .= exampleOutput+ , "input" .= exampleInput+ ]++-- | Construct a value of type 'Example' (by applying it's required fields, if any)+mkExample ::+ -- | 'exampleOutput': Required. An example of what the model should output given the input.+ Message ->+ -- | 'exampleInput': Required. An example of an input `Message` from the user.+ Message ->+ Example+mkExample exampleOutput exampleInput =+ Example+ { exampleOutput+ , exampleInput+ }++-- ** ExecutableCode++{- | ExecutableCode+Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.+-}+data ExecutableCode = ExecutableCode+ { executableCodeLanguage :: !(E'Language)+ -- ^ /Required/ "language" - Required. Programming language of the `code`.+ , executableCodeCode :: !(Text)+ -- ^ /Required/ "code" - Required. The code to be executed.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ExecutableCode+instance A.FromJSON ExecutableCode where+ parseJSON = A.withObject "ExecutableCode" $ \o ->+ ExecutableCode+ <$> (o .: "language")+ <*> (o .: "code")++-- | ToJSON ExecutableCode+instance A.ToJSON ExecutableCode where+ toJSON ExecutableCode {..} =+ _omitNulls+ [ "language" .= executableCodeLanguage+ , "code" .= executableCodeCode+ ]++-- | Construct a value of type 'ExecutableCode' (by applying it's required fields, if any)+mkExecutableCode ::+ -- | 'executableCodeLanguage': Required. Programming language of the `code`.+ E'Language ->+ -- | 'executableCodeCode': Required. The code to be executed.+ Text ->+ ExecutableCode+mkExecutableCode executableCodeLanguage executableCodeCode =+ ExecutableCode+ { executableCodeLanguage+ , executableCodeCode+ }++-- ** File++{- | File+A file uploaded to the API. Next ID: 15+-}+data File = File+ { fileUri :: !(Maybe Text)+ -- ^ /ReadOnly/ "uri" - Output only. The uri of the `File`.+ , fileName :: !(Maybe Text)+ -- ^ "name" - Immutable. Identifier. The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`+ , fileExpirationTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "expirationTime" - Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.+ , fileDisplayName :: !(Maybe Text)+ -- ^ "displayName" - Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: \"Welcome Image\"+ , fileVideoMetadata :: !(Maybe VideoFileMetadata)+ -- ^ /ReadOnly/ "videoMetadata" - Output only. Metadata for a video.+ , fileState :: !(Maybe E'State)+ -- ^ /ReadOnly/ "state" - Output only. Processing state of the File.+ , fileSource :: !(Maybe E'Source)+ -- ^ "source" - Source of the File.+ , fileMimeType :: !(Maybe Text)+ -- ^ /ReadOnly/ "mimeType" - Output only. MIME type of the file.+ , fileCreateTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "createTime" - Output only. The timestamp of when the `File` was created.+ , fileError :: !(Maybe Status)+ -- ^ /ReadOnly/ "error" - Output only. Error status if File processing failed.+ , fileDownloadUri :: !(Maybe Text)+ -- ^ /ReadOnly/ "downloadUri" - Output only. The download uri of the `File`.+ , fileSizeBytes :: !(Maybe Text)+ -- ^ /ReadOnly/ "sizeBytes" - Output only. Size of the file in bytes.+ , fileSha256Hash :: !(Maybe ByteArray)+ -- ^ /ReadOnly/ "sha256Hash" - Output only. SHA-256 hash of the uploaded bytes.+ , fileUpdateTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "updateTime" - Output only. The timestamp of when the `File` was last updated.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON File+instance A.FromJSON File where+ parseJSON = A.withObject "File" $ \o ->+ File+ <$> (o .:? "uri")+ <*> (o .:? "name")+ <*> (o .:? "expirationTime")+ <*> (o .:? "displayName")+ <*> (o .:? "videoMetadata")+ <*> (o .:? "state")+ <*> (o .:? "source")+ <*> (o .:? "mimeType")+ <*> (o .:? "createTime")+ <*> (o .:? "error")+ <*> (o .:? "downloadUri")+ <*> (o .:? "sizeBytes")+ <*> (o .:? "sha256Hash")+ <*> (o .:? "updateTime")++-- | ToJSON File+instance A.ToJSON File where+ toJSON File {..} =+ _omitNulls+ [ "uri" .= fileUri+ , "name" .= fileName+ , "expirationTime" .= fileExpirationTime+ , "displayName" .= fileDisplayName+ , "videoMetadata" .= fileVideoMetadata+ , "state" .= fileState+ , "source" .= fileSource+ , "mimeType" .= fileMimeType+ , "createTime" .= fileCreateTime+ , "error" .= fileError+ , "downloadUri" .= fileDownloadUri+ , "sizeBytes" .= fileSizeBytes+ , "sha256Hash" .= fileSha256Hash+ , "updateTime" .= fileUpdateTime+ ]++-- | Construct a value of type 'File' (by applying it's required fields, if any)+mkFile ::+ File+mkFile =+ File+ { fileUri = Nothing+ , fileName = Nothing+ , fileExpirationTime = Nothing+ , fileDisplayName = Nothing+ , fileVideoMetadata = Nothing+ , fileState = Nothing+ , fileSource = Nothing+ , fileMimeType = Nothing+ , fileCreateTime = Nothing+ , fileError = Nothing+ , fileDownloadUri = Nothing+ , fileSizeBytes = Nothing+ , fileSha256Hash = Nothing+ , fileUpdateTime = Nothing+ }++-- ** FileData++{- | FileData+URI based data.+-}+data FileData = FileData+ { fileDataMimeType :: !(Maybe Text)+ -- ^ "mimeType" - Optional. The IANA standard MIME type of the source data.+ , fileDataFileUri :: !(Text)+ -- ^ /Required/ "fileUri" - Required. URI.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON FileData+instance A.FromJSON FileData where+ parseJSON = A.withObject "FileData" $ \o ->+ FileData+ <$> (o .:? "mimeType")+ <*> (o .: "fileUri")++-- | ToJSON FileData+instance A.ToJSON FileData where+ toJSON FileData {..} =+ _omitNulls+ [ "mimeType" .= fileDataMimeType+ , "fileUri" .= fileDataFileUri+ ]++-- | Construct a value of type 'FileData' (by applying it's required fields, if any)+mkFileData ::+ -- | 'fileDataFileUri': Required. URI.+ Text ->+ FileData+mkFileData fileDataFileUri =+ FileData+ { fileDataMimeType = Nothing+ , fileDataFileUri+ }++-- ** FunctionCall++{- | FunctionCall+A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.+-}+data FunctionCall = FunctionCall+ { functionCallArgs :: !(Maybe (Map.Map String String))+ -- ^ "args" - Optional. The function parameters and values in JSON object format.+ , functionCallId :: !(Maybe Text)+ -- ^ "id" - Optional. The unique id of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.+ , functionCallName :: !(Text)+ -- ^ /Required/ "name" - Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON FunctionCall+instance A.FromJSON FunctionCall where+ parseJSON = A.withObject "FunctionCall" $ \o ->+ FunctionCall+ <$> (o .:? "args")+ <*> (o .:? "id")+ <*> (o .: "name")++-- | ToJSON FunctionCall+instance A.ToJSON FunctionCall where+ toJSON FunctionCall {..} =+ _omitNulls+ [ "args" .= functionCallArgs+ , "id" .= functionCallId+ , "name" .= functionCallName+ ]++-- | Construct a value of type 'FunctionCall' (by applying it's required fields, if any)+mkFunctionCall ::+ -- | 'functionCallName': Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.+ Text ->+ FunctionCall+mkFunctionCall functionCallName =+ FunctionCall+ { functionCallArgs = Nothing+ , functionCallId = Nothing+ , functionCallName+ }++-- ** FunctionCallingConfig++{- | FunctionCallingConfig+Configuration for specifying function calling behavior.+-}+data FunctionCallingConfig = FunctionCallingConfig+ { functionCallingConfigMode :: !(Maybe E'Mode2)+ -- ^ "mode" - Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.+ , functionCallingConfigAllowedFunctionNames :: !(Maybe [Text])+ -- ^ "allowedFunctionNames" - Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON FunctionCallingConfig+instance A.FromJSON FunctionCallingConfig where+ parseJSON = A.withObject "FunctionCallingConfig" $ \o ->+ FunctionCallingConfig+ <$> (o .:? "mode")+ <*> (o .:? "allowedFunctionNames")++-- | ToJSON FunctionCallingConfig+instance A.ToJSON FunctionCallingConfig where+ toJSON FunctionCallingConfig {..} =+ _omitNulls+ [ "mode" .= functionCallingConfigMode+ , "allowedFunctionNames" .= functionCallingConfigAllowedFunctionNames+ ]++-- | Construct a value of type 'FunctionCallingConfig' (by applying it's required fields, if any)+mkFunctionCallingConfig ::+ FunctionCallingConfig+mkFunctionCallingConfig =+ FunctionCallingConfig+ { functionCallingConfigMode = Nothing+ , functionCallingConfigAllowedFunctionNames = Nothing+ }++-- ** FunctionDeclaration++{- | FunctionDeclaration+Structured representation of a function declaration as defined by the [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.+-}+data FunctionDeclaration = FunctionDeclaration+ { functionDeclarationParameters :: !(Maybe Schema)+ -- ^ "parameters" - Optional. Describes the parameters to this function. Reflects the Open API 3.03 Parameter Object string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter.+ , functionDeclarationName :: !(Text)+ -- ^ /Required/ "name" - Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.+ , functionDeclarationBehavior :: !(Maybe E'Behavior)+ -- ^ "behavior" - Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.+ , functionDeclarationDescription :: !(Text)+ -- ^ /Required/ "description" - Required. A brief description of the function.+ , functionDeclarationResponse :: !(Maybe Schema)+ -- ^ "response" - Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.+ , functionDeclarationResponseJsonSchema :: !(Maybe String)+ -- ^ "responseJsonSchema" - Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`.+ , functionDeclarationParametersJsonSchema :: !(Maybe String)+ -- ^ "parametersJsonSchema" - Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { \"type\": \"object\", \"properties\": { \"name\": { \"type\": \"string\" }, \"age\": { \"type\": \"integer\" } }, \"additionalProperties\": false, \"required\": [\"name\", \"age\"], \"propertyOrdering\": [\"name\", \"age\"] } ``` This field is mutually exclusive with `parameters`.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON FunctionDeclaration+instance A.FromJSON FunctionDeclaration where+ parseJSON = A.withObject "FunctionDeclaration" $ \o ->+ FunctionDeclaration+ <$> (o .:? "parameters")+ <*> (o .: "name")+ <*> (o .:? "behavior")+ <*> (o .: "description")+ <*> (o .:? "response")+ <*> (o .:? "responseJsonSchema")+ <*> (o .:? "parametersJsonSchema")++-- | ToJSON FunctionDeclaration+instance A.ToJSON FunctionDeclaration where+ toJSON FunctionDeclaration {..} =+ _omitNulls+ [ "parameters" .= functionDeclarationParameters+ , "name" .= functionDeclarationName+ , "behavior" .= functionDeclarationBehavior+ , "description" .= functionDeclarationDescription+ , "response" .= functionDeclarationResponse+ , "responseJsonSchema" .= functionDeclarationResponseJsonSchema+ , "parametersJsonSchema" .= functionDeclarationParametersJsonSchema+ ]++-- | Construct a value of type 'FunctionDeclaration' (by applying it's required fields, if any)+mkFunctionDeclaration ::+ -- | 'functionDeclarationName': Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.+ Text ->+ -- | 'functionDeclarationDescription': Required. A brief description of the function.+ Text ->+ FunctionDeclaration+mkFunctionDeclaration functionDeclarationName functionDeclarationDescription =+ FunctionDeclaration+ { functionDeclarationParameters = Nothing+ , functionDeclarationName+ , functionDeclarationBehavior = Nothing+ , functionDeclarationDescription+ , functionDeclarationResponse = Nothing+ , functionDeclarationResponseJsonSchema = Nothing+ , functionDeclarationParametersJsonSchema = Nothing+ }++-- ** FunctionResponse++{- | FunctionResponse+The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.+-}+data FunctionResponse = FunctionResponse+ { functionResponseScheduling :: !(Maybe E'Scheduling)+ -- ^ "scheduling" - Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.+ , functionResponseId :: !(Maybe Text)+ -- ^ "id" - Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.+ , functionResponseWillContinue :: !(Maybe Bool)+ -- ^ "willContinue" - Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`.+ , functionResponseName :: !(Text)+ -- ^ /Required/ "name" - Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.+ , functionResponseResponse :: !((Map.Map String String))+ -- ^ /Required/ "response" - Required. The function response in JSON object format.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON FunctionResponse+instance A.FromJSON FunctionResponse where+ parseJSON = A.withObject "FunctionResponse" $ \o ->+ FunctionResponse+ <$> (o .:? "scheduling")+ <*> (o .:? "id")+ <*> (o .:? "willContinue")+ <*> (o .: "name")+ <*> (o .: "response")++-- | ToJSON FunctionResponse+instance A.ToJSON FunctionResponse where+ toJSON FunctionResponse {..} =+ _omitNulls+ [ "scheduling" .= functionResponseScheduling+ , "id" .= functionResponseId+ , "willContinue" .= functionResponseWillContinue+ , "name" .= functionResponseName+ , "response" .= functionResponseResponse+ ]++-- | Construct a value of type 'FunctionResponse' (by applying it's required fields, if any)+mkFunctionResponse ::+ -- | 'functionResponseName': Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.+ Text ->+ -- | 'functionResponseResponse': Required. The function response in JSON object format.+ (Map.Map String String) ->+ FunctionResponse+mkFunctionResponse functionResponseName functionResponseResponse =+ FunctionResponse+ { functionResponseScheduling = Nothing+ , functionResponseId = Nothing+ , functionResponseWillContinue = Nothing+ , functionResponseName+ , functionResponseResponse+ }++-- ** GenerateAnswerRequest++{- | GenerateAnswerRequest+Request to generate a grounded answer from the `Model`.+-}+data GenerateAnswerRequest = GenerateAnswerRequest+ { generateAnswerRequestSemanticRetriever :: !(Maybe SemanticRetrieverConfig)+ -- ^ "semanticRetriever" - Content retrieved from resources created via the Semantic Retriever API.+ , generateAnswerRequestTemperature :: !(Maybe Float)+ -- ^ "temperature" - Optional. Controls the randomness of the output. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model. A low temperature (~0.2) is usually recommended for Attributed-Question-Answering use cases.+ , generateAnswerRequestAnswerStyle :: !(E'AnswerStyle)+ -- ^ /Required/ "answerStyle" - Required. Style in which answers should be returned.+ , generateAnswerRequestContents :: !([Content])+ -- ^ /Required/ "contents" - Required. The content of the current conversation with the `Model`. For single-turn queries, this is a single question to answer. For multi-turn queries, this is a repeated field that contains conversation history and the last `Content` in the list containing the question. Note: `GenerateAnswer` only supports queries in English.+ , generateAnswerRequestSafetySettings :: !(Maybe [SafetySetting])+ -- ^ "safetySettings" - Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateAnswerRequest.contents` and `GenerateAnswerResponse.candidate`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.+ , generateAnswerRequestInlinePassages :: !(Maybe GroundingPassages)+ -- ^ "inlinePassages" - Passages provided inline with the request.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GenerateAnswerRequest+instance A.FromJSON GenerateAnswerRequest where+ parseJSON = A.withObject "GenerateAnswerRequest" $ \o ->+ GenerateAnswerRequest+ <$> (o .:? "semanticRetriever")+ <*> (o .:? "temperature")+ <*> (o .: "answerStyle")+ <*> (o .: "contents")+ <*> (o .:? "safetySettings")+ <*> (o .:? "inlinePassages")++-- | ToJSON GenerateAnswerRequest+instance A.ToJSON GenerateAnswerRequest where+ toJSON GenerateAnswerRequest {..} =+ _omitNulls+ [ "semanticRetriever" .= generateAnswerRequestSemanticRetriever+ , "temperature" .= generateAnswerRequestTemperature+ , "answerStyle" .= generateAnswerRequestAnswerStyle+ , "contents" .= generateAnswerRequestContents+ , "safetySettings" .= generateAnswerRequestSafetySettings+ , "inlinePassages" .= generateAnswerRequestInlinePassages+ ]++-- | Construct a value of type 'GenerateAnswerRequest' (by applying it's required fields, if any)+mkGenerateAnswerRequest ::+ -- | 'generateAnswerRequestAnswerStyle': Required. Style in which answers should be returned.+ E'AnswerStyle ->+ -- | 'generateAnswerRequestContents': Required. The content of the current conversation with the `Model`. For single-turn queries, this is a single question to answer. For multi-turn queries, this is a repeated field that contains conversation history and the last `Content` in the list containing the question. Note: `GenerateAnswer` only supports queries in English.+ [Content] ->+ GenerateAnswerRequest+mkGenerateAnswerRequest generateAnswerRequestAnswerStyle generateAnswerRequestContents =+ GenerateAnswerRequest+ { generateAnswerRequestSemanticRetriever = Nothing+ , generateAnswerRequestTemperature = Nothing+ , generateAnswerRequestAnswerStyle+ , generateAnswerRequestContents+ , generateAnswerRequestSafetySettings = Nothing+ , generateAnswerRequestInlinePassages = Nothing+ }++-- ** GenerateAnswerResponse++{- | GenerateAnswerResponse+Response from the model for a grounded answer.+-}+data GenerateAnswerResponse = GenerateAnswerResponse+ { generateAnswerResponseAnswer :: !(Maybe Candidate)+ -- ^ "answer" - Candidate answer from the model. Note: The model *always* attempts to provide a grounded answer, even when the answer is unlikely to be answerable from the given passages. In that case, a low-quality or ungrounded answer may be provided, along with a low `answerable_probability`.+ , generateAnswerResponseInputFeedback :: !(Maybe InputFeedback)+ -- ^ /ReadOnly/ "inputFeedback" - Output only. Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question. The input data can be one or more of the following: - Question specified by the last entry in `GenerateAnswerRequest.content` - Conversation history specified by the other entries in `GenerateAnswerRequest.content` - Grounding sources (`GenerateAnswerRequest.semantic_retriever` or `GenerateAnswerRequest.inline_passages`)+ , generateAnswerResponseAnswerableProbability :: !(Maybe Float)+ -- ^ /ReadOnly/ "answerableProbability" - Output only. The model's estimate of the probability that its answer is correct and grounded in the input passages. A low `answerable_probability` indicates that the answer might not be grounded in the sources. When `answerable_probability` is low, you may want to: * Display a message to the effect of \"We couldn’t answer that question\" to the user. * Fall back to a general-purpose LLM that answers the question from world knowledge. The threshold and nature of such fallbacks will depend on individual use cases. `0.5` is a good starting threshold.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GenerateAnswerResponse+instance A.FromJSON GenerateAnswerResponse where+ parseJSON = A.withObject "GenerateAnswerResponse" $ \o ->+ GenerateAnswerResponse+ <$> (o .:? "answer")+ <*> (o .:? "inputFeedback")+ <*> (o .:? "answerableProbability")++-- | ToJSON GenerateAnswerResponse+instance A.ToJSON GenerateAnswerResponse where+ toJSON GenerateAnswerResponse {..} =+ _omitNulls+ [ "answer" .= generateAnswerResponseAnswer+ , "inputFeedback" .= generateAnswerResponseInputFeedback+ , "answerableProbability" .= generateAnswerResponseAnswerableProbability+ ]++-- | Construct a value of type 'GenerateAnswerResponse' (by applying it's required fields, if any)+mkGenerateAnswerResponse ::+ GenerateAnswerResponse+mkGenerateAnswerResponse =+ GenerateAnswerResponse+ { generateAnswerResponseAnswer = Nothing+ , generateAnswerResponseInputFeedback = Nothing+ , generateAnswerResponseAnswerableProbability = Nothing+ }++-- ** GenerateContentRequest++{- | GenerateContentRequest+Request to generate a completion from the model. NEXT ID: 13+-}+data GenerateContentRequest = GenerateContentRequest+ { generateContentRequestToolConfig :: !(Maybe ToolConfig)+ -- ^ "toolConfig" - Optional. Tool configuration for any `Tool` specified in the request. Refer to the [Function calling guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) for a usage example.+ , generateContentRequestTools :: !(Maybe [Tool])+ -- ^ "tools" - Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.+ , generateContentRequestContents :: !([Content])+ -- ^ /Required/ "contents" - Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.+ , generateContentRequestSystemInstruction :: !(Maybe Content)+ -- ^ "systemInstruction" - Optional. Developer set [system instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). Currently, text only.+ , generateContentRequestCachedContent :: !(Maybe Text)+ -- ^ "cachedContent" - Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`+ , generateContentRequestSafetySettings :: !(Maybe [SafetySetting])+ -- ^ "safetySettings" - Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.+ , generateContentRequestModel :: !(Text)+ -- ^ /Required/ "model" - Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.+ , generateContentRequestGenerationConfig :: !(Maybe GenerationConfig)+ -- ^ "generationConfig" - Optional. Configuration options for model generation and outputs.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GenerateContentRequest+instance A.FromJSON GenerateContentRequest where+ parseJSON = A.withObject "GenerateContentRequest" $ \o ->+ GenerateContentRequest+ <$> (o .:? "toolConfig")+ <*> (o .:? "tools")+ <*> (o .: "contents")+ <*> (o .:? "systemInstruction")+ <*> (o .:? "cachedContent")+ <*> (o .:? "safetySettings")+ <*> (o .: "model")+ <*> (o .:? "generationConfig")++-- | ToJSON GenerateContentRequest+instance A.ToJSON GenerateContentRequest where+ toJSON GenerateContentRequest {..} =+ _omitNulls+ [ "toolConfig" .= generateContentRequestToolConfig+ , "tools" .= generateContentRequestTools+ , "contents" .= generateContentRequestContents+ , "systemInstruction" .= generateContentRequestSystemInstruction+ , "cachedContent" .= generateContentRequestCachedContent+ , "safetySettings" .= generateContentRequestSafetySettings+ , "model" .= generateContentRequestModel+ , "generationConfig" .= generateContentRequestGenerationConfig+ ]++-- | Construct a value of type 'GenerateContentRequest' (by applying it's required fields, if any)+mkGenerateContentRequest ::+ -- | 'generateContentRequestContents': Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.+ [Content] ->+ -- | 'generateContentRequestModel': Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.+ Text ->+ GenerateContentRequest+mkGenerateContentRequest generateContentRequestContents generateContentRequestModel =+ GenerateContentRequest+ { generateContentRequestToolConfig = Nothing+ , generateContentRequestTools = Nothing+ , generateContentRequestContents+ , generateContentRequestSystemInstruction = Nothing+ , generateContentRequestCachedContent = Nothing+ , generateContentRequestSafetySettings = Nothing+ , generateContentRequestModel+ , generateContentRequestGenerationConfig = Nothing+ }++-- ** GenerateContentResponse++{- | GenerateContentResponse+Response from the model supporting multiple candidate responses. Safety ratings and content filtering are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API: - Returns either all requested candidates or none of them - Returns no candidates at all only if there was something wrong with the prompt (check `prompt_feedback`) - Reports feedback on each candidate in `finish_reason` and `safety_ratings`.+-}+data GenerateContentResponse = GenerateContentResponse+ { generateContentResponseCandidates :: !(Maybe [Candidate])+ -- ^ "candidates" - Candidate responses from the model.+ , generateContentResponseUsageMetadata :: !(Maybe UsageMetadata)+ -- ^ /ReadOnly/ "usageMetadata" - Output only. Metadata on the generation requests' token usage.+ , generateContentResponseModelVersion :: !(Maybe Text)+ -- ^ /ReadOnly/ "modelVersion" - Output only. The model version used to generate the response.+ , generateContentResponsePromptFeedback :: !(Maybe PromptFeedback)+ -- ^ "promptFeedback" - Returns the prompt's feedback related to the content filters.+ , generateContentResponseResponseId :: !(Maybe Text)+ -- ^ /ReadOnly/ "responseId" - Output only. response_id is used to identify each response.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GenerateContentResponse+instance A.FromJSON GenerateContentResponse where+ parseJSON = A.withObject "GenerateContentResponse" $ \o ->+ GenerateContentResponse+ <$> (o .:? "candidates")+ <*> (o .:? "usageMetadata")+ <*> (o .:? "modelVersion")+ <*> (o .:? "promptFeedback")+ <*> (o .:? "responseId")++-- | ToJSON GenerateContentResponse+instance A.ToJSON GenerateContentResponse where+ toJSON GenerateContentResponse {..} =+ _omitNulls+ [ "candidates" .= generateContentResponseCandidates+ , "usageMetadata" .= generateContentResponseUsageMetadata+ , "modelVersion" .= generateContentResponseModelVersion+ , "promptFeedback" .= generateContentResponsePromptFeedback+ , "responseId" .= generateContentResponseResponseId+ ]++-- | Construct a value of type 'GenerateContentResponse' (by applying it's required fields, if any)+mkGenerateContentResponse ::+ GenerateContentResponse+mkGenerateContentResponse =+ GenerateContentResponse+ { generateContentResponseCandidates = Nothing+ , generateContentResponseUsageMetadata = Nothing+ , generateContentResponseModelVersion = Nothing+ , generateContentResponsePromptFeedback = Nothing+ , generateContentResponseResponseId = Nothing+ }++-- ** GenerateMessageRequest++{- | GenerateMessageRequest+Request to generate a message response from the model.+-}+data GenerateMessageRequest = GenerateMessageRequest+ { generateMessageRequestTemperature :: !(Maybe Float)+ -- ^ "temperature" - Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model.+ , generateMessageRequestTopP :: !(Maybe Float)+ -- ^ "topP" - Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`.+ , generateMessageRequestCandidateCount :: !(Maybe Int)+ -- ^ "candidateCount" - Optional. The number of generated response messages to return. This value must be between `[1, 8]`, inclusive. If unset, this will default to `1`.+ , generateMessageRequestTopK :: !(Maybe Int)+ -- ^ "topK" - Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens.+ , generateMessageRequestPrompt :: !(MessagePrompt)+ -- ^ /Required/ "prompt" - Required. The structured textual input given to the model as a prompt. Given a prompt, the model will return what it predicts is the next message in the discussion.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GenerateMessageRequest+instance A.FromJSON GenerateMessageRequest where+ parseJSON = A.withObject "GenerateMessageRequest" $ \o ->+ GenerateMessageRequest+ <$> (o .:? "temperature")+ <*> (o .:? "topP")+ <*> (o .:? "candidateCount")+ <*> (o .:? "topK")+ <*> (o .: "prompt")++-- | ToJSON GenerateMessageRequest+instance A.ToJSON GenerateMessageRequest where+ toJSON GenerateMessageRequest {..} =+ _omitNulls+ [ "temperature" .= generateMessageRequestTemperature+ , "topP" .= generateMessageRequestTopP+ , "candidateCount" .= generateMessageRequestCandidateCount+ , "topK" .= generateMessageRequestTopK+ , "prompt" .= generateMessageRequestPrompt+ ]++-- | Construct a value of type 'GenerateMessageRequest' (by applying it's required fields, if any)+mkGenerateMessageRequest ::+ -- | 'generateMessageRequestPrompt': Required. The structured textual input given to the model as a prompt. Given a prompt, the model will return what it predicts is the next message in the discussion.+ MessagePrompt ->+ GenerateMessageRequest+mkGenerateMessageRequest generateMessageRequestPrompt =+ GenerateMessageRequest+ { generateMessageRequestTemperature = Nothing+ , generateMessageRequestTopP = Nothing+ , generateMessageRequestCandidateCount = Nothing+ , generateMessageRequestTopK = Nothing+ , generateMessageRequestPrompt+ }++-- ** GenerateMessageResponse++{- | GenerateMessageResponse+The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.+-}+data GenerateMessageResponse = GenerateMessageResponse+ { generateMessageResponseCandidates :: !(Maybe [Message])+ -- ^ "candidates" - Candidate response messages from the model.+ , generateMessageResponseMessages :: !(Maybe [Message])+ -- ^ "messages" - The conversation history used by the model.+ , generateMessageResponseFilters :: !(Maybe [ContentFilter])+ -- ^ "filters" - A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GenerateMessageResponse+instance A.FromJSON GenerateMessageResponse where+ parseJSON = A.withObject "GenerateMessageResponse" $ \o ->+ GenerateMessageResponse+ <$> (o .:? "candidates")+ <*> (o .:? "messages")+ <*> (o .:? "filters")++-- | ToJSON GenerateMessageResponse+instance A.ToJSON GenerateMessageResponse where+ toJSON GenerateMessageResponse {..} =+ _omitNulls+ [ "candidates" .= generateMessageResponseCandidates+ , "messages" .= generateMessageResponseMessages+ , "filters" .= generateMessageResponseFilters+ ]++-- | Construct a value of type 'GenerateMessageResponse' (by applying it's required fields, if any)+mkGenerateMessageResponse ::+ GenerateMessageResponse+mkGenerateMessageResponse =+ GenerateMessageResponse+ { generateMessageResponseCandidates = Nothing+ , generateMessageResponseMessages = Nothing+ , generateMessageResponseFilters = Nothing+ }++-- ** GenerateTextRequest++{- | GenerateTextRequest+Request to generate a text completion response from the model.+-}+data GenerateTextRequest = GenerateTextRequest+ { generateTextRequestStopSequences :: !(Maybe [Text])+ -- ^ "stopSequences" - The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response.+ , generateTextRequestPrompt :: !(TextPrompt)+ -- ^ /Required/ "prompt" - Required. The free-form input text given to the model as a prompt. Given a prompt, the model will generate a TextCompletion response it predicts as the completion of the input text.+ , generateTextRequestMaxOutputTokens :: !(Maybe Int)+ -- ^ "maxOutputTokens" - Optional. The maximum number of tokens to include in a candidate. If unset, this will default to output_token_limit specified in the `Model` specification.+ , generateTextRequestSafetySettings :: !(Maybe [SafetySetting])+ -- ^ "safetySettings" - Optional. A list of unique `SafetySetting` instances for blocking unsafe content. that will be enforced on the `GenerateTextRequest.prompt` and `GenerateTextResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any prompts and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_DEROGATORY, HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL, HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text service.+ , generateTextRequestTemperature :: !(Maybe Float)+ -- ^ "temperature" - Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned the `getModel` function. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model.+ , generateTextRequestTopK :: !(Maybe Int)+ -- ^ "topK" - Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Defaults to 40. Note: The default value varies by model, see the `Model.top_k` attribute of the `Model` returned the `getModel` function.+ , generateTextRequestTopP :: !(Maybe Float)+ -- ^ "topP" - Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits number of tokens based on the cumulative probability. Note: The default value varies by model, see the `Model.top_p` attribute of the `Model` returned the `getModel` function.+ , generateTextRequestCandidateCount :: !(Maybe Int)+ -- ^ "candidateCount" - Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GenerateTextRequest+instance A.FromJSON GenerateTextRequest where+ parseJSON = A.withObject "GenerateTextRequest" $ \o ->+ GenerateTextRequest+ <$> (o .:? "stopSequences")+ <*> (o .: "prompt")+ <*> (o .:? "maxOutputTokens")+ <*> (o .:? "safetySettings")+ <*> (o .:? "temperature")+ <*> (o .:? "topK")+ <*> (o .:? "topP")+ <*> (o .:? "candidateCount")++-- | ToJSON GenerateTextRequest+instance A.ToJSON GenerateTextRequest where+ toJSON GenerateTextRequest {..} =+ _omitNulls+ [ "stopSequences" .= generateTextRequestStopSequences+ , "prompt" .= generateTextRequestPrompt+ , "maxOutputTokens" .= generateTextRequestMaxOutputTokens+ , "safetySettings" .= generateTextRequestSafetySettings+ , "temperature" .= generateTextRequestTemperature+ , "topK" .= generateTextRequestTopK+ , "topP" .= generateTextRequestTopP+ , "candidateCount" .= generateTextRequestCandidateCount+ ]++-- | Construct a value of type 'GenerateTextRequest' (by applying it's required fields, if any)+mkGenerateTextRequest ::+ -- | 'generateTextRequestPrompt': Required. The free-form input text given to the model as a prompt. Given a prompt, the model will generate a TextCompletion response it predicts as the completion of the input text.+ TextPrompt ->+ GenerateTextRequest+mkGenerateTextRequest generateTextRequestPrompt =+ GenerateTextRequest+ { generateTextRequestStopSequences = Nothing+ , generateTextRequestPrompt+ , generateTextRequestMaxOutputTokens = Nothing+ , generateTextRequestSafetySettings = Nothing+ , generateTextRequestTemperature = Nothing+ , generateTextRequestTopK = Nothing+ , generateTextRequestTopP = Nothing+ , generateTextRequestCandidateCount = Nothing+ }++-- ** GenerateTextResponse++{- | GenerateTextResponse+The response from the model, including candidate completions.+-}+data GenerateTextResponse = GenerateTextResponse+ { generateTextResponseSafetyFeedback :: !(Maybe [SafetyFeedback])+ -- ^ "safetyFeedback" - Returns any safety feedback related to content filtering.+ , generateTextResponseCandidates :: !(Maybe [TextCompletion])+ -- ^ "candidates" - Candidate responses from the model.+ , generateTextResponseFilters :: !(Maybe [ContentFilter])+ -- ^ "filters" - A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category. This indicates the smallest change to the `SafetySettings` that would be necessary to unblock at least 1 response. The blocking is configured by the `SafetySettings` in the request (or the default `SafetySettings` of the API).+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GenerateTextResponse+instance A.FromJSON GenerateTextResponse where+ parseJSON = A.withObject "GenerateTextResponse" $ \o ->+ GenerateTextResponse+ <$> (o .:? "safetyFeedback")+ <*> (o .:? "candidates")+ <*> (o .:? "filters")++-- | ToJSON GenerateTextResponse+instance A.ToJSON GenerateTextResponse where+ toJSON GenerateTextResponse {..} =+ _omitNulls+ [ "safetyFeedback" .= generateTextResponseSafetyFeedback+ , "candidates" .= generateTextResponseCandidates+ , "filters" .= generateTextResponseFilters+ ]++-- | Construct a value of type 'GenerateTextResponse' (by applying it's required fields, if any)+mkGenerateTextResponse ::+ GenerateTextResponse+mkGenerateTextResponse =+ GenerateTextResponse+ { generateTextResponseSafetyFeedback = Nothing+ , generateTextResponseCandidates = Nothing+ , generateTextResponseFilters = Nothing+ }++-- ** GenerateVideoResponse++{- | GenerateVideoResponse+Veo response.+-}+data GenerateVideoResponse = GenerateVideoResponse+ { generateVideoResponseGeneratedSamples :: !(Maybe [Media])+ -- ^ "generatedSamples" - The generated samples.+ , generateVideoResponseRaiMediaFilteredCount :: !(Maybe Int)+ -- ^ "raiMediaFilteredCount" - Returns if any videos were filtered due to RAI policies.+ , generateVideoResponseRaiMediaFilteredReasons :: !(Maybe [Text])+ -- ^ "raiMediaFilteredReasons" - Returns rai failure reasons if any.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GenerateVideoResponse+instance A.FromJSON GenerateVideoResponse where+ parseJSON = A.withObject "GenerateVideoResponse" $ \o ->+ GenerateVideoResponse+ <$> (o .:? "generatedSamples")+ <*> (o .:? "raiMediaFilteredCount")+ <*> (o .:? "raiMediaFilteredReasons")++-- | ToJSON GenerateVideoResponse+instance A.ToJSON GenerateVideoResponse where+ toJSON GenerateVideoResponse {..} =+ _omitNulls+ [ "generatedSamples" .= generateVideoResponseGeneratedSamples+ , "raiMediaFilteredCount" .= generateVideoResponseRaiMediaFilteredCount+ , "raiMediaFilteredReasons" .= generateVideoResponseRaiMediaFilteredReasons+ ]++-- | Construct a value of type 'GenerateVideoResponse' (by applying it's required fields, if any)+mkGenerateVideoResponse ::+ GenerateVideoResponse+mkGenerateVideoResponse =+ GenerateVideoResponse+ { generateVideoResponseGeneratedSamples = Nothing+ , generateVideoResponseRaiMediaFilteredCount = Nothing+ , generateVideoResponseRaiMediaFilteredReasons = Nothing+ }++-- ** GeneratedFile++{- | GeneratedFile+A file generated on behalf of a user.+-}+data GeneratedFile = GeneratedFile+ { generatedFileError :: !(Maybe Status)+ -- ^ "error" - Error details if the GeneratedFile ends up in the STATE_FAILED state.+ , generatedFileName :: !(Maybe Text)+ -- ^ "name" - Identifier. The name of the generated file. Example: `generatedFiles/abc-123`+ , generatedFileState :: !(Maybe E'State2)+ -- ^ /ReadOnly/ "state" - Output only. The state of the GeneratedFile.+ , generatedFileMimeType :: !(Maybe Text)+ -- ^ "mimeType" - MIME type of the generatedFile.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GeneratedFile+instance A.FromJSON GeneratedFile where+ parseJSON = A.withObject "GeneratedFile" $ \o ->+ GeneratedFile+ <$> (o .:? "error")+ <*> (o .:? "name")+ <*> (o .:? "state")+ <*> (o .:? "mimeType")++-- | ToJSON GeneratedFile+instance A.ToJSON GeneratedFile where+ toJSON GeneratedFile {..} =+ _omitNulls+ [ "error" .= generatedFileError+ , "name" .= generatedFileName+ , "state" .= generatedFileState+ , "mimeType" .= generatedFileMimeType+ ]++-- | Construct a value of type 'GeneratedFile' (by applying it's required fields, if any)+mkGeneratedFile ::+ GeneratedFile+mkGeneratedFile =+ GeneratedFile+ { generatedFileError = Nothing+ , generatedFileName = Nothing+ , generatedFileState = Nothing+ , generatedFileMimeType = Nothing+ }++-- ** GenerationConfig++{- | GenerationConfig+Configuration options for model generation and outputs. Not all parameters are configurable for every model.+-}+data GenerationConfig = GenerationConfig+ { generationConfigResponseSchema :: !(Maybe Schema)+ -- ^ "responseSchema" - Optional. Output schema of the generated candidate text. Schemas must be a subset of the [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema) and can be objects, primitives or arrays. If set, a compatible `response_mime_type` must also be set. Compatible MIME types: `application/json`: Schema for JSON response. Refer to the [JSON text generation guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details.+ , generationConfigThinkingConfig :: !(Maybe ThinkingConfig)+ -- ^ "thinkingConfig" - Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.+ , generationConfigLogprobs :: !(Maybe Int)+ -- ^ "logprobs" - Optional. Only valid if response_logprobs=True. This sets the number of top logprobs to return at each decoding step in the Candidate.logprobs_result.+ , generationConfigMediaResolution :: !(Maybe E'MediaResolution)+ -- ^ "mediaResolution" - Optional. If specified, the media resolution specified will be used.+ , generationConfigStopSequences :: !(Maybe [Text])+ -- ^ "stopSequences" - Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a `stop_sequence`. The stop sequence will not be included as part of the response.+ , generationConfigSpeechConfig :: !(Maybe SpeechConfig)+ -- ^ "speechConfig" - Optional. The speech generation config.+ , generationConfigResponseJsonSchema :: !(Maybe String)+ -- ^ "responseJsonSchema" - Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set.+ , generationConfigPresencePenalty :: !(Maybe Float)+ -- ^ "presencePenalty" - Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequency_penalty for a penalty that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary.+ , generationConfigTopP :: !(Maybe Float)+ -- ^ "topP" - Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and Top-p (nucleus) sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.+ , generationConfigTemperature :: !(Maybe Float)+ -- ^ "temperature" - Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0].+ , generationConfigTopK :: !(Maybe Int)+ -- ^ "topK" - Optional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.+ , generationConfigCandidateCount :: !(Maybe Int)+ -- ^ "candidateCount" - Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family)+ , generationConfigEnableEnhancedCivicAnswers :: !(Maybe Bool)+ -- ^ "enableEnhancedCivicAnswers" - Optional. Enables enhanced civic answers. It may not be available for all models.+ , generationConfigResponseLogprobs :: !(Maybe Bool)+ -- ^ "responseLogprobs" - Optional. If true, export the logprobs results in response.+ , generationConfigResponseModalities :: !(Maybe [E'ResponseModalities])+ -- ^ "responseModalities" - Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response. A model may have multiple combinations of supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned. An empty list is equivalent to requesting only text.+ , generationConfigFrequencyPenalty :: !(Maybe Float)+ -- ^ "frequencyPenalty" - Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit.+ , generationConfigSeed :: !(Maybe Int)+ -- ^ "seed" - Optional. Seed used in decoding. If not set, the request uses a randomly generated seed.+ , generationConfigMaxOutputTokens :: !(Maybe Int)+ -- ^ "maxOutputTokens" - Optional. The maximum number of tokens to include in a response candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function.+ , generationConfigResponseMimeType :: !(Maybe Text)+ -- ^ "responseMimeType" - Optional. MIME type of the generated candidate text. Supported MIME types are: `text/plain`: (default) Text output. `application/json`: JSON response in the response candidates. `text/x.enum`: ENUM as a string response in the response candidates. Refer to the [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GenerationConfig+instance A.FromJSON GenerationConfig where+ parseJSON = A.withObject "GenerationConfig" $ \o ->+ GenerationConfig+ <$> (o .:? "responseSchema")+ <*> (o .:? "thinkingConfig")+ <*> (o .:? "logprobs")+ <*> (o .:? "mediaResolution")+ <*> (o .:? "stopSequences")+ <*> (o .:? "speechConfig")+ <*> (o .:? "responseJsonSchema")+ <*> (o .:? "presencePenalty")+ <*> (o .:? "topP")+ <*> (o .:? "temperature")+ <*> (o .:? "topK")+ <*> (o .:? "candidateCount")+ <*> (o .:? "enableEnhancedCivicAnswers")+ <*> (o .:? "responseLogprobs")+ <*> (o .:? "responseModalities")+ <*> (o .:? "frequencyPenalty")+ <*> (o .:? "seed")+ <*> (o .:? "maxOutputTokens")+ <*> (o .:? "responseMimeType")++-- | ToJSON GenerationConfig+instance A.ToJSON GenerationConfig where+ toJSON GenerationConfig {..} =+ _omitNulls+ [ "responseSchema" .= generationConfigResponseSchema+ , "thinkingConfig" .= generationConfigThinkingConfig+ , "logprobs" .= generationConfigLogprobs+ , "mediaResolution" .= generationConfigMediaResolution+ , "stopSequences" .= generationConfigStopSequences+ , "speechConfig" .= generationConfigSpeechConfig+ , "responseJsonSchema" .= generationConfigResponseJsonSchema+ , "presencePenalty" .= generationConfigPresencePenalty+ , "topP" .= generationConfigTopP+ , "temperature" .= generationConfigTemperature+ , "topK" .= generationConfigTopK+ , "candidateCount" .= generationConfigCandidateCount+ , "enableEnhancedCivicAnswers" .= generationConfigEnableEnhancedCivicAnswers+ , "responseLogprobs" .= generationConfigResponseLogprobs+ , "responseModalities" .= generationConfigResponseModalities+ , "frequencyPenalty" .= generationConfigFrequencyPenalty+ , "seed" .= generationConfigSeed+ , "maxOutputTokens" .= generationConfigMaxOutputTokens+ , "responseMimeType" .= generationConfigResponseMimeType+ ]++-- | Construct a value of type 'GenerationConfig' (by applying it's required fields, if any)+mkGenerationConfig ::+ GenerationConfig+mkGenerationConfig =+ GenerationConfig+ { generationConfigResponseSchema = Nothing+ , generationConfigThinkingConfig = Nothing+ , generationConfigLogprobs = Nothing+ , generationConfigMediaResolution = Nothing+ , generationConfigStopSequences = Nothing+ , generationConfigSpeechConfig = Nothing+ , generationConfigResponseJsonSchema = Nothing+ , generationConfigPresencePenalty = Nothing+ , generationConfigTopP = Nothing+ , generationConfigTemperature = Nothing+ , generationConfigTopK = Nothing+ , generationConfigCandidateCount = Nothing+ , generationConfigEnableEnhancedCivicAnswers = Nothing+ , generationConfigResponseLogprobs = Nothing+ , generationConfigResponseModalities = Nothing+ , generationConfigFrequencyPenalty = Nothing+ , generationConfigSeed = Nothing+ , generationConfigMaxOutputTokens = Nothing+ , generationConfigResponseMimeType = Nothing+ }++-- ** GoogleSearch++{- | GoogleSearch+GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.+-}+data GoogleSearch = GoogleSearch+ { googleSearchTimeRangeFilter :: !(Maybe Interval)+ -- ^ "timeRangeFilter" - Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa).+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GoogleSearch+instance A.FromJSON GoogleSearch where+ parseJSON = A.withObject "GoogleSearch" $ \o ->+ GoogleSearch+ <$> (o .:? "timeRangeFilter")++-- | ToJSON GoogleSearch+instance A.ToJSON GoogleSearch where+ toJSON GoogleSearch {..} =+ _omitNulls+ [ "timeRangeFilter" .= googleSearchTimeRangeFilter+ ]++-- | Construct a value of type 'GoogleSearch' (by applying it's required fields, if any)+mkGoogleSearch ::+ GoogleSearch+mkGoogleSearch =+ GoogleSearch+ { googleSearchTimeRangeFilter = Nothing+ }++-- ** GoogleSearchRetrieval++{- | GoogleSearchRetrieval+Tool to retrieve public web data for grounding, powered by Google.+-}+data GoogleSearchRetrieval = GoogleSearchRetrieval+ { googleSearchRetrievalDynamicRetrievalConfig :: !(Maybe DynamicRetrievalConfig)+ -- ^ "dynamicRetrievalConfig" - Specifies the dynamic retrieval configuration for the given source.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GoogleSearchRetrieval+instance A.FromJSON GoogleSearchRetrieval where+ parseJSON = A.withObject "GoogleSearchRetrieval" $ \o ->+ GoogleSearchRetrieval+ <$> (o .:? "dynamicRetrievalConfig")++-- | ToJSON GoogleSearchRetrieval+instance A.ToJSON GoogleSearchRetrieval where+ toJSON GoogleSearchRetrieval {..} =+ _omitNulls+ [ "dynamicRetrievalConfig" .= googleSearchRetrievalDynamicRetrievalConfig+ ]++-- | Construct a value of type 'GoogleSearchRetrieval' (by applying it's required fields, if any)+mkGoogleSearchRetrieval ::+ GoogleSearchRetrieval+mkGoogleSearchRetrieval =+ GoogleSearchRetrieval+ { googleSearchRetrievalDynamicRetrievalConfig = Nothing+ }++-- ** GroundingAttribution++{- | GroundingAttribution+Attribution for a source that contributed to an answer.+-}+data GroundingAttribution = GroundingAttribution+ { groundingAttributionSourceId :: !(Maybe AttributionSourceId)+ -- ^ /ReadOnly/ "sourceId" - Output only. Identifier for the source contributing to this attribution.+ , groundingAttributionContent :: !(Maybe Content)+ -- ^ "content" - Grounding source content that makes up this attribution.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GroundingAttribution+instance A.FromJSON GroundingAttribution where+ parseJSON = A.withObject "GroundingAttribution" $ \o ->+ GroundingAttribution+ <$> (o .:? "sourceId")+ <*> (o .:? "content")++-- | ToJSON GroundingAttribution+instance A.ToJSON GroundingAttribution where+ toJSON GroundingAttribution {..} =+ _omitNulls+ [ "sourceId" .= groundingAttributionSourceId+ , "content" .= groundingAttributionContent+ ]++-- | Construct a value of type 'GroundingAttribution' (by applying it's required fields, if any)+mkGroundingAttribution ::+ GroundingAttribution+mkGroundingAttribution =+ GroundingAttribution+ { groundingAttributionSourceId = Nothing+ , groundingAttributionContent = Nothing+ }++-- ** GroundingChunk++{- | GroundingChunk+Grounding chunk.+-}+data GroundingChunk = GroundingChunk+ { groundingChunkWeb :: !(Maybe Web)+ -- ^ "web" - Grounding chunk from the web.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GroundingChunk+instance A.FromJSON GroundingChunk where+ parseJSON = A.withObject "GroundingChunk" $ \o ->+ GroundingChunk+ <$> (o .:? "web")++-- | ToJSON GroundingChunk+instance A.ToJSON GroundingChunk where+ toJSON GroundingChunk {..} =+ _omitNulls+ [ "web" .= groundingChunkWeb+ ]++-- | Construct a value of type 'GroundingChunk' (by applying it's required fields, if any)+mkGroundingChunk ::+ GroundingChunk+mkGroundingChunk =+ GroundingChunk+ { groundingChunkWeb = Nothing+ }++-- ** GroundingMetadata++{- | GroundingMetadata+Metadata returned to client when grounding is enabled.+-}+data GroundingMetadata = GroundingMetadata+ { groundingMetadataRetrievalMetadata :: !(Maybe RetrievalMetadata)+ -- ^ "retrievalMetadata" - Metadata related to retrieval in the grounding flow.+ , groundingMetadataWebSearchQueries :: !(Maybe [Text])+ -- ^ "webSearchQueries" - Web search queries for the following-up web search.+ , groundingMetadataGroundingChunks :: !(Maybe [GroundingChunk])+ -- ^ "groundingChunks" - List of supporting references retrieved from specified grounding source.+ , groundingMetadataSearchEntryPoint :: !(Maybe SearchEntryPoint)+ -- ^ "searchEntryPoint" - Optional. Google search entry for the following-up web searches.+ , groundingMetadataGroundingSupports :: !(Maybe [GroundingSupport])+ -- ^ "groundingSupports" - List of grounding support.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GroundingMetadata+instance A.FromJSON GroundingMetadata where+ parseJSON = A.withObject "GroundingMetadata" $ \o ->+ GroundingMetadata+ <$> (o .:? "retrievalMetadata")+ <*> (o .:? "webSearchQueries")+ <*> (o .:? "groundingChunks")+ <*> (o .:? "searchEntryPoint")+ <*> (o .:? "groundingSupports")++-- | ToJSON GroundingMetadata+instance A.ToJSON GroundingMetadata where+ toJSON GroundingMetadata {..} =+ _omitNulls+ [ "retrievalMetadata" .= groundingMetadataRetrievalMetadata+ , "webSearchQueries" .= groundingMetadataWebSearchQueries+ , "groundingChunks" .= groundingMetadataGroundingChunks+ , "searchEntryPoint" .= groundingMetadataSearchEntryPoint+ , "groundingSupports" .= groundingMetadataGroundingSupports+ ]++-- | Construct a value of type 'GroundingMetadata' (by applying it's required fields, if any)+mkGroundingMetadata ::+ GroundingMetadata+mkGroundingMetadata =+ GroundingMetadata+ { groundingMetadataRetrievalMetadata = Nothing+ , groundingMetadataWebSearchQueries = Nothing+ , groundingMetadataGroundingChunks = Nothing+ , groundingMetadataSearchEntryPoint = Nothing+ , groundingMetadataGroundingSupports = Nothing+ }++-- ** GroundingPassage++{- | GroundingPassage+Passage included inline with a grounding configuration.+-}+data GroundingPassage = GroundingPassage+ { groundingPassageContent :: !(Maybe Content)+ -- ^ "content" - Content of the passage.+ , groundingPassageId :: !(Maybe Text)+ -- ^ "id" - Identifier for the passage for attributing this passage in grounded answers.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GroundingPassage+instance A.FromJSON GroundingPassage where+ parseJSON = A.withObject "GroundingPassage" $ \o ->+ GroundingPassage+ <$> (o .:? "content")+ <*> (o .:? "id")++-- | ToJSON GroundingPassage+instance A.ToJSON GroundingPassage where+ toJSON GroundingPassage {..} =+ _omitNulls+ [ "content" .= groundingPassageContent+ , "id" .= groundingPassageId+ ]++-- | Construct a value of type 'GroundingPassage' (by applying it's required fields, if any)+mkGroundingPassage ::+ GroundingPassage+mkGroundingPassage =+ GroundingPassage+ { groundingPassageContent = Nothing+ , groundingPassageId = Nothing+ }++-- ** GroundingPassageId++{- | GroundingPassageId+Identifier for a part within a `GroundingPassage`.+-}+data GroundingPassageId = GroundingPassageId+ { groundingPassageIdPassageId :: !(Maybe Text)+ -- ^ /ReadOnly/ "passageId" - Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`.+ , groundingPassageIdPartIndex :: !(Maybe Int)+ -- ^ /ReadOnly/ "partIndex" - Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GroundingPassageId+instance A.FromJSON GroundingPassageId where+ parseJSON = A.withObject "GroundingPassageId" $ \o ->+ GroundingPassageId+ <$> (o .:? "passageId")+ <*> (o .:? "partIndex")++-- | ToJSON GroundingPassageId+instance A.ToJSON GroundingPassageId where+ toJSON GroundingPassageId {..} =+ _omitNulls+ [ "passageId" .= groundingPassageIdPassageId+ , "partIndex" .= groundingPassageIdPartIndex+ ]++-- | Construct a value of type 'GroundingPassageId' (by applying it's required fields, if any)+mkGroundingPassageId ::+ GroundingPassageId+mkGroundingPassageId =+ GroundingPassageId+ { groundingPassageIdPassageId = Nothing+ , groundingPassageIdPartIndex = Nothing+ }++-- ** GroundingPassages++{- | GroundingPassages+A repeated list of passages.+-}+data GroundingPassages = GroundingPassages+ { groundingPassagesPassages :: !(Maybe [GroundingPassage])+ -- ^ "passages" - List of passages.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GroundingPassages+instance A.FromJSON GroundingPassages where+ parseJSON = A.withObject "GroundingPassages" $ \o ->+ GroundingPassages+ <$> (o .:? "passages")++-- | ToJSON GroundingPassages+instance A.ToJSON GroundingPassages where+ toJSON GroundingPassages {..} =+ _omitNulls+ [ "passages" .= groundingPassagesPassages+ ]++-- | Construct a value of type 'GroundingPassages' (by applying it's required fields, if any)+mkGroundingPassages ::+ GroundingPassages+mkGroundingPassages =+ GroundingPassages+ { groundingPassagesPassages = Nothing+ }++-- ** GroundingSupport++{- | GroundingSupport+Grounding support.+-}+data GroundingSupport = GroundingSupport+ { groundingSupportConfidenceScores :: !(Maybe [Float])+ -- ^ "confidenceScores" - Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.+ , groundingSupportGroundingChunkIndices :: !(Maybe [Int])+ -- ^ "groundingChunkIndices" - A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.+ , groundingSupportSegment :: !(Maybe Segment)+ -- ^ "segment" - Segment of the content this support belongs to.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON GroundingSupport+instance A.FromJSON GroundingSupport where+ parseJSON = A.withObject "GroundingSupport" $ \o ->+ GroundingSupport+ <$> (o .:? "confidenceScores")+ <*> (o .:? "groundingChunkIndices")+ <*> (o .:? "segment")++-- | ToJSON GroundingSupport+instance A.ToJSON GroundingSupport where+ toJSON GroundingSupport {..} =+ _omitNulls+ [ "confidenceScores" .= groundingSupportConfidenceScores+ , "groundingChunkIndices" .= groundingSupportGroundingChunkIndices+ , "segment" .= groundingSupportSegment+ ]++-- | Construct a value of type 'GroundingSupport' (by applying it's required fields, if any)+mkGroundingSupport ::+ GroundingSupport+mkGroundingSupport =+ GroundingSupport+ { groundingSupportConfidenceScores = Nothing+ , groundingSupportGroundingChunkIndices = Nothing+ , groundingSupportSegment = Nothing+ }++-- ** Hyperparameters++{- | Hyperparameters+Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance+-}+data Hyperparameters = Hyperparameters+ { hyperparametersEpochCount :: !(Maybe Int)+ -- ^ "epochCount" - Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used.+ , hyperparametersLearningRate :: !(Maybe Float)+ -- ^ "learningRate" - Optional. Immutable. The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples.+ , hyperparametersLearningRateMultiplier :: !(Maybe Float)+ -- ^ "learningRateMultiplier" - Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used.+ , hyperparametersBatchSize :: !(Maybe Int)+ -- ^ "batchSize" - Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Hyperparameters+instance A.FromJSON Hyperparameters where+ parseJSON = A.withObject "Hyperparameters" $ \o ->+ Hyperparameters+ <$> (o .:? "epochCount")+ <*> (o .:? "learningRate")+ <*> (o .:? "learningRateMultiplier")+ <*> (o .:? "batchSize")++-- | ToJSON Hyperparameters+instance A.ToJSON Hyperparameters where+ toJSON Hyperparameters {..} =+ _omitNulls+ [ "epochCount" .= hyperparametersEpochCount+ , "learningRate" .= hyperparametersLearningRate+ , "learningRateMultiplier" .= hyperparametersLearningRateMultiplier+ , "batchSize" .= hyperparametersBatchSize+ ]++-- | Construct a value of type 'Hyperparameters' (by applying it's required fields, if any)+mkHyperparameters ::+ Hyperparameters+mkHyperparameters =+ Hyperparameters+ { hyperparametersEpochCount = Nothing+ , hyperparametersLearningRate = Nothing+ , hyperparametersLearningRateMultiplier = Nothing+ , hyperparametersBatchSize = Nothing+ }++-- ** InputFeedback++{- | InputFeedback+Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question.+-}+data InputFeedback = InputFeedback+ { inputFeedbackSafetyRatings :: !(Maybe [SafetyRating])+ -- ^ "safetyRatings" - Ratings for safety of the input. There is at most one rating per category.+ , inputFeedbackBlockReason :: !(Maybe E'BlockReason2)+ -- ^ "blockReason" - Optional. If set, the input was blocked and no candidates are returned. Rephrase the input.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON InputFeedback+instance A.FromJSON InputFeedback where+ parseJSON = A.withObject "InputFeedback" $ \o ->+ InputFeedback+ <$> (o .:? "safetyRatings")+ <*> (o .:? "blockReason")++-- | ToJSON InputFeedback+instance A.ToJSON InputFeedback where+ toJSON InputFeedback {..} =+ _omitNulls+ [ "safetyRatings" .= inputFeedbackSafetyRatings+ , "blockReason" .= inputFeedbackBlockReason+ ]++-- | Construct a value of type 'InputFeedback' (by applying it's required fields, if any)+mkInputFeedback ::+ InputFeedback+mkInputFeedback =+ InputFeedback+ { inputFeedbackSafetyRatings = Nothing+ , inputFeedbackBlockReason = Nothing+ }++-- ** Interval++{- | Interval+Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.+-}+data Interval = Interval+ { intervalStartTime :: !(Maybe DateTime)+ -- ^ "startTime" - Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.+ , intervalEndTime :: !(Maybe DateTime)+ -- ^ "endTime" - Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Interval+instance A.FromJSON Interval where+ parseJSON = A.withObject "Interval" $ \o ->+ Interval+ <$> (o .:? "startTime")+ <*> (o .:? "endTime")++-- | ToJSON Interval+instance A.ToJSON Interval where+ toJSON Interval {..} =+ _omitNulls+ [ "startTime" .= intervalStartTime+ , "endTime" .= intervalEndTime+ ]++-- | Construct a value of type 'Interval' (by applying it's required fields, if any)+mkInterval ::+ Interval+mkInterval =+ Interval+ { intervalStartTime = Nothing+ , intervalEndTime = Nothing+ }++-- ** ListCachedContentsResponse++{- | ListCachedContentsResponse+Response with CachedContents list.+-}+data ListCachedContentsResponse = ListCachedContentsResponse+ { listCachedContentsResponseNextPageToken :: !(Maybe Text)+ -- ^ "nextPageToken" - A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.+ , listCachedContentsResponseCachedContents :: !(Maybe [CachedContent])+ -- ^ "cachedContents" - List of cached contents.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ListCachedContentsResponse+instance A.FromJSON ListCachedContentsResponse where+ parseJSON = A.withObject "ListCachedContentsResponse" $ \o ->+ ListCachedContentsResponse+ <$> (o .:? "nextPageToken")+ <*> (o .:? "cachedContents")++-- | ToJSON ListCachedContentsResponse+instance A.ToJSON ListCachedContentsResponse where+ toJSON ListCachedContentsResponse {..} =+ _omitNulls+ [ "nextPageToken" .= listCachedContentsResponseNextPageToken+ , "cachedContents" .= listCachedContentsResponseCachedContents+ ]++-- | Construct a value of type 'ListCachedContentsResponse' (by applying it's required fields, if any)+mkListCachedContentsResponse ::+ ListCachedContentsResponse+mkListCachedContentsResponse =+ ListCachedContentsResponse+ { listCachedContentsResponseNextPageToken = Nothing+ , listCachedContentsResponseCachedContents = Nothing+ }++-- ** ListChunksResponse++{- | ListChunksResponse+Response from `ListChunks` containing a paginated list of `Chunk`s. The `Chunk`s are sorted by ascending `chunk.create_time`.+-}+data ListChunksResponse = ListChunksResponse+ { listChunksResponseNextPageToken :: !(Maybe Text)+ -- ^ "nextPageToken" - A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.+ , listChunksResponseChunks :: !(Maybe [Chunk])+ -- ^ "chunks" - The returned `Chunk`s.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ListChunksResponse+instance A.FromJSON ListChunksResponse where+ parseJSON = A.withObject "ListChunksResponse" $ \o ->+ ListChunksResponse+ <$> (o .:? "nextPageToken")+ <*> (o .:? "chunks")++-- | ToJSON ListChunksResponse+instance A.ToJSON ListChunksResponse where+ toJSON ListChunksResponse {..} =+ _omitNulls+ [ "nextPageToken" .= listChunksResponseNextPageToken+ , "chunks" .= listChunksResponseChunks+ ]++-- | Construct a value of type 'ListChunksResponse' (by applying it's required fields, if any)+mkListChunksResponse ::+ ListChunksResponse+mkListChunksResponse =+ ListChunksResponse+ { listChunksResponseNextPageToken = Nothing+ , listChunksResponseChunks = Nothing+ }++-- ** ListCorporaResponse++{- | ListCorporaResponse+Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.+-}+data ListCorporaResponse = ListCorporaResponse+ { listCorporaResponseCorpora :: !(Maybe [Corpus])+ -- ^ "corpora" - The returned corpora.+ , listCorporaResponseNextPageToken :: !(Maybe Text)+ -- ^ "nextPageToken" - A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ListCorporaResponse+instance A.FromJSON ListCorporaResponse where+ parseJSON = A.withObject "ListCorporaResponse" $ \o ->+ ListCorporaResponse+ <$> (o .:? "corpora")+ <*> (o .:? "nextPageToken")++-- | ToJSON ListCorporaResponse+instance A.ToJSON ListCorporaResponse where+ toJSON ListCorporaResponse {..} =+ _omitNulls+ [ "corpora" .= listCorporaResponseCorpora+ , "nextPageToken" .= listCorporaResponseNextPageToken+ ]++-- | Construct a value of type 'ListCorporaResponse' (by applying it's required fields, if any)+mkListCorporaResponse ::+ ListCorporaResponse+mkListCorporaResponse =+ ListCorporaResponse+ { listCorporaResponseCorpora = Nothing+ , listCorporaResponseNextPageToken = Nothing+ }++-- ** ListDocumentsResponse++{- | ListDocumentsResponse+Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.+-}+data ListDocumentsResponse = ListDocumentsResponse+ { listDocumentsResponseNextPageToken :: !(Maybe Text)+ -- ^ "nextPageToken" - A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.+ , listDocumentsResponseDocuments :: !(Maybe [Document])+ -- ^ "documents" - The returned `Document`s.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ListDocumentsResponse+instance A.FromJSON ListDocumentsResponse where+ parseJSON = A.withObject "ListDocumentsResponse" $ \o ->+ ListDocumentsResponse+ <$> (o .:? "nextPageToken")+ <*> (o .:? "documents")++-- | ToJSON ListDocumentsResponse+instance A.ToJSON ListDocumentsResponse where+ toJSON ListDocumentsResponse {..} =+ _omitNulls+ [ "nextPageToken" .= listDocumentsResponseNextPageToken+ , "documents" .= listDocumentsResponseDocuments+ ]++-- | Construct a value of type 'ListDocumentsResponse' (by applying it's required fields, if any)+mkListDocumentsResponse ::+ ListDocumentsResponse+mkListDocumentsResponse =+ ListDocumentsResponse+ { listDocumentsResponseNextPageToken = Nothing+ , listDocumentsResponseDocuments = Nothing+ }++-- ** ListFilesResponse++{- | ListFilesResponse+Response for `ListFiles`.+-}+data ListFilesResponse = ListFilesResponse+ { listFilesResponseNextPageToken :: !(Maybe Text)+ -- ^ "nextPageToken" - A token that can be sent as a `page_token` into a subsequent `ListFiles` call.+ , listFilesResponseFiles :: !(Maybe [File])+ -- ^ "files" - The list of `File`s.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ListFilesResponse+instance A.FromJSON ListFilesResponse where+ parseJSON = A.withObject "ListFilesResponse" $ \o ->+ ListFilesResponse+ <$> (o .:? "nextPageToken")+ <*> (o .:? "files")++-- | ToJSON ListFilesResponse+instance A.ToJSON ListFilesResponse where+ toJSON ListFilesResponse {..} =+ _omitNulls+ [ "nextPageToken" .= listFilesResponseNextPageToken+ , "files" .= listFilesResponseFiles+ ]++-- | Construct a value of type 'ListFilesResponse' (by applying it's required fields, if any)+mkListFilesResponse ::+ ListFilesResponse+mkListFilesResponse =+ ListFilesResponse+ { listFilesResponseNextPageToken = Nothing+ , listFilesResponseFiles = Nothing+ }++-- ** ListGeneratedFilesResponse++{- | ListGeneratedFilesResponse+Response for `ListGeneratedFiles`.+-}+data ListGeneratedFilesResponse = ListGeneratedFilesResponse+ { listGeneratedFilesResponseNextPageToken :: !(Maybe Text)+ -- ^ "nextPageToken" - A token that can be sent as a `page_token` into a subsequent `ListGeneratedFiles` call.+ , listGeneratedFilesResponseGeneratedFiles :: !(Maybe [GeneratedFile])+ -- ^ "generatedFiles" - The list of `GeneratedFile`s.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ListGeneratedFilesResponse+instance A.FromJSON ListGeneratedFilesResponse where+ parseJSON = A.withObject "ListGeneratedFilesResponse" $ \o ->+ ListGeneratedFilesResponse+ <$> (o .:? "nextPageToken")+ <*> (o .:? "generatedFiles")++-- | ToJSON ListGeneratedFilesResponse+instance A.ToJSON ListGeneratedFilesResponse where+ toJSON ListGeneratedFilesResponse {..} =+ _omitNulls+ [ "nextPageToken" .= listGeneratedFilesResponseNextPageToken+ , "generatedFiles" .= listGeneratedFilesResponseGeneratedFiles+ ]++-- | Construct a value of type 'ListGeneratedFilesResponse' (by applying it's required fields, if any)+mkListGeneratedFilesResponse ::+ ListGeneratedFilesResponse+mkListGeneratedFilesResponse =+ ListGeneratedFilesResponse+ { listGeneratedFilesResponseNextPageToken = Nothing+ , listGeneratedFilesResponseGeneratedFiles = Nothing+ }++-- ** ListModelsResponse++{- | ListModelsResponse+Response from `ListModel` containing a paginated list of Models.+-}+data ListModelsResponse = ListModelsResponse+ { listModelsResponseModels :: !(Maybe [Model])+ -- ^ "models" - The returned Models.+ , listModelsResponseNextPageToken :: !(Maybe Text)+ -- ^ "nextPageToken" - A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ListModelsResponse+instance A.FromJSON ListModelsResponse where+ parseJSON = A.withObject "ListModelsResponse" $ \o ->+ ListModelsResponse+ <$> (o .:? "models")+ <*> (o .:? "nextPageToken")++-- | ToJSON ListModelsResponse+instance A.ToJSON ListModelsResponse where+ toJSON ListModelsResponse {..} =+ _omitNulls+ [ "models" .= listModelsResponseModels+ , "nextPageToken" .= listModelsResponseNextPageToken+ ]++-- | Construct a value of type 'ListModelsResponse' (by applying it's required fields, if any)+mkListModelsResponse ::+ ListModelsResponse+mkListModelsResponse =+ ListModelsResponse+ { listModelsResponseModels = Nothing+ , listModelsResponseNextPageToken = Nothing+ }++-- ** ListOperationsResponse++{- | ListOperationsResponse+The response message for Operations.ListOperations.+-}+data ListOperationsResponse = ListOperationsResponse+ { listOperationsResponseNextPageToken :: !(Maybe Text)+ -- ^ "nextPageToken" - The standard List next-page token.+ , listOperationsResponseOperations :: !(Maybe [Operation])+ -- ^ "operations" - A list of operations that matches the specified filter in the request.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ListOperationsResponse+instance A.FromJSON ListOperationsResponse where+ parseJSON = A.withObject "ListOperationsResponse" $ \o ->+ ListOperationsResponse+ <$> (o .:? "nextPageToken")+ <*> (o .:? "operations")++-- | ToJSON ListOperationsResponse+instance A.ToJSON ListOperationsResponse where+ toJSON ListOperationsResponse {..} =+ _omitNulls+ [ "nextPageToken" .= listOperationsResponseNextPageToken+ , "operations" .= listOperationsResponseOperations+ ]++-- | Construct a value of type 'ListOperationsResponse' (by applying it's required fields, if any)+mkListOperationsResponse ::+ ListOperationsResponse+mkListOperationsResponse =+ ListOperationsResponse+ { listOperationsResponseNextPageToken = Nothing+ , listOperationsResponseOperations = Nothing+ }++-- ** ListPermissionsResponse++{- | ListPermissionsResponse+Response from `ListPermissions` containing a paginated list of permissions.+-}+data ListPermissionsResponse = ListPermissionsResponse+ { listPermissionsResponsePermissions :: !(Maybe [Permission])+ -- ^ "permissions" - Returned permissions.+ , listPermissionsResponseNextPageToken :: !(Maybe Text)+ -- ^ "nextPageToken" - A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ListPermissionsResponse+instance A.FromJSON ListPermissionsResponse where+ parseJSON = A.withObject "ListPermissionsResponse" $ \o ->+ ListPermissionsResponse+ <$> (o .:? "permissions")+ <*> (o .:? "nextPageToken")++-- | ToJSON ListPermissionsResponse+instance A.ToJSON ListPermissionsResponse where+ toJSON ListPermissionsResponse {..} =+ _omitNulls+ [ "permissions" .= listPermissionsResponsePermissions+ , "nextPageToken" .= listPermissionsResponseNextPageToken+ ]++-- | Construct a value of type 'ListPermissionsResponse' (by applying it's required fields, if any)+mkListPermissionsResponse ::+ ListPermissionsResponse+mkListPermissionsResponse =+ ListPermissionsResponse+ { listPermissionsResponsePermissions = Nothing+ , listPermissionsResponseNextPageToken = Nothing+ }++-- ** ListTunedModelsResponse++{- | ListTunedModelsResponse+Response from `ListTunedModels` containing a paginated list of Models.+-}+data ListTunedModelsResponse = ListTunedModelsResponse+ { listTunedModelsResponseNextPageToken :: !(Maybe Text)+ -- ^ "nextPageToken" - A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.+ , listTunedModelsResponseTunedModels :: !(Maybe [TunedModel])+ -- ^ "tunedModels" - The returned Models.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ListTunedModelsResponse+instance A.FromJSON ListTunedModelsResponse where+ parseJSON = A.withObject "ListTunedModelsResponse" $ \o ->+ ListTunedModelsResponse+ <$> (o .:? "nextPageToken")+ <*> (o .:? "tunedModels")++-- | ToJSON ListTunedModelsResponse+instance A.ToJSON ListTunedModelsResponse where+ toJSON ListTunedModelsResponse {..} =+ _omitNulls+ [ "nextPageToken" .= listTunedModelsResponseNextPageToken+ , "tunedModels" .= listTunedModelsResponseTunedModels+ ]++-- | Construct a value of type 'ListTunedModelsResponse' (by applying it's required fields, if any)+mkListTunedModelsResponse ::+ ListTunedModelsResponse+mkListTunedModelsResponse =+ ListTunedModelsResponse+ { listTunedModelsResponseNextPageToken = Nothing+ , listTunedModelsResponseTunedModels = Nothing+ }++-- ** LogprobsResult++{- | LogprobsResult+Logprobs Result+-}+data LogprobsResult = LogprobsResult+ { logprobsResultChosenCandidates :: !(Maybe [LogprobsResultCandidate])+ -- ^ "chosenCandidates" - Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.+ , logprobsResultTopCandidates :: !(Maybe [TopCandidates])+ -- ^ "topCandidates" - Length = total number of decoding steps.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON LogprobsResult+instance A.FromJSON LogprobsResult where+ parseJSON = A.withObject "LogprobsResult" $ \o ->+ LogprobsResult+ <$> (o .:? "chosenCandidates")+ <*> (o .:? "topCandidates")++-- | ToJSON LogprobsResult+instance A.ToJSON LogprobsResult where+ toJSON LogprobsResult {..} =+ _omitNulls+ [ "chosenCandidates" .= logprobsResultChosenCandidates+ , "topCandidates" .= logprobsResultTopCandidates+ ]++-- | Construct a value of type 'LogprobsResult' (by applying it's required fields, if any)+mkLogprobsResult ::+ LogprobsResult+mkLogprobsResult =+ LogprobsResult+ { logprobsResultChosenCandidates = Nothing+ , logprobsResultTopCandidates = Nothing+ }++-- ** LogprobsResultCandidate++{- | LogprobsResultCandidate+Candidate for the logprobs token and score.+-}+data LogprobsResultCandidate = LogprobsResultCandidate+ { logprobsResultCandidateLogProbability :: !(Maybe Float)+ -- ^ "logProbability" - The candidate's log probability.+ , logprobsResultCandidateTokenId :: !(Maybe Int)+ -- ^ "tokenId" - The candidate’s token id value.+ , logprobsResultCandidateToken :: !(Maybe Text)+ -- ^ "token" - The candidate’s token string value.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON LogprobsResultCandidate+instance A.FromJSON LogprobsResultCandidate where+ parseJSON = A.withObject "LogprobsResultCandidate" $ \o ->+ LogprobsResultCandidate+ <$> (o .:? "logProbability")+ <*> (o .:? "tokenId")+ <*> (o .:? "token")++-- | ToJSON LogprobsResultCandidate+instance A.ToJSON LogprobsResultCandidate where+ toJSON LogprobsResultCandidate {..} =+ _omitNulls+ [ "logProbability" .= logprobsResultCandidateLogProbability+ , "tokenId" .= logprobsResultCandidateTokenId+ , "token" .= logprobsResultCandidateToken+ ]++-- | Construct a value of type 'LogprobsResultCandidate' (by applying it's required fields, if any)+mkLogprobsResultCandidate ::+ LogprobsResultCandidate+mkLogprobsResultCandidate =+ LogprobsResultCandidate+ { logprobsResultCandidateLogProbability = Nothing+ , logprobsResultCandidateTokenId = Nothing+ , logprobsResultCandidateToken = Nothing+ }++-- ** Media++{- | Media+A proto encapsulate various type of media.+-}+data Media = Media+ { mediaVideo :: !(Maybe Video)+ -- ^ "video" - Video as the only one for now. This is mimicking Vertex proto.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Media+instance A.FromJSON Media where+ parseJSON = A.withObject "Media" $ \o ->+ Media+ <$> (o .:? "video")++-- | ToJSON Media+instance A.ToJSON Media where+ toJSON Media {..} =+ _omitNulls+ [ "video" .= mediaVideo+ ]++-- | Construct a value of type 'Media' (by applying it's required fields, if any)+mkMedia ::+ Media+mkMedia =+ Media+ { mediaVideo = Nothing+ }++-- ** Message++{- | Message+The base unit of structured text. A `Message` includes an `author` and the `content` of the `Message`. The `author` is used to tag messages when they are fed to the model as text.+-}+data Message = Message+ { messageCitationMetadata :: !(Maybe CitationMetadata)+ -- ^ /ReadOnly/ "citationMetadata" - Output only. Citation information for model-generated `content` in this `Message`. If this `Message` was generated as output from the model, this field may be populated with attribution information for any text included in the `content`. This field is used only on output.+ , messageAuthor :: !(Maybe Text)+ -- ^ "author" - Optional. The author of this Message. This serves as a key for tagging the content of this Message when it is fed to the model as text. The author can be any alphanumeric string.+ , messageContent :: !(Text)+ -- ^ /Required/ "content" - Required. The text content of the structured `Message`.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Message+instance A.FromJSON Message where+ parseJSON = A.withObject "Message" $ \o ->+ Message+ <$> (o .:? "citationMetadata")+ <*> (o .:? "author")+ <*> (o .: "content")++-- | ToJSON Message+instance A.ToJSON Message where+ toJSON Message {..} =+ _omitNulls+ [ "citationMetadata" .= messageCitationMetadata+ , "author" .= messageAuthor+ , "content" .= messageContent+ ]++-- | Construct a value of type 'Message' (by applying it's required fields, if any)+mkMessage ::+ -- | 'messageContent': Required. The text content of the structured `Message`.+ Text ->+ Message+mkMessage messageContent =+ Message+ { messageCitationMetadata = Nothing+ , messageAuthor = Nothing+ , messageContent+ }++-- ** MessagePrompt++{- | MessagePrompt+All of the structured input text passed to the model as a prompt. A `MessagePrompt` contains a structured set of fields that provide context for the conversation, examples of user input/model output message pairs that prime the model to respond in different ways, and the conversation history or list of messages representing the alternating turns of the conversation between the user and the model.+-}+data MessagePrompt = MessagePrompt+ { messagePromptContext :: !(Maybe Text)+ -- ^ "context" - Optional. Text that should be provided to the model first to ground the response. If not empty, this `context` will be given to the model first before the `examples` and `messages`. When using a `context` be sure to provide it with every request to maintain continuity. This field can be a description of your prompt to the model to help provide context and guide the responses. Examples: \"Translate the phrase from English to French.\" or \"Given a statement, classify the sentiment as happy, sad or neutral.\" Anything included in this field will take precedence over message history if the total input size exceeds the model's `input_token_limit` and the input request is truncated.+ , messagePromptMessages :: !([Message])+ -- ^ /Required/ "messages" - Required. A snapshot of the recent conversation history sorted chronologically. Turns alternate between two authors. If the total input size exceeds the model's `input_token_limit` the input will be truncated: The oldest items will be dropped from `messages`.+ , messagePromptExamples :: !(Maybe [Example])+ -- ^ "examples" - Optional. Examples of what the model should generate. This includes both user input and the response that the model should emulate. These `examples` are treated identically to conversation messages except that they take precedence over the history in `messages`: If the total input size exceeds the model's `input_token_limit` the input will be truncated. Items will be dropped from `messages` before `examples`.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON MessagePrompt+instance A.FromJSON MessagePrompt where+ parseJSON = A.withObject "MessagePrompt" $ \o ->+ MessagePrompt+ <$> (o .:? "context")+ <*> (o .: "messages")+ <*> (o .:? "examples")++-- | ToJSON MessagePrompt+instance A.ToJSON MessagePrompt where+ toJSON MessagePrompt {..} =+ _omitNulls+ [ "context" .= messagePromptContext+ , "messages" .= messagePromptMessages+ , "examples" .= messagePromptExamples+ ]++-- | Construct a value of type 'MessagePrompt' (by applying it's required fields, if any)+mkMessagePrompt ::+ -- | 'messagePromptMessages': Required. A snapshot of the recent conversation history sorted chronologically. Turns alternate between two authors. If the total input size exceeds the model's `input_token_limit` the input will be truncated: The oldest items will be dropped from `messages`.+ [Message] ->+ MessagePrompt+mkMessagePrompt messagePromptMessages =+ MessagePrompt+ { messagePromptContext = Nothing+ , messagePromptMessages+ , messagePromptExamples = Nothing+ }++-- ** MetadataFilter++{- | MetadataFilter+User provided filter to limit retrieval based on `Chunk` or `Document` level metadata values. Example (genre = drama OR genre = action): key = \"document.custom_metadata.genre\" conditions = [{string_value = \"drama\", operation = EQUAL}, {string_value = \"action\", operation = EQUAL}]+-}+data MetadataFilter = MetadataFilter+ { metadataFilterConditions :: !([Condition])+ -- ^ /Required/ "conditions" - Required. The `Condition`s for the given key that will trigger this filter. Multiple `Condition`s are joined by logical ORs.+ , metadataFilterKey :: !(Text)+ -- ^ /Required/ "key" - Required. The key of the metadata to filter on.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON MetadataFilter+instance A.FromJSON MetadataFilter where+ parseJSON = A.withObject "MetadataFilter" $ \o ->+ MetadataFilter+ <$> (o .: "conditions")+ <*> (o .: "key")++-- | ToJSON MetadataFilter+instance A.ToJSON MetadataFilter where+ toJSON MetadataFilter {..} =+ _omitNulls+ [ "conditions" .= metadataFilterConditions+ , "key" .= metadataFilterKey+ ]++-- | Construct a value of type 'MetadataFilter' (by applying it's required fields, if any)+mkMetadataFilter ::+ -- | 'metadataFilterConditions': Required. The `Condition`s for the given key that will trigger this filter. Multiple `Condition`s are joined by logical ORs.+ [Condition] ->+ -- | 'metadataFilterKey': Required. The key of the metadata to filter on.+ Text ->+ MetadataFilter+mkMetadataFilter metadataFilterConditions metadataFilterKey =+ MetadataFilter+ { metadataFilterConditions+ , metadataFilterKey+ }++-- ** ModalityTokenCount++{- | ModalityTokenCount+Represents token counting info for a single modality.+-}+data ModalityTokenCount = ModalityTokenCount+ { modalityTokenCountTokenCount :: !(Maybe Int)+ -- ^ "tokenCount" - Number of tokens.+ , modalityTokenCountModality :: !(Maybe Modality)+ -- ^ "modality" - The modality associated with this token count.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ModalityTokenCount+instance A.FromJSON ModalityTokenCount where+ parseJSON = A.withObject "ModalityTokenCount" $ \o ->+ ModalityTokenCount+ <$> (o .:? "tokenCount")+ <*> (o .:? "modality")++-- | ToJSON ModalityTokenCount+instance A.ToJSON ModalityTokenCount where+ toJSON ModalityTokenCount {..} =+ _omitNulls+ [ "tokenCount" .= modalityTokenCountTokenCount+ , "modality" .= modalityTokenCountModality+ ]++-- | Construct a value of type 'ModalityTokenCount' (by applying it's required fields, if any)+mkModalityTokenCount ::+ ModalityTokenCount+mkModalityTokenCount =+ ModalityTokenCount+ { modalityTokenCountTokenCount = Nothing+ , modalityTokenCountModality = Nothing+ }++-- ** Model++{- | Model+Information about a Generative Language Model.+-}+data Model = Model+ { modelTopK :: !(Maybe Int)+ -- ^ "topK" - For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter.+ , modelName :: !(Text)+ -- ^ /Required/ "name" - Required. The resource name of the `Model`. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of: * \"{base_model_id}-{version}\" Examples: * `models/gemini-1.5-flash-001`+ , modelBaseModelId :: !(Text)+ -- ^ /Required/ "baseModelId" - Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash`+ , modelVersion :: !(Text)+ -- ^ /Required/ "version" - Required. The version number of the model. This represents the major version (`1.0` or `1.5`)+ , modelInputTokenLimit :: !(Maybe Int)+ -- ^ "inputTokenLimit" - Maximum number of input tokens allowed for this model.+ , modelTopP :: !(Maybe Float)+ -- ^ "topP" - For [Nucleus sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model.+ , modelSupportedGenerationMethods :: !(Maybe [Text])+ -- ^ "supportedGenerationMethods" - The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`.+ , modelTemperature :: !(Maybe Float)+ -- ^ "temperature" - Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.+ , modelDisplayName :: !(Maybe Text)+ -- ^ "displayName" - The human-readable name of the model. E.g. \"Gemini 1.5 Flash\". The name can be up to 128 characters long and can consist of any UTF-8 characters.+ , modelDescription :: !(Maybe Text)+ -- ^ "description" - A short description of the model.+ , modelMaxTemperature :: !(Maybe Float)+ -- ^ "maxTemperature" - The maximum temperature this model can use.+ , modelOutputTokenLimit :: !(Maybe Int)+ -- ^ "outputTokenLimit" - Maximum number of output tokens available for this model.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Model+instance A.FromJSON Model where+ parseJSON = A.withObject "Model" $ \o ->+ Model+ <$> (o .:? "topK")+ <*> (o .: "name")+ <*> (o .: "baseModelId")+ <*> (o .: "version")+ <*> (o .:? "inputTokenLimit")+ <*> (o .:? "topP")+ <*> (o .:? "supportedGenerationMethods")+ <*> (o .:? "temperature")+ <*> (o .:? "displayName")+ <*> (o .:? "description")+ <*> (o .:? "maxTemperature")+ <*> (o .:? "outputTokenLimit")++-- | ToJSON Model+instance A.ToJSON Model where+ toJSON Model {..} =+ _omitNulls+ [ "topK" .= modelTopK+ , "name" .= modelName+ , "baseModelId" .= modelBaseModelId+ , "version" .= modelVersion+ , "inputTokenLimit" .= modelInputTokenLimit+ , "topP" .= modelTopP+ , "supportedGenerationMethods" .= modelSupportedGenerationMethods+ , "temperature" .= modelTemperature+ , "displayName" .= modelDisplayName+ , "description" .= modelDescription+ , "maxTemperature" .= modelMaxTemperature+ , "outputTokenLimit" .= modelOutputTokenLimit+ ]++-- | Construct a value of type 'Model' (by applying it's required fields, if any)+mkModel ::+ -- | 'modelName': Required. The resource name of the `Model`. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of: * \"{base_model_id}-{version}\" Examples: * `models/gemini-1.5-flash-001`+ Text ->+ -- | 'modelBaseModelId': Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash`+ Text ->+ -- | 'modelVersion': Required. The version number of the model. This represents the major version (`1.0` or `1.5`)+ Text ->+ Model+mkModel modelName modelBaseModelId modelVersion =+ Model+ { modelTopK = Nothing+ , modelName+ , modelBaseModelId+ , modelVersion+ , modelInputTokenLimit = Nothing+ , modelTopP = Nothing+ , modelSupportedGenerationMethods = Nothing+ , modelTemperature = Nothing+ , modelDisplayName = Nothing+ , modelDescription = Nothing+ , modelMaxTemperature = Nothing+ , modelOutputTokenLimit = Nothing+ }++-- ** MultiSpeakerVoiceConfig++{- | MultiSpeakerVoiceConfig+The configuration for the multi-speaker setup.+-}+data MultiSpeakerVoiceConfig = MultiSpeakerVoiceConfig+ { multiSpeakerVoiceConfigSpeakerVoiceConfigs :: !([SpeakerVoiceConfig])+ -- ^ /Required/ "speakerVoiceConfigs" - Required. All the enabled speaker voices.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON MultiSpeakerVoiceConfig+instance A.FromJSON MultiSpeakerVoiceConfig where+ parseJSON = A.withObject "MultiSpeakerVoiceConfig" $ \o ->+ MultiSpeakerVoiceConfig+ <$> (o .: "speakerVoiceConfigs")++-- | ToJSON MultiSpeakerVoiceConfig+instance A.ToJSON MultiSpeakerVoiceConfig where+ toJSON MultiSpeakerVoiceConfig {..} =+ _omitNulls+ [ "speakerVoiceConfigs" .= multiSpeakerVoiceConfigSpeakerVoiceConfigs+ ]++-- | Construct a value of type 'MultiSpeakerVoiceConfig' (by applying it's required fields, if any)+mkMultiSpeakerVoiceConfig ::+ -- | 'multiSpeakerVoiceConfigSpeakerVoiceConfigs': Required. All the enabled speaker voices.+ [SpeakerVoiceConfig] ->+ MultiSpeakerVoiceConfig+mkMultiSpeakerVoiceConfig multiSpeakerVoiceConfigSpeakerVoiceConfigs =+ MultiSpeakerVoiceConfig+ { multiSpeakerVoiceConfigSpeakerVoiceConfigs+ }++-- ** Operation++{- | Operation+This resource represents a long-running operation that is the result of a network API call.+-}+data Operation = Operation+ { operationDone :: !(Maybe Bool)+ -- ^ "done" - If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.+ , operationName :: !(Maybe Text)+ -- ^ "name" - The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.+ , operationError :: !(Maybe Status)+ -- ^ "error" - The error result of the operation in case of failure or cancellation.+ , operationMetadata :: !(Maybe (Map.Map String String))+ -- ^ "metadata" - Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.+ , operationResponse :: !(Maybe (Map.Map String String))+ -- ^ "response" - The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Operation+instance A.FromJSON Operation where+ parseJSON = A.withObject "Operation" $ \o ->+ Operation+ <$> (o .:? "done")+ <*> (o .:? "name")+ <*> (o .:? "error")+ <*> (o .:? "metadata")+ <*> (o .:? "response")++-- | ToJSON Operation+instance A.ToJSON Operation where+ toJSON Operation {..} =+ _omitNulls+ [ "done" .= operationDone+ , "name" .= operationName+ , "error" .= operationError+ , "metadata" .= operationMetadata+ , "response" .= operationResponse+ ]++-- | Construct a value of type 'Operation' (by applying it's required fields, if any)+mkOperation ::+ Operation+mkOperation =+ Operation+ { operationDone = Nothing+ , operationName = Nothing+ , operationError = Nothing+ , operationMetadata = Nothing+ , operationResponse = Nothing+ }++-- ** Part++{- | Part+A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.+-}+data Part = Part+ { partInlineData :: !(Maybe Blob)+ -- ^ "inlineData" - Inline media bytes.+ , partFunctionResponse :: !(Maybe FunctionResponse)+ -- ^ "functionResponse" - The result output of a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model.+ , partCodeExecutionResult :: !(Maybe CodeExecutionResult)+ -- ^ "codeExecutionResult" - Result of executing the `ExecutableCode`.+ , partFileData :: !(Maybe FileData)+ -- ^ "fileData" - URI based data.+ , partExecutableCode :: !(Maybe ExecutableCode)+ -- ^ "executableCode" - Code generated by the model that is meant to be executed.+ , partVideoMetadata :: !(Maybe VideoMetadata)+ -- ^ "videoMetadata" - Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.+ , partThought :: !(Maybe Bool)+ -- ^ "thought" - Optional. Indicates if the part is thought from the model.+ , partText :: !(Maybe Text)+ -- ^ "text" - Inline text.+ , partThoughtSignature :: !(Maybe ByteArray)+ -- ^ "thoughtSignature" - Optional. An opaque signature for the thought so it can be reused in subsequent requests.+ , partFunctionCall :: !(Maybe FunctionCall)+ -- ^ "functionCall" - A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Part+instance A.FromJSON Part where+ parseJSON = A.withObject "Part" $ \o ->+ Part+ <$> (o .:? "inlineData")+ <*> (o .:? "functionResponse")+ <*> (o .:? "codeExecutionResult")+ <*> (o .:? "fileData")+ <*> (o .:? "executableCode")+ <*> (o .:? "videoMetadata")+ <*> (o .:? "thought")+ <*> (o .:? "text")+ <*> (o .:? "thoughtSignature")+ <*> (o .:? "functionCall")++-- | ToJSON Part+instance A.ToJSON Part where+ toJSON Part {..} =+ _omitNulls+ [ "inlineData" .= partInlineData+ , "functionResponse" .= partFunctionResponse+ , "codeExecutionResult" .= partCodeExecutionResult+ , "fileData" .= partFileData+ , "executableCode" .= partExecutableCode+ , "videoMetadata" .= partVideoMetadata+ , "thought" .= partThought+ , "text" .= partText+ , "thoughtSignature" .= partThoughtSignature+ , "functionCall" .= partFunctionCall+ ]++-- | Construct a value of type 'Part' (by applying it's required fields, if any)+mkPart ::+ Part+mkPart =+ Part+ { partInlineData = Nothing+ , partFunctionResponse = Nothing+ , partCodeExecutionResult = Nothing+ , partFileData = Nothing+ , partExecutableCode = Nothing+ , partVideoMetadata = Nothing+ , partThought = Nothing+ , partText = Nothing+ , partThoughtSignature = Nothing+ , partFunctionCall = Nothing+ }++-- ** Permission++{- | Permission+Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete+-}+data Permission = Permission+ { permissionName :: !(Maybe Text)+ -- ^ /ReadOnly/ "name" - Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.+ , permissionGranteeType :: !(Maybe E'GranteeType)+ -- ^ "granteeType" - Optional. Immutable. The type of the grantee.+ , permissionRole :: !(E'Role)+ -- ^ /Required/ "role" - Required. The role granted by this permission.+ , permissionEmailAddress :: !(Maybe Text)+ -- ^ "emailAddress" - Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Permission+instance A.FromJSON Permission where+ parseJSON = A.withObject "Permission" $ \o ->+ Permission+ <$> (o .:? "name")+ <*> (o .:? "granteeType")+ <*> (o .: "role")+ <*> (o .:? "emailAddress")++-- | ToJSON Permission+instance A.ToJSON Permission where+ toJSON Permission {..} =+ _omitNulls+ [ "name" .= permissionName+ , "granteeType" .= permissionGranteeType+ , "role" .= permissionRole+ , "emailAddress" .= permissionEmailAddress+ ]++-- | Construct a value of type 'Permission' (by applying it's required fields, if any)+mkPermission ::+ -- | 'permissionRole': Required. The role granted by this permission.+ E'Role ->+ Permission+mkPermission permissionRole =+ Permission+ { permissionName = Nothing+ , permissionGranteeType = Nothing+ , permissionRole+ , permissionEmailAddress = Nothing+ }++-- ** PrebuiltVoiceConfig++{- | PrebuiltVoiceConfig+The configuration for the prebuilt speaker to use.+-}+data PrebuiltVoiceConfig = PrebuiltVoiceConfig+ { prebuiltVoiceConfigVoiceName :: !(Maybe Text)+ -- ^ "voiceName" - The name of the preset voice to use.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON PrebuiltVoiceConfig+instance A.FromJSON PrebuiltVoiceConfig where+ parseJSON = A.withObject "PrebuiltVoiceConfig" $ \o ->+ PrebuiltVoiceConfig+ <$> (o .:? "voiceName")++-- | ToJSON PrebuiltVoiceConfig+instance A.ToJSON PrebuiltVoiceConfig where+ toJSON PrebuiltVoiceConfig {..} =+ _omitNulls+ [ "voiceName" .= prebuiltVoiceConfigVoiceName+ ]++-- | Construct a value of type 'PrebuiltVoiceConfig' (by applying it's required fields, if any)+mkPrebuiltVoiceConfig ::+ PrebuiltVoiceConfig+mkPrebuiltVoiceConfig =+ PrebuiltVoiceConfig+ { prebuiltVoiceConfigVoiceName = Nothing+ }++-- ** PredictLongRunningOperation++{- | PredictLongRunningOperation+This resource represents a long-running operation where metadata and response fields are strongly typed.+-}+data PredictLongRunningOperation = PredictLongRunningOperation+ { predictLongRunningOperationDone :: !(Maybe Bool)+ -- ^ "done" - If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.+ , predictLongRunningOperationName :: !(Maybe Text)+ -- ^ "name" - The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.+ , predictLongRunningOperationError :: !(Maybe Status)+ -- ^ "error" - The error result of the operation in case of failure or cancellation.+ , predictLongRunningOperationMetadata :: !(Maybe A.Value)+ -- ^ "metadata" - Metadata for PredictLongRunning long running operations.+ , predictLongRunningOperationResponse :: !(Maybe PredictLongRunningResponse)+ -- ^ "response"+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON PredictLongRunningOperation+instance A.FromJSON PredictLongRunningOperation where+ parseJSON = A.withObject "PredictLongRunningOperation" $ \o ->+ PredictLongRunningOperation+ <$> (o .:? "done")+ <*> (o .:? "name")+ <*> (o .:? "error")+ <*> (o .:? "metadata")+ <*> (o .:? "response")++-- | ToJSON PredictLongRunningOperation+instance A.ToJSON PredictLongRunningOperation where+ toJSON PredictLongRunningOperation {..} =+ _omitNulls+ [ "done" .= predictLongRunningOperationDone+ , "name" .= predictLongRunningOperationName+ , "error" .= predictLongRunningOperationError+ , "metadata" .= predictLongRunningOperationMetadata+ , "response" .= predictLongRunningOperationResponse+ ]++-- | Construct a value of type 'PredictLongRunningOperation' (by applying it's required fields, if any)+mkPredictLongRunningOperation ::+ PredictLongRunningOperation+mkPredictLongRunningOperation =+ PredictLongRunningOperation+ { predictLongRunningOperationDone = Nothing+ , predictLongRunningOperationName = Nothing+ , predictLongRunningOperationError = Nothing+ , predictLongRunningOperationMetadata = Nothing+ , predictLongRunningOperationResponse = Nothing+ }++-- ** PredictLongRunningRequest++{- | PredictLongRunningRequest+Request message for [PredictionService.PredictLongRunning].+-}+data PredictLongRunningRequest = PredictLongRunningRequest+ { predictLongRunningRequestParameters :: !(Maybe String)+ -- ^ "parameters" - Optional. The parameters that govern the prediction call.+ , predictLongRunningRequestInstances :: !([String])+ -- ^ /Required/ "instances" - Required. The instances that are the input to the prediction call.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON PredictLongRunningRequest+instance A.FromJSON PredictLongRunningRequest where+ parseJSON = A.withObject "PredictLongRunningRequest" $ \o ->+ PredictLongRunningRequest+ <$> (o .:? "parameters")+ <*> (o .: "instances")++-- | ToJSON PredictLongRunningRequest+instance A.ToJSON PredictLongRunningRequest where+ toJSON PredictLongRunningRequest {..} =+ _omitNulls+ [ "parameters" .= predictLongRunningRequestParameters+ , "instances" .= predictLongRunningRequestInstances+ ]++-- | Construct a value of type 'PredictLongRunningRequest' (by applying it's required fields, if any)+mkPredictLongRunningRequest ::+ -- | 'predictLongRunningRequestInstances': Required. The instances that are the input to the prediction call.+ [String] ->+ PredictLongRunningRequest+mkPredictLongRunningRequest predictLongRunningRequestInstances =+ PredictLongRunningRequest+ { predictLongRunningRequestParameters = Nothing+ , predictLongRunningRequestInstances+ }++-- ** PredictLongRunningResponse++{- | PredictLongRunningResponse+Response message for [PredictionService.PredictLongRunning]+-}+data PredictLongRunningResponse = PredictLongRunningResponse+ { predictLongRunningResponseGenerateVideoResponse :: !(Maybe GenerateVideoResponse)+ -- ^ "generateVideoResponse" - The response of the video generation prediction.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON PredictLongRunningResponse+instance A.FromJSON PredictLongRunningResponse where+ parseJSON = A.withObject "PredictLongRunningResponse" $ \o ->+ PredictLongRunningResponse+ <$> (o .:? "generateVideoResponse")++-- | ToJSON PredictLongRunningResponse+instance A.ToJSON PredictLongRunningResponse where+ toJSON PredictLongRunningResponse {..} =+ _omitNulls+ [ "generateVideoResponse" .= predictLongRunningResponseGenerateVideoResponse+ ]++-- | Construct a value of type 'PredictLongRunningResponse' (by applying it's required fields, if any)+mkPredictLongRunningResponse ::+ PredictLongRunningResponse+mkPredictLongRunningResponse =+ PredictLongRunningResponse+ { predictLongRunningResponseGenerateVideoResponse = Nothing+ }++-- ** PredictRequest++{- | PredictRequest+Request message for PredictionService.Predict.+-}+data PredictRequest = PredictRequest+ { predictRequestInstances :: !([String])+ -- ^ /Required/ "instances" - Required. The instances that are the input to the prediction call.+ , predictRequestParameters :: !(Maybe String)+ -- ^ "parameters" - Optional. The parameters that govern the prediction call.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON PredictRequest+instance A.FromJSON PredictRequest where+ parseJSON = A.withObject "PredictRequest" $ \o ->+ PredictRequest+ <$> (o .: "instances")+ <*> (o .:? "parameters")++-- | ToJSON PredictRequest+instance A.ToJSON PredictRequest where+ toJSON PredictRequest {..} =+ _omitNulls+ [ "instances" .= predictRequestInstances+ , "parameters" .= predictRequestParameters+ ]++-- | Construct a value of type 'PredictRequest' (by applying it's required fields, if any)+mkPredictRequest ::+ -- | 'predictRequestInstances': Required. The instances that are the input to the prediction call.+ [String] ->+ PredictRequest+mkPredictRequest predictRequestInstances =+ PredictRequest+ { predictRequestInstances+ , predictRequestParameters = Nothing+ }++-- ** PredictResponse++{- | PredictResponse+Response message for [PredictionService.Predict].+-}+data PredictResponse = PredictResponse+ { predictResponsePredictions :: !(Maybe [String])+ -- ^ "predictions" - The outputs of the prediction call.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON PredictResponse+instance A.FromJSON PredictResponse where+ parseJSON = A.withObject "PredictResponse" $ \o ->+ PredictResponse+ <$> (o .:? "predictions")++-- | ToJSON PredictResponse+instance A.ToJSON PredictResponse where+ toJSON PredictResponse {..} =+ _omitNulls+ [ "predictions" .= predictResponsePredictions+ ]++-- | Construct a value of type 'PredictResponse' (by applying it's required fields, if any)+mkPredictResponse ::+ PredictResponse+mkPredictResponse =+ PredictResponse+ { predictResponsePredictions = Nothing+ }++-- ** PromptFeedback++{- | PromptFeedback+A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.+-}+data PromptFeedback = PromptFeedback+ { promptFeedbackBlockReason :: !(Maybe E'BlockReason)+ -- ^ "blockReason" - Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt.+ , promptFeedbackSafetyRatings :: !(Maybe [SafetyRating])+ -- ^ "safetyRatings" - Ratings for safety of the prompt. There is at most one rating per category.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON PromptFeedback+instance A.FromJSON PromptFeedback where+ parseJSON = A.withObject "PromptFeedback" $ \o ->+ PromptFeedback+ <$> (o .:? "blockReason")+ <*> (o .:? "safetyRatings")++-- | ToJSON PromptFeedback+instance A.ToJSON PromptFeedback where+ toJSON PromptFeedback {..} =+ _omitNulls+ [ "blockReason" .= promptFeedbackBlockReason+ , "safetyRatings" .= promptFeedbackSafetyRatings+ ]++-- | Construct a value of type 'PromptFeedback' (by applying it's required fields, if any)+mkPromptFeedback ::+ PromptFeedback+mkPromptFeedback =+ PromptFeedback+ { promptFeedbackBlockReason = Nothing+ , promptFeedbackSafetyRatings = Nothing+ }++-- ** QueryCorpusRequest++{- | QueryCorpusRequest+Request for querying a `Corpus`.+-}+data QueryCorpusRequest = QueryCorpusRequest+ { queryCorpusRequestMetadataFilters :: !(Maybe [MetadataFilter])+ -- ^ "metadataFilters" - Optional. Filter for `Chunk` and `Document` metadata. Each `MetadataFilter` object should correspond to a unique key. Multiple `MetadataFilter` objects are joined by logical \"AND\"s. Example query at document level: (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action) `MetadataFilter` object list: metadata_filters = [ {key = \"document.custom_metadata.year\" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]}, {key = \"document.custom_metadata.year\" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]}, {key = \"document.custom_metadata.genre\" conditions = [{string_value = \"drama\", operation = EQUAL}, {string_value = \"action\", operation = EQUAL}]}] Example query at chunk level for a numeric range of values: (year > 2015 AND year <= 2020) `MetadataFilter` object list: metadata_filters = [ {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2015, operation = GREATER}]}, {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] Note: \"AND\"s for the same key are only supported for numeric values. String values only support \"OR\"s for the same key.+ , queryCorpusRequestQuery :: !(Text)+ -- ^ /Required/ "query" - Required. Query string to perform semantic search.+ , queryCorpusRequestResultsCount :: !(Maybe Int)+ -- ^ "resultsCount" - Optional. The maximum number of `Chunk`s to return. The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum specified result count is 100.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON QueryCorpusRequest+instance A.FromJSON QueryCorpusRequest where+ parseJSON = A.withObject "QueryCorpusRequest" $ \o ->+ QueryCorpusRequest+ <$> (o .:? "metadataFilters")+ <*> (o .: "query")+ <*> (o .:? "resultsCount")++-- | ToJSON QueryCorpusRequest+instance A.ToJSON QueryCorpusRequest where+ toJSON QueryCorpusRequest {..} =+ _omitNulls+ [ "metadataFilters" .= queryCorpusRequestMetadataFilters+ , "query" .= queryCorpusRequestQuery+ , "resultsCount" .= queryCorpusRequestResultsCount+ ]++-- | Construct a value of type 'QueryCorpusRequest' (by applying it's required fields, if any)+mkQueryCorpusRequest ::+ -- | 'queryCorpusRequestQuery': Required. Query string to perform semantic search.+ Text ->+ QueryCorpusRequest+mkQueryCorpusRequest queryCorpusRequestQuery =+ QueryCorpusRequest+ { queryCorpusRequestMetadataFilters = Nothing+ , queryCorpusRequestQuery+ , queryCorpusRequestResultsCount = Nothing+ }++-- ** QueryCorpusResponse++{- | QueryCorpusResponse+Response from `QueryCorpus` containing a list of relevant chunks.+-}+data QueryCorpusResponse = QueryCorpusResponse+ { queryCorpusResponseRelevantChunks :: !(Maybe [RelevantChunk])+ -- ^ "relevantChunks" - The relevant chunks.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON QueryCorpusResponse+instance A.FromJSON QueryCorpusResponse where+ parseJSON = A.withObject "QueryCorpusResponse" $ \o ->+ QueryCorpusResponse+ <$> (o .:? "relevantChunks")++-- | ToJSON QueryCorpusResponse+instance A.ToJSON QueryCorpusResponse where+ toJSON QueryCorpusResponse {..} =+ _omitNulls+ [ "relevantChunks" .= queryCorpusResponseRelevantChunks+ ]++-- | Construct a value of type 'QueryCorpusResponse' (by applying it's required fields, if any)+mkQueryCorpusResponse ::+ QueryCorpusResponse+mkQueryCorpusResponse =+ QueryCorpusResponse+ { queryCorpusResponseRelevantChunks = Nothing+ }++-- ** QueryDocumentRequest++{- | QueryDocumentRequest+Request for querying a `Document`.+-}+data QueryDocumentRequest = QueryDocumentRequest+ { queryDocumentRequestQuery :: !(Text)+ -- ^ /Required/ "query" - Required. Query string to perform semantic search.+ , queryDocumentRequestResultsCount :: !(Maybe Int)+ -- ^ "resultsCount" - Optional. The maximum number of `Chunk`s to return. The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum specified result count is 100.+ , queryDocumentRequestMetadataFilters :: !(Maybe [MetadataFilter])+ -- ^ "metadataFilters" - Optional. Filter for `Chunk` metadata. Each `MetadataFilter` object should correspond to a unique key. Multiple `MetadataFilter` objects are joined by logical \"AND\"s. Note: `Document`-level filtering is not supported for this request because a `Document` name is already specified. Example query: (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action) `MetadataFilter` object list: metadata_filters = [ {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}}, {key = \"chunk.custom_metadata.genre\" conditions = [{string_value = \"drama\", operation = EQUAL}, {string_value = \"action\", operation = EQUAL}}] Example query for a numeric range of values: (year > 2015 AND year <= 2020) `MetadataFilter` object list: metadata_filters = [ {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2015, operation = GREATER}]}, {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] Note: \"AND\"s for the same key are only supported for numeric values. String values only support \"OR\"s for the same key.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON QueryDocumentRequest+instance A.FromJSON QueryDocumentRequest where+ parseJSON = A.withObject "QueryDocumentRequest" $ \o ->+ QueryDocumentRequest+ <$> (o .: "query")+ <*> (o .:? "resultsCount")+ <*> (o .:? "metadataFilters")++-- | ToJSON QueryDocumentRequest+instance A.ToJSON QueryDocumentRequest where+ toJSON QueryDocumentRequest {..} =+ _omitNulls+ [ "query" .= queryDocumentRequestQuery+ , "resultsCount" .= queryDocumentRequestResultsCount+ , "metadataFilters" .= queryDocumentRequestMetadataFilters+ ]++-- | Construct a value of type 'QueryDocumentRequest' (by applying it's required fields, if any)+mkQueryDocumentRequest ::+ -- | 'queryDocumentRequestQuery': Required. Query string to perform semantic search.+ Text ->+ QueryDocumentRequest+mkQueryDocumentRequest queryDocumentRequestQuery =+ QueryDocumentRequest+ { queryDocumentRequestQuery+ , queryDocumentRequestResultsCount = Nothing+ , queryDocumentRequestMetadataFilters = Nothing+ }++-- ** QueryDocumentResponse++{- | QueryDocumentResponse+Response from `QueryDocument` containing a list of relevant chunks.+-}+data QueryDocumentResponse = QueryDocumentResponse+ { queryDocumentResponseRelevantChunks :: !(Maybe [RelevantChunk])+ -- ^ "relevantChunks" - The returned relevant chunks.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON QueryDocumentResponse+instance A.FromJSON QueryDocumentResponse where+ parseJSON = A.withObject "QueryDocumentResponse" $ \o ->+ QueryDocumentResponse+ <$> (o .:? "relevantChunks")++-- | ToJSON QueryDocumentResponse+instance A.ToJSON QueryDocumentResponse where+ toJSON QueryDocumentResponse {..} =+ _omitNulls+ [ "relevantChunks" .= queryDocumentResponseRelevantChunks+ ]++-- | Construct a value of type 'QueryDocumentResponse' (by applying it's required fields, if any)+mkQueryDocumentResponse ::+ QueryDocumentResponse+mkQueryDocumentResponse =+ QueryDocumentResponse+ { queryDocumentResponseRelevantChunks = Nothing+ }++-- ** RelevantChunk++{- | RelevantChunk+The information for a chunk relevant to a query.+-}+data RelevantChunk = RelevantChunk+ { relevantChunkChunk :: !(Maybe Chunk)+ -- ^ "chunk" - `Chunk` associated with the query.+ , relevantChunkChunkRelevanceScore :: !(Maybe Float)+ -- ^ "chunkRelevanceScore" - `Chunk` relevance to the query.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON RelevantChunk+instance A.FromJSON RelevantChunk where+ parseJSON = A.withObject "RelevantChunk" $ \o ->+ RelevantChunk+ <$> (o .:? "chunk")+ <*> (o .:? "chunkRelevanceScore")++-- | ToJSON RelevantChunk+instance A.ToJSON RelevantChunk where+ toJSON RelevantChunk {..} =+ _omitNulls+ [ "chunk" .= relevantChunkChunk+ , "chunkRelevanceScore" .= relevantChunkChunkRelevanceScore+ ]++-- | Construct a value of type 'RelevantChunk' (by applying it's required fields, if any)+mkRelevantChunk ::+ RelevantChunk+mkRelevantChunk =+ RelevantChunk+ { relevantChunkChunk = Nothing+ , relevantChunkChunkRelevanceScore = Nothing+ }++-- ** RetrievalMetadata++{- | RetrievalMetadata+Metadata related to retrieval in the grounding flow.+-}+data RetrievalMetadata = RetrievalMetadata+ { retrievalMetadataGoogleSearchDynamicRetrievalScore :: !(Maybe Float)+ -- ^ "googleSearchDynamicRetrievalScore" - Optional. Score indicating how likely information from google search could help answer the prompt. The score is in the range [0, 1], where 0 is the least likely and 1 is the most likely. This score is only populated when google search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger google search.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON RetrievalMetadata+instance A.FromJSON RetrievalMetadata where+ parseJSON = A.withObject "RetrievalMetadata" $ \o ->+ RetrievalMetadata+ <$> (o .:? "googleSearchDynamicRetrievalScore")++-- | ToJSON RetrievalMetadata+instance A.ToJSON RetrievalMetadata where+ toJSON RetrievalMetadata {..} =+ _omitNulls+ [ "googleSearchDynamicRetrievalScore" .= retrievalMetadataGoogleSearchDynamicRetrievalScore+ ]++-- | Construct a value of type 'RetrievalMetadata' (by applying it's required fields, if any)+mkRetrievalMetadata ::+ RetrievalMetadata+mkRetrievalMetadata =+ RetrievalMetadata+ { retrievalMetadataGoogleSearchDynamicRetrievalScore = Nothing+ }++-- ** SafetyFeedback++{- | SafetyFeedback+Safety feedback for an entire request. This field is populated if content in the input and/or response is blocked due to safety settings. SafetyFeedback may not exist for every HarmCategory. Each SafetyFeedback will return the safety settings used by the request as well as the lowest HarmProbability that should be allowed in order to return a result.+-}+data SafetyFeedback = SafetyFeedback+ { safetyFeedbackSetting :: !(Maybe SafetySetting)+ -- ^ "setting" - Safety settings applied to the request.+ , safetyFeedbackRating :: !(Maybe SafetyRating)+ -- ^ "rating" - Safety rating evaluated from content.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON SafetyFeedback+instance A.FromJSON SafetyFeedback where+ parseJSON = A.withObject "SafetyFeedback" $ \o ->+ SafetyFeedback+ <$> (o .:? "setting")+ <*> (o .:? "rating")++-- | ToJSON SafetyFeedback+instance A.ToJSON SafetyFeedback where+ toJSON SafetyFeedback {..} =+ _omitNulls+ [ "setting" .= safetyFeedbackSetting+ , "rating" .= safetyFeedbackRating+ ]++-- | Construct a value of type 'SafetyFeedback' (by applying it's required fields, if any)+mkSafetyFeedback ::+ SafetyFeedback+mkSafetyFeedback =+ SafetyFeedback+ { safetyFeedbackSetting = Nothing+ , safetyFeedbackRating = Nothing+ }++-- ** SafetyRating++{- | SafetyRating+Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.+-}+data SafetyRating = SafetyRating+ { safetyRatingCategory :: !(HarmCategory)+ -- ^ /Required/ "category" - Required. The category for this rating.+ , safetyRatingBlocked :: !(Maybe Bool)+ -- ^ "blocked" - Was this content blocked because of this rating?+ , safetyRatingProbability :: !(E'Probability)+ -- ^ /Required/ "probability" - Required. The probability of harm for this content.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON SafetyRating+instance A.FromJSON SafetyRating where+ parseJSON = A.withObject "SafetyRating" $ \o ->+ SafetyRating+ <$> (o .: "category")+ <*> (o .:? "blocked")+ <*> (o .: "probability")++-- | ToJSON SafetyRating+instance A.ToJSON SafetyRating where+ toJSON SafetyRating {..} =+ _omitNulls+ [ "category" .= safetyRatingCategory+ , "blocked" .= safetyRatingBlocked+ , "probability" .= safetyRatingProbability+ ]++-- | Construct a value of type 'SafetyRating' (by applying it's required fields, if any)+mkSafetyRating ::+ -- | 'safetyRatingCategory': Required. The category for this rating.+ HarmCategory ->+ -- | 'safetyRatingProbability': Required. The probability of harm for this content.+ E'Probability ->+ SafetyRating+mkSafetyRating safetyRatingCategory safetyRatingProbability =+ SafetyRating+ { safetyRatingCategory+ , safetyRatingBlocked = Nothing+ , safetyRatingProbability+ }++-- ** SafetySetting++{- | SafetySetting+Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.+-}+data SafetySetting = SafetySetting+ { safetySettingThreshold :: !(E'Threshold)+ -- ^ /Required/ "threshold" - Required. Controls the probability threshold at which harm is blocked.+ , safetySettingCategory :: !(HarmCategory)+ -- ^ /Required/ "category" - Required. The category for this setting.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON SafetySetting+instance A.FromJSON SafetySetting where+ parseJSON = A.withObject "SafetySetting" $ \o ->+ SafetySetting+ <$> (o .: "threshold")+ <*> (o .: "category")++-- | ToJSON SafetySetting+instance A.ToJSON SafetySetting where+ toJSON SafetySetting {..} =+ _omitNulls+ [ "threshold" .= safetySettingThreshold+ , "category" .= safetySettingCategory+ ]++-- | Construct a value of type 'SafetySetting' (by applying it's required fields, if any)+mkSafetySetting ::+ -- | 'safetySettingThreshold': Required. Controls the probability threshold at which harm is blocked.+ E'Threshold ->+ -- | 'safetySettingCategory': Required. The category for this setting.+ HarmCategory ->+ SafetySetting+mkSafetySetting safetySettingThreshold safetySettingCategory =+ SafetySetting+ { safetySettingThreshold+ , safetySettingCategory+ }++-- ** Schema++{- | Schema+The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema).+-}+data Schema = Schema+ { schemaItems :: !(Maybe Schema)+ -- ^ "items" - Optional. Schema of the elements of Type.ARRAY.+ , schemaAnyOf :: !(Maybe [Schema])+ -- ^ "anyOf" - Optional. The value should be validated against any (one or more) of the subschemas in the list.+ , schemaMinLength :: !(Maybe Text)+ -- ^ "minLength" - Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING+ , schemaMaximum :: !(Maybe Double)+ -- ^ "maximum" - Optional. Maximum value of the Type.INTEGER and Type.NUMBER+ , schemaPropertyOrdering :: !(Maybe [Text])+ -- ^ "propertyOrdering" - Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response.+ , schemaNullable :: !(Maybe Bool)+ -- ^ "nullable" - Optional. Indicates if the value may be null.+ , schemaRequired :: !(Maybe [Text])+ -- ^ "required" - Optional. Required properties of Type.OBJECT.+ , schemaMinProperties :: !(Maybe Text)+ -- ^ "minProperties" - Optional. Minimum number of the properties for Type.OBJECT.+ , schemaMaxItems :: !(Maybe Text)+ -- ^ "maxItems" - Optional. Maximum number of the elements for Type.ARRAY.+ , schemaExample :: !(Maybe String)+ -- ^ "example" - Optional. Example of the object. Will only populated when the object is the root.+ , schemaTitle :: !(Maybe Text)+ -- ^ "title" - Optional. The title of the schema.+ , schemaMinItems :: !(Maybe Text)+ -- ^ "minItems" - Optional. Minimum number of the elements for Type.ARRAY.+ , schemaDescription :: !(Maybe Text)+ -- ^ "description" - Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.+ , schemaType :: !(ModelType)+ -- ^ /Required/ "type" - Required. Data type.+ , schemaDefault :: !(Maybe String)+ -- ^ "default" - Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field errors.+ , schemaMinimum :: !(Maybe Double)+ -- ^ "minimum" - Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER+ , schemaPattern :: !(Maybe Text)+ -- ^ "pattern" - Optional. Pattern of the Type.STRING to restrict a string to a regular expression.+ , schemaProperties :: !(Maybe (Map.Map String Schema))+ -- ^ "properties" - Optional. Properties of Type.OBJECT.+ , schemaMaxProperties :: !(Maybe Text)+ -- ^ "maxProperties" - Optional. Maximum number of the properties for Type.OBJECT.+ , schemaFormat :: !(Maybe Text)+ -- ^ "format" - Optional. The format of the data. This is used only for primitive datatypes. Supported formats: for NUMBER type: float, double for INTEGER type: int32, int64 for STRING type: enum, date-time+ , schemaEnum :: !(Maybe [Text])+ -- ^ "enum" - Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]}+ , schemaMaxLength :: !(Maybe Text)+ -- ^ "maxLength" - Optional. Maximum length of the Type.STRING+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Schema+instance A.FromJSON Schema where+ parseJSON = A.withObject "Schema" $ \o ->+ Schema+ <$> (o .:? "items")+ <*> (o .:? "anyOf")+ <*> (o .:? "minLength")+ <*> (o .:? "maximum")+ <*> (o .:? "propertyOrdering")+ <*> (o .:? "nullable")+ <*> (o .:? "required")+ <*> (o .:? "minProperties")+ <*> (o .:? "maxItems")+ <*> (o .:? "example")+ <*> (o .:? "title")+ <*> (o .:? "minItems")+ <*> (o .:? "description")+ <*> (o .: "type")+ <*> (o .:? "default")+ <*> (o .:? "minimum")+ <*> (o .:? "pattern")+ <*> (o .:? "properties")+ <*> (o .:? "maxProperties")+ <*> (o .:? "format")+ <*> (o .:? "enum")+ <*> (o .:? "maxLength")++-- | ToJSON Schema+instance A.ToJSON Schema where+ toJSON Schema {..} =+ _omitNulls+ [ "items" .= schemaItems+ , "anyOf" .= schemaAnyOf+ , "minLength" .= schemaMinLength+ , "maximum" .= schemaMaximum+ , "propertyOrdering" .= schemaPropertyOrdering+ , "nullable" .= schemaNullable+ , "required" .= schemaRequired+ , "minProperties" .= schemaMinProperties+ , "maxItems" .= schemaMaxItems+ , "example" .= schemaExample+ , "title" .= schemaTitle+ , "minItems" .= schemaMinItems+ , "description" .= schemaDescription+ , "type" .= schemaType+ , "default" .= schemaDefault+ , "minimum" .= schemaMinimum+ , "pattern" .= schemaPattern+ , "properties" .= schemaProperties+ , "maxProperties" .= schemaMaxProperties+ , "format" .= schemaFormat+ , "enum" .= schemaEnum+ , "maxLength" .= schemaMaxLength+ ]++-- | Construct a value of type 'Schema' (by applying it's required fields, if any)+mkSchema ::+ -- | 'schemaType': Required. Data type.+ ModelType ->+ Schema+mkSchema schemaType =+ Schema+ { schemaItems = Nothing+ , schemaAnyOf = Nothing+ , schemaMinLength = Nothing+ , schemaMaximum = Nothing+ , schemaPropertyOrdering = Nothing+ , schemaNullable = Nothing+ , schemaRequired = Nothing+ , schemaMinProperties = Nothing+ , schemaMaxItems = Nothing+ , schemaExample = Nothing+ , schemaTitle = Nothing+ , schemaMinItems = Nothing+ , schemaDescription = Nothing+ , schemaType+ , schemaDefault = Nothing+ , schemaMinimum = Nothing+ , schemaPattern = Nothing+ , schemaProperties = Nothing+ , schemaMaxProperties = Nothing+ , schemaFormat = Nothing+ , schemaEnum = Nothing+ , schemaMaxLength = Nothing+ }++-- ** SearchEntryPoint++{- | SearchEntryPoint+Google search entry point.+-}+data SearchEntryPoint = SearchEntryPoint+ { searchEntryPointSdkBlob :: !(Maybe ByteArray)+ -- ^ "sdkBlob" - Optional. Base64 encoded JSON representing array of tuple.+ , searchEntryPointRenderedContent :: !(Maybe Text)+ -- ^ "renderedContent" - Optional. Web content snippet that can be embedded in a web page or an app webview.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON SearchEntryPoint+instance A.FromJSON SearchEntryPoint where+ parseJSON = A.withObject "SearchEntryPoint" $ \o ->+ SearchEntryPoint+ <$> (o .:? "sdkBlob")+ <*> (o .:? "renderedContent")++-- | ToJSON SearchEntryPoint+instance A.ToJSON SearchEntryPoint where+ toJSON SearchEntryPoint {..} =+ _omitNulls+ [ "sdkBlob" .= searchEntryPointSdkBlob+ , "renderedContent" .= searchEntryPointRenderedContent+ ]++-- | Construct a value of type 'SearchEntryPoint' (by applying it's required fields, if any)+mkSearchEntryPoint ::+ SearchEntryPoint+mkSearchEntryPoint =+ SearchEntryPoint+ { searchEntryPointSdkBlob = Nothing+ , searchEntryPointRenderedContent = Nothing+ }++-- ** Segment++{- | Segment+Segment of the content.+-}+data Segment = Segment+ { segmentPartIndex :: !(Maybe Int)+ -- ^ /ReadOnly/ "partIndex" - Output only. The index of a Part object within its parent Content object.+ , segmentStartIndex :: !(Maybe Int)+ -- ^ /ReadOnly/ "startIndex" - Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.+ , segmentText :: !(Maybe Text)+ -- ^ /ReadOnly/ "text" - Output only. The text corresponding to the segment from the response.+ , segmentEndIndex :: !(Maybe Int)+ -- ^ /ReadOnly/ "endIndex" - Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Segment+instance A.FromJSON Segment where+ parseJSON = A.withObject "Segment" $ \o ->+ Segment+ <$> (o .:? "partIndex")+ <*> (o .:? "startIndex")+ <*> (o .:? "text")+ <*> (o .:? "endIndex")++-- | ToJSON Segment+instance A.ToJSON Segment where+ toJSON Segment {..} =+ _omitNulls+ [ "partIndex" .= segmentPartIndex+ , "startIndex" .= segmentStartIndex+ , "text" .= segmentText+ , "endIndex" .= segmentEndIndex+ ]++-- | Construct a value of type 'Segment' (by applying it's required fields, if any)+mkSegment ::+ Segment+mkSegment =+ Segment+ { segmentPartIndex = Nothing+ , segmentStartIndex = Nothing+ , segmentText = Nothing+ , segmentEndIndex = Nothing+ }++-- ** SemanticRetrieverChunk++{- | SemanticRetrieverChunk+Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.+-}+data SemanticRetrieverChunk = SemanticRetrieverChunk+ { semanticRetrieverChunkChunk :: !(Maybe Text)+ -- ^ /ReadOnly/ "chunk" - Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`+ , semanticRetrieverChunkSource :: !(Maybe Text)+ -- ^ /ReadOnly/ "source" - Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON SemanticRetrieverChunk+instance A.FromJSON SemanticRetrieverChunk where+ parseJSON = A.withObject "SemanticRetrieverChunk" $ \o ->+ SemanticRetrieverChunk+ <$> (o .:? "chunk")+ <*> (o .:? "source")++-- | ToJSON SemanticRetrieverChunk+instance A.ToJSON SemanticRetrieverChunk where+ toJSON SemanticRetrieverChunk {..} =+ _omitNulls+ [ "chunk" .= semanticRetrieverChunkChunk+ , "source" .= semanticRetrieverChunkSource+ ]++-- | Construct a value of type 'SemanticRetrieverChunk' (by applying it's required fields, if any)+mkSemanticRetrieverChunk ::+ SemanticRetrieverChunk+mkSemanticRetrieverChunk =+ SemanticRetrieverChunk+ { semanticRetrieverChunkChunk = Nothing+ , semanticRetrieverChunkSource = Nothing+ }++-- ** SemanticRetrieverConfig++{- | SemanticRetrieverConfig+Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API.+-}+data SemanticRetrieverConfig = SemanticRetrieverConfig+ { semanticRetrieverConfigSource :: !(Text)+ -- ^ /Required/ "source" - Required. Name of the resource for retrieval. Example: `corpora/123` or `corpora/123/documents/abc`.+ , semanticRetrieverConfigQuery :: !(Content)+ -- ^ /Required/ "query" - Required. Query to use for matching `Chunk`s in the given resource by similarity.+ , semanticRetrieverConfigMaxChunksCount :: !(Maybe Int)+ -- ^ "maxChunksCount" - Optional. Maximum number of relevant `Chunk`s to retrieve.+ , semanticRetrieverConfigMetadataFilters :: !(Maybe [MetadataFilter])+ -- ^ "metadataFilters" - Optional. Filters for selecting `Document`s and/or `Chunk`s from the resource.+ , semanticRetrieverConfigMinimumRelevanceScore :: !(Maybe Float)+ -- ^ "minimumRelevanceScore" - Optional. Minimum relevance score for retrieved relevant `Chunk`s.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON SemanticRetrieverConfig+instance A.FromJSON SemanticRetrieverConfig where+ parseJSON = A.withObject "SemanticRetrieverConfig" $ \o ->+ SemanticRetrieverConfig+ <$> (o .: "source")+ <*> (o .: "query")+ <*> (o .:? "maxChunksCount")+ <*> (o .:? "metadataFilters")+ <*> (o .:? "minimumRelevanceScore")++-- | ToJSON SemanticRetrieverConfig+instance A.ToJSON SemanticRetrieverConfig where+ toJSON SemanticRetrieverConfig {..} =+ _omitNulls+ [ "source" .= semanticRetrieverConfigSource+ , "query" .= semanticRetrieverConfigQuery+ , "maxChunksCount" .= semanticRetrieverConfigMaxChunksCount+ , "metadataFilters" .= semanticRetrieverConfigMetadataFilters+ , "minimumRelevanceScore" .= semanticRetrieverConfigMinimumRelevanceScore+ ]++-- | Construct a value of type 'SemanticRetrieverConfig' (by applying it's required fields, if any)+mkSemanticRetrieverConfig ::+ -- | 'semanticRetrieverConfigSource': Required. Name of the resource for retrieval. Example: `corpora/123` or `corpora/123/documents/abc`.+ Text ->+ -- | 'semanticRetrieverConfigQuery': Required. Query to use for matching `Chunk`s in the given resource by similarity.+ Content ->+ SemanticRetrieverConfig+mkSemanticRetrieverConfig semanticRetrieverConfigSource semanticRetrieverConfigQuery =+ SemanticRetrieverConfig+ { semanticRetrieverConfigSource+ , semanticRetrieverConfigQuery+ , semanticRetrieverConfigMaxChunksCount = Nothing+ , semanticRetrieverConfigMetadataFilters = Nothing+ , semanticRetrieverConfigMinimumRelevanceScore = Nothing+ }++-- ** SpeakerVoiceConfig++{- | SpeakerVoiceConfig+The configuration for a single speaker in a multi speaker setup.+-}+data SpeakerVoiceConfig = SpeakerVoiceConfig+ { speakerVoiceConfigVoiceConfig :: !(VoiceConfig)+ -- ^ /Required/ "voiceConfig" - Required. The configuration for the voice to use.+ , speakerVoiceConfigSpeaker :: !(Text)+ -- ^ /Required/ "speaker" - Required. The name of the speaker to use. Should be the same as in the prompt.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON SpeakerVoiceConfig+instance A.FromJSON SpeakerVoiceConfig where+ parseJSON = A.withObject "SpeakerVoiceConfig" $ \o ->+ SpeakerVoiceConfig+ <$> (o .: "voiceConfig")+ <*> (o .: "speaker")++-- | ToJSON SpeakerVoiceConfig+instance A.ToJSON SpeakerVoiceConfig where+ toJSON SpeakerVoiceConfig {..} =+ _omitNulls+ [ "voiceConfig" .= speakerVoiceConfigVoiceConfig+ , "speaker" .= speakerVoiceConfigSpeaker+ ]++-- | Construct a value of type 'SpeakerVoiceConfig' (by applying it's required fields, if any)+mkSpeakerVoiceConfig ::+ -- | 'speakerVoiceConfigVoiceConfig': Required. The configuration for the voice to use.+ VoiceConfig ->+ -- | 'speakerVoiceConfigSpeaker': Required. The name of the speaker to use. Should be the same as in the prompt.+ Text ->+ SpeakerVoiceConfig+mkSpeakerVoiceConfig speakerVoiceConfigVoiceConfig speakerVoiceConfigSpeaker =+ SpeakerVoiceConfig+ { speakerVoiceConfigVoiceConfig+ , speakerVoiceConfigSpeaker+ }++-- ** SpeechConfig++{- | SpeechConfig+The speech generation config.+-}+data SpeechConfig = SpeechConfig+ { speechConfigVoiceConfig :: !(Maybe VoiceConfig)+ -- ^ "voiceConfig" - The configuration in case of single-voice output.+ , speechConfigLanguageCode :: !(Maybe Text)+ -- ^ "languageCode" - Optional. Language code (in BCP 47 format, e.g. \"en-US\") for speech synthesis. Valid values are: de-DE, en-AU, en-GB, en-IN, en-US, es-US, fr-FR, hi-IN, pt-BR, ar-XA, es-ES, fr-CA, id-ID, it-IT, ja-JP, tr-TR, vi-VN, bn-IN, gu-IN, kn-IN, ml-IN, mr-IN, ta-IN, te-IN, nl-NL, ko-KR, cmn-CN, pl-PL, ru-RU, and th-TH.+ , speechConfigMultiSpeakerVoiceConfig :: !(Maybe MultiSpeakerVoiceConfig)+ -- ^ "multiSpeakerVoiceConfig" - Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON SpeechConfig+instance A.FromJSON SpeechConfig where+ parseJSON = A.withObject "SpeechConfig" $ \o ->+ SpeechConfig+ <$> (o .:? "voiceConfig")+ <*> (o .:? "languageCode")+ <*> (o .:? "multiSpeakerVoiceConfig")++-- | ToJSON SpeechConfig+instance A.ToJSON SpeechConfig where+ toJSON SpeechConfig {..} =+ _omitNulls+ [ "voiceConfig" .= speechConfigVoiceConfig+ , "languageCode" .= speechConfigLanguageCode+ , "multiSpeakerVoiceConfig" .= speechConfigMultiSpeakerVoiceConfig+ ]++-- | Construct a value of type 'SpeechConfig' (by applying it's required fields, if any)+mkSpeechConfig ::+ SpeechConfig+mkSpeechConfig =+ SpeechConfig+ { speechConfigVoiceConfig = Nothing+ , speechConfigLanguageCode = Nothing+ , speechConfigMultiSpeakerVoiceConfig = Nothing+ }++-- ** Status++{- | Status+The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).+-}+data Status = Status+ { statusCode :: !(Maybe Int)+ -- ^ "code" - The status code, which should be an enum value of google.rpc.Code.+ , statusDetails :: !(Maybe [(Map.Map String String)])+ -- ^ "details" - A list of messages that carry the error details. There is a common set of message types for APIs to use.+ , statusMessage :: !(Maybe Text)+ -- ^ "message" - A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Status+instance A.FromJSON Status where+ parseJSON = A.withObject "Status" $ \o ->+ Status+ <$> (o .:? "code")+ <*> (o .:? "details")+ <*> (o .:? "message")++-- | ToJSON Status+instance A.ToJSON Status where+ toJSON Status {..} =+ _omitNulls+ [ "code" .= statusCode+ , "details" .= statusDetails+ , "message" .= statusMessage+ ]++-- | Construct a value of type 'Status' (by applying it's required fields, if any)+mkStatus ::+ Status+mkStatus =+ Status+ { statusCode = Nothing+ , statusDetails = Nothing+ , statusMessage = Nothing+ }++-- ** StringList++{- | StringList+User provided string values assigned to a single metadata key.+-}+data StringList = StringList+ { stringListValues :: !(Maybe [Text])+ -- ^ "values" - The string values of the metadata to store.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON StringList+instance A.FromJSON StringList where+ parseJSON = A.withObject "StringList" $ \o ->+ StringList+ <$> (o .:? "values")++-- | ToJSON StringList+instance A.ToJSON StringList where+ toJSON StringList {..} =+ _omitNulls+ [ "values" .= stringListValues+ ]++-- | Construct a value of type 'StringList' (by applying it's required fields, if any)+mkStringList ::+ StringList+mkStringList =+ StringList+ { stringListValues = Nothing+ }++-- ** TextCompletion++{- | TextCompletion+Output text returned from a model.+-}+data TextCompletion = TextCompletion+ { textCompletionSafetyRatings :: !(Maybe [SafetyRating])+ -- ^ "safetyRatings" - Ratings for the safety of a response. There is at most one rating per category.+ , textCompletionOutput :: !(Maybe Text)+ -- ^ /ReadOnly/ "output" - Output only. The generated text returned from the model.+ , textCompletionCitationMetadata :: !(Maybe CitationMetadata)+ -- ^ /ReadOnly/ "citationMetadata" - Output only. Citation information for model-generated `output` in this `TextCompletion`. This field may be populated with attribution information for any text included in the `output`.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON TextCompletion+instance A.FromJSON TextCompletion where+ parseJSON = A.withObject "TextCompletion" $ \o ->+ TextCompletion+ <$> (o .:? "safetyRatings")+ <*> (o .:? "output")+ <*> (o .:? "citationMetadata")++-- | ToJSON TextCompletion+instance A.ToJSON TextCompletion where+ toJSON TextCompletion {..} =+ _omitNulls+ [ "safetyRatings" .= textCompletionSafetyRatings+ , "output" .= textCompletionOutput+ , "citationMetadata" .= textCompletionCitationMetadata+ ]++-- | Construct a value of type 'TextCompletion' (by applying it's required fields, if any)+mkTextCompletion ::+ TextCompletion+mkTextCompletion =+ TextCompletion+ { textCompletionSafetyRatings = Nothing+ , textCompletionOutput = Nothing+ , textCompletionCitationMetadata = Nothing+ }++-- ** TextPrompt++{- | TextPrompt+Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.+-}+data TextPrompt = TextPrompt+ { textPromptText :: !(Text)+ -- ^ /Required/ "text" - Required. The prompt text.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON TextPrompt+instance A.FromJSON TextPrompt where+ parseJSON = A.withObject "TextPrompt" $ \o ->+ TextPrompt+ <$> (o .: "text")++-- | ToJSON TextPrompt+instance A.ToJSON TextPrompt where+ toJSON TextPrompt {..} =+ _omitNulls+ [ "text" .= textPromptText+ ]++-- | Construct a value of type 'TextPrompt' (by applying it's required fields, if any)+mkTextPrompt ::+ -- | 'textPromptText': Required. The prompt text.+ Text ->+ TextPrompt+mkTextPrompt textPromptText =+ TextPrompt+ { textPromptText+ }++-- ** ThinkingConfig++{- | ThinkingConfig+Config for thinking features.+-}+data ThinkingConfig = ThinkingConfig+ { thinkingConfigThinkingBudget :: !(Maybe Int)+ -- ^ "thinkingBudget" - The number of thoughts tokens that the model should generate.+ , thinkingConfigIncludeThoughts :: !(Maybe Bool)+ -- ^ "includeThoughts" - Indicates whether to include thoughts in the response. If true, thoughts are returned only when available.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ThinkingConfig+instance A.FromJSON ThinkingConfig where+ parseJSON = A.withObject "ThinkingConfig" $ \o ->+ ThinkingConfig+ <$> (o .:? "thinkingBudget")+ <*> (o .:? "includeThoughts")++-- | ToJSON ThinkingConfig+instance A.ToJSON ThinkingConfig where+ toJSON ThinkingConfig {..} =+ _omitNulls+ [ "thinkingBudget" .= thinkingConfigThinkingBudget+ , "includeThoughts" .= thinkingConfigIncludeThoughts+ ]++-- | Construct a value of type 'ThinkingConfig' (by applying it's required fields, if any)+mkThinkingConfig ::+ ThinkingConfig+mkThinkingConfig =+ ThinkingConfig+ { thinkingConfigThinkingBudget = Nothing+ , thinkingConfigIncludeThoughts = Nothing+ }++-- ** Tool++{- | Tool+Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.+-}+data Tool = Tool+ { toolFunctionDeclarations :: !(Maybe [FunctionDeclaration])+ -- ^ "functionDeclarations" - Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role \"function\" generation context for the next model turn.+ , toolGoogleSearchRetrieval :: !(Maybe GoogleSearchRetrieval)+ -- ^ "googleSearchRetrieval" - Optional. Retrieval tool that is powered by Google search.+ , toolGoogleSearch :: !(Maybe GoogleSearch)+ -- ^ "googleSearch" - Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.+ , toolCodeExecution :: !(Maybe A.Value)+ -- ^ "codeExecution" - Optional. Enables the model to execute code as part of generation.+ , toolUrlContext :: !(Maybe A.Value)+ -- ^ "urlContext" - Optional. Tool to support URL context retrieval.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Tool+instance A.FromJSON Tool where+ parseJSON = A.withObject "Tool" $ \o ->+ Tool+ <$> (o .:? "functionDeclarations")+ <*> (o .:? "googleSearchRetrieval")+ <*> (o .:? "googleSearch")+ <*> (o .:? "codeExecution")+ <*> (o .:? "urlContext")++-- | ToJSON Tool+instance A.ToJSON Tool where+ toJSON Tool {..} =+ _omitNulls+ [ "functionDeclarations" .= toolFunctionDeclarations+ , "googleSearchRetrieval" .= toolGoogleSearchRetrieval+ , "googleSearch" .= toolGoogleSearch+ , "codeExecution" .= toolCodeExecution+ , "urlContext" .= toolUrlContext+ ]++-- | Construct a value of type 'Tool' (by applying it's required fields, if any)+mkTool ::+ Tool+mkTool =+ Tool+ { toolFunctionDeclarations = Nothing+ , toolGoogleSearchRetrieval = Nothing+ , toolGoogleSearch = Nothing+ , toolCodeExecution = Nothing+ , toolUrlContext = Nothing+ }++-- ** ToolConfig++{- | ToolConfig+The Tool configuration containing parameters for specifying `Tool` use in the request.+-}+data ToolConfig = ToolConfig+ { toolConfigFunctionCallingConfig :: !(Maybe FunctionCallingConfig)+ -- ^ "functionCallingConfig" - Optional. Function calling config.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON ToolConfig+instance A.FromJSON ToolConfig where+ parseJSON = A.withObject "ToolConfig" $ \o ->+ ToolConfig+ <$> (o .:? "functionCallingConfig")++-- | ToJSON ToolConfig+instance A.ToJSON ToolConfig where+ toJSON ToolConfig {..} =+ _omitNulls+ [ "functionCallingConfig" .= toolConfigFunctionCallingConfig+ ]++-- | Construct a value of type 'ToolConfig' (by applying it's required fields, if any)+mkToolConfig ::+ ToolConfig+mkToolConfig =+ ToolConfig+ { toolConfigFunctionCallingConfig = Nothing+ }++-- ** TopCandidates++{- | TopCandidates+Candidates with top log probabilities at each decoding step.+-}+data TopCandidates = TopCandidates+ { topCandidatesCandidates :: !(Maybe [LogprobsResultCandidate])+ -- ^ "candidates" - Sorted by log probability in descending order.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON TopCandidates+instance A.FromJSON TopCandidates where+ parseJSON = A.withObject "TopCandidates" $ \o ->+ TopCandidates+ <$> (o .:? "candidates")++-- | ToJSON TopCandidates+instance A.ToJSON TopCandidates where+ toJSON TopCandidates {..} =+ _omitNulls+ [ "candidates" .= topCandidatesCandidates+ ]++-- | Construct a value of type 'TopCandidates' (by applying it's required fields, if any)+mkTopCandidates ::+ TopCandidates+mkTopCandidates =+ TopCandidates+ { topCandidatesCandidates = Nothing+ }++-- ** TransferOwnershipRequest++{- | TransferOwnershipRequest+Request to transfer the ownership of the tuned model.+-}+data TransferOwnershipRequest = TransferOwnershipRequest+ { transferOwnershipRequestEmailAddress :: !(Text)+ -- ^ /Required/ "emailAddress" - Required. The email address of the user to whom the tuned model is being transferred to.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON TransferOwnershipRequest+instance A.FromJSON TransferOwnershipRequest where+ parseJSON = A.withObject "TransferOwnershipRequest" $ \o ->+ TransferOwnershipRequest+ <$> (o .: "emailAddress")++-- | ToJSON TransferOwnershipRequest+instance A.ToJSON TransferOwnershipRequest where+ toJSON TransferOwnershipRequest {..} =+ _omitNulls+ [ "emailAddress" .= transferOwnershipRequestEmailAddress+ ]++-- | Construct a value of type 'TransferOwnershipRequest' (by applying it's required fields, if any)+mkTransferOwnershipRequest ::+ -- | 'transferOwnershipRequestEmailAddress': Required. The email address of the user to whom the tuned model is being transferred to.+ Text ->+ TransferOwnershipRequest+mkTransferOwnershipRequest transferOwnershipRequestEmailAddress =+ TransferOwnershipRequest+ { transferOwnershipRequestEmailAddress+ }++-- ** TunedModel++{- | TunedModel+A fine-tuned model created using ModelService.CreateTunedModel.+-}+data TunedModel = TunedModel+ { tunedModelUpdateTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "updateTime" - Output only. The timestamp when this model was updated.+ , tunedModelName :: !(Maybe Text)+ -- ^ /ReadOnly/ "name" - Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`+ , tunedModelCreateTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "createTime" - Output only. The timestamp when this model was created.+ , tunedModelTuningTask :: !(TuningTask)+ -- ^ /Required/ "tuningTask" - Required. The tuning task that creates the tuned model.+ , tunedModelTunedModelSource :: !(Maybe TunedModelSource)+ -- ^ "tunedModelSource" - Optional. TunedModel to use as the starting point for training the new model.+ , tunedModelBaseModel :: !(Maybe Text)+ -- ^ "baseModel" - Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001`+ , tunedModelReaderProjectNumbers :: !(Maybe [Text])+ -- ^ "readerProjectNumbers" - Optional. List of project numbers that have read access to the tuned model.+ , tunedModelDisplayName :: !(Maybe Text)+ -- ^ "displayName" - Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces.+ , tunedModelTemperature :: !(Maybe Float)+ -- ^ "temperature" - Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model.+ , tunedModelDescription :: !(Maybe Text)+ -- ^ "description" - Optional. A short description of this model.+ , tunedModelTopP :: !(Maybe Float)+ -- ^ "topP" - Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model.+ , tunedModelTopK :: !(Maybe Int)+ -- ^ "topK" - Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model.+ , tunedModelState :: !(Maybe E'State3)+ -- ^ /ReadOnly/ "state" - Output only. The state of the tuned model.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON TunedModel+instance A.FromJSON TunedModel where+ parseJSON = A.withObject "TunedModel" $ \o ->+ TunedModel+ <$> (o .:? "updateTime")+ <*> (o .:? "name")+ <*> (o .:? "createTime")+ <*> (o .: "tuningTask")+ <*> (o .:? "tunedModelSource")+ <*> (o .:? "baseModel")+ <*> (o .:? "readerProjectNumbers")+ <*> (o .:? "displayName")+ <*> (o .:? "temperature")+ <*> (o .:? "description")+ <*> (o .:? "topP")+ <*> (o .:? "topK")+ <*> (o .:? "state")++-- | ToJSON TunedModel+instance A.ToJSON TunedModel where+ toJSON TunedModel {..} =+ _omitNulls+ [ "updateTime" .= tunedModelUpdateTime+ , "name" .= tunedModelName+ , "createTime" .= tunedModelCreateTime+ , "tuningTask" .= tunedModelTuningTask+ , "tunedModelSource" .= tunedModelTunedModelSource+ , "baseModel" .= tunedModelBaseModel+ , "readerProjectNumbers" .= tunedModelReaderProjectNumbers+ , "displayName" .= tunedModelDisplayName+ , "temperature" .= tunedModelTemperature+ , "description" .= tunedModelDescription+ , "topP" .= tunedModelTopP+ , "topK" .= tunedModelTopK+ , "state" .= tunedModelState+ ]++-- | Construct a value of type 'TunedModel' (by applying it's required fields, if any)+mkTunedModel ::+ -- | 'tunedModelTuningTask': Required. The tuning task that creates the tuned model.+ TuningTask ->+ TunedModel+mkTunedModel tunedModelTuningTask =+ TunedModel+ { tunedModelUpdateTime = Nothing+ , tunedModelName = Nothing+ , tunedModelCreateTime = Nothing+ , tunedModelTuningTask+ , tunedModelTunedModelSource = Nothing+ , tunedModelBaseModel = Nothing+ , tunedModelReaderProjectNumbers = Nothing+ , tunedModelDisplayName = Nothing+ , tunedModelTemperature = Nothing+ , tunedModelDescription = Nothing+ , tunedModelTopP = Nothing+ , tunedModelTopK = Nothing+ , tunedModelState = Nothing+ }++-- ** TunedModelSource++{- | TunedModelSource+Tuned model as a source for training a new model.+-}+data TunedModelSource = TunedModelSource+ { tunedModelSourceTunedModel :: !(Maybe Text)+ -- ^ "tunedModel" - Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model`+ , tunedModelSourceBaseModel :: !(Maybe Text)+ -- ^ /ReadOnly/ "baseModel" - Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/gemini-1.5-flash-001`+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON TunedModelSource+instance A.FromJSON TunedModelSource where+ parseJSON = A.withObject "TunedModelSource" $ \o ->+ TunedModelSource+ <$> (o .:? "tunedModel")+ <*> (o .:? "baseModel")++-- | ToJSON TunedModelSource+instance A.ToJSON TunedModelSource where+ toJSON TunedModelSource {..} =+ _omitNulls+ [ "tunedModel" .= tunedModelSourceTunedModel+ , "baseModel" .= tunedModelSourceBaseModel+ ]++-- | Construct a value of type 'TunedModelSource' (by applying it's required fields, if any)+mkTunedModelSource ::+ TunedModelSource+mkTunedModelSource =+ TunedModelSource+ { tunedModelSourceTunedModel = Nothing+ , tunedModelSourceBaseModel = Nothing+ }++-- ** TuningExample++{- | TuningExample+A single example for tuning.+-}+data TuningExample = TuningExample+ { tuningExampleTextInput :: !(Maybe Text)+ -- ^ "textInput" - Optional. Text model input.+ , tuningExampleOutput :: !(Text)+ -- ^ /Required/ "output" - Required. The expected model output.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON TuningExample+instance A.FromJSON TuningExample where+ parseJSON = A.withObject "TuningExample" $ \o ->+ TuningExample+ <$> (o .:? "textInput")+ <*> (o .: "output")++-- | ToJSON TuningExample+instance A.ToJSON TuningExample where+ toJSON TuningExample {..} =+ _omitNulls+ [ "textInput" .= tuningExampleTextInput+ , "output" .= tuningExampleOutput+ ]++-- | Construct a value of type 'TuningExample' (by applying it's required fields, if any)+mkTuningExample ::+ -- | 'tuningExampleOutput': Required. The expected model output.+ Text ->+ TuningExample+mkTuningExample tuningExampleOutput =+ TuningExample+ { tuningExampleTextInput = Nothing+ , tuningExampleOutput+ }++-- ** TuningExamples++{- | TuningExamples+A set of tuning examples. Can be training or validation data.+-}+data TuningExamples = TuningExamples+ { tuningExamplesExamples :: !(Maybe [TuningExample])+ -- ^ "examples" - The examples. Example input can be for text or discuss, but all examples in a set must be of the same type.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON TuningExamples+instance A.FromJSON TuningExamples where+ parseJSON = A.withObject "TuningExamples" $ \o ->+ TuningExamples+ <$> (o .:? "examples")++-- | ToJSON TuningExamples+instance A.ToJSON TuningExamples where+ toJSON TuningExamples {..} =+ _omitNulls+ [ "examples" .= tuningExamplesExamples+ ]++-- | Construct a value of type 'TuningExamples' (by applying it's required fields, if any)+mkTuningExamples ::+ TuningExamples+mkTuningExamples =+ TuningExamples+ { tuningExamplesExamples = Nothing+ }++-- ** TuningSnapshot++{- | TuningSnapshot+Record for a single tuning step.+-}+data TuningSnapshot = TuningSnapshot+ { tuningSnapshotMeanLoss :: !(Maybe Float)+ -- ^ /ReadOnly/ "meanLoss" - Output only. The mean loss of the training examples for this step.+ , tuningSnapshotComputeTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "computeTime" - Output only. The timestamp when this metric was computed.+ , tuningSnapshotStep :: !(Maybe Int)+ -- ^ /ReadOnly/ "step" - Output only. The tuning step.+ , tuningSnapshotEpoch :: !(Maybe Int)+ -- ^ /ReadOnly/ "epoch" - Output only. The epoch this step was part of.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON TuningSnapshot+instance A.FromJSON TuningSnapshot where+ parseJSON = A.withObject "TuningSnapshot" $ \o ->+ TuningSnapshot+ <$> (o .:? "meanLoss")+ <*> (o .:? "computeTime")+ <*> (o .:? "step")+ <*> (o .:? "epoch")++-- | ToJSON TuningSnapshot+instance A.ToJSON TuningSnapshot where+ toJSON TuningSnapshot {..} =+ _omitNulls+ [ "meanLoss" .= tuningSnapshotMeanLoss+ , "computeTime" .= tuningSnapshotComputeTime+ , "step" .= tuningSnapshotStep+ , "epoch" .= tuningSnapshotEpoch+ ]++-- | Construct a value of type 'TuningSnapshot' (by applying it's required fields, if any)+mkTuningSnapshot ::+ TuningSnapshot+mkTuningSnapshot =+ TuningSnapshot+ { tuningSnapshotMeanLoss = Nothing+ , tuningSnapshotComputeTime = Nothing+ , tuningSnapshotStep = Nothing+ , tuningSnapshotEpoch = Nothing+ }++-- ** TuningTask++{- | TuningTask+Tuning tasks that create tuned models.+-}+data TuningTask = TuningTask+ { tuningTaskStartTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "startTime" - Output only. The timestamp when tuning this model started.+ , tuningTaskTrainingData :: !(Dataset)+ -- ^ /Required/ "trainingData" - Required. Input only. Immutable. The model training data.+ , tuningTaskHyperparameters :: !(Maybe Hyperparameters)+ -- ^ "hyperparameters" - Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used.+ , tuningTaskCompleteTime :: !(Maybe DateTime)+ -- ^ /ReadOnly/ "completeTime" - Output only. The timestamp when tuning this model completed.+ , tuningTaskSnapshots :: !(Maybe [TuningSnapshot])+ -- ^ /ReadOnly/ "snapshots" - Output only. Metrics collected during tuning.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON TuningTask+instance A.FromJSON TuningTask where+ parseJSON = A.withObject "TuningTask" $ \o ->+ TuningTask+ <$> (o .:? "startTime")+ <*> (o .: "trainingData")+ <*> (o .:? "hyperparameters")+ <*> (o .:? "completeTime")+ <*> (o .:? "snapshots")++-- | ToJSON TuningTask+instance A.ToJSON TuningTask where+ toJSON TuningTask {..} =+ _omitNulls+ [ "startTime" .= tuningTaskStartTime+ , "trainingData" .= tuningTaskTrainingData+ , "hyperparameters" .= tuningTaskHyperparameters+ , "completeTime" .= tuningTaskCompleteTime+ , "snapshots" .= tuningTaskSnapshots+ ]++-- | Construct a value of type 'TuningTask' (by applying it's required fields, if any)+mkTuningTask ::+ -- | 'tuningTaskTrainingData': Required. Input only. Immutable. The model training data.+ Dataset ->+ TuningTask+mkTuningTask tuningTaskTrainingData =+ TuningTask+ { tuningTaskStartTime = Nothing+ , tuningTaskTrainingData+ , tuningTaskHyperparameters = Nothing+ , tuningTaskCompleteTime = Nothing+ , tuningTaskSnapshots = Nothing+ }++-- ** UpdateChunkRequest++{- | UpdateChunkRequest+Request to update a `Chunk`.+-}+data UpdateChunkRequest = UpdateChunkRequest+ { updateChunkRequestUpdateMask :: !(Text)+ -- ^ /Required/ "updateMask" - Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.+ , updateChunkRequestChunk :: !(Chunk)+ -- ^ /Required/ "chunk" - Required. The `Chunk` to update.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON UpdateChunkRequest+instance A.FromJSON UpdateChunkRequest where+ parseJSON = A.withObject "UpdateChunkRequest" $ \o ->+ UpdateChunkRequest+ <$> (o .: "updateMask")+ <*> (o .: "chunk")++-- | ToJSON UpdateChunkRequest+instance A.ToJSON UpdateChunkRequest where+ toJSON UpdateChunkRequest {..} =+ _omitNulls+ [ "updateMask" .= updateChunkRequestUpdateMask+ , "chunk" .= updateChunkRequestChunk+ ]++-- | Construct a value of type 'UpdateChunkRequest' (by applying it's required fields, if any)+mkUpdateChunkRequest ::+ -- | 'updateChunkRequestUpdateMask': Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.+ Text ->+ -- | 'updateChunkRequestChunk': Required. The `Chunk` to update.+ Chunk ->+ UpdateChunkRequest+mkUpdateChunkRequest updateChunkRequestUpdateMask updateChunkRequestChunk =+ UpdateChunkRequest+ { updateChunkRequestUpdateMask+ , updateChunkRequestChunk+ }++-- ** UrlContextMetadata++{- | UrlContextMetadata+Metadata related to url context retrieval tool.+-}+data UrlContextMetadata = UrlContextMetadata+ { urlContextMetadataUrlMetadata :: !(Maybe [UrlMetadata])+ -- ^ "urlMetadata" - List of url context.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON UrlContextMetadata+instance A.FromJSON UrlContextMetadata where+ parseJSON = A.withObject "UrlContextMetadata" $ \o ->+ UrlContextMetadata+ <$> (o .:? "urlMetadata")++-- | ToJSON UrlContextMetadata+instance A.ToJSON UrlContextMetadata where+ toJSON UrlContextMetadata {..} =+ _omitNulls+ [ "urlMetadata" .= urlContextMetadataUrlMetadata+ ]++-- | Construct a value of type 'UrlContextMetadata' (by applying it's required fields, if any)+mkUrlContextMetadata ::+ UrlContextMetadata+mkUrlContextMetadata =+ UrlContextMetadata+ { urlContextMetadataUrlMetadata = Nothing+ }++-- ** UrlMetadata++{- | UrlMetadata+Context of the a single url retrieval.+-}+data UrlMetadata = UrlMetadata+ { urlMetadataRetrievedUrl :: !(Maybe Text)+ -- ^ "retrievedUrl" - Retrieved url by the tool.+ , urlMetadataUrlRetrievalStatus :: !(Maybe E'UrlRetrievalStatus)+ -- ^ "urlRetrievalStatus" - Status of the url retrieval.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON UrlMetadata+instance A.FromJSON UrlMetadata where+ parseJSON = A.withObject "UrlMetadata" $ \o ->+ UrlMetadata+ <$> (o .:? "retrievedUrl")+ <*> (o .:? "urlRetrievalStatus")++-- | ToJSON UrlMetadata+instance A.ToJSON UrlMetadata where+ toJSON UrlMetadata {..} =+ _omitNulls+ [ "retrievedUrl" .= urlMetadataRetrievedUrl+ , "urlRetrievalStatus" .= urlMetadataUrlRetrievalStatus+ ]++-- | Construct a value of type 'UrlMetadata' (by applying it's required fields, if any)+mkUrlMetadata ::+ UrlMetadata+mkUrlMetadata =+ UrlMetadata+ { urlMetadataRetrievedUrl = Nothing+ , urlMetadataUrlRetrievalStatus = Nothing+ }++-- ** UsageMetadata++{- | UsageMetadata+Metadata on the generation request's token usage.+-}+data UsageMetadata = UsageMetadata+ { usageMetadataCandidatesTokensDetails :: !(Maybe [ModalityTokenCount])+ -- ^ /ReadOnly/ "candidatesTokensDetails" - Output only. List of modalities that were returned in the response.+ , usageMetadataThoughtsTokenCount :: !(Maybe Int)+ -- ^ /ReadOnly/ "thoughtsTokenCount" - Output only. Number of tokens of thoughts for thinking models.+ , usageMetadataToolUsePromptTokenCount :: !(Maybe Int)+ -- ^ /ReadOnly/ "toolUsePromptTokenCount" - Output only. Number of tokens present in tool-use prompt(s).+ , usageMetadataCachedContentTokenCount :: !(Maybe Int)+ -- ^ "cachedContentTokenCount" - Number of tokens in the cached part of the prompt (the cached content)+ , usageMetadataPromptTokenCount :: !(Maybe Int)+ -- ^ "promptTokenCount" - Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.+ , usageMetadataCandidatesTokenCount :: !(Maybe Int)+ -- ^ "candidatesTokenCount" - Total number of tokens across all the generated response candidates.+ , usageMetadataPromptTokensDetails :: !(Maybe [ModalityTokenCount])+ -- ^ /ReadOnly/ "promptTokensDetails" - Output only. List of modalities that were processed in the request input.+ , usageMetadataTotalTokenCount :: !(Maybe Int)+ -- ^ "totalTokenCount" - Total token count for the generation request (prompt + response candidates).+ , usageMetadataCacheTokensDetails :: !(Maybe [ModalityTokenCount])+ -- ^ /ReadOnly/ "cacheTokensDetails" - Output only. List of modalities of the cached content in the request input.+ , usageMetadataToolUsePromptTokensDetails :: !(Maybe [ModalityTokenCount])+ -- ^ /ReadOnly/ "toolUsePromptTokensDetails" - Output only. List of modalities that were processed for tool-use request inputs.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON UsageMetadata+instance A.FromJSON UsageMetadata where+ parseJSON = A.withObject "UsageMetadata" $ \o ->+ UsageMetadata+ <$> (o .:? "candidatesTokensDetails")+ <*> (o .:? "thoughtsTokenCount")+ <*> (o .:? "toolUsePromptTokenCount")+ <*> (o .:? "cachedContentTokenCount")+ <*> (o .:? "promptTokenCount")+ <*> (o .:? "candidatesTokenCount")+ <*> (o .:? "promptTokensDetails")+ <*> (o .:? "totalTokenCount")+ <*> (o .:? "cacheTokensDetails")+ <*> (o .:? "toolUsePromptTokensDetails")++-- | ToJSON UsageMetadata+instance A.ToJSON UsageMetadata where+ toJSON UsageMetadata {..} =+ _omitNulls+ [ "candidatesTokensDetails" .= usageMetadataCandidatesTokensDetails+ , "thoughtsTokenCount" .= usageMetadataThoughtsTokenCount+ , "toolUsePromptTokenCount" .= usageMetadataToolUsePromptTokenCount+ , "cachedContentTokenCount" .= usageMetadataCachedContentTokenCount+ , "promptTokenCount" .= usageMetadataPromptTokenCount+ , "candidatesTokenCount" .= usageMetadataCandidatesTokenCount+ , "promptTokensDetails" .= usageMetadataPromptTokensDetails+ , "totalTokenCount" .= usageMetadataTotalTokenCount+ , "cacheTokensDetails" .= usageMetadataCacheTokensDetails+ , "toolUsePromptTokensDetails" .= usageMetadataToolUsePromptTokensDetails+ ]++-- | Construct a value of type 'UsageMetadata' (by applying it's required fields, if any)+mkUsageMetadata ::+ UsageMetadata+mkUsageMetadata =+ UsageMetadata+ { usageMetadataCandidatesTokensDetails = Nothing+ , usageMetadataThoughtsTokenCount = Nothing+ , usageMetadataToolUsePromptTokenCount = Nothing+ , usageMetadataCachedContentTokenCount = Nothing+ , usageMetadataPromptTokenCount = Nothing+ , usageMetadataCandidatesTokenCount = Nothing+ , usageMetadataPromptTokensDetails = Nothing+ , usageMetadataTotalTokenCount = Nothing+ , usageMetadataCacheTokensDetails = Nothing+ , usageMetadataToolUsePromptTokensDetails = Nothing+ }++-- ** Video++{- | Video+Representation of a video.+-}+data Video = Video+ { videoVideo :: !(Maybe ByteArray)+ -- ^ "video" - Raw bytes.+ , videoUri :: !(Maybe Text)+ -- ^ "uri" - Path to another storage.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Video+instance A.FromJSON Video where+ parseJSON = A.withObject "Video" $ \o ->+ Video+ <$> (o .:? "video")+ <*> (o .:? "uri")++-- | ToJSON Video+instance A.ToJSON Video where+ toJSON Video {..} =+ _omitNulls+ [ "video" .= videoVideo+ , "uri" .= videoUri+ ]++-- | Construct a value of type 'Video' (by applying it's required fields, if any)+mkVideo ::+ Video+mkVideo =+ Video+ { videoVideo = Nothing+ , videoUri = Nothing+ }++-- ** VideoFileMetadata++{- | VideoFileMetadata+Metadata for a video `File`.+-}+data VideoFileMetadata = VideoFileMetadata+ { videoFileMetadataVideoDuration :: !(Maybe Text)+ -- ^ "videoDuration" - Duration of the video.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON VideoFileMetadata+instance A.FromJSON VideoFileMetadata where+ parseJSON = A.withObject "VideoFileMetadata" $ \o ->+ VideoFileMetadata+ <$> (o .:? "videoDuration")++-- | ToJSON VideoFileMetadata+instance A.ToJSON VideoFileMetadata where+ toJSON VideoFileMetadata {..} =+ _omitNulls+ [ "videoDuration" .= videoFileMetadataVideoDuration+ ]++-- | Construct a value of type 'VideoFileMetadata' (by applying it's required fields, if any)+mkVideoFileMetadata ::+ VideoFileMetadata+mkVideoFileMetadata =+ VideoFileMetadata+ { videoFileMetadataVideoDuration = Nothing+ }++-- ** VideoMetadata++{- | VideoMetadata+Metadata describes the input video content.+-}+data VideoMetadata = VideoMetadata+ { videoMetadataEndOffset :: !(Maybe Text)+ -- ^ "endOffset" - Optional. The end offset of the video.+ , videoMetadataStartOffset :: !(Maybe Text)+ -- ^ "startOffset" - Optional. The start offset of the video.+ , videoMetadataFps :: !(Maybe Double)+ -- ^ "fps" - Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0].+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON VideoMetadata+instance A.FromJSON VideoMetadata where+ parseJSON = A.withObject "VideoMetadata" $ \o ->+ VideoMetadata+ <$> (o .:? "endOffset")+ <*> (o .:? "startOffset")+ <*> (o .:? "fps")++-- | ToJSON VideoMetadata+instance A.ToJSON VideoMetadata where+ toJSON VideoMetadata {..} =+ _omitNulls+ [ "endOffset" .= videoMetadataEndOffset+ , "startOffset" .= videoMetadataStartOffset+ , "fps" .= videoMetadataFps+ ]++-- | Construct a value of type 'VideoMetadata' (by applying it's required fields, if any)+mkVideoMetadata ::+ VideoMetadata+mkVideoMetadata =+ VideoMetadata+ { videoMetadataEndOffset = Nothing+ , videoMetadataStartOffset = Nothing+ , videoMetadataFps = Nothing+ }++-- ** VoiceConfig++{- | VoiceConfig+The configuration for the voice to use.+-}+data VoiceConfig = VoiceConfig+ { voiceConfigPrebuiltVoiceConfig :: !(Maybe PrebuiltVoiceConfig)+ -- ^ "prebuiltVoiceConfig" - The configuration for the prebuilt voice to use.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON VoiceConfig+instance A.FromJSON VoiceConfig where+ parseJSON = A.withObject "VoiceConfig" $ \o ->+ VoiceConfig+ <$> (o .:? "prebuiltVoiceConfig")++-- | ToJSON VoiceConfig+instance A.ToJSON VoiceConfig where+ toJSON VoiceConfig {..} =+ _omitNulls+ [ "prebuiltVoiceConfig" .= voiceConfigPrebuiltVoiceConfig+ ]++-- | Construct a value of type 'VoiceConfig' (by applying it's required fields, if any)+mkVoiceConfig ::+ VoiceConfig+mkVoiceConfig =+ VoiceConfig+ { voiceConfigPrebuiltVoiceConfig = Nothing+ }++-- ** Web++{- | Web+Chunk from the web.+-}+data Web = Web+ { webTitle :: !(Maybe Text)+ -- ^ "title" - Title of the chunk.+ , webUri :: !(Maybe Text)+ -- ^ "uri" - URI reference of the chunk.+ }+ deriving (P.Show, P.Eq, P.Typeable)++-- | FromJSON Web+instance A.FromJSON Web where+ parseJSON = A.withObject "Web" $ \o ->+ Web+ <$> (o .:? "title")+ <*> (o .:? "uri")++-- | ToJSON Web+instance A.ToJSON Web where+ toJSON Web {..} =+ _omitNulls+ [ "title" .= webTitle+ , "uri" .= webUri+ ]++-- | Construct a value of type 'Web' (by applying it's required fields, if any)+mkWeb ::+ Web+mkWeb =+ Web+ { webTitle = Nothing+ , webUri = Nothing+ }++-- * Enums++-- ** E'Alt++-- | Enum of 'Text'+data E'Alt+ = -- | @"json"@+ E'Alt'Json+ | -- | @"media"@+ E'Alt'Media+ | -- | @"proto"@+ E'Alt'Proto+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Alt where toJSON = A.toJSON . fromE'Alt+instance A.FromJSON E'Alt where parseJSON o = P.either P.fail (pure . P.id) . toE'Alt =<< A.parseJSON o+instance WH.ToHttpApiData E'Alt where toQueryParam = WH.toQueryParam . fromE'Alt+instance WH.FromHttpApiData E'Alt where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Alt+instance MimeRender MimeMultipartFormData E'Alt where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Alt' enum+fromE'Alt :: E'Alt -> Text+fromE'Alt = \case+ E'Alt'Json -> "json"+ E'Alt'Media -> "media"+ E'Alt'Proto -> "proto"++-- | parse 'E'Alt' enum+toE'Alt :: Text -> P.Either String E'Alt+toE'Alt = \case+ "json" -> P.Right E'Alt'Json+ "media" -> P.Right E'Alt'Media+ "proto" -> P.Right E'Alt'Proto+ s -> P.Left $ "toE'Alt: enum parse failure: " P.++ P.show s++-- ** E'AnswerStyle++{- | Enum of 'Text' .+Required. Style in which answers should be returned.+-}+data E'AnswerStyle+ = -- | @"ANSWER_STYLE_UNSPECIFIED"@+ E'AnswerStyle'ANSWER_STYLE_UNSPECIFIED+ | -- | @"ABSTRACTIVE"@+ E'AnswerStyle'ABSTRACTIVE+ | -- | @"EXTRACTIVE"@+ E'AnswerStyle'EXTRACTIVE+ | -- | @"VERBOSE"@+ E'AnswerStyle'VERBOSE+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'AnswerStyle where toJSON = A.toJSON . fromE'AnswerStyle+instance A.FromJSON E'AnswerStyle where parseJSON o = P.either P.fail (pure . P.id) . toE'AnswerStyle =<< A.parseJSON o+instance WH.ToHttpApiData E'AnswerStyle where toQueryParam = WH.toQueryParam . fromE'AnswerStyle+instance WH.FromHttpApiData E'AnswerStyle where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'AnswerStyle+instance MimeRender MimeMultipartFormData E'AnswerStyle where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'AnswerStyle' enum+fromE'AnswerStyle :: E'AnswerStyle -> Text+fromE'AnswerStyle = \case+ E'AnswerStyle'ANSWER_STYLE_UNSPECIFIED -> "ANSWER_STYLE_UNSPECIFIED"+ E'AnswerStyle'ABSTRACTIVE -> "ABSTRACTIVE"+ E'AnswerStyle'EXTRACTIVE -> "EXTRACTIVE"+ E'AnswerStyle'VERBOSE -> "VERBOSE"++-- | parse 'E'AnswerStyle' enum+toE'AnswerStyle :: Text -> P.Either String E'AnswerStyle+toE'AnswerStyle = \case+ "ANSWER_STYLE_UNSPECIFIED" -> P.Right E'AnswerStyle'ANSWER_STYLE_UNSPECIFIED+ "ABSTRACTIVE" -> P.Right E'AnswerStyle'ABSTRACTIVE+ "EXTRACTIVE" -> P.Right E'AnswerStyle'EXTRACTIVE+ "VERBOSE" -> P.Right E'AnswerStyle'VERBOSE+ s -> P.Left $ "toE'AnswerStyle: enum parse failure: " P.++ P.show s++-- ** E'Behavior++{- | Enum of 'Text' .+Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.+-}+data E'Behavior+ = -- | @"UNSPECIFIED"@+ E'Behavior'UNSPECIFIED+ | -- | @"BLOCKING"@+ E'Behavior'BLOCKING+ | -- | @"NON_BLOCKING"@+ E'Behavior'NON_BLOCKING+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Behavior where toJSON = A.toJSON . fromE'Behavior+instance A.FromJSON E'Behavior where parseJSON o = P.either P.fail (pure . P.id) . toE'Behavior =<< A.parseJSON o+instance WH.ToHttpApiData E'Behavior where toQueryParam = WH.toQueryParam . fromE'Behavior+instance WH.FromHttpApiData E'Behavior where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Behavior+instance MimeRender MimeMultipartFormData E'Behavior where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Behavior' enum+fromE'Behavior :: E'Behavior -> Text+fromE'Behavior = \case+ E'Behavior'UNSPECIFIED -> "UNSPECIFIED"+ E'Behavior'BLOCKING -> "BLOCKING"+ E'Behavior'NON_BLOCKING -> "NON_BLOCKING"++-- | parse 'E'Behavior' enum+toE'Behavior :: Text -> P.Either String E'Behavior+toE'Behavior = \case+ "UNSPECIFIED" -> P.Right E'Behavior'UNSPECIFIED+ "BLOCKING" -> P.Right E'Behavior'BLOCKING+ "NON_BLOCKING" -> P.Right E'Behavior'NON_BLOCKING+ s -> P.Left $ "toE'Behavior: enum parse failure: " P.++ P.show s++-- ** E'BlockReason++{- | Enum of 'Text' .+Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt.+-}+data E'BlockReason+ = -- | @"BLOCK_REASON_UNSPECIFIED"@+ E'BlockReason'BLOCK_REASON_UNSPECIFIED+ | -- | @"SAFETY"@+ E'BlockReason'SAFETY+ | -- | @"OTHER"@+ E'BlockReason'OTHER+ | -- | @"BLOCKLIST"@+ E'BlockReason'BLOCKLIST+ | -- | @"PROHIBITED_CONTENT"@+ E'BlockReason'PROHIBITED_CONTENT+ | -- | @"IMAGE_SAFETY"@+ E'BlockReason'IMAGE_SAFETY+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'BlockReason where toJSON = A.toJSON . fromE'BlockReason+instance A.FromJSON E'BlockReason where parseJSON o = P.either P.fail (pure . P.id) . toE'BlockReason =<< A.parseJSON o+instance WH.ToHttpApiData E'BlockReason where toQueryParam = WH.toQueryParam . fromE'BlockReason+instance WH.FromHttpApiData E'BlockReason where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'BlockReason+instance MimeRender MimeMultipartFormData E'BlockReason where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'BlockReason' enum+fromE'BlockReason :: E'BlockReason -> Text+fromE'BlockReason = \case+ E'BlockReason'BLOCK_REASON_UNSPECIFIED -> "BLOCK_REASON_UNSPECIFIED"+ E'BlockReason'SAFETY -> "SAFETY"+ E'BlockReason'OTHER -> "OTHER"+ E'BlockReason'BLOCKLIST -> "BLOCKLIST"+ E'BlockReason'PROHIBITED_CONTENT -> "PROHIBITED_CONTENT"+ E'BlockReason'IMAGE_SAFETY -> "IMAGE_SAFETY"++-- | parse 'E'BlockReason' enum+toE'BlockReason :: Text -> P.Either String E'BlockReason+toE'BlockReason = \case+ "BLOCK_REASON_UNSPECIFIED" -> P.Right E'BlockReason'BLOCK_REASON_UNSPECIFIED+ "SAFETY" -> P.Right E'BlockReason'SAFETY+ "OTHER" -> P.Right E'BlockReason'OTHER+ "BLOCKLIST" -> P.Right E'BlockReason'BLOCKLIST+ "PROHIBITED_CONTENT" -> P.Right E'BlockReason'PROHIBITED_CONTENT+ "IMAGE_SAFETY" -> P.Right E'BlockReason'IMAGE_SAFETY+ s -> P.Left $ "toE'BlockReason: enum parse failure: " P.++ P.show s++-- ** E'BlockReason2++{- | Enum of 'Text' .+Optional. If set, the input was blocked and no candidates are returned. Rephrase the input.+-}+data E'BlockReason2+ = -- | @"BLOCK_REASON_UNSPECIFIED"@+ E'BlockReason2'BLOCK_REASON_UNSPECIFIED+ | -- | @"SAFETY"@+ E'BlockReason2'SAFETY+ | -- | @"OTHER"@+ E'BlockReason2'OTHER+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'BlockReason2 where toJSON = A.toJSON . fromE'BlockReason2+instance A.FromJSON E'BlockReason2 where parseJSON o = P.either P.fail (pure . P.id) . toE'BlockReason2 =<< A.parseJSON o+instance WH.ToHttpApiData E'BlockReason2 where toQueryParam = WH.toQueryParam . fromE'BlockReason2+instance WH.FromHttpApiData E'BlockReason2 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'BlockReason2+instance MimeRender MimeMultipartFormData E'BlockReason2 where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'BlockReason2' enum+fromE'BlockReason2 :: E'BlockReason2 -> Text+fromE'BlockReason2 = \case+ E'BlockReason2'BLOCK_REASON_UNSPECIFIED -> "BLOCK_REASON_UNSPECIFIED"+ E'BlockReason2'SAFETY -> "SAFETY"+ E'BlockReason2'OTHER -> "OTHER"++-- | parse 'E'BlockReason2' enum+toE'BlockReason2 :: Text -> P.Either String E'BlockReason2+toE'BlockReason2 = \case+ "BLOCK_REASON_UNSPECIFIED" -> P.Right E'BlockReason2'BLOCK_REASON_UNSPECIFIED+ "SAFETY" -> P.Right E'BlockReason2'SAFETY+ "OTHER" -> P.Right E'BlockReason2'OTHER+ s -> P.Left $ "toE'BlockReason2: enum parse failure: " P.++ P.show s++-- ** E'FinishReason++{- | Enum of 'Text' .+Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.+-}+data E'FinishReason+ = -- | @"FINISH_REASON_UNSPECIFIED"@+ E'FinishReason'FINISH_REASON_UNSPECIFIED+ | -- | @"STOP"@+ E'FinishReason'STOP+ | -- | @"MAX_TOKENS"@+ E'FinishReason'MAX_TOKENS+ | -- | @"SAFETY"@+ E'FinishReason'SAFETY+ | -- | @"RECITATION"@+ E'FinishReason'RECITATION+ | -- | @"LANGUAGE"@+ E'FinishReason'LANGUAGE+ | -- | @"OTHER"@+ E'FinishReason'OTHER+ | -- | @"BLOCKLIST"@+ E'FinishReason'BLOCKLIST+ | -- | @"PROHIBITED_CONTENT"@+ E'FinishReason'PROHIBITED_CONTENT+ | -- | @"SPII"@+ E'FinishReason'SPII+ | -- | @"MALFORMED_FUNCTION_CALL"@+ E'FinishReason'MALFORMED_FUNCTION_CALL+ | -- | @"IMAGE_SAFETY"@+ E'FinishReason'IMAGE_SAFETY+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'FinishReason where toJSON = A.toJSON . fromE'FinishReason+instance A.FromJSON E'FinishReason where parseJSON o = P.either P.fail (pure . P.id) . toE'FinishReason =<< A.parseJSON o+instance WH.ToHttpApiData E'FinishReason where toQueryParam = WH.toQueryParam . fromE'FinishReason+instance WH.FromHttpApiData E'FinishReason where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'FinishReason+instance MimeRender MimeMultipartFormData E'FinishReason where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'FinishReason' enum+fromE'FinishReason :: E'FinishReason -> Text+fromE'FinishReason = \case+ E'FinishReason'FINISH_REASON_UNSPECIFIED -> "FINISH_REASON_UNSPECIFIED"+ E'FinishReason'STOP -> "STOP"+ E'FinishReason'MAX_TOKENS -> "MAX_TOKENS"+ E'FinishReason'SAFETY -> "SAFETY"+ E'FinishReason'RECITATION -> "RECITATION"+ E'FinishReason'LANGUAGE -> "LANGUAGE"+ E'FinishReason'OTHER -> "OTHER"+ E'FinishReason'BLOCKLIST -> "BLOCKLIST"+ E'FinishReason'PROHIBITED_CONTENT -> "PROHIBITED_CONTENT"+ E'FinishReason'SPII -> "SPII"+ E'FinishReason'MALFORMED_FUNCTION_CALL -> "MALFORMED_FUNCTION_CALL"+ E'FinishReason'IMAGE_SAFETY -> "IMAGE_SAFETY"++-- | parse 'E'FinishReason' enum+toE'FinishReason :: Text -> P.Either String E'FinishReason+toE'FinishReason = \case+ "FINISH_REASON_UNSPECIFIED" -> P.Right E'FinishReason'FINISH_REASON_UNSPECIFIED+ "STOP" -> P.Right E'FinishReason'STOP+ "MAX_TOKENS" -> P.Right E'FinishReason'MAX_TOKENS+ "SAFETY" -> P.Right E'FinishReason'SAFETY+ "RECITATION" -> P.Right E'FinishReason'RECITATION+ "LANGUAGE" -> P.Right E'FinishReason'LANGUAGE+ "OTHER" -> P.Right E'FinishReason'OTHER+ "BLOCKLIST" -> P.Right E'FinishReason'BLOCKLIST+ "PROHIBITED_CONTENT" -> P.Right E'FinishReason'PROHIBITED_CONTENT+ "SPII" -> P.Right E'FinishReason'SPII+ "MALFORMED_FUNCTION_CALL" -> P.Right E'FinishReason'MALFORMED_FUNCTION_CALL+ "IMAGE_SAFETY" -> P.Right E'FinishReason'IMAGE_SAFETY+ s -> P.Left $ "toE'FinishReason: enum parse failure: " P.++ P.show s++-- ** E'GranteeType++{- | Enum of 'Text' .+Optional. Immutable. The type of the grantee.+-}+data E'GranteeType+ = -- | @"GRANTEE_TYPE_UNSPECIFIED"@+ E'GranteeType'GRANTEE_TYPE_UNSPECIFIED+ | -- | @"USER"@+ E'GranteeType'USER+ | -- | @"GROUP"@+ E'GranteeType'GROUP+ | -- | @"EVERYONE"@+ E'GranteeType'EVERYONE+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'GranteeType where toJSON = A.toJSON . fromE'GranteeType+instance A.FromJSON E'GranteeType where parseJSON o = P.either P.fail (pure . P.id) . toE'GranteeType =<< A.parseJSON o+instance WH.ToHttpApiData E'GranteeType where toQueryParam = WH.toQueryParam . fromE'GranteeType+instance WH.FromHttpApiData E'GranteeType where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'GranteeType+instance MimeRender MimeMultipartFormData E'GranteeType where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'GranteeType' enum+fromE'GranteeType :: E'GranteeType -> Text+fromE'GranteeType = \case+ E'GranteeType'GRANTEE_TYPE_UNSPECIFIED -> "GRANTEE_TYPE_UNSPECIFIED"+ E'GranteeType'USER -> "USER"+ E'GranteeType'GROUP -> "GROUP"+ E'GranteeType'EVERYONE -> "EVERYONE"++-- | parse 'E'GranteeType' enum+toE'GranteeType :: Text -> P.Either String E'GranteeType+toE'GranteeType = \case+ "GRANTEE_TYPE_UNSPECIFIED" -> P.Right E'GranteeType'GRANTEE_TYPE_UNSPECIFIED+ "USER" -> P.Right E'GranteeType'USER+ "GROUP" -> P.Right E'GranteeType'GROUP+ "EVERYONE" -> P.Right E'GranteeType'EVERYONE+ s -> P.Left $ "toE'GranteeType: enum parse failure: " P.++ P.show s++-- ** E'Language++{- | Enum of 'Text' .+Required. Programming language of the `code`.+-}+data E'Language+ = -- | @"LANGUAGE_UNSPECIFIED"@+ E'Language'LANGUAGE_UNSPECIFIED+ | -- | @"PYTHON"@+ E'Language'PYTHON+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Language where toJSON = A.toJSON . fromE'Language+instance A.FromJSON E'Language where parseJSON o = P.either P.fail (pure . P.id) . toE'Language =<< A.parseJSON o+instance WH.ToHttpApiData E'Language where toQueryParam = WH.toQueryParam . fromE'Language+instance WH.FromHttpApiData E'Language where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Language+instance MimeRender MimeMultipartFormData E'Language where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Language' enum+fromE'Language :: E'Language -> Text+fromE'Language = \case+ E'Language'LANGUAGE_UNSPECIFIED -> "LANGUAGE_UNSPECIFIED"+ E'Language'PYTHON -> "PYTHON"++-- | parse 'E'Language' enum+toE'Language :: Text -> P.Either String E'Language+toE'Language = \case+ "LANGUAGE_UNSPECIFIED" -> P.Right E'Language'LANGUAGE_UNSPECIFIED+ "PYTHON" -> P.Right E'Language'PYTHON+ s -> P.Left $ "toE'Language: enum parse failure: " P.++ P.show s++-- ** E'MediaResolution++{- | Enum of 'Text' .+Optional. If specified, the media resolution specified will be used.+-}+data E'MediaResolution+ = -- | @"MEDIA_RESOLUTION_UNSPECIFIED"@+ E'MediaResolution'UNSPECIFIED+ | -- | @"MEDIA_RESOLUTION_LOW"@+ E'MediaResolution'LOW+ | -- | @"MEDIA_RESOLUTION_MEDIUM"@+ E'MediaResolution'MEDIUM+ | -- | @"MEDIA_RESOLUTION_HIGH"@+ E'MediaResolution'HIGH+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'MediaResolution where toJSON = A.toJSON . fromE'MediaResolution+instance A.FromJSON E'MediaResolution where parseJSON o = P.either P.fail (pure . P.id) . toE'MediaResolution =<< A.parseJSON o+instance WH.ToHttpApiData E'MediaResolution where toQueryParam = WH.toQueryParam . fromE'MediaResolution+instance WH.FromHttpApiData E'MediaResolution where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'MediaResolution+instance MimeRender MimeMultipartFormData E'MediaResolution where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'MediaResolution' enum+fromE'MediaResolution :: E'MediaResolution -> Text+fromE'MediaResolution = \case+ E'MediaResolution'UNSPECIFIED -> "MEDIA_RESOLUTION_UNSPECIFIED"+ E'MediaResolution'LOW -> "MEDIA_RESOLUTION_LOW"+ E'MediaResolution'MEDIUM -> "MEDIA_RESOLUTION_MEDIUM"+ E'MediaResolution'HIGH -> "MEDIA_RESOLUTION_HIGH"++-- | parse 'E'MediaResolution' enum+toE'MediaResolution :: Text -> P.Either String E'MediaResolution+toE'MediaResolution = \case+ "MEDIA_RESOLUTION_UNSPECIFIED" -> P.Right E'MediaResolution'UNSPECIFIED+ "MEDIA_RESOLUTION_LOW" -> P.Right E'MediaResolution'LOW+ "MEDIA_RESOLUTION_MEDIUM" -> P.Right E'MediaResolution'MEDIUM+ "MEDIA_RESOLUTION_HIGH" -> P.Right E'MediaResolution'HIGH+ s -> P.Left $ "toE'MediaResolution: enum parse failure: " P.++ P.show s++-- ** E'Mode++{- | Enum of 'Text' .+The mode of the predictor to be used in dynamic retrieval.+-}+data E'Mode+ = -- | @"MODE_UNSPECIFIED"@+ E'Mode'UNSPECIFIED+ | -- | @"MODE_DYNAMIC"@+ E'Mode'DYNAMIC+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Mode where toJSON = A.toJSON . fromE'Mode+instance A.FromJSON E'Mode where parseJSON o = P.either P.fail (pure . P.id) . toE'Mode =<< A.parseJSON o+instance WH.ToHttpApiData E'Mode where toQueryParam = WH.toQueryParam . fromE'Mode+instance WH.FromHttpApiData E'Mode where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Mode+instance MimeRender MimeMultipartFormData E'Mode where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Mode' enum+fromE'Mode :: E'Mode -> Text+fromE'Mode = \case+ E'Mode'UNSPECIFIED -> "MODE_UNSPECIFIED"+ E'Mode'DYNAMIC -> "MODE_DYNAMIC"++-- | parse 'E'Mode' enum+toE'Mode :: Text -> P.Either String E'Mode+toE'Mode = \case+ "MODE_UNSPECIFIED" -> P.Right E'Mode'UNSPECIFIED+ "MODE_DYNAMIC" -> P.Right E'Mode'DYNAMIC+ s -> P.Left $ "toE'Mode: enum parse failure: " P.++ P.show s++-- ** E'Mode2++{- | Enum of 'Text' .+Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.+-}+data E'Mode2+ = -- | @"MODE_UNSPECIFIED"@+ E'Mode2'MODE_UNSPECIFIED+ | -- | @"AUTO"@+ E'Mode2'AUTO+ | -- | @"ANY"@+ E'Mode2'ANY+ | -- | @"NONE"@+ E'Mode2'NONE+ | -- | @"VALIDATED"@+ E'Mode2'VALIDATED+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Mode2 where toJSON = A.toJSON . fromE'Mode2+instance A.FromJSON E'Mode2 where parseJSON o = P.either P.fail (pure . P.id) . toE'Mode2 =<< A.parseJSON o+instance WH.ToHttpApiData E'Mode2 where toQueryParam = WH.toQueryParam . fromE'Mode2+instance WH.FromHttpApiData E'Mode2 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Mode2+instance MimeRender MimeMultipartFormData E'Mode2 where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Mode2' enum+fromE'Mode2 :: E'Mode2 -> Text+fromE'Mode2 = \case+ E'Mode2'MODE_UNSPECIFIED -> "MODE_UNSPECIFIED"+ E'Mode2'AUTO -> "AUTO"+ E'Mode2'ANY -> "ANY"+ E'Mode2'NONE -> "NONE"+ E'Mode2'VALIDATED -> "VALIDATED"++-- | parse 'E'Mode2' enum+toE'Mode2 :: Text -> P.Either String E'Mode2+toE'Mode2 = \case+ "MODE_UNSPECIFIED" -> P.Right E'Mode2'MODE_UNSPECIFIED+ "AUTO" -> P.Right E'Mode2'AUTO+ "ANY" -> P.Right E'Mode2'ANY+ "NONE" -> P.Right E'Mode2'NONE+ "VALIDATED" -> P.Right E'Mode2'VALIDATED+ s -> P.Left $ "toE'Mode2: enum parse failure: " P.++ P.show s++-- ** E'Operation++{- | Enum of 'Text' .+Required. Operator applied to the given key-value pair to trigger the condition.+-}+data E'Operation+ = -- | @"OPERATOR_UNSPECIFIED"@+ E'Operation'OPERATOR_UNSPECIFIED+ | -- | @"LESS"@+ E'Operation'LESS+ | -- | @"LESS_EQUAL"@+ E'Operation'LESS_EQUAL+ | -- | @"EQUAL"@+ E'Operation'EQUAL+ | -- | @"GREATER_EQUAL"@+ E'Operation'GREATER_EQUAL+ | -- | @"GREATER"@+ E'Operation'GREATER+ | -- | @"NOT_EQUAL"@+ E'Operation'NOT_EQUAL+ | -- | @"INCLUDES"@+ E'Operation'INCLUDES+ | -- | @"EXCLUDES"@+ E'Operation'EXCLUDES+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Operation where toJSON = A.toJSON . fromE'Operation+instance A.FromJSON E'Operation where parseJSON o = P.either P.fail (pure . P.id) . toE'Operation =<< A.parseJSON o+instance WH.ToHttpApiData E'Operation where toQueryParam = WH.toQueryParam . fromE'Operation+instance WH.FromHttpApiData E'Operation where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Operation+instance MimeRender MimeMultipartFormData E'Operation where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Operation' enum+fromE'Operation :: E'Operation -> Text+fromE'Operation = \case+ E'Operation'OPERATOR_UNSPECIFIED -> "OPERATOR_UNSPECIFIED"+ E'Operation'LESS -> "LESS"+ E'Operation'LESS_EQUAL -> "LESS_EQUAL"+ E'Operation'EQUAL -> "EQUAL"+ E'Operation'GREATER_EQUAL -> "GREATER_EQUAL"+ E'Operation'GREATER -> "GREATER"+ E'Operation'NOT_EQUAL -> "NOT_EQUAL"+ E'Operation'INCLUDES -> "INCLUDES"+ E'Operation'EXCLUDES -> "EXCLUDES"++-- | parse 'E'Operation' enum+toE'Operation :: Text -> P.Either String E'Operation+toE'Operation = \case+ "OPERATOR_UNSPECIFIED" -> P.Right E'Operation'OPERATOR_UNSPECIFIED+ "LESS" -> P.Right E'Operation'LESS+ "LESS_EQUAL" -> P.Right E'Operation'LESS_EQUAL+ "EQUAL" -> P.Right E'Operation'EQUAL+ "GREATER_EQUAL" -> P.Right E'Operation'GREATER_EQUAL+ "GREATER" -> P.Right E'Operation'GREATER+ "NOT_EQUAL" -> P.Right E'Operation'NOT_EQUAL+ "INCLUDES" -> P.Right E'Operation'INCLUDES+ "EXCLUDES" -> P.Right E'Operation'EXCLUDES+ s -> P.Left $ "toE'Operation: enum parse failure: " P.++ P.show s++-- ** E'Outcome++{- | Enum of 'Text' .+Required. Outcome of the code execution.+-}+data E'Outcome+ = -- | @"OUTCOME_UNSPECIFIED"@+ E'Outcome'UNSPECIFIED+ | -- | @"OUTCOME_OK"@+ E'Outcome'OK+ | -- | @"OUTCOME_FAILED"@+ E'Outcome'FAILED+ | -- | @"OUTCOME_DEADLINE_EXCEEDED"@+ E'Outcome'DEADLINE_EXCEEDED+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Outcome where toJSON = A.toJSON . fromE'Outcome+instance A.FromJSON E'Outcome where parseJSON o = P.either P.fail (pure . P.id) . toE'Outcome =<< A.parseJSON o+instance WH.ToHttpApiData E'Outcome where toQueryParam = WH.toQueryParam . fromE'Outcome+instance WH.FromHttpApiData E'Outcome where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Outcome+instance MimeRender MimeMultipartFormData E'Outcome where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Outcome' enum+fromE'Outcome :: E'Outcome -> Text+fromE'Outcome = \case+ E'Outcome'UNSPECIFIED -> "OUTCOME_UNSPECIFIED"+ E'Outcome'OK -> "OUTCOME_OK"+ E'Outcome'FAILED -> "OUTCOME_FAILED"+ E'Outcome'DEADLINE_EXCEEDED -> "OUTCOME_DEADLINE_EXCEEDED"++-- | parse 'E'Outcome' enum+toE'Outcome :: Text -> P.Either String E'Outcome+toE'Outcome = \case+ "OUTCOME_UNSPECIFIED" -> P.Right E'Outcome'UNSPECIFIED+ "OUTCOME_OK" -> P.Right E'Outcome'OK+ "OUTCOME_FAILED" -> P.Right E'Outcome'FAILED+ "OUTCOME_DEADLINE_EXCEEDED" -> P.Right E'Outcome'DEADLINE_EXCEEDED+ s -> P.Left $ "toE'Outcome: enum parse failure: " P.++ P.show s++-- ** E'Probability++{- | Enum of 'Text' .+Required. The probability of harm for this content.+-}+data E'Probability+ = -- | @"HARM_PROBABILITY_UNSPECIFIED"@+ E'Probability'HARM_PROBABILITY_UNSPECIFIED+ | -- | @"NEGLIGIBLE"@+ E'Probability'NEGLIGIBLE+ | -- | @"LOW"@+ E'Probability'LOW+ | -- | @"MEDIUM"@+ E'Probability'MEDIUM+ | -- | @"HIGH"@+ E'Probability'HIGH+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Probability where toJSON = A.toJSON . fromE'Probability+instance A.FromJSON E'Probability where parseJSON o = P.either P.fail (pure . P.id) . toE'Probability =<< A.parseJSON o+instance WH.ToHttpApiData E'Probability where toQueryParam = WH.toQueryParam . fromE'Probability+instance WH.FromHttpApiData E'Probability where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Probability+instance MimeRender MimeMultipartFormData E'Probability where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Probability' enum+fromE'Probability :: E'Probability -> Text+fromE'Probability = \case+ E'Probability'HARM_PROBABILITY_UNSPECIFIED -> "HARM_PROBABILITY_UNSPECIFIED"+ E'Probability'NEGLIGIBLE -> "NEGLIGIBLE"+ E'Probability'LOW -> "LOW"+ E'Probability'MEDIUM -> "MEDIUM"+ E'Probability'HIGH -> "HIGH"++-- | parse 'E'Probability' enum+toE'Probability :: Text -> P.Either String E'Probability+toE'Probability = \case+ "HARM_PROBABILITY_UNSPECIFIED" -> P.Right E'Probability'HARM_PROBABILITY_UNSPECIFIED+ "NEGLIGIBLE" -> P.Right E'Probability'NEGLIGIBLE+ "LOW" -> P.Right E'Probability'LOW+ "MEDIUM" -> P.Right E'Probability'MEDIUM+ "HIGH" -> P.Right E'Probability'HIGH+ s -> P.Left $ "toE'Probability: enum parse failure: " P.++ P.show s++-- ** E'Reason++{- | Enum of 'Text' .+The reason content was blocked during request processing.+-}+data E'Reason+ = -- | @"BLOCKED_REASON_UNSPECIFIED"@+ E'Reason'BLOCKED_REASON_UNSPECIFIED+ | -- | @"SAFETY"@+ E'Reason'SAFETY+ | -- | @"OTHER"@+ E'Reason'OTHER+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Reason where toJSON = A.toJSON . fromE'Reason+instance A.FromJSON E'Reason where parseJSON o = P.either P.fail (pure . P.id) . toE'Reason =<< A.parseJSON o+instance WH.ToHttpApiData E'Reason where toQueryParam = WH.toQueryParam . fromE'Reason+instance WH.FromHttpApiData E'Reason where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Reason+instance MimeRender MimeMultipartFormData E'Reason where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Reason' enum+fromE'Reason :: E'Reason -> Text+fromE'Reason = \case+ E'Reason'BLOCKED_REASON_UNSPECIFIED -> "BLOCKED_REASON_UNSPECIFIED"+ E'Reason'SAFETY -> "SAFETY"+ E'Reason'OTHER -> "OTHER"++-- | parse 'E'Reason' enum+toE'Reason :: Text -> P.Either String E'Reason+toE'Reason = \case+ "BLOCKED_REASON_UNSPECIFIED" -> P.Right E'Reason'BLOCKED_REASON_UNSPECIFIED+ "SAFETY" -> P.Right E'Reason'SAFETY+ "OTHER" -> P.Right E'Reason'OTHER+ s -> P.Left $ "toE'Reason: enum parse failure: " P.++ P.show s++-- ** E'ResponseModalities++-- | Enum of 'Text'+data E'ResponseModalities+ = -- | @"MODALITY_UNSPECIFIED"@+ E'ResponseModalities'MODALITY_UNSPECIFIED+ | -- | @"TEXT"@+ E'ResponseModalities'TEXT+ | -- | @"IMAGE"@+ E'ResponseModalities'IMAGE+ | -- | @"AUDIO"@+ E'ResponseModalities'AUDIO+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'ResponseModalities where toJSON = A.toJSON . fromE'ResponseModalities+instance A.FromJSON E'ResponseModalities where parseJSON o = P.either P.fail (pure . P.id) . toE'ResponseModalities =<< A.parseJSON o+instance WH.ToHttpApiData E'ResponseModalities where toQueryParam = WH.toQueryParam . fromE'ResponseModalities+instance WH.FromHttpApiData E'ResponseModalities where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'ResponseModalities+instance MimeRender MimeMultipartFormData E'ResponseModalities where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'ResponseModalities' enum+fromE'ResponseModalities :: E'ResponseModalities -> Text+fromE'ResponseModalities = \case+ E'ResponseModalities'MODALITY_UNSPECIFIED -> "MODALITY_UNSPECIFIED"+ E'ResponseModalities'TEXT -> "TEXT"+ E'ResponseModalities'IMAGE -> "IMAGE"+ E'ResponseModalities'AUDIO -> "AUDIO"++-- | parse 'E'ResponseModalities' enum+toE'ResponseModalities :: Text -> P.Either String E'ResponseModalities+toE'ResponseModalities = \case+ "MODALITY_UNSPECIFIED" -> P.Right E'ResponseModalities'MODALITY_UNSPECIFIED+ "TEXT" -> P.Right E'ResponseModalities'TEXT+ "IMAGE" -> P.Right E'ResponseModalities'IMAGE+ "AUDIO" -> P.Right E'ResponseModalities'AUDIO+ s -> P.Left $ "toE'ResponseModalities: enum parse failure: " P.++ P.show s++-- ** E'Role++{- | Enum of 'Text' .+Required. The role granted by this permission.+-}+data E'Role+ = -- | @"ROLE_UNSPECIFIED"@+ E'Role'ROLE_UNSPECIFIED+ | -- | @"OWNER"@+ E'Role'OWNER+ | -- | @"WRITER"@+ E'Role'WRITER+ | -- | @"READER"@+ E'Role'READER+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Role where toJSON = A.toJSON . fromE'Role+instance A.FromJSON E'Role where parseJSON o = P.either P.fail (pure . P.id) . toE'Role =<< A.parseJSON o+instance WH.ToHttpApiData E'Role where toQueryParam = WH.toQueryParam . fromE'Role+instance WH.FromHttpApiData E'Role where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Role+instance MimeRender MimeMultipartFormData E'Role where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Role' enum+fromE'Role :: E'Role -> Text+fromE'Role = \case+ E'Role'ROLE_UNSPECIFIED -> "ROLE_UNSPECIFIED"+ E'Role'OWNER -> "OWNER"+ E'Role'WRITER -> "WRITER"+ E'Role'READER -> "READER"++-- | parse 'E'Role' enum+toE'Role :: Text -> P.Either String E'Role+toE'Role = \case+ "ROLE_UNSPECIFIED" -> P.Right E'Role'ROLE_UNSPECIFIED+ "OWNER" -> P.Right E'Role'OWNER+ "WRITER" -> P.Right E'Role'WRITER+ "READER" -> P.Right E'Role'READER+ s -> P.Left $ "toE'Role: enum parse failure: " P.++ P.show s++-- ** E'Scheduling++{- | Enum of 'Text' .+Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.+-}+data E'Scheduling+ = -- | @"SCHEDULING_UNSPECIFIED"@+ E'Scheduling'SCHEDULING_UNSPECIFIED+ | -- | @"SILENT"@+ E'Scheduling'SILENT+ | -- | @"WHEN_IDLE"@+ E'Scheduling'WHEN_IDLE+ | -- | @"INTERRUPT"@+ E'Scheduling'INTERRUPT+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Scheduling where toJSON = A.toJSON . fromE'Scheduling+instance A.FromJSON E'Scheduling where parseJSON o = P.either P.fail (pure . P.id) . toE'Scheduling =<< A.parseJSON o+instance WH.ToHttpApiData E'Scheduling where toQueryParam = WH.toQueryParam . fromE'Scheduling+instance WH.FromHttpApiData E'Scheduling where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Scheduling+instance MimeRender MimeMultipartFormData E'Scheduling where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Scheduling' enum+fromE'Scheduling :: E'Scheduling -> Text+fromE'Scheduling = \case+ E'Scheduling'SCHEDULING_UNSPECIFIED -> "SCHEDULING_UNSPECIFIED"+ E'Scheduling'SILENT -> "SILENT"+ E'Scheduling'WHEN_IDLE -> "WHEN_IDLE"+ E'Scheduling'INTERRUPT -> "INTERRUPT"++-- | parse 'E'Scheduling' enum+toE'Scheduling :: Text -> P.Either String E'Scheduling+toE'Scheduling = \case+ "SCHEDULING_UNSPECIFIED" -> P.Right E'Scheduling'SCHEDULING_UNSPECIFIED+ "SILENT" -> P.Right E'Scheduling'SILENT+ "WHEN_IDLE" -> P.Right E'Scheduling'WHEN_IDLE+ "INTERRUPT" -> P.Right E'Scheduling'INTERRUPT+ s -> P.Left $ "toE'Scheduling: enum parse failure: " P.++ P.show s++-- ** E'Source++{- | Enum of 'Text' .+Source of the File.+-}+data E'Source+ = -- | @"SOURCE_UNSPECIFIED"@+ E'Source'SOURCE_UNSPECIFIED+ | -- | @"UPLOADED"@+ E'Source'UPLOADED+ | -- | @"GENERATED"@+ E'Source'GENERATED+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Source where toJSON = A.toJSON . fromE'Source+instance A.FromJSON E'Source where parseJSON o = P.either P.fail (pure . P.id) . toE'Source =<< A.parseJSON o+instance WH.ToHttpApiData E'Source where toQueryParam = WH.toQueryParam . fromE'Source+instance WH.FromHttpApiData E'Source where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Source+instance MimeRender MimeMultipartFormData E'Source where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Source' enum+fromE'Source :: E'Source -> Text+fromE'Source = \case+ E'Source'SOURCE_UNSPECIFIED -> "SOURCE_UNSPECIFIED"+ E'Source'UPLOADED -> "UPLOADED"+ E'Source'GENERATED -> "GENERATED"++-- | parse 'E'Source' enum+toE'Source :: Text -> P.Either String E'Source+toE'Source = \case+ "SOURCE_UNSPECIFIED" -> P.Right E'Source'SOURCE_UNSPECIFIED+ "UPLOADED" -> P.Right E'Source'UPLOADED+ "GENERATED" -> P.Right E'Source'GENERATED+ s -> P.Left $ "toE'Source: enum parse failure: " P.++ P.show s++-- ** E'State++{- | Enum of 'Text' .+Output only. Processing state of the File.+-}+data E'State+ = -- | @"STATE_UNSPECIFIED"@+ E'State'STATE_UNSPECIFIED+ | -- | @"PROCESSING"@+ E'State'PROCESSING+ | -- | @"ACTIVE"@+ E'State'ACTIVE+ | -- | @"FAILED"@+ E'State'FAILED+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'State where toJSON = A.toJSON . fromE'State+instance A.FromJSON E'State where parseJSON o = P.either P.fail (pure . P.id) . toE'State =<< A.parseJSON o+instance WH.ToHttpApiData E'State where toQueryParam = WH.toQueryParam . fromE'State+instance WH.FromHttpApiData E'State where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'State+instance MimeRender MimeMultipartFormData E'State where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'State' enum+fromE'State :: E'State -> Text+fromE'State = \case+ E'State'STATE_UNSPECIFIED -> "STATE_UNSPECIFIED"+ E'State'PROCESSING -> "PROCESSING"+ E'State'ACTIVE -> "ACTIVE"+ E'State'FAILED -> "FAILED"++-- | parse 'E'State' enum+toE'State :: Text -> P.Either String E'State+toE'State = \case+ "STATE_UNSPECIFIED" -> P.Right E'State'STATE_UNSPECIFIED+ "PROCESSING" -> P.Right E'State'PROCESSING+ "ACTIVE" -> P.Right E'State'ACTIVE+ "FAILED" -> P.Right E'State'FAILED+ s -> P.Left $ "toE'State: enum parse failure: " P.++ P.show s++-- ** E'State2++{- | Enum of 'Text' .+Output only. The state of the GeneratedFile.+-}+data E'State2+ = -- | @"STATE_UNSPECIFIED"@+ E'State2'STATE_UNSPECIFIED+ | -- | @"GENERATING"@+ E'State2'GENERATING+ | -- | @"GENERATED"@+ E'State2'GENERATED+ | -- | @"FAILED"@+ E'State2'FAILED+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'State2 where toJSON = A.toJSON . fromE'State2+instance A.FromJSON E'State2 where parseJSON o = P.either P.fail (pure . P.id) . toE'State2 =<< A.parseJSON o+instance WH.ToHttpApiData E'State2 where toQueryParam = WH.toQueryParam . fromE'State2+instance WH.FromHttpApiData E'State2 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'State2+instance MimeRender MimeMultipartFormData E'State2 where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'State2' enum+fromE'State2 :: E'State2 -> Text+fromE'State2 = \case+ E'State2'STATE_UNSPECIFIED -> "STATE_UNSPECIFIED"+ E'State2'GENERATING -> "GENERATING"+ E'State2'GENERATED -> "GENERATED"+ E'State2'FAILED -> "FAILED"++-- | parse 'E'State2' enum+toE'State2 :: Text -> P.Either String E'State2+toE'State2 = \case+ "STATE_UNSPECIFIED" -> P.Right E'State2'STATE_UNSPECIFIED+ "GENERATING" -> P.Right E'State2'GENERATING+ "GENERATED" -> P.Right E'State2'GENERATED+ "FAILED" -> P.Right E'State2'FAILED+ s -> P.Left $ "toE'State2: enum parse failure: " P.++ P.show s++-- ** E'State3++{- | Enum of 'Text' .+Output only. The state of the tuned model.+-}+data E'State3+ = -- | @"STATE_UNSPECIFIED"@+ E'State3'STATE_UNSPECIFIED+ | -- | @"CREATING"@+ E'State3'CREATING+ | -- | @"ACTIVE"@+ E'State3'ACTIVE+ | -- | @"FAILED"@+ E'State3'FAILED+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'State3 where toJSON = A.toJSON . fromE'State3+instance A.FromJSON E'State3 where parseJSON o = P.either P.fail (pure . P.id) . toE'State3 =<< A.parseJSON o+instance WH.ToHttpApiData E'State3 where toQueryParam = WH.toQueryParam . fromE'State3+instance WH.FromHttpApiData E'State3 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'State3+instance MimeRender MimeMultipartFormData E'State3 where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'State3' enum+fromE'State3 :: E'State3 -> Text+fromE'State3 = \case+ E'State3'STATE_UNSPECIFIED -> "STATE_UNSPECIFIED"+ E'State3'CREATING -> "CREATING"+ E'State3'ACTIVE -> "ACTIVE"+ E'State3'FAILED -> "FAILED"++-- | parse 'E'State3' enum+toE'State3 :: Text -> P.Either String E'State3+toE'State3 = \case+ "STATE_UNSPECIFIED" -> P.Right E'State3'STATE_UNSPECIFIED+ "CREATING" -> P.Right E'State3'CREATING+ "ACTIVE" -> P.Right E'State3'ACTIVE+ "FAILED" -> P.Right E'State3'FAILED+ s -> P.Left $ "toE'State3: enum parse failure: " P.++ P.show s++-- ** E'State4++{- | Enum of 'Text' .+Output only. Current state of the `Chunk`.+-}+data E'State4+ = -- | @"STATE_UNSPECIFIED"@+ E'State4'UNSPECIFIED+ | -- | @"STATE_PENDING_PROCESSING"@+ E'State4'PENDING_PROCESSING+ | -- | @"STATE_ACTIVE"@+ E'State4'ACTIVE+ | -- | @"STATE_FAILED"@+ E'State4'FAILED+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'State4 where toJSON = A.toJSON . fromE'State4+instance A.FromJSON E'State4 where parseJSON o = P.either P.fail (pure . P.id) . toE'State4 =<< A.parseJSON o+instance WH.ToHttpApiData E'State4 where toQueryParam = WH.toQueryParam . fromE'State4+instance WH.FromHttpApiData E'State4 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'State4+instance MimeRender MimeMultipartFormData E'State4 where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'State4' enum+fromE'State4 :: E'State4 -> Text+fromE'State4 = \case+ E'State4'UNSPECIFIED -> "STATE_UNSPECIFIED"+ E'State4'PENDING_PROCESSING -> "STATE_PENDING_PROCESSING"+ E'State4'ACTIVE -> "STATE_ACTIVE"+ E'State4'FAILED -> "STATE_FAILED"++-- | parse 'E'State4' enum+toE'State4 :: Text -> P.Either String E'State4+toE'State4 = \case+ "STATE_UNSPECIFIED" -> P.Right E'State4'UNSPECIFIED+ "STATE_PENDING_PROCESSING" -> P.Right E'State4'PENDING_PROCESSING+ "STATE_ACTIVE" -> P.Right E'State4'ACTIVE+ "STATE_FAILED" -> P.Right E'State4'FAILED+ s -> P.Left $ "toE'State4: enum parse failure: " P.++ P.show s++-- ** E'Threshold++{- | Enum of 'Text' .+Required. Controls the probability threshold at which harm is blocked.+-}+data E'Threshold+ = -- | @"HARM_BLOCK_THRESHOLD_UNSPECIFIED"@+ E'Threshold'HARM_BLOCK_THRESHOLD_UNSPECIFIED+ | -- | @"BLOCK_LOW_AND_ABOVE"@+ E'Threshold'BLOCK_LOW_AND_ABOVE+ | -- | @"BLOCK_MEDIUM_AND_ABOVE"@+ E'Threshold'BLOCK_MEDIUM_AND_ABOVE+ | -- | @"BLOCK_ONLY_HIGH"@+ E'Threshold'BLOCK_ONLY_HIGH+ | -- | @"BLOCK_NONE"@+ E'Threshold'BLOCK_NONE+ | -- | @"OFF"@+ E'Threshold'OFF+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Threshold where toJSON = A.toJSON . fromE'Threshold+instance A.FromJSON E'Threshold where parseJSON o = P.either P.fail (pure . P.id) . toE'Threshold =<< A.parseJSON o+instance WH.ToHttpApiData E'Threshold where toQueryParam = WH.toQueryParam . fromE'Threshold+instance WH.FromHttpApiData E'Threshold where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Threshold+instance MimeRender MimeMultipartFormData E'Threshold where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Threshold' enum+fromE'Threshold :: E'Threshold -> Text+fromE'Threshold = \case+ E'Threshold'HARM_BLOCK_THRESHOLD_UNSPECIFIED -> "HARM_BLOCK_THRESHOLD_UNSPECIFIED"+ E'Threshold'BLOCK_LOW_AND_ABOVE -> "BLOCK_LOW_AND_ABOVE"+ E'Threshold'BLOCK_MEDIUM_AND_ABOVE -> "BLOCK_MEDIUM_AND_ABOVE"+ E'Threshold'BLOCK_ONLY_HIGH -> "BLOCK_ONLY_HIGH"+ E'Threshold'BLOCK_NONE -> "BLOCK_NONE"+ E'Threshold'OFF -> "OFF"++-- | parse 'E'Threshold' enum+toE'Threshold :: Text -> P.Either String E'Threshold+toE'Threshold = \case+ "HARM_BLOCK_THRESHOLD_UNSPECIFIED" -> P.Right E'Threshold'HARM_BLOCK_THRESHOLD_UNSPECIFIED+ "BLOCK_LOW_AND_ABOVE" -> P.Right E'Threshold'BLOCK_LOW_AND_ABOVE+ "BLOCK_MEDIUM_AND_ABOVE" -> P.Right E'Threshold'BLOCK_MEDIUM_AND_ABOVE+ "BLOCK_ONLY_HIGH" -> P.Right E'Threshold'BLOCK_ONLY_HIGH+ "BLOCK_NONE" -> P.Right E'Threshold'BLOCK_NONE+ "OFF" -> P.Right E'Threshold'OFF+ s -> P.Left $ "toE'Threshold: enum parse failure: " P.++ P.show s++-- ** E'UrlRetrievalStatus++{- | Enum of 'Text' .+Status of the url retrieval.+-}+data E'UrlRetrievalStatus+ = -- | @"URL_RETRIEVAL_STATUS_UNSPECIFIED"@+ E'UrlRetrievalStatus'UNSPECIFIED+ | -- | @"URL_RETRIEVAL_STATUS_SUCCESS"@+ E'UrlRetrievalStatus'SUCCESS+ | -- | @"URL_RETRIEVAL_STATUS_ERROR"@+ E'UrlRetrievalStatus'ERROR+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'UrlRetrievalStatus where toJSON = A.toJSON . fromE'UrlRetrievalStatus+instance A.FromJSON E'UrlRetrievalStatus where parseJSON o = P.either P.fail (pure . P.id) . toE'UrlRetrievalStatus =<< A.parseJSON o+instance WH.ToHttpApiData E'UrlRetrievalStatus where toQueryParam = WH.toQueryParam . fromE'UrlRetrievalStatus+instance WH.FromHttpApiData E'UrlRetrievalStatus where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'UrlRetrievalStatus+instance MimeRender MimeMultipartFormData E'UrlRetrievalStatus where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'UrlRetrievalStatus' enum+fromE'UrlRetrievalStatus :: E'UrlRetrievalStatus -> Text+fromE'UrlRetrievalStatus = \case+ E'UrlRetrievalStatus'UNSPECIFIED -> "URL_RETRIEVAL_STATUS_UNSPECIFIED"+ E'UrlRetrievalStatus'SUCCESS -> "URL_RETRIEVAL_STATUS_SUCCESS"+ E'UrlRetrievalStatus'ERROR -> "URL_RETRIEVAL_STATUS_ERROR"++-- | parse 'E'UrlRetrievalStatus' enum+toE'UrlRetrievalStatus :: Text -> P.Either String E'UrlRetrievalStatus+toE'UrlRetrievalStatus = \case+ "URL_RETRIEVAL_STATUS_UNSPECIFIED" -> P.Right E'UrlRetrievalStatus'UNSPECIFIED+ "URL_RETRIEVAL_STATUS_SUCCESS" -> P.Right E'UrlRetrievalStatus'SUCCESS+ "URL_RETRIEVAL_STATUS_ERROR" -> P.Right E'UrlRetrievalStatus'ERROR+ s -> P.Left $ "toE'UrlRetrievalStatus: enum parse failure: " P.++ P.show s++-- ** E'Xgafv++-- | Enum of 'Text'+data E'Xgafv+ = -- | @"1"@+ E'Xgafv'1+ | -- | @"2"@+ E'Xgafv'2+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON E'Xgafv where toJSON = A.toJSON . fromE'Xgafv+instance A.FromJSON E'Xgafv where parseJSON o = P.either P.fail (pure . P.id) . toE'Xgafv =<< A.parseJSON o+instance WH.ToHttpApiData E'Xgafv where toQueryParam = WH.toQueryParam . fromE'Xgafv+instance WH.FromHttpApiData E'Xgafv where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Xgafv+instance MimeRender MimeMultipartFormData E'Xgafv where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'E'Xgafv' enum+fromE'Xgafv :: E'Xgafv -> Text+fromE'Xgafv = \case+ E'Xgafv'1 -> "1"+ E'Xgafv'2 -> "2"++-- | parse 'E'Xgafv' enum+toE'Xgafv :: Text -> P.Either String E'Xgafv+toE'Xgafv = \case+ "1" -> P.Right E'Xgafv'1+ "2" -> P.Right E'Xgafv'2+ s -> P.Left $ "toE'Xgafv: enum parse failure: " P.++ P.show s++-- ** HarmCategory++-- | Enum of 'Text'+data HarmCategory+ = -- | @"HARM_CATEGORY_UNSPECIFIED"@+ HarmCategory'UNSPECIFIED+ | -- | @"HARM_CATEGORY_DEROGATORY"@+ HarmCategory'DEROGATORY+ | -- | @"HARM_CATEGORY_TOXICITY"@+ HarmCategory'TOXICITY+ | -- | @"HARM_CATEGORY_VIOLENCE"@+ HarmCategory'VIOLENCE+ | -- | @"HARM_CATEGORY_SEXUAL"@+ HarmCategory'SEXUAL+ | -- | @"HARM_CATEGORY_MEDICAL"@+ HarmCategory'MEDICAL+ | -- | @"HARM_CATEGORY_DANGEROUS"@+ HarmCategory'DANGEROUS+ | -- | @"HARM_CATEGORY_HARASSMENT"@+ HarmCategory'HARASSMENT+ | -- | @"HARM_CATEGORY_HATE_SPEECH"@+ HarmCategory'HATE_SPEECH+ | -- | @"HARM_CATEGORY_SEXUALLY_EXPLICIT"@+ HarmCategory'SEXUALLY_EXPLICIT+ | -- | @"HARM_CATEGORY_DANGEROUS_CONTENT"@+ HarmCategory'DANGEROUS_CONTENT+ | -- | @"HARM_CATEGORY_CIVIC_INTEGRITY"@+ HarmCategory'CIVIC_INTEGRITY+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON HarmCategory where toJSON = A.toJSON . fromHarmCategory+instance A.FromJSON HarmCategory where parseJSON o = P.either P.fail (pure . P.id) . toHarmCategory =<< A.parseJSON o+instance WH.ToHttpApiData HarmCategory where toQueryParam = WH.toQueryParam . fromHarmCategory+instance WH.FromHttpApiData HarmCategory where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toHarmCategory+instance MimeRender MimeMultipartFormData HarmCategory where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'HarmCategory' enum+fromHarmCategory :: HarmCategory -> Text+fromHarmCategory = \case+ HarmCategory'UNSPECIFIED -> "HARM_CATEGORY_UNSPECIFIED"+ HarmCategory'DEROGATORY -> "HARM_CATEGORY_DEROGATORY"+ HarmCategory'TOXICITY -> "HARM_CATEGORY_TOXICITY"+ HarmCategory'VIOLENCE -> "HARM_CATEGORY_VIOLENCE"+ HarmCategory'SEXUAL -> "HARM_CATEGORY_SEXUAL"+ HarmCategory'MEDICAL -> "HARM_CATEGORY_MEDICAL"+ HarmCategory'DANGEROUS -> "HARM_CATEGORY_DANGEROUS"+ HarmCategory'HARASSMENT -> "HARM_CATEGORY_HARASSMENT"+ HarmCategory'HATE_SPEECH -> "HARM_CATEGORY_HATE_SPEECH"+ HarmCategory'SEXUALLY_EXPLICIT -> "HARM_CATEGORY_SEXUALLY_EXPLICIT"+ HarmCategory'DANGEROUS_CONTENT -> "HARM_CATEGORY_DANGEROUS_CONTENT"+ HarmCategory'CIVIC_INTEGRITY -> "HARM_CATEGORY_CIVIC_INTEGRITY"++-- | parse 'HarmCategory' enum+toHarmCategory :: Text -> P.Either String HarmCategory+toHarmCategory = \case+ "HARM_CATEGORY_UNSPECIFIED" -> P.Right HarmCategory'UNSPECIFIED+ "HARM_CATEGORY_DEROGATORY" -> P.Right HarmCategory'DEROGATORY+ "HARM_CATEGORY_TOXICITY" -> P.Right HarmCategory'TOXICITY+ "HARM_CATEGORY_VIOLENCE" -> P.Right HarmCategory'VIOLENCE+ "HARM_CATEGORY_SEXUAL" -> P.Right HarmCategory'SEXUAL+ "HARM_CATEGORY_MEDICAL" -> P.Right HarmCategory'MEDICAL+ "HARM_CATEGORY_DANGEROUS" -> P.Right HarmCategory'DANGEROUS+ "HARM_CATEGORY_HARASSMENT" -> P.Right HarmCategory'HARASSMENT+ "HARM_CATEGORY_HATE_SPEECH" -> P.Right HarmCategory'HATE_SPEECH+ "HARM_CATEGORY_SEXUALLY_EXPLICIT" -> P.Right HarmCategory'SEXUALLY_EXPLICIT+ "HARM_CATEGORY_DANGEROUS_CONTENT" -> P.Right HarmCategory'DANGEROUS_CONTENT+ "HARM_CATEGORY_CIVIC_INTEGRITY" -> P.Right HarmCategory'CIVIC_INTEGRITY+ s -> P.Left $ "toHarmCategory: enum parse failure: " P.++ P.show s++-- ** Modality++-- | Enum of 'Text'+data Modality+ = -- | @"MODALITY_UNSPECIFIED"@+ Modality'MODALITY_UNSPECIFIED+ | -- | @"TEXT"@+ Modality'TEXT+ | -- | @"IMAGE"@+ Modality'IMAGE+ | -- | @"VIDEO"@+ Modality'VIDEO+ | -- | @"AUDIO"@+ Modality'AUDIO+ | -- | @"DOCUMENT"@+ Modality'DOCUMENT+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON Modality where toJSON = A.toJSON . fromModality+instance A.FromJSON Modality where parseJSON o = P.either P.fail (pure . P.id) . toModality =<< A.parseJSON o+instance WH.ToHttpApiData Modality where toQueryParam = WH.toQueryParam . fromModality+instance WH.FromHttpApiData Modality where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toModality+instance MimeRender MimeMultipartFormData Modality where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'Modality' enum+fromModality :: Modality -> Text+fromModality = \case+ Modality'MODALITY_UNSPECIFIED -> "MODALITY_UNSPECIFIED"+ Modality'TEXT -> "TEXT"+ Modality'IMAGE -> "IMAGE"+ Modality'VIDEO -> "VIDEO"+ Modality'AUDIO -> "AUDIO"+ Modality'DOCUMENT -> "DOCUMENT"++-- | parse 'Modality' enum+toModality :: Text -> P.Either String Modality+toModality = \case+ "MODALITY_UNSPECIFIED" -> P.Right Modality'MODALITY_UNSPECIFIED+ "TEXT" -> P.Right Modality'TEXT+ "IMAGE" -> P.Right Modality'IMAGE+ "VIDEO" -> P.Right Modality'VIDEO+ "AUDIO" -> P.Right Modality'AUDIO+ "DOCUMENT" -> P.Right Modality'DOCUMENT+ s -> P.Left $ "toModality: enum parse failure: " P.++ P.show s++-- ** ModelType++-- | Enum of 'Text'+data ModelType+ = -- | @"TYPE_UNSPECIFIED"@+ ModelType'TYPE_UNSPECIFIED+ | -- | @"STRING"@+ ModelType'STRING+ | -- | @"NUMBER"@+ ModelType'NUMBER+ | -- | @"INTEGER"@+ ModelType'INTEGER+ | -- | @"BOOLEAN"@+ ModelType'BOOLEAN+ | -- | @"ARRAY"@+ ModelType'ARRAY+ | -- | @"OBJECT"@+ ModelType'OBJECT+ | -- | @"NULL"@+ ModelType'NULL+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON ModelType where toJSON = A.toJSON . fromModelType+instance A.FromJSON ModelType where parseJSON o = P.either P.fail (pure . P.id) . toModelType =<< A.parseJSON o+instance WH.ToHttpApiData ModelType where toQueryParam = WH.toQueryParam . fromModelType+instance WH.FromHttpApiData ModelType where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toModelType+instance MimeRender MimeMultipartFormData ModelType where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'ModelType' enum+fromModelType :: ModelType -> Text+fromModelType = \case+ ModelType'TYPE_UNSPECIFIED -> "TYPE_UNSPECIFIED"+ ModelType'STRING -> "STRING"+ ModelType'NUMBER -> "NUMBER"+ ModelType'INTEGER -> "INTEGER"+ ModelType'BOOLEAN -> "BOOLEAN"+ ModelType'ARRAY -> "ARRAY"+ ModelType'OBJECT -> "OBJECT"+ ModelType'NULL -> "NULL"++-- | parse 'ModelType' enum+toModelType :: Text -> P.Either String ModelType+toModelType = \case+ "TYPE_UNSPECIFIED" -> P.Right ModelType'TYPE_UNSPECIFIED+ "STRING" -> P.Right ModelType'STRING+ "NUMBER" -> P.Right ModelType'NUMBER+ "INTEGER" -> P.Right ModelType'INTEGER+ "BOOLEAN" -> P.Right ModelType'BOOLEAN+ "ARRAY" -> P.Right ModelType'ARRAY+ "OBJECT" -> P.Right ModelType'OBJECT+ "NULL" -> P.Right ModelType'NULL+ s -> P.Left $ "toModelType: enum parse failure: " P.++ P.show s++-- ** TaskType++-- | Enum of 'Text'+data TaskType+ = -- | @"TASK_TYPE_UNSPECIFIED"@+ TaskType'TASK_TYPE_UNSPECIFIED+ | -- | @"RETRIEVAL_QUERY"@+ TaskType'RETRIEVAL_QUERY+ | -- | @"RETRIEVAL_DOCUMENT"@+ TaskType'RETRIEVAL_DOCUMENT+ | -- | @"SEMANTIC_SIMILARITY"@+ TaskType'SEMANTIC_SIMILARITY+ | -- | @"CLASSIFICATION"@+ TaskType'CLASSIFICATION+ | -- | @"CLUSTERING"@+ TaskType'CLUSTERING+ | -- | @"QUESTION_ANSWERING"@+ TaskType'QUESTION_ANSWERING+ | -- | @"FACT_VERIFICATION"@+ TaskType'FACT_VERIFICATION+ | -- | @"CODE_RETRIEVAL_QUERY"@+ TaskType'CODE_RETRIEVAL_QUERY+ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)++instance A.ToJSON TaskType where toJSON = A.toJSON . fromTaskType+instance A.FromJSON TaskType where parseJSON o = P.either P.fail (pure . P.id) . toTaskType =<< A.parseJSON o+instance WH.ToHttpApiData TaskType where toQueryParam = WH.toQueryParam . fromTaskType+instance WH.FromHttpApiData TaskType where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toTaskType+instance MimeRender MimeMultipartFormData TaskType where mimeRender _ = mimeRenderDefaultMultipartFormData++-- | unwrap 'TaskType' enum+fromTaskType :: TaskType -> Text+fromTaskType = \case+ TaskType'TASK_TYPE_UNSPECIFIED -> "TASK_TYPE_UNSPECIFIED"+ TaskType'RETRIEVAL_QUERY -> "RETRIEVAL_QUERY"+ TaskType'RETRIEVAL_DOCUMENT -> "RETRIEVAL_DOCUMENT"+ TaskType'SEMANTIC_SIMILARITY -> "SEMANTIC_SIMILARITY"+ TaskType'CLASSIFICATION -> "CLASSIFICATION"+ TaskType'CLUSTERING -> "CLUSTERING"+ TaskType'QUESTION_ANSWERING -> "QUESTION_ANSWERING"+ TaskType'FACT_VERIFICATION -> "FACT_VERIFICATION"+ TaskType'CODE_RETRIEVAL_QUERY -> "CODE_RETRIEVAL_QUERY"++-- | parse 'TaskType' enum+toTaskType :: Text -> P.Either String TaskType+toTaskType = \case+ "TASK_TYPE_UNSPECIFIED" -> P.Right TaskType'TASK_TYPE_UNSPECIFIED+ "RETRIEVAL_QUERY" -> P.Right TaskType'RETRIEVAL_QUERY+ "RETRIEVAL_DOCUMENT" -> P.Right TaskType'RETRIEVAL_DOCUMENT+ "SEMANTIC_SIMILARITY" -> P.Right TaskType'SEMANTIC_SIMILARITY+ "CLASSIFICATION" -> P.Right TaskType'CLASSIFICATION+ "CLUSTERING" -> P.Right TaskType'CLUSTERING+ "QUESTION_ANSWERING" -> P.Right TaskType'QUESTION_ANSWERING+ "FACT_VERIFICATION" -> P.Right TaskType'FACT_VERIFICATION+ "CODE_RETRIEVAL_QUERY" -> P.Right TaskType'CODE_RETRIEVAL_QUERY+ s -> P.Left $ "toTaskType: enum parse failure: " P.++ P.show s
+ lib/GenAI/Client/ModelLens.hs view
@@ -0,0 +1,2599 @@+{-+ Generative Language API++ The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.++ OpenAPI Version: 3.0.3+ Generative Language API API version: v1beta+ Generated by OpenAPI Generator (https://openapi-generator.tech)+-}+{-# LANGUAGE KindSignatures #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE RecordWildCards #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}++{- |+Module : GenAI.Client.Lens+-}+module GenAI.Client.ModelLens where++import Data.Aeson qualified as A+import Data.ByteString.Lazy qualified as BL+import Data.Data qualified as P (Data, Typeable)+import Data.Map qualified as Map+import Data.Set qualified as Set+import Data.Time qualified as TI++import Data.Text (Text)++import Prelude (Applicative, Bool (..), Char, Double, FilePath, Float, Functor, Int, Integer, Maybe (..), Monad, String, fmap, maybe, mempty, pure, undefined, ($), (.), (<$>), (<*>), (=<<))+import Prelude qualified as P++import GenAI.Client.Core+import GenAI.Client.Model++-- * AttributionSourceId++-- | 'attributionSourceIdGroundingPassage' Lens+attributionSourceIdGroundingPassageL :: Lens_' AttributionSourceId (Maybe GroundingPassageId)+attributionSourceIdGroundingPassageL f AttributionSourceId {..} = (\attributionSourceIdGroundingPassage -> AttributionSourceId {attributionSourceIdGroundingPassage, ..}) <$> f attributionSourceIdGroundingPassage+{-# INLINE attributionSourceIdGroundingPassageL #-}++-- | 'attributionSourceIdSemanticRetrieverChunk' Lens+attributionSourceIdSemanticRetrieverChunkL :: Lens_' AttributionSourceId (Maybe SemanticRetrieverChunk)+attributionSourceIdSemanticRetrieverChunkL f AttributionSourceId {..} = (\attributionSourceIdSemanticRetrieverChunk -> AttributionSourceId {attributionSourceIdSemanticRetrieverChunk, ..}) <$> f attributionSourceIdSemanticRetrieverChunk+{-# INLINE attributionSourceIdSemanticRetrieverChunkL #-}++-- * BaseOperation++-- | 'baseOperationDone' Lens+baseOperationDoneL :: Lens_' BaseOperation (Maybe Bool)+baseOperationDoneL f BaseOperation {..} = (\baseOperationDone -> BaseOperation {baseOperationDone, ..}) <$> f baseOperationDone+{-# INLINE baseOperationDoneL #-}++-- | 'baseOperationName' Lens+baseOperationNameL :: Lens_' BaseOperation (Maybe Text)+baseOperationNameL f BaseOperation {..} = (\baseOperationName -> BaseOperation {baseOperationName, ..}) <$> f baseOperationName+{-# INLINE baseOperationNameL #-}++-- | 'baseOperationError' Lens+baseOperationErrorL :: Lens_' BaseOperation (Maybe Status)+baseOperationErrorL f BaseOperation {..} = (\baseOperationError -> BaseOperation {baseOperationError, ..}) <$> f baseOperationError+{-# INLINE baseOperationErrorL #-}++-- * BatchCreateChunksRequest++-- | 'batchCreateChunksRequestRequests' Lens+batchCreateChunksRequestRequestsL :: Lens_' BatchCreateChunksRequest ([CreateChunkRequest])+batchCreateChunksRequestRequestsL f BatchCreateChunksRequest {..} = (\batchCreateChunksRequestRequests -> BatchCreateChunksRequest {batchCreateChunksRequestRequests, ..}) <$> f batchCreateChunksRequestRequests+{-# INLINE batchCreateChunksRequestRequestsL #-}++-- * BatchCreateChunksResponse++-- | 'batchCreateChunksResponseChunks' Lens+batchCreateChunksResponseChunksL :: Lens_' BatchCreateChunksResponse (Maybe [Chunk])+batchCreateChunksResponseChunksL f BatchCreateChunksResponse {..} = (\batchCreateChunksResponseChunks -> BatchCreateChunksResponse {batchCreateChunksResponseChunks, ..}) <$> f batchCreateChunksResponseChunks+{-# INLINE batchCreateChunksResponseChunksL #-}++-- * BatchDeleteChunksRequest++-- | 'batchDeleteChunksRequestRequests' Lens+batchDeleteChunksRequestRequestsL :: Lens_' BatchDeleteChunksRequest ([DeleteChunkRequest])+batchDeleteChunksRequestRequestsL f BatchDeleteChunksRequest {..} = (\batchDeleteChunksRequestRequests -> BatchDeleteChunksRequest {batchDeleteChunksRequestRequests, ..}) <$> f batchDeleteChunksRequestRequests+{-# INLINE batchDeleteChunksRequestRequestsL #-}++-- * BatchEmbedContentsRequest++-- | 'batchEmbedContentsRequestRequests' Lens+batchEmbedContentsRequestRequestsL :: Lens_' BatchEmbedContentsRequest ([EmbedContentRequest])+batchEmbedContentsRequestRequestsL f BatchEmbedContentsRequest {..} = (\batchEmbedContentsRequestRequests -> BatchEmbedContentsRequest {batchEmbedContentsRequestRequests, ..}) <$> f batchEmbedContentsRequestRequests+{-# INLINE batchEmbedContentsRequestRequestsL #-}++-- * BatchEmbedContentsResponse++-- | 'batchEmbedContentsResponseEmbeddings' Lens+batchEmbedContentsResponseEmbeddingsL :: Lens_' BatchEmbedContentsResponse (Maybe [ContentEmbedding])+batchEmbedContentsResponseEmbeddingsL f BatchEmbedContentsResponse {..} = (\batchEmbedContentsResponseEmbeddings -> BatchEmbedContentsResponse {batchEmbedContentsResponseEmbeddings, ..}) <$> f batchEmbedContentsResponseEmbeddings+{-# INLINE batchEmbedContentsResponseEmbeddingsL #-}++-- * BatchEmbedTextRequest++-- | 'batchEmbedTextRequestRequests' Lens+batchEmbedTextRequestRequestsL :: Lens_' BatchEmbedTextRequest (Maybe [EmbedTextRequest])+batchEmbedTextRequestRequestsL f BatchEmbedTextRequest {..} = (\batchEmbedTextRequestRequests -> BatchEmbedTextRequest {batchEmbedTextRequestRequests, ..}) <$> f batchEmbedTextRequestRequests+{-# INLINE batchEmbedTextRequestRequestsL #-}++-- | 'batchEmbedTextRequestTexts' Lens+batchEmbedTextRequestTextsL :: Lens_' BatchEmbedTextRequest (Maybe [Text])+batchEmbedTextRequestTextsL f BatchEmbedTextRequest {..} = (\batchEmbedTextRequestTexts -> BatchEmbedTextRequest {batchEmbedTextRequestTexts, ..}) <$> f batchEmbedTextRequestTexts+{-# INLINE batchEmbedTextRequestTextsL #-}++-- * BatchEmbedTextResponse++-- | 'batchEmbedTextResponseEmbeddings' Lens+batchEmbedTextResponseEmbeddingsL :: Lens_' BatchEmbedTextResponse (Maybe [Embedding])+batchEmbedTextResponseEmbeddingsL f BatchEmbedTextResponse {..} = (\batchEmbedTextResponseEmbeddings -> BatchEmbedTextResponse {batchEmbedTextResponseEmbeddings, ..}) <$> f batchEmbedTextResponseEmbeddings+{-# INLINE batchEmbedTextResponseEmbeddingsL #-}++-- * BatchUpdateChunksRequest++-- | 'batchUpdateChunksRequestRequests' Lens+batchUpdateChunksRequestRequestsL :: Lens_' BatchUpdateChunksRequest ([UpdateChunkRequest])+batchUpdateChunksRequestRequestsL f BatchUpdateChunksRequest {..} = (\batchUpdateChunksRequestRequests -> BatchUpdateChunksRequest {batchUpdateChunksRequestRequests, ..}) <$> f batchUpdateChunksRequestRequests+{-# INLINE batchUpdateChunksRequestRequestsL #-}++-- * BatchUpdateChunksResponse++-- | 'batchUpdateChunksResponseChunks' Lens+batchUpdateChunksResponseChunksL :: Lens_' BatchUpdateChunksResponse (Maybe [Chunk])+batchUpdateChunksResponseChunksL f BatchUpdateChunksResponse {..} = (\batchUpdateChunksResponseChunks -> BatchUpdateChunksResponse {batchUpdateChunksResponseChunks, ..}) <$> f batchUpdateChunksResponseChunks+{-# INLINE batchUpdateChunksResponseChunksL #-}++-- * Blob++-- | 'blobData' Lens+blobDataL :: Lens_' Blob (Maybe ByteArray)+blobDataL f Blob {..} = (\blobData -> Blob {blobData, ..}) <$> f blobData+{-# INLINE blobDataL #-}++-- | 'blobMimeType' Lens+blobMimeTypeL :: Lens_' Blob (Maybe Text)+blobMimeTypeL f Blob {..} = (\blobMimeType -> Blob {blobMimeType, ..}) <$> f blobMimeType+{-# INLINE blobMimeTypeL #-}++-- * CachedContent++-- | 'cachedContentTools' Lens+cachedContentToolsL :: Lens_' CachedContent (Maybe [Tool])+cachedContentToolsL f CachedContent {..} = (\cachedContentTools -> CachedContent {cachedContentTools, ..}) <$> f cachedContentTools+{-# INLINE cachedContentToolsL #-}++-- | 'cachedContentDisplayName' Lens+cachedContentDisplayNameL :: Lens_' CachedContent (Maybe Text)+cachedContentDisplayNameL f CachedContent {..} = (\cachedContentDisplayName -> CachedContent {cachedContentDisplayName, ..}) <$> f cachedContentDisplayName+{-# INLINE cachedContentDisplayNameL #-}++-- | 'cachedContentModel' Lens+cachedContentModelL :: Lens_' CachedContent (Text)+cachedContentModelL f CachedContent {..} = (\cachedContentModel -> CachedContent {cachedContentModel, ..}) <$> f cachedContentModel+{-# INLINE cachedContentModelL #-}++-- | 'cachedContentExpireTime' Lens+cachedContentExpireTimeL :: Lens_' CachedContent (Maybe DateTime)+cachedContentExpireTimeL f CachedContent {..} = (\cachedContentExpireTime -> CachedContent {cachedContentExpireTime, ..}) <$> f cachedContentExpireTime+{-# INLINE cachedContentExpireTimeL #-}++-- | 'cachedContentUsageMetadata' Lens+cachedContentUsageMetadataL :: Lens_' CachedContent (Maybe CachedContentUsageMetadata)+cachedContentUsageMetadataL f CachedContent {..} = (\cachedContentUsageMetadata -> CachedContent {cachedContentUsageMetadata, ..}) <$> f cachedContentUsageMetadata+{-# INLINE cachedContentUsageMetadataL #-}++-- | 'cachedContentName' Lens+cachedContentNameL :: Lens_' CachedContent (Maybe Text)+cachedContentNameL f CachedContent {..} = (\cachedContentName -> CachedContent {cachedContentName, ..}) <$> f cachedContentName+{-# INLINE cachedContentNameL #-}++-- | 'cachedContentContents' Lens+cachedContentContentsL :: Lens_' CachedContent (Maybe [Content])+cachedContentContentsL f CachedContent {..} = (\cachedContentContents -> CachedContent {cachedContentContents, ..}) <$> f cachedContentContents+{-# INLINE cachedContentContentsL #-}++-- | 'cachedContentSystemInstruction' Lens+cachedContentSystemInstructionL :: Lens_' CachedContent (Maybe Content)+cachedContentSystemInstructionL f CachedContent {..} = (\cachedContentSystemInstruction -> CachedContent {cachedContentSystemInstruction, ..}) <$> f cachedContentSystemInstruction+{-# INLINE cachedContentSystemInstructionL #-}++-- | 'cachedContentToolConfig' Lens+cachedContentToolConfigL :: Lens_' CachedContent (Maybe ToolConfig)+cachedContentToolConfigL f CachedContent {..} = (\cachedContentToolConfig -> CachedContent {cachedContentToolConfig, ..}) <$> f cachedContentToolConfig+{-# INLINE cachedContentToolConfigL #-}++-- | 'cachedContentCreateTime' Lens+cachedContentCreateTimeL :: Lens_' CachedContent (Maybe DateTime)+cachedContentCreateTimeL f CachedContent {..} = (\cachedContentCreateTime -> CachedContent {cachedContentCreateTime, ..}) <$> f cachedContentCreateTime+{-# INLINE cachedContentCreateTimeL #-}++-- | 'cachedContentTtl' Lens+cachedContentTtlL :: Lens_' CachedContent (Maybe Text)+cachedContentTtlL f CachedContent {..} = (\cachedContentTtl -> CachedContent {cachedContentTtl, ..}) <$> f cachedContentTtl+{-# INLINE cachedContentTtlL #-}++-- | 'cachedContentUpdateTime' Lens+cachedContentUpdateTimeL :: Lens_' CachedContent (Maybe DateTime)+cachedContentUpdateTimeL f CachedContent {..} = (\cachedContentUpdateTime -> CachedContent {cachedContentUpdateTime, ..}) <$> f cachedContentUpdateTime+{-# INLINE cachedContentUpdateTimeL #-}++-- * CachedContentUsageMetadata++-- | 'cachedContentUsageMetadataTotalTokenCount' Lens+cachedContentUsageMetadataTotalTokenCountL :: Lens_' CachedContentUsageMetadata (Maybe Int)+cachedContentUsageMetadataTotalTokenCountL f CachedContentUsageMetadata {..} = (\cachedContentUsageMetadataTotalTokenCount -> CachedContentUsageMetadata {cachedContentUsageMetadataTotalTokenCount, ..}) <$> f cachedContentUsageMetadataTotalTokenCount+{-# INLINE cachedContentUsageMetadataTotalTokenCountL #-}++-- * Candidate++-- | 'candidateCitationMetadata' Lens+candidateCitationMetadataL :: Lens_' Candidate (Maybe CitationMetadata)+candidateCitationMetadataL f Candidate {..} = (\candidateCitationMetadata -> Candidate {candidateCitationMetadata, ..}) <$> f candidateCitationMetadata+{-# INLINE candidateCitationMetadataL #-}++-- | 'candidateGroundingMetadata' Lens+candidateGroundingMetadataL :: Lens_' Candidate (Maybe GroundingMetadata)+candidateGroundingMetadataL f Candidate {..} = (\candidateGroundingMetadata -> Candidate {candidateGroundingMetadata, ..}) <$> f candidateGroundingMetadata+{-# INLINE candidateGroundingMetadataL #-}++-- | 'candidateUrlContextMetadata' Lens+candidateUrlContextMetadataL :: Lens_' Candidate (Maybe UrlContextMetadata)+candidateUrlContextMetadataL f Candidate {..} = (\candidateUrlContextMetadata -> Candidate {candidateUrlContextMetadata, ..}) <$> f candidateUrlContextMetadata+{-# INLINE candidateUrlContextMetadataL #-}++-- | 'candidateGroundingAttributions' Lens+candidateGroundingAttributionsL :: Lens_' Candidate (Maybe [GroundingAttribution])+candidateGroundingAttributionsL f Candidate {..} = (\candidateGroundingAttributions -> Candidate {candidateGroundingAttributions, ..}) <$> f candidateGroundingAttributions+{-# INLINE candidateGroundingAttributionsL #-}++-- | 'candidateLogprobsResult' Lens+candidateLogprobsResultL :: Lens_' Candidate (Maybe LogprobsResult)+candidateLogprobsResultL f Candidate {..} = (\candidateLogprobsResult -> Candidate {candidateLogprobsResult, ..}) <$> f candidateLogprobsResult+{-# INLINE candidateLogprobsResultL #-}++-- | 'candidateContent' Lens+candidateContentL :: Lens_' Candidate (Maybe Content)+candidateContentL f Candidate {..} = (\candidateContent -> Candidate {candidateContent, ..}) <$> f candidateContent+{-# INLINE candidateContentL #-}++-- | 'candidateAvgLogprobs' Lens+candidateAvgLogprobsL :: Lens_' Candidate (Maybe Double)+candidateAvgLogprobsL f Candidate {..} = (\candidateAvgLogprobs -> Candidate {candidateAvgLogprobs, ..}) <$> f candidateAvgLogprobs+{-# INLINE candidateAvgLogprobsL #-}++-- | 'candidateIndex' Lens+candidateIndexL :: Lens_' Candidate (Maybe Int)+candidateIndexL f Candidate {..} = (\candidateIndex -> Candidate {candidateIndex, ..}) <$> f candidateIndex+{-# INLINE candidateIndexL #-}++-- | 'candidateFinishReason' Lens+candidateFinishReasonL :: Lens_' Candidate (Maybe E'FinishReason)+candidateFinishReasonL f Candidate {..} = (\candidateFinishReason -> Candidate {candidateFinishReason, ..}) <$> f candidateFinishReason+{-# INLINE candidateFinishReasonL #-}++-- | 'candidateSafetyRatings' Lens+candidateSafetyRatingsL :: Lens_' Candidate (Maybe [SafetyRating])+candidateSafetyRatingsL f Candidate {..} = (\candidateSafetyRatings -> Candidate {candidateSafetyRatings, ..}) <$> f candidateSafetyRatings+{-# INLINE candidateSafetyRatingsL #-}++-- | 'candidateTokenCount' Lens+candidateTokenCountL :: Lens_' Candidate (Maybe Int)+candidateTokenCountL f Candidate {..} = (\candidateTokenCount -> Candidate {candidateTokenCount, ..}) <$> f candidateTokenCount+{-# INLINE candidateTokenCountL #-}++-- * Chunk++-- | 'chunkCreateTime' Lens+chunkCreateTimeL :: Lens_' Chunk (Maybe DateTime)+chunkCreateTimeL f Chunk {..} = (\chunkCreateTime -> Chunk {chunkCreateTime, ..}) <$> f chunkCreateTime+{-# INLINE chunkCreateTimeL #-}++-- | 'chunkCustomMetadata' Lens+chunkCustomMetadataL :: Lens_' Chunk (Maybe [CustomMetadata])+chunkCustomMetadataL f Chunk {..} = (\chunkCustomMetadata -> Chunk {chunkCustomMetadata, ..}) <$> f chunkCustomMetadata+{-# INLINE chunkCustomMetadataL #-}++-- | 'chunkData' Lens+chunkDataL :: Lens_' Chunk (ChunkData)+chunkDataL f Chunk {..} = (\chunkData -> Chunk {chunkData, ..}) <$> f chunkData+{-# INLINE chunkDataL #-}++-- | 'chunkUpdateTime' Lens+chunkUpdateTimeL :: Lens_' Chunk (Maybe DateTime)+chunkUpdateTimeL f Chunk {..} = (\chunkUpdateTime -> Chunk {chunkUpdateTime, ..}) <$> f chunkUpdateTime+{-# INLINE chunkUpdateTimeL #-}++-- | 'chunkState' Lens+chunkStateL :: Lens_' Chunk (Maybe E'State4)+chunkStateL f Chunk {..} = (\chunkState -> Chunk {chunkState, ..}) <$> f chunkState+{-# INLINE chunkStateL #-}++-- | 'chunkName' Lens+chunkNameL :: Lens_' Chunk (Maybe Text)+chunkNameL f Chunk {..} = (\chunkName -> Chunk {chunkName, ..}) <$> f chunkName+{-# INLINE chunkNameL #-}++-- * ChunkData++-- | 'chunkDataStringValue' Lens+chunkDataStringValueL :: Lens_' ChunkData (Maybe Text)+chunkDataStringValueL f ChunkData {..} = (\chunkDataStringValue -> ChunkData {chunkDataStringValue, ..}) <$> f chunkDataStringValue+{-# INLINE chunkDataStringValueL #-}++-- * CitationMetadata++-- | 'citationMetadataCitationSources' Lens+citationMetadataCitationSourcesL :: Lens_' CitationMetadata (Maybe [CitationSource])+citationMetadataCitationSourcesL f CitationMetadata {..} = (\citationMetadataCitationSources -> CitationMetadata {citationMetadataCitationSources, ..}) <$> f citationMetadataCitationSources+{-# INLINE citationMetadataCitationSourcesL #-}++-- * CitationSource++-- | 'citationSourceStartIndex' Lens+citationSourceStartIndexL :: Lens_' CitationSource (Maybe Int)+citationSourceStartIndexL f CitationSource {..} = (\citationSourceStartIndex -> CitationSource {citationSourceStartIndex, ..}) <$> f citationSourceStartIndex+{-# INLINE citationSourceStartIndexL #-}++-- | 'citationSourceUri' Lens+citationSourceUriL :: Lens_' CitationSource (Maybe Text)+citationSourceUriL f CitationSource {..} = (\citationSourceUri -> CitationSource {citationSourceUri, ..}) <$> f citationSourceUri+{-# INLINE citationSourceUriL #-}++-- | 'citationSourceEndIndex' Lens+citationSourceEndIndexL :: Lens_' CitationSource (Maybe Int)+citationSourceEndIndexL f CitationSource {..} = (\citationSourceEndIndex -> CitationSource {citationSourceEndIndex, ..}) <$> f citationSourceEndIndex+{-# INLINE citationSourceEndIndexL #-}++-- | 'citationSourceLicense' Lens+citationSourceLicenseL :: Lens_' CitationSource (Maybe Text)+citationSourceLicenseL f CitationSource {..} = (\citationSourceLicense -> CitationSource {citationSourceLicense, ..}) <$> f citationSourceLicense+{-# INLINE citationSourceLicenseL #-}++-- * CodeExecutionResult++-- | 'codeExecutionResultOutcome' Lens+codeExecutionResultOutcomeL :: Lens_' CodeExecutionResult (E'Outcome)+codeExecutionResultOutcomeL f CodeExecutionResult {..} = (\codeExecutionResultOutcome -> CodeExecutionResult {codeExecutionResultOutcome, ..}) <$> f codeExecutionResultOutcome+{-# INLINE codeExecutionResultOutcomeL #-}++-- | 'codeExecutionResultOutput' Lens+codeExecutionResultOutputL :: Lens_' CodeExecutionResult (Maybe Text)+codeExecutionResultOutputL f CodeExecutionResult {..} = (\codeExecutionResultOutput -> CodeExecutionResult {codeExecutionResultOutput, ..}) <$> f codeExecutionResultOutput+{-# INLINE codeExecutionResultOutputL #-}++-- * Condition++-- | 'conditionNumericValue' Lens+conditionNumericValueL :: Lens_' Condition (Maybe Float)+conditionNumericValueL f Condition {..} = (\conditionNumericValue -> Condition {conditionNumericValue, ..}) <$> f conditionNumericValue+{-# INLINE conditionNumericValueL #-}++-- | 'conditionOperation' Lens+conditionOperationL :: Lens_' Condition (E'Operation)+conditionOperationL f Condition {..} = (\conditionOperation -> Condition {conditionOperation, ..}) <$> f conditionOperation+{-# INLINE conditionOperationL #-}++-- | 'conditionStringValue' Lens+conditionStringValueL :: Lens_' Condition (Maybe Text)+conditionStringValueL f Condition {..} = (\conditionStringValue -> Condition {conditionStringValue, ..}) <$> f conditionStringValue+{-# INLINE conditionStringValueL #-}++-- * Content++-- | 'contentParts' Lens+contentPartsL :: Lens_' Content (Maybe [Part])+contentPartsL f Content {..} = (\contentParts -> Content {contentParts, ..}) <$> f contentParts+{-# INLINE contentPartsL #-}++-- | 'contentRole' Lens+contentRoleL :: Lens_' Content (Maybe Text)+contentRoleL f Content {..} = (\contentRole -> Content {contentRole, ..}) <$> f contentRole+{-# INLINE contentRoleL #-}++-- * ContentEmbedding++-- | 'contentEmbeddingValues' Lens+contentEmbeddingValuesL :: Lens_' ContentEmbedding (Maybe [Float])+contentEmbeddingValuesL f ContentEmbedding {..} = (\contentEmbeddingValues -> ContentEmbedding {contentEmbeddingValues, ..}) <$> f contentEmbeddingValues+{-# INLINE contentEmbeddingValuesL #-}++-- * ContentFilter++-- | 'contentFilterReason' Lens+contentFilterReasonL :: Lens_' ContentFilter (Maybe E'Reason)+contentFilterReasonL f ContentFilter {..} = (\contentFilterReason -> ContentFilter {contentFilterReason, ..}) <$> f contentFilterReason+{-# INLINE contentFilterReasonL #-}++-- | 'contentFilterMessage' Lens+contentFilterMessageL :: Lens_' ContentFilter (Maybe Text)+contentFilterMessageL f ContentFilter {..} = (\contentFilterMessage -> ContentFilter {contentFilterMessage, ..}) <$> f contentFilterMessage+{-# INLINE contentFilterMessageL #-}++-- * Corpus++-- | 'corpusUpdateTime' Lens+corpusUpdateTimeL :: Lens_' Corpus (Maybe DateTime)+corpusUpdateTimeL f Corpus {..} = (\corpusUpdateTime -> Corpus {corpusUpdateTime, ..}) <$> f corpusUpdateTime+{-# INLINE corpusUpdateTimeL #-}++-- | 'corpusCreateTime' Lens+corpusCreateTimeL :: Lens_' Corpus (Maybe DateTime)+corpusCreateTimeL f Corpus {..} = (\corpusCreateTime -> Corpus {corpusCreateTime, ..}) <$> f corpusCreateTime+{-# INLINE corpusCreateTimeL #-}++-- | 'corpusDisplayName' Lens+corpusDisplayNameL :: Lens_' Corpus (Maybe Text)+corpusDisplayNameL f Corpus {..} = (\corpusDisplayName -> Corpus {corpusDisplayName, ..}) <$> f corpusDisplayName+{-# INLINE corpusDisplayNameL #-}++-- | 'corpusName' Lens+corpusNameL :: Lens_' Corpus (Maybe Text)+corpusNameL f Corpus {..} = (\corpusName -> Corpus {corpusName, ..}) <$> f corpusName+{-# INLINE corpusNameL #-}++-- * CountMessageTokensRequest++-- | 'countMessageTokensRequestPrompt' Lens+countMessageTokensRequestPromptL :: Lens_' CountMessageTokensRequest (MessagePrompt)+countMessageTokensRequestPromptL f CountMessageTokensRequest {..} = (\countMessageTokensRequestPrompt -> CountMessageTokensRequest {countMessageTokensRequestPrompt, ..}) <$> f countMessageTokensRequestPrompt+{-# INLINE countMessageTokensRequestPromptL #-}++-- * CountMessageTokensResponse++-- | 'countMessageTokensResponseTokenCount' Lens+countMessageTokensResponseTokenCountL :: Lens_' CountMessageTokensResponse (Maybe Int)+countMessageTokensResponseTokenCountL f CountMessageTokensResponse {..} = (\countMessageTokensResponseTokenCount -> CountMessageTokensResponse {countMessageTokensResponseTokenCount, ..}) <$> f countMessageTokensResponseTokenCount+{-# INLINE countMessageTokensResponseTokenCountL #-}++-- * CountTextTokensRequest++-- | 'countTextTokensRequestPrompt' Lens+countTextTokensRequestPromptL :: Lens_' CountTextTokensRequest (TextPrompt)+countTextTokensRequestPromptL f CountTextTokensRequest {..} = (\countTextTokensRequestPrompt -> CountTextTokensRequest {countTextTokensRequestPrompt, ..}) <$> f countTextTokensRequestPrompt+{-# INLINE countTextTokensRequestPromptL #-}++-- * CountTextTokensResponse++-- | 'countTextTokensResponseTokenCount' Lens+countTextTokensResponseTokenCountL :: Lens_' CountTextTokensResponse (Maybe Int)+countTextTokensResponseTokenCountL f CountTextTokensResponse {..} = (\countTextTokensResponseTokenCount -> CountTextTokensResponse {countTextTokensResponseTokenCount, ..}) <$> f countTextTokensResponseTokenCount+{-# INLINE countTextTokensResponseTokenCountL #-}++-- * CountTokensRequest++-- | 'countTokensRequestContents' Lens+countTokensRequestContentsL :: Lens_' CountTokensRequest (Maybe [Content])+countTokensRequestContentsL f CountTokensRequest {..} = (\countTokensRequestContents -> CountTokensRequest {countTokensRequestContents, ..}) <$> f countTokensRequestContents+{-# INLINE countTokensRequestContentsL #-}++-- | 'countTokensRequestGenerateContentRequest' Lens+countTokensRequestGenerateContentRequestL :: Lens_' CountTokensRequest (Maybe GenerateContentRequest)+countTokensRequestGenerateContentRequestL f CountTokensRequest {..} = (\countTokensRequestGenerateContentRequest -> CountTokensRequest {countTokensRequestGenerateContentRequest, ..}) <$> f countTokensRequestGenerateContentRequest+{-# INLINE countTokensRequestGenerateContentRequestL #-}++-- * CountTokensResponse++-- | 'countTokensResponseCacheTokensDetails' Lens+countTokensResponseCacheTokensDetailsL :: Lens_' CountTokensResponse (Maybe [ModalityTokenCount])+countTokensResponseCacheTokensDetailsL f CountTokensResponse {..} = (\countTokensResponseCacheTokensDetails -> CountTokensResponse {countTokensResponseCacheTokensDetails, ..}) <$> f countTokensResponseCacheTokensDetails+{-# INLINE countTokensResponseCacheTokensDetailsL #-}++-- | 'countTokensResponsePromptTokensDetails' Lens+countTokensResponsePromptTokensDetailsL :: Lens_' CountTokensResponse (Maybe [ModalityTokenCount])+countTokensResponsePromptTokensDetailsL f CountTokensResponse {..} = (\countTokensResponsePromptTokensDetails -> CountTokensResponse {countTokensResponsePromptTokensDetails, ..}) <$> f countTokensResponsePromptTokensDetails+{-# INLINE countTokensResponsePromptTokensDetailsL #-}++-- | 'countTokensResponseTotalTokens' Lens+countTokensResponseTotalTokensL :: Lens_' CountTokensResponse (Maybe Int)+countTokensResponseTotalTokensL f CountTokensResponse {..} = (\countTokensResponseTotalTokens -> CountTokensResponse {countTokensResponseTotalTokens, ..}) <$> f countTokensResponseTotalTokens+{-# INLINE countTokensResponseTotalTokensL #-}++-- | 'countTokensResponseCachedContentTokenCount' Lens+countTokensResponseCachedContentTokenCountL :: Lens_' CountTokensResponse (Maybe Int)+countTokensResponseCachedContentTokenCountL f CountTokensResponse {..} = (\countTokensResponseCachedContentTokenCount -> CountTokensResponse {countTokensResponseCachedContentTokenCount, ..}) <$> f countTokensResponseCachedContentTokenCount+{-# INLINE countTokensResponseCachedContentTokenCountL #-}++-- * CreateChunkRequest++-- | 'createChunkRequestParent' Lens+createChunkRequestParentL :: Lens_' CreateChunkRequest (Text)+createChunkRequestParentL f CreateChunkRequest {..} = (\createChunkRequestParent -> CreateChunkRequest {createChunkRequestParent, ..}) <$> f createChunkRequestParent+{-# INLINE createChunkRequestParentL #-}++-- | 'createChunkRequestChunk' Lens+createChunkRequestChunkL :: Lens_' CreateChunkRequest (Chunk)+createChunkRequestChunkL f CreateChunkRequest {..} = (\createChunkRequestChunk -> CreateChunkRequest {createChunkRequestChunk, ..}) <$> f createChunkRequestChunk+{-# INLINE createChunkRequestChunkL #-}++-- * CreateFileRequest++-- | 'createFileRequestFile' Lens+createFileRequestFileL :: Lens_' CreateFileRequest (Maybe File)+createFileRequestFileL f CreateFileRequest {..} = (\createFileRequestFile -> CreateFileRequest {createFileRequestFile, ..}) <$> f createFileRequestFile+{-# INLINE createFileRequestFileL #-}++-- * CreateFileResponse++-- | 'createFileResponseFile' Lens+createFileResponseFileL :: Lens_' CreateFileResponse (Maybe File)+createFileResponseFileL f CreateFileResponse {..} = (\createFileResponseFile -> CreateFileResponse {createFileResponseFile, ..}) <$> f createFileResponseFile+{-# INLINE createFileResponseFileL #-}++-- * CreateTunedModelMetadata++-- | 'createTunedModelMetadataCompletedPercent' Lens+createTunedModelMetadataCompletedPercentL :: Lens_' CreateTunedModelMetadata (Maybe Float)+createTunedModelMetadataCompletedPercentL f CreateTunedModelMetadata {..} = (\createTunedModelMetadataCompletedPercent -> CreateTunedModelMetadata {createTunedModelMetadataCompletedPercent, ..}) <$> f createTunedModelMetadataCompletedPercent+{-# INLINE createTunedModelMetadataCompletedPercentL #-}++-- | 'createTunedModelMetadataCompletedSteps' Lens+createTunedModelMetadataCompletedStepsL :: Lens_' CreateTunedModelMetadata (Maybe Int)+createTunedModelMetadataCompletedStepsL f CreateTunedModelMetadata {..} = (\createTunedModelMetadataCompletedSteps -> CreateTunedModelMetadata {createTunedModelMetadataCompletedSteps, ..}) <$> f createTunedModelMetadataCompletedSteps+{-# INLINE createTunedModelMetadataCompletedStepsL #-}++-- | 'createTunedModelMetadataTotalSteps' Lens+createTunedModelMetadataTotalStepsL :: Lens_' CreateTunedModelMetadata (Maybe Int)+createTunedModelMetadataTotalStepsL f CreateTunedModelMetadata {..} = (\createTunedModelMetadataTotalSteps -> CreateTunedModelMetadata {createTunedModelMetadataTotalSteps, ..}) <$> f createTunedModelMetadataTotalSteps+{-# INLINE createTunedModelMetadataTotalStepsL #-}++-- | 'createTunedModelMetadataSnapshots' Lens+createTunedModelMetadataSnapshotsL :: Lens_' CreateTunedModelMetadata (Maybe [TuningSnapshot])+createTunedModelMetadataSnapshotsL f CreateTunedModelMetadata {..} = (\createTunedModelMetadataSnapshots -> CreateTunedModelMetadata {createTunedModelMetadataSnapshots, ..}) <$> f createTunedModelMetadataSnapshots+{-# INLINE createTunedModelMetadataSnapshotsL #-}++-- | 'createTunedModelMetadataTunedModel' Lens+createTunedModelMetadataTunedModelL :: Lens_' CreateTunedModelMetadata (Maybe Text)+createTunedModelMetadataTunedModelL f CreateTunedModelMetadata {..} = (\createTunedModelMetadataTunedModel -> CreateTunedModelMetadata {createTunedModelMetadataTunedModel, ..}) <$> f createTunedModelMetadataTunedModel+{-# INLINE createTunedModelMetadataTunedModelL #-}++-- * CreateTunedModelOperation++-- | 'createTunedModelOperationDone' Lens+createTunedModelOperationDoneL :: Lens_' CreateTunedModelOperation (Maybe Bool)+createTunedModelOperationDoneL f CreateTunedModelOperation {..} = (\createTunedModelOperationDone -> CreateTunedModelOperation {createTunedModelOperationDone, ..}) <$> f createTunedModelOperationDone+{-# INLINE createTunedModelOperationDoneL #-}++-- | 'createTunedModelOperationName' Lens+createTunedModelOperationNameL :: Lens_' CreateTunedModelOperation (Maybe Text)+createTunedModelOperationNameL f CreateTunedModelOperation {..} = (\createTunedModelOperationName -> CreateTunedModelOperation {createTunedModelOperationName, ..}) <$> f createTunedModelOperationName+{-# INLINE createTunedModelOperationNameL #-}++-- | 'createTunedModelOperationError' Lens+createTunedModelOperationErrorL :: Lens_' CreateTunedModelOperation (Maybe Status)+createTunedModelOperationErrorL f CreateTunedModelOperation {..} = (\createTunedModelOperationError -> CreateTunedModelOperation {createTunedModelOperationError, ..}) <$> f createTunedModelOperationError+{-# INLINE createTunedModelOperationErrorL #-}++-- | 'createTunedModelOperationMetadata' Lens+createTunedModelOperationMetadataL :: Lens_' CreateTunedModelOperation (Maybe CreateTunedModelMetadata)+createTunedModelOperationMetadataL f CreateTunedModelOperation {..} = (\createTunedModelOperationMetadata -> CreateTunedModelOperation {createTunedModelOperationMetadata, ..}) <$> f createTunedModelOperationMetadata+{-# INLINE createTunedModelOperationMetadataL #-}++-- | 'createTunedModelOperationResponse' Lens+createTunedModelOperationResponseL :: Lens_' CreateTunedModelOperation (Maybe TunedModel)+createTunedModelOperationResponseL f CreateTunedModelOperation {..} = (\createTunedModelOperationResponse -> CreateTunedModelOperation {createTunedModelOperationResponse, ..}) <$> f createTunedModelOperationResponse+{-# INLINE createTunedModelOperationResponseL #-}++-- * CustomMetadata++-- | 'customMetadataStringListValue' Lens+customMetadataStringListValueL :: Lens_' CustomMetadata (Maybe StringList)+customMetadataStringListValueL f CustomMetadata {..} = (\customMetadataStringListValue -> CustomMetadata {customMetadataStringListValue, ..}) <$> f customMetadataStringListValue+{-# INLINE customMetadataStringListValueL #-}++-- | 'customMetadataStringValue' Lens+customMetadataStringValueL :: Lens_' CustomMetadata (Maybe Text)+customMetadataStringValueL f CustomMetadata {..} = (\customMetadataStringValue -> CustomMetadata {customMetadataStringValue, ..}) <$> f customMetadataStringValue+{-# INLINE customMetadataStringValueL #-}++-- | 'customMetadataKey' Lens+customMetadataKeyL :: Lens_' CustomMetadata (Text)+customMetadataKeyL f CustomMetadata {..} = (\customMetadataKey -> CustomMetadata {customMetadataKey, ..}) <$> f customMetadataKey+{-# INLINE customMetadataKeyL #-}++-- | 'customMetadataNumericValue' Lens+customMetadataNumericValueL :: Lens_' CustomMetadata (Maybe Float)+customMetadataNumericValueL f CustomMetadata {..} = (\customMetadataNumericValue -> CustomMetadata {customMetadataNumericValue, ..}) <$> f customMetadataNumericValue+{-# INLINE customMetadataNumericValueL #-}++-- * Dataset++-- | 'datasetExamples' Lens+datasetExamplesL :: Lens_' Dataset (Maybe TuningExamples)+datasetExamplesL f Dataset {..} = (\datasetExamples -> Dataset {datasetExamples, ..}) <$> f datasetExamples+{-# INLINE datasetExamplesL #-}++-- * DeleteChunkRequest++-- | 'deleteChunkRequestName' Lens+deleteChunkRequestNameL :: Lens_' DeleteChunkRequest (Text)+deleteChunkRequestNameL f DeleteChunkRequest {..} = (\deleteChunkRequestName -> DeleteChunkRequest {deleteChunkRequestName, ..}) <$> f deleteChunkRequestName+{-# INLINE deleteChunkRequestNameL #-}++-- * Document++-- | 'documentUpdateTime' Lens+documentUpdateTimeL :: Lens_' Document (Maybe DateTime)+documentUpdateTimeL f Document {..} = (\documentUpdateTime -> Document {documentUpdateTime, ..}) <$> f documentUpdateTime+{-# INLINE documentUpdateTimeL #-}++-- | 'documentName' Lens+documentNameL :: Lens_' Document (Maybe Text)+documentNameL f Document {..} = (\documentName -> Document {documentName, ..}) <$> f documentName+{-# INLINE documentNameL #-}++-- | 'documentCustomMetadata' Lens+documentCustomMetadataL :: Lens_' Document (Maybe [CustomMetadata])+documentCustomMetadataL f Document {..} = (\documentCustomMetadata -> Document {documentCustomMetadata, ..}) <$> f documentCustomMetadata+{-# INLINE documentCustomMetadataL #-}++-- | 'documentCreateTime' Lens+documentCreateTimeL :: Lens_' Document (Maybe DateTime)+documentCreateTimeL f Document {..} = (\documentCreateTime -> Document {documentCreateTime, ..}) <$> f documentCreateTime+{-# INLINE documentCreateTimeL #-}++-- | 'documentDisplayName' Lens+documentDisplayNameL :: Lens_' Document (Maybe Text)+documentDisplayNameL f Document {..} = (\documentDisplayName -> Document {documentDisplayName, ..}) <$> f documentDisplayName+{-# INLINE documentDisplayNameL #-}++-- * DynamicRetrievalConfig++-- | 'dynamicRetrievalConfigDynamicThreshold' Lens+dynamicRetrievalConfigDynamicThresholdL :: Lens_' DynamicRetrievalConfig (Maybe Float)+dynamicRetrievalConfigDynamicThresholdL f DynamicRetrievalConfig {..} = (\dynamicRetrievalConfigDynamicThreshold -> DynamicRetrievalConfig {dynamicRetrievalConfigDynamicThreshold, ..}) <$> f dynamicRetrievalConfigDynamicThreshold+{-# INLINE dynamicRetrievalConfigDynamicThresholdL #-}++-- | 'dynamicRetrievalConfigMode' Lens+dynamicRetrievalConfigModeL :: Lens_' DynamicRetrievalConfig (Maybe E'Mode)+dynamicRetrievalConfigModeL f DynamicRetrievalConfig {..} = (\dynamicRetrievalConfigMode -> DynamicRetrievalConfig {dynamicRetrievalConfigMode, ..}) <$> f dynamicRetrievalConfigMode+{-# INLINE dynamicRetrievalConfigModeL #-}++-- * EmbedContentRequest++-- | 'embedContentRequestTaskType' Lens+embedContentRequestTaskTypeL :: Lens_' EmbedContentRequest (Maybe TaskType)+embedContentRequestTaskTypeL f EmbedContentRequest {..} = (\embedContentRequestTaskType -> EmbedContentRequest {embedContentRequestTaskType, ..}) <$> f embedContentRequestTaskType+{-# INLINE embedContentRequestTaskTypeL #-}++-- | 'embedContentRequestContent' Lens+embedContentRequestContentL :: Lens_' EmbedContentRequest (Content)+embedContentRequestContentL f EmbedContentRequest {..} = (\embedContentRequestContent -> EmbedContentRequest {embedContentRequestContent, ..}) <$> f embedContentRequestContent+{-# INLINE embedContentRequestContentL #-}++-- | 'embedContentRequestOutputDimensionality' Lens+embedContentRequestOutputDimensionalityL :: Lens_' EmbedContentRequest (Maybe Int)+embedContentRequestOutputDimensionalityL f EmbedContentRequest {..} = (\embedContentRequestOutputDimensionality -> EmbedContentRequest {embedContentRequestOutputDimensionality, ..}) <$> f embedContentRequestOutputDimensionality+{-# INLINE embedContentRequestOutputDimensionalityL #-}++-- | 'embedContentRequestModel' Lens+embedContentRequestModelL :: Lens_' EmbedContentRequest (Text)+embedContentRequestModelL f EmbedContentRequest {..} = (\embedContentRequestModel -> EmbedContentRequest {embedContentRequestModel, ..}) <$> f embedContentRequestModel+{-# INLINE embedContentRequestModelL #-}++-- | 'embedContentRequestTitle' Lens+embedContentRequestTitleL :: Lens_' EmbedContentRequest (Maybe Text)+embedContentRequestTitleL f EmbedContentRequest {..} = (\embedContentRequestTitle -> EmbedContentRequest {embedContentRequestTitle, ..}) <$> f embedContentRequestTitle+{-# INLINE embedContentRequestTitleL #-}++-- * EmbedContentResponse++-- | 'embedContentResponseEmbedding' Lens+embedContentResponseEmbeddingL :: Lens_' EmbedContentResponse (Maybe ContentEmbedding)+embedContentResponseEmbeddingL f EmbedContentResponse {..} = (\embedContentResponseEmbedding -> EmbedContentResponse {embedContentResponseEmbedding, ..}) <$> f embedContentResponseEmbedding+{-# INLINE embedContentResponseEmbeddingL #-}++-- * EmbedTextRequest++-- | 'embedTextRequestText' Lens+embedTextRequestTextL :: Lens_' EmbedTextRequest (Maybe Text)+embedTextRequestTextL f EmbedTextRequest {..} = (\embedTextRequestText -> EmbedTextRequest {embedTextRequestText, ..}) <$> f embedTextRequestText+{-# INLINE embedTextRequestTextL #-}++-- | 'embedTextRequestModel' Lens+embedTextRequestModelL :: Lens_' EmbedTextRequest (Text)+embedTextRequestModelL f EmbedTextRequest {..} = (\embedTextRequestModel -> EmbedTextRequest {embedTextRequestModel, ..}) <$> f embedTextRequestModel+{-# INLINE embedTextRequestModelL #-}++-- * EmbedTextResponse++-- | 'embedTextResponseEmbedding' Lens+embedTextResponseEmbeddingL :: Lens_' EmbedTextResponse (Maybe Embedding)+embedTextResponseEmbeddingL f EmbedTextResponse {..} = (\embedTextResponseEmbedding -> EmbedTextResponse {embedTextResponseEmbedding, ..}) <$> f embedTextResponseEmbedding+{-# INLINE embedTextResponseEmbeddingL #-}++-- * Embedding++-- | 'embeddingValue' Lens+embeddingValueL :: Lens_' Embedding (Maybe [Float])+embeddingValueL f Embedding {..} = (\embeddingValue -> Embedding {embeddingValue, ..}) <$> f embeddingValue+{-# INLINE embeddingValueL #-}++-- * Example++-- | 'exampleOutput' Lens+exampleOutputL :: Lens_' Example (Message)+exampleOutputL f Example {..} = (\exampleOutput -> Example {exampleOutput, ..}) <$> f exampleOutput+{-# INLINE exampleOutputL #-}++-- | 'exampleInput' Lens+exampleInputL :: Lens_' Example (Message)+exampleInputL f Example {..} = (\exampleInput -> Example {exampleInput, ..}) <$> f exampleInput+{-# INLINE exampleInputL #-}++-- * ExecutableCode++-- | 'executableCodeLanguage' Lens+executableCodeLanguageL :: Lens_' ExecutableCode (E'Language)+executableCodeLanguageL f ExecutableCode {..} = (\executableCodeLanguage -> ExecutableCode {executableCodeLanguage, ..}) <$> f executableCodeLanguage+{-# INLINE executableCodeLanguageL #-}++-- | 'executableCodeCode' Lens+executableCodeCodeL :: Lens_' ExecutableCode (Text)+executableCodeCodeL f ExecutableCode {..} = (\executableCodeCode -> ExecutableCode {executableCodeCode, ..}) <$> f executableCodeCode+{-# INLINE executableCodeCodeL #-}++-- * File++-- | 'fileUri' Lens+fileUriL :: Lens_' File (Maybe Text)+fileUriL f File {..} = (\fileUri -> File {fileUri, ..}) <$> f fileUri+{-# INLINE fileUriL #-}++-- | 'fileName' Lens+fileNameL :: Lens_' File (Maybe Text)+fileNameL f File {..} = (\fileName -> File {fileName, ..}) <$> f fileName+{-# INLINE fileNameL #-}++-- | 'fileExpirationTime' Lens+fileExpirationTimeL :: Lens_' File (Maybe DateTime)+fileExpirationTimeL f File {..} = (\fileExpirationTime -> File {fileExpirationTime, ..}) <$> f fileExpirationTime+{-# INLINE fileExpirationTimeL #-}++-- | 'fileDisplayName' Lens+fileDisplayNameL :: Lens_' File (Maybe Text)+fileDisplayNameL f File {..} = (\fileDisplayName -> File {fileDisplayName, ..}) <$> f fileDisplayName+{-# INLINE fileDisplayNameL #-}++-- | 'fileVideoMetadata' Lens+fileVideoMetadataL :: Lens_' File (Maybe VideoFileMetadata)+fileVideoMetadataL f File {..} = (\fileVideoMetadata -> File {fileVideoMetadata, ..}) <$> f fileVideoMetadata+{-# INLINE fileVideoMetadataL #-}++-- | 'fileState' Lens+fileStateL :: Lens_' File (Maybe E'State)+fileStateL f File {..} = (\fileState -> File {fileState, ..}) <$> f fileState+{-# INLINE fileStateL #-}++-- | 'fileSource' Lens+fileSourceL :: Lens_' File (Maybe E'Source)+fileSourceL f File {..} = (\fileSource -> File {fileSource, ..}) <$> f fileSource+{-# INLINE fileSourceL #-}++-- | 'fileMimeType' Lens+fileMimeTypeL :: Lens_' File (Maybe Text)+fileMimeTypeL f File {..} = (\fileMimeType -> File {fileMimeType, ..}) <$> f fileMimeType+{-# INLINE fileMimeTypeL #-}++-- | 'fileCreateTime' Lens+fileCreateTimeL :: Lens_' File (Maybe DateTime)+fileCreateTimeL f File {..} = (\fileCreateTime -> File {fileCreateTime, ..}) <$> f fileCreateTime+{-# INLINE fileCreateTimeL #-}++-- | 'fileError' Lens+fileErrorL :: Lens_' File (Maybe Status)+fileErrorL f File {..} = (\fileError -> File {fileError, ..}) <$> f fileError+{-# INLINE fileErrorL #-}++-- | 'fileDownloadUri' Lens+fileDownloadUriL :: Lens_' File (Maybe Text)+fileDownloadUriL f File {..} = (\fileDownloadUri -> File {fileDownloadUri, ..}) <$> f fileDownloadUri+{-# INLINE fileDownloadUriL #-}++-- | 'fileSizeBytes' Lens+fileSizeBytesL :: Lens_' File (Maybe Text)+fileSizeBytesL f File {..} = (\fileSizeBytes -> File {fileSizeBytes, ..}) <$> f fileSizeBytes+{-# INLINE fileSizeBytesL #-}++-- | 'fileSha256Hash' Lens+fileSha256HashL :: Lens_' File (Maybe ByteArray)+fileSha256HashL f File {..} = (\fileSha256Hash -> File {fileSha256Hash, ..}) <$> f fileSha256Hash+{-# INLINE fileSha256HashL #-}++-- | 'fileUpdateTime' Lens+fileUpdateTimeL :: Lens_' File (Maybe DateTime)+fileUpdateTimeL f File {..} = (\fileUpdateTime -> File {fileUpdateTime, ..}) <$> f fileUpdateTime+{-# INLINE fileUpdateTimeL #-}++-- * FileData++-- | 'fileDataMimeType' Lens+fileDataMimeTypeL :: Lens_' FileData (Maybe Text)+fileDataMimeTypeL f FileData {..} = (\fileDataMimeType -> FileData {fileDataMimeType, ..}) <$> f fileDataMimeType+{-# INLINE fileDataMimeTypeL #-}++-- | 'fileDataFileUri' Lens+fileDataFileUriL :: Lens_' FileData (Text)+fileDataFileUriL f FileData {..} = (\fileDataFileUri -> FileData {fileDataFileUri, ..}) <$> f fileDataFileUri+{-# INLINE fileDataFileUriL #-}++-- * FunctionCall++-- | 'functionCallArgs' Lens+functionCallArgsL :: Lens_' FunctionCall (Maybe (Map.Map String String))+functionCallArgsL f FunctionCall {..} = (\functionCallArgs -> FunctionCall {functionCallArgs, ..}) <$> f functionCallArgs+{-# INLINE functionCallArgsL #-}++-- | 'functionCallId' Lens+functionCallIdL :: Lens_' FunctionCall (Maybe Text)+functionCallIdL f FunctionCall {..} = (\functionCallId -> FunctionCall {functionCallId, ..}) <$> f functionCallId+{-# INLINE functionCallIdL #-}++-- | 'functionCallName' Lens+functionCallNameL :: Lens_' FunctionCall (Text)+functionCallNameL f FunctionCall {..} = (\functionCallName -> FunctionCall {functionCallName, ..}) <$> f functionCallName+{-# INLINE functionCallNameL #-}++-- * FunctionCallingConfig++-- | 'functionCallingConfigMode' Lens+functionCallingConfigModeL :: Lens_' FunctionCallingConfig (Maybe E'Mode2)+functionCallingConfigModeL f FunctionCallingConfig {..} = (\functionCallingConfigMode -> FunctionCallingConfig {functionCallingConfigMode, ..}) <$> f functionCallingConfigMode+{-# INLINE functionCallingConfigModeL #-}++-- | 'functionCallingConfigAllowedFunctionNames' Lens+functionCallingConfigAllowedFunctionNamesL :: Lens_' FunctionCallingConfig (Maybe [Text])+functionCallingConfigAllowedFunctionNamesL f FunctionCallingConfig {..} = (\functionCallingConfigAllowedFunctionNames -> FunctionCallingConfig {functionCallingConfigAllowedFunctionNames, ..}) <$> f functionCallingConfigAllowedFunctionNames+{-# INLINE functionCallingConfigAllowedFunctionNamesL #-}++-- * FunctionDeclaration++-- | 'functionDeclarationParameters' Lens+functionDeclarationParametersL :: Lens_' FunctionDeclaration (Maybe Schema)+functionDeclarationParametersL f FunctionDeclaration {..} = (\functionDeclarationParameters -> FunctionDeclaration {functionDeclarationParameters, ..}) <$> f functionDeclarationParameters+{-# INLINE functionDeclarationParametersL #-}++-- | 'functionDeclarationName' Lens+functionDeclarationNameL :: Lens_' FunctionDeclaration (Text)+functionDeclarationNameL f FunctionDeclaration {..} = (\functionDeclarationName -> FunctionDeclaration {functionDeclarationName, ..}) <$> f functionDeclarationName+{-# INLINE functionDeclarationNameL #-}++-- | 'functionDeclarationBehavior' Lens+functionDeclarationBehaviorL :: Lens_' FunctionDeclaration (Maybe E'Behavior)+functionDeclarationBehaviorL f FunctionDeclaration {..} = (\functionDeclarationBehavior -> FunctionDeclaration {functionDeclarationBehavior, ..}) <$> f functionDeclarationBehavior+{-# INLINE functionDeclarationBehaviorL #-}++-- | 'functionDeclarationDescription' Lens+functionDeclarationDescriptionL :: Lens_' FunctionDeclaration (Text)+functionDeclarationDescriptionL f FunctionDeclaration {..} = (\functionDeclarationDescription -> FunctionDeclaration {functionDeclarationDescription, ..}) <$> f functionDeclarationDescription+{-# INLINE functionDeclarationDescriptionL #-}++-- | 'functionDeclarationResponse' Lens+functionDeclarationResponseL :: Lens_' FunctionDeclaration (Maybe Schema)+functionDeclarationResponseL f FunctionDeclaration {..} = (\functionDeclarationResponse -> FunctionDeclaration {functionDeclarationResponse, ..}) <$> f functionDeclarationResponse+{-# INLINE functionDeclarationResponseL #-}++-- | 'functionDeclarationResponseJsonSchema' Lens+functionDeclarationResponseJsonSchemaL :: Lens_' FunctionDeclaration (Maybe String)+functionDeclarationResponseJsonSchemaL f FunctionDeclaration {..} = (\functionDeclarationResponseJsonSchema -> FunctionDeclaration {functionDeclarationResponseJsonSchema, ..}) <$> f functionDeclarationResponseJsonSchema+{-# INLINE functionDeclarationResponseJsonSchemaL #-}++-- | 'functionDeclarationParametersJsonSchema' Lens+functionDeclarationParametersJsonSchemaL :: Lens_' FunctionDeclaration (Maybe String)+functionDeclarationParametersJsonSchemaL f FunctionDeclaration {..} = (\functionDeclarationParametersJsonSchema -> FunctionDeclaration {functionDeclarationParametersJsonSchema, ..}) <$> f functionDeclarationParametersJsonSchema+{-# INLINE functionDeclarationParametersJsonSchemaL #-}++-- * FunctionResponse++-- | 'functionResponseScheduling' Lens+functionResponseSchedulingL :: Lens_' FunctionResponse (Maybe E'Scheduling)+functionResponseSchedulingL f FunctionResponse {..} = (\functionResponseScheduling -> FunctionResponse {functionResponseScheduling, ..}) <$> f functionResponseScheduling+{-# INLINE functionResponseSchedulingL #-}++-- | 'functionResponseId' Lens+functionResponseIdL :: Lens_' FunctionResponse (Maybe Text)+functionResponseIdL f FunctionResponse {..} = (\functionResponseId -> FunctionResponse {functionResponseId, ..}) <$> f functionResponseId+{-# INLINE functionResponseIdL #-}++-- | 'functionResponseWillContinue' Lens+functionResponseWillContinueL :: Lens_' FunctionResponse (Maybe Bool)+functionResponseWillContinueL f FunctionResponse {..} = (\functionResponseWillContinue -> FunctionResponse {functionResponseWillContinue, ..}) <$> f functionResponseWillContinue+{-# INLINE functionResponseWillContinueL #-}++-- | 'functionResponseName' Lens+functionResponseNameL :: Lens_' FunctionResponse (Text)+functionResponseNameL f FunctionResponse {..} = (\functionResponseName -> FunctionResponse {functionResponseName, ..}) <$> f functionResponseName+{-# INLINE functionResponseNameL #-}++-- | 'functionResponseResponse' Lens+functionResponseResponseL :: Lens_' FunctionResponse ((Map.Map String String))+functionResponseResponseL f FunctionResponse {..} = (\functionResponseResponse -> FunctionResponse {functionResponseResponse, ..}) <$> f functionResponseResponse+{-# INLINE functionResponseResponseL #-}++-- * GenerateAnswerRequest++-- | 'generateAnswerRequestSemanticRetriever' Lens+generateAnswerRequestSemanticRetrieverL :: Lens_' GenerateAnswerRequest (Maybe SemanticRetrieverConfig)+generateAnswerRequestSemanticRetrieverL f GenerateAnswerRequest {..} = (\generateAnswerRequestSemanticRetriever -> GenerateAnswerRequest {generateAnswerRequestSemanticRetriever, ..}) <$> f generateAnswerRequestSemanticRetriever+{-# INLINE generateAnswerRequestSemanticRetrieverL #-}++-- | 'generateAnswerRequestTemperature' Lens+generateAnswerRequestTemperatureL :: Lens_' GenerateAnswerRequest (Maybe Float)+generateAnswerRequestTemperatureL f GenerateAnswerRequest {..} = (\generateAnswerRequestTemperature -> GenerateAnswerRequest {generateAnswerRequestTemperature, ..}) <$> f generateAnswerRequestTemperature+{-# INLINE generateAnswerRequestTemperatureL #-}++-- | 'generateAnswerRequestAnswerStyle' Lens+generateAnswerRequestAnswerStyleL :: Lens_' GenerateAnswerRequest (E'AnswerStyle)+generateAnswerRequestAnswerStyleL f GenerateAnswerRequest {..} = (\generateAnswerRequestAnswerStyle -> GenerateAnswerRequest {generateAnswerRequestAnswerStyle, ..}) <$> f generateAnswerRequestAnswerStyle+{-# INLINE generateAnswerRequestAnswerStyleL #-}++-- | 'generateAnswerRequestContents' Lens+generateAnswerRequestContentsL :: Lens_' GenerateAnswerRequest ([Content])+generateAnswerRequestContentsL f GenerateAnswerRequest {..} = (\generateAnswerRequestContents -> GenerateAnswerRequest {generateAnswerRequestContents, ..}) <$> f generateAnswerRequestContents+{-# INLINE generateAnswerRequestContentsL #-}++-- | 'generateAnswerRequestSafetySettings' Lens+generateAnswerRequestSafetySettingsL :: Lens_' GenerateAnswerRequest (Maybe [SafetySetting])+generateAnswerRequestSafetySettingsL f GenerateAnswerRequest {..} = (\generateAnswerRequestSafetySettings -> GenerateAnswerRequest {generateAnswerRequestSafetySettings, ..}) <$> f generateAnswerRequestSafetySettings+{-# INLINE generateAnswerRequestSafetySettingsL #-}++-- | 'generateAnswerRequestInlinePassages' Lens+generateAnswerRequestInlinePassagesL :: Lens_' GenerateAnswerRequest (Maybe GroundingPassages)+generateAnswerRequestInlinePassagesL f GenerateAnswerRequest {..} = (\generateAnswerRequestInlinePassages -> GenerateAnswerRequest {generateAnswerRequestInlinePassages, ..}) <$> f generateAnswerRequestInlinePassages+{-# INLINE generateAnswerRequestInlinePassagesL #-}++-- * GenerateAnswerResponse++-- | 'generateAnswerResponseAnswer' Lens+generateAnswerResponseAnswerL :: Lens_' GenerateAnswerResponse (Maybe Candidate)+generateAnswerResponseAnswerL f GenerateAnswerResponse {..} = (\generateAnswerResponseAnswer -> GenerateAnswerResponse {generateAnswerResponseAnswer, ..}) <$> f generateAnswerResponseAnswer+{-# INLINE generateAnswerResponseAnswerL #-}++-- | 'generateAnswerResponseInputFeedback' Lens+generateAnswerResponseInputFeedbackL :: Lens_' GenerateAnswerResponse (Maybe InputFeedback)+generateAnswerResponseInputFeedbackL f GenerateAnswerResponse {..} = (\generateAnswerResponseInputFeedback -> GenerateAnswerResponse {generateAnswerResponseInputFeedback, ..}) <$> f generateAnswerResponseInputFeedback+{-# INLINE generateAnswerResponseInputFeedbackL #-}++-- | 'generateAnswerResponseAnswerableProbability' Lens+generateAnswerResponseAnswerableProbabilityL :: Lens_' GenerateAnswerResponse (Maybe Float)+generateAnswerResponseAnswerableProbabilityL f GenerateAnswerResponse {..} = (\generateAnswerResponseAnswerableProbability -> GenerateAnswerResponse {generateAnswerResponseAnswerableProbability, ..}) <$> f generateAnswerResponseAnswerableProbability+{-# INLINE generateAnswerResponseAnswerableProbabilityL #-}++-- * GenerateContentRequest++-- | 'generateContentRequestToolConfig' Lens+generateContentRequestToolConfigL :: Lens_' GenerateContentRequest (Maybe ToolConfig)+generateContentRequestToolConfigL f GenerateContentRequest {..} = (\generateContentRequestToolConfig -> GenerateContentRequest {generateContentRequestToolConfig, ..}) <$> f generateContentRequestToolConfig+{-# INLINE generateContentRequestToolConfigL #-}++-- | 'generateContentRequestTools' Lens+generateContentRequestToolsL :: Lens_' GenerateContentRequest (Maybe [Tool])+generateContentRequestToolsL f GenerateContentRequest {..} = (\generateContentRequestTools -> GenerateContentRequest {generateContentRequestTools, ..}) <$> f generateContentRequestTools+{-# INLINE generateContentRequestToolsL #-}++-- | 'generateContentRequestContents' Lens+generateContentRequestContentsL :: Lens_' GenerateContentRequest ([Content])+generateContentRequestContentsL f GenerateContentRequest {..} = (\generateContentRequestContents -> GenerateContentRequest {generateContentRequestContents, ..}) <$> f generateContentRequestContents+{-# INLINE generateContentRequestContentsL #-}++-- | 'generateContentRequestSystemInstruction' Lens+generateContentRequestSystemInstructionL :: Lens_' GenerateContentRequest (Maybe Content)+generateContentRequestSystemInstructionL f GenerateContentRequest {..} = (\generateContentRequestSystemInstruction -> GenerateContentRequest {generateContentRequestSystemInstruction, ..}) <$> f generateContentRequestSystemInstruction+{-# INLINE generateContentRequestSystemInstructionL #-}++-- | 'generateContentRequestCachedContent' Lens+generateContentRequestCachedContentL :: Lens_' GenerateContentRequest (Maybe Text)+generateContentRequestCachedContentL f GenerateContentRequest {..} = (\generateContentRequestCachedContent -> GenerateContentRequest {generateContentRequestCachedContent, ..}) <$> f generateContentRequestCachedContent+{-# INLINE generateContentRequestCachedContentL #-}++-- | 'generateContentRequestSafetySettings' Lens+generateContentRequestSafetySettingsL :: Lens_' GenerateContentRequest (Maybe [SafetySetting])+generateContentRequestSafetySettingsL f GenerateContentRequest {..} = (\generateContentRequestSafetySettings -> GenerateContentRequest {generateContentRequestSafetySettings, ..}) <$> f generateContentRequestSafetySettings+{-# INLINE generateContentRequestSafetySettingsL #-}++-- | 'generateContentRequestModel' Lens+generateContentRequestModelL :: Lens_' GenerateContentRequest (Text)+generateContentRequestModelL f GenerateContentRequest {..} = (\generateContentRequestModel -> GenerateContentRequest {generateContentRequestModel, ..}) <$> f generateContentRequestModel+{-# INLINE generateContentRequestModelL #-}++-- | 'generateContentRequestGenerationConfig' Lens+generateContentRequestGenerationConfigL :: Lens_' GenerateContentRequest (Maybe GenerationConfig)+generateContentRequestGenerationConfigL f GenerateContentRequest {..} = (\generateContentRequestGenerationConfig -> GenerateContentRequest {generateContentRequestGenerationConfig, ..}) <$> f generateContentRequestGenerationConfig+{-# INLINE generateContentRequestGenerationConfigL #-}++-- * GenerateContentResponse++-- | 'generateContentResponseCandidates' Lens+generateContentResponseCandidatesL :: Lens_' GenerateContentResponse (Maybe [Candidate])+generateContentResponseCandidatesL f GenerateContentResponse {..} = (\generateContentResponseCandidates -> GenerateContentResponse {generateContentResponseCandidates, ..}) <$> f generateContentResponseCandidates+{-# INLINE generateContentResponseCandidatesL #-}++-- | 'generateContentResponseUsageMetadata' Lens+generateContentResponseUsageMetadataL :: Lens_' GenerateContentResponse (Maybe UsageMetadata)+generateContentResponseUsageMetadataL f GenerateContentResponse {..} = (\generateContentResponseUsageMetadata -> GenerateContentResponse {generateContentResponseUsageMetadata, ..}) <$> f generateContentResponseUsageMetadata+{-# INLINE generateContentResponseUsageMetadataL #-}++-- | 'generateContentResponseModelVersion' Lens+generateContentResponseModelVersionL :: Lens_' GenerateContentResponse (Maybe Text)+generateContentResponseModelVersionL f GenerateContentResponse {..} = (\generateContentResponseModelVersion -> GenerateContentResponse {generateContentResponseModelVersion, ..}) <$> f generateContentResponseModelVersion+{-# INLINE generateContentResponseModelVersionL #-}++-- | 'generateContentResponsePromptFeedback' Lens+generateContentResponsePromptFeedbackL :: Lens_' GenerateContentResponse (Maybe PromptFeedback)+generateContentResponsePromptFeedbackL f GenerateContentResponse {..} = (\generateContentResponsePromptFeedback -> GenerateContentResponse {generateContentResponsePromptFeedback, ..}) <$> f generateContentResponsePromptFeedback+{-# INLINE generateContentResponsePromptFeedbackL #-}++-- | 'generateContentResponseResponseId' Lens+generateContentResponseResponseIdL :: Lens_' GenerateContentResponse (Maybe Text)+generateContentResponseResponseIdL f GenerateContentResponse {..} = (\generateContentResponseResponseId -> GenerateContentResponse {generateContentResponseResponseId, ..}) <$> f generateContentResponseResponseId+{-# INLINE generateContentResponseResponseIdL #-}++-- * GenerateMessageRequest++-- | 'generateMessageRequestTemperature' Lens+generateMessageRequestTemperatureL :: Lens_' GenerateMessageRequest (Maybe Float)+generateMessageRequestTemperatureL f GenerateMessageRequest {..} = (\generateMessageRequestTemperature -> GenerateMessageRequest {generateMessageRequestTemperature, ..}) <$> f generateMessageRequestTemperature+{-# INLINE generateMessageRequestTemperatureL #-}++-- | 'generateMessageRequestTopP' Lens+generateMessageRequestTopPL :: Lens_' GenerateMessageRequest (Maybe Float)+generateMessageRequestTopPL f GenerateMessageRequest {..} = (\generateMessageRequestTopP -> GenerateMessageRequest {generateMessageRequestTopP, ..}) <$> f generateMessageRequestTopP+{-# INLINE generateMessageRequestTopPL #-}++-- | 'generateMessageRequestCandidateCount' Lens+generateMessageRequestCandidateCountL :: Lens_' GenerateMessageRequest (Maybe Int)+generateMessageRequestCandidateCountL f GenerateMessageRequest {..} = (\generateMessageRequestCandidateCount -> GenerateMessageRequest {generateMessageRequestCandidateCount, ..}) <$> f generateMessageRequestCandidateCount+{-# INLINE generateMessageRequestCandidateCountL #-}++-- | 'generateMessageRequestTopK' Lens+generateMessageRequestTopKL :: Lens_' GenerateMessageRequest (Maybe Int)+generateMessageRequestTopKL f GenerateMessageRequest {..} = (\generateMessageRequestTopK -> GenerateMessageRequest {generateMessageRequestTopK, ..}) <$> f generateMessageRequestTopK+{-# INLINE generateMessageRequestTopKL #-}++-- | 'generateMessageRequestPrompt' Lens+generateMessageRequestPromptL :: Lens_' GenerateMessageRequest (MessagePrompt)+generateMessageRequestPromptL f GenerateMessageRequest {..} = (\generateMessageRequestPrompt -> GenerateMessageRequest {generateMessageRequestPrompt, ..}) <$> f generateMessageRequestPrompt+{-# INLINE generateMessageRequestPromptL #-}++-- * GenerateMessageResponse++-- | 'generateMessageResponseCandidates' Lens+generateMessageResponseCandidatesL :: Lens_' GenerateMessageResponse (Maybe [Message])+generateMessageResponseCandidatesL f GenerateMessageResponse {..} = (\generateMessageResponseCandidates -> GenerateMessageResponse {generateMessageResponseCandidates, ..}) <$> f generateMessageResponseCandidates+{-# INLINE generateMessageResponseCandidatesL #-}++-- | 'generateMessageResponseMessages' Lens+generateMessageResponseMessagesL :: Lens_' GenerateMessageResponse (Maybe [Message])+generateMessageResponseMessagesL f GenerateMessageResponse {..} = (\generateMessageResponseMessages -> GenerateMessageResponse {generateMessageResponseMessages, ..}) <$> f generateMessageResponseMessages+{-# INLINE generateMessageResponseMessagesL #-}++-- | 'generateMessageResponseFilters' Lens+generateMessageResponseFiltersL :: Lens_' GenerateMessageResponse (Maybe [ContentFilter])+generateMessageResponseFiltersL f GenerateMessageResponse {..} = (\generateMessageResponseFilters -> GenerateMessageResponse {generateMessageResponseFilters, ..}) <$> f generateMessageResponseFilters+{-# INLINE generateMessageResponseFiltersL #-}++-- * GenerateTextRequest++-- | 'generateTextRequestStopSequences' Lens+generateTextRequestStopSequencesL :: Lens_' GenerateTextRequest (Maybe [Text])+generateTextRequestStopSequencesL f GenerateTextRequest {..} = (\generateTextRequestStopSequences -> GenerateTextRequest {generateTextRequestStopSequences, ..}) <$> f generateTextRequestStopSequences+{-# INLINE generateTextRequestStopSequencesL #-}++-- | 'generateTextRequestPrompt' Lens+generateTextRequestPromptL :: Lens_' GenerateTextRequest (TextPrompt)+generateTextRequestPromptL f GenerateTextRequest {..} = (\generateTextRequestPrompt -> GenerateTextRequest {generateTextRequestPrompt, ..}) <$> f generateTextRequestPrompt+{-# INLINE generateTextRequestPromptL #-}++-- | 'generateTextRequestMaxOutputTokens' Lens+generateTextRequestMaxOutputTokensL :: Lens_' GenerateTextRequest (Maybe Int)+generateTextRequestMaxOutputTokensL f GenerateTextRequest {..} = (\generateTextRequestMaxOutputTokens -> GenerateTextRequest {generateTextRequestMaxOutputTokens, ..}) <$> f generateTextRequestMaxOutputTokens+{-# INLINE generateTextRequestMaxOutputTokensL #-}++-- | 'generateTextRequestSafetySettings' Lens+generateTextRequestSafetySettingsL :: Lens_' GenerateTextRequest (Maybe [SafetySetting])+generateTextRequestSafetySettingsL f GenerateTextRequest {..} = (\generateTextRequestSafetySettings -> GenerateTextRequest {generateTextRequestSafetySettings, ..}) <$> f generateTextRequestSafetySettings+{-# INLINE generateTextRequestSafetySettingsL #-}++-- | 'generateTextRequestTemperature' Lens+generateTextRequestTemperatureL :: Lens_' GenerateTextRequest (Maybe Float)+generateTextRequestTemperatureL f GenerateTextRequest {..} = (\generateTextRequestTemperature -> GenerateTextRequest {generateTextRequestTemperature, ..}) <$> f generateTextRequestTemperature+{-# INLINE generateTextRequestTemperatureL #-}++-- | 'generateTextRequestTopK' Lens+generateTextRequestTopKL :: Lens_' GenerateTextRequest (Maybe Int)+generateTextRequestTopKL f GenerateTextRequest {..} = (\generateTextRequestTopK -> GenerateTextRequest {generateTextRequestTopK, ..}) <$> f generateTextRequestTopK+{-# INLINE generateTextRequestTopKL #-}++-- | 'generateTextRequestTopP' Lens+generateTextRequestTopPL :: Lens_' GenerateTextRequest (Maybe Float)+generateTextRequestTopPL f GenerateTextRequest {..} = (\generateTextRequestTopP -> GenerateTextRequest {generateTextRequestTopP, ..}) <$> f generateTextRequestTopP+{-# INLINE generateTextRequestTopPL #-}++-- | 'generateTextRequestCandidateCount' Lens+generateTextRequestCandidateCountL :: Lens_' GenerateTextRequest (Maybe Int)+generateTextRequestCandidateCountL f GenerateTextRequest {..} = (\generateTextRequestCandidateCount -> GenerateTextRequest {generateTextRequestCandidateCount, ..}) <$> f generateTextRequestCandidateCount+{-# INLINE generateTextRequestCandidateCountL #-}++-- * GenerateTextResponse++-- | 'generateTextResponseSafetyFeedback' Lens+generateTextResponseSafetyFeedbackL :: Lens_' GenerateTextResponse (Maybe [SafetyFeedback])+generateTextResponseSafetyFeedbackL f GenerateTextResponse {..} = (\generateTextResponseSafetyFeedback -> GenerateTextResponse {generateTextResponseSafetyFeedback, ..}) <$> f generateTextResponseSafetyFeedback+{-# INLINE generateTextResponseSafetyFeedbackL #-}++-- | 'generateTextResponseCandidates' Lens+generateTextResponseCandidatesL :: Lens_' GenerateTextResponse (Maybe [TextCompletion])+generateTextResponseCandidatesL f GenerateTextResponse {..} = (\generateTextResponseCandidates -> GenerateTextResponse {generateTextResponseCandidates, ..}) <$> f generateTextResponseCandidates+{-# INLINE generateTextResponseCandidatesL #-}++-- | 'generateTextResponseFilters' Lens+generateTextResponseFiltersL :: Lens_' GenerateTextResponse (Maybe [ContentFilter])+generateTextResponseFiltersL f GenerateTextResponse {..} = (\generateTextResponseFilters -> GenerateTextResponse {generateTextResponseFilters, ..}) <$> f generateTextResponseFilters+{-# INLINE generateTextResponseFiltersL #-}++-- * GenerateVideoResponse++-- | 'generateVideoResponseGeneratedSamples' Lens+generateVideoResponseGeneratedSamplesL :: Lens_' GenerateVideoResponse (Maybe [Media])+generateVideoResponseGeneratedSamplesL f GenerateVideoResponse {..} = (\generateVideoResponseGeneratedSamples -> GenerateVideoResponse {generateVideoResponseGeneratedSamples, ..}) <$> f generateVideoResponseGeneratedSamples+{-# INLINE generateVideoResponseGeneratedSamplesL #-}++-- | 'generateVideoResponseRaiMediaFilteredCount' Lens+generateVideoResponseRaiMediaFilteredCountL :: Lens_' GenerateVideoResponse (Maybe Int)+generateVideoResponseRaiMediaFilteredCountL f GenerateVideoResponse {..} = (\generateVideoResponseRaiMediaFilteredCount -> GenerateVideoResponse {generateVideoResponseRaiMediaFilteredCount, ..}) <$> f generateVideoResponseRaiMediaFilteredCount+{-# INLINE generateVideoResponseRaiMediaFilteredCountL #-}++-- | 'generateVideoResponseRaiMediaFilteredReasons' Lens+generateVideoResponseRaiMediaFilteredReasonsL :: Lens_' GenerateVideoResponse (Maybe [Text])+generateVideoResponseRaiMediaFilteredReasonsL f GenerateVideoResponse {..} = (\generateVideoResponseRaiMediaFilteredReasons -> GenerateVideoResponse {generateVideoResponseRaiMediaFilteredReasons, ..}) <$> f generateVideoResponseRaiMediaFilteredReasons+{-# INLINE generateVideoResponseRaiMediaFilteredReasonsL #-}++-- * GeneratedFile++-- | 'generatedFileError' Lens+generatedFileErrorL :: Lens_' GeneratedFile (Maybe Status)+generatedFileErrorL f GeneratedFile {..} = (\generatedFileError -> GeneratedFile {generatedFileError, ..}) <$> f generatedFileError+{-# INLINE generatedFileErrorL #-}++-- | 'generatedFileName' Lens+generatedFileNameL :: Lens_' GeneratedFile (Maybe Text)+generatedFileNameL f GeneratedFile {..} = (\generatedFileName -> GeneratedFile {generatedFileName, ..}) <$> f generatedFileName+{-# INLINE generatedFileNameL #-}++-- | 'generatedFileState' Lens+generatedFileStateL :: Lens_' GeneratedFile (Maybe E'State2)+generatedFileStateL f GeneratedFile {..} = (\generatedFileState -> GeneratedFile {generatedFileState, ..}) <$> f generatedFileState+{-# INLINE generatedFileStateL #-}++-- | 'generatedFileMimeType' Lens+generatedFileMimeTypeL :: Lens_' GeneratedFile (Maybe Text)+generatedFileMimeTypeL f GeneratedFile {..} = (\generatedFileMimeType -> GeneratedFile {generatedFileMimeType, ..}) <$> f generatedFileMimeType+{-# INLINE generatedFileMimeTypeL #-}++-- * GenerationConfig++-- | 'generationConfigResponseSchema' Lens+generationConfigResponseSchemaL :: Lens_' GenerationConfig (Maybe Schema)+generationConfigResponseSchemaL f GenerationConfig {..} = (\generationConfigResponseSchema -> GenerationConfig {generationConfigResponseSchema, ..}) <$> f generationConfigResponseSchema+{-# INLINE generationConfigResponseSchemaL #-}++-- | 'generationConfigThinkingConfig' Lens+generationConfigThinkingConfigL :: Lens_' GenerationConfig (Maybe ThinkingConfig)+generationConfigThinkingConfigL f GenerationConfig {..} = (\generationConfigThinkingConfig -> GenerationConfig {generationConfigThinkingConfig, ..}) <$> f generationConfigThinkingConfig+{-# INLINE generationConfigThinkingConfigL #-}++-- | 'generationConfigLogprobs' Lens+generationConfigLogprobsL :: Lens_' GenerationConfig (Maybe Int)+generationConfigLogprobsL f GenerationConfig {..} = (\generationConfigLogprobs -> GenerationConfig {generationConfigLogprobs, ..}) <$> f generationConfigLogprobs+{-# INLINE generationConfigLogprobsL #-}++-- | 'generationConfigMediaResolution' Lens+generationConfigMediaResolutionL :: Lens_' GenerationConfig (Maybe E'MediaResolution)+generationConfigMediaResolutionL f GenerationConfig {..} = (\generationConfigMediaResolution -> GenerationConfig {generationConfigMediaResolution, ..}) <$> f generationConfigMediaResolution+{-# INLINE generationConfigMediaResolutionL #-}++-- | 'generationConfigStopSequences' Lens+generationConfigStopSequencesL :: Lens_' GenerationConfig (Maybe [Text])+generationConfigStopSequencesL f GenerationConfig {..} = (\generationConfigStopSequences -> GenerationConfig {generationConfigStopSequences, ..}) <$> f generationConfigStopSequences+{-# INLINE generationConfigStopSequencesL #-}++-- | 'generationConfigSpeechConfig' Lens+generationConfigSpeechConfigL :: Lens_' GenerationConfig (Maybe SpeechConfig)+generationConfigSpeechConfigL f GenerationConfig {..} = (\generationConfigSpeechConfig -> GenerationConfig {generationConfigSpeechConfig, ..}) <$> f generationConfigSpeechConfig+{-# INLINE generationConfigSpeechConfigL #-}++-- | 'generationConfigResponseJsonSchema' Lens+generationConfigResponseJsonSchemaL :: Lens_' GenerationConfig (Maybe String)+generationConfigResponseJsonSchemaL f GenerationConfig {..} = (\generationConfigResponseJsonSchema -> GenerationConfig {generationConfigResponseJsonSchema, ..}) <$> f generationConfigResponseJsonSchema+{-# INLINE generationConfigResponseJsonSchemaL #-}++-- | 'generationConfigPresencePenalty' Lens+generationConfigPresencePenaltyL :: Lens_' GenerationConfig (Maybe Float)+generationConfigPresencePenaltyL f GenerationConfig {..} = (\generationConfigPresencePenalty -> GenerationConfig {generationConfigPresencePenalty, ..}) <$> f generationConfigPresencePenalty+{-# INLINE generationConfigPresencePenaltyL #-}++-- | 'generationConfigTopP' Lens+generationConfigTopPL :: Lens_' GenerationConfig (Maybe Float)+generationConfigTopPL f GenerationConfig {..} = (\generationConfigTopP -> GenerationConfig {generationConfigTopP, ..}) <$> f generationConfigTopP+{-# INLINE generationConfigTopPL #-}++-- | 'generationConfigTemperature' Lens+generationConfigTemperatureL :: Lens_' GenerationConfig (Maybe Float)+generationConfigTemperatureL f GenerationConfig {..} = (\generationConfigTemperature -> GenerationConfig {generationConfigTemperature, ..}) <$> f generationConfigTemperature+{-# INLINE generationConfigTemperatureL #-}++-- | 'generationConfigTopK' Lens+generationConfigTopKL :: Lens_' GenerationConfig (Maybe Int)+generationConfigTopKL f GenerationConfig {..} = (\generationConfigTopK -> GenerationConfig {generationConfigTopK, ..}) <$> f generationConfigTopK+{-# INLINE generationConfigTopKL #-}++-- | 'generationConfigCandidateCount' Lens+generationConfigCandidateCountL :: Lens_' GenerationConfig (Maybe Int)+generationConfigCandidateCountL f GenerationConfig {..} = (\generationConfigCandidateCount -> GenerationConfig {generationConfigCandidateCount, ..}) <$> f generationConfigCandidateCount+{-# INLINE generationConfigCandidateCountL #-}++-- | 'generationConfigEnableEnhancedCivicAnswers' Lens+generationConfigEnableEnhancedCivicAnswersL :: Lens_' GenerationConfig (Maybe Bool)+generationConfigEnableEnhancedCivicAnswersL f GenerationConfig {..} = (\generationConfigEnableEnhancedCivicAnswers -> GenerationConfig {generationConfigEnableEnhancedCivicAnswers, ..}) <$> f generationConfigEnableEnhancedCivicAnswers+{-# INLINE generationConfigEnableEnhancedCivicAnswersL #-}++-- | 'generationConfigResponseLogprobs' Lens+generationConfigResponseLogprobsL :: Lens_' GenerationConfig (Maybe Bool)+generationConfigResponseLogprobsL f GenerationConfig {..} = (\generationConfigResponseLogprobs -> GenerationConfig {generationConfigResponseLogprobs, ..}) <$> f generationConfigResponseLogprobs+{-# INLINE generationConfigResponseLogprobsL #-}++-- | 'generationConfigResponseModalities' Lens+generationConfigResponseModalitiesL :: Lens_' GenerationConfig (Maybe [E'ResponseModalities])+generationConfigResponseModalitiesL f GenerationConfig {..} = (\generationConfigResponseModalities -> GenerationConfig {generationConfigResponseModalities, ..}) <$> f generationConfigResponseModalities+{-# INLINE generationConfigResponseModalitiesL #-}++-- | 'generationConfigFrequencyPenalty' Lens+generationConfigFrequencyPenaltyL :: Lens_' GenerationConfig (Maybe Float)+generationConfigFrequencyPenaltyL f GenerationConfig {..} = (\generationConfigFrequencyPenalty -> GenerationConfig {generationConfigFrequencyPenalty, ..}) <$> f generationConfigFrequencyPenalty+{-# INLINE generationConfigFrequencyPenaltyL #-}++-- | 'generationConfigSeed' Lens+generationConfigSeedL :: Lens_' GenerationConfig (Maybe Int)+generationConfigSeedL f GenerationConfig {..} = (\generationConfigSeed -> GenerationConfig {generationConfigSeed, ..}) <$> f generationConfigSeed+{-# INLINE generationConfigSeedL #-}++-- | 'generationConfigMaxOutputTokens' Lens+generationConfigMaxOutputTokensL :: Lens_' GenerationConfig (Maybe Int)+generationConfigMaxOutputTokensL f GenerationConfig {..} = (\generationConfigMaxOutputTokens -> GenerationConfig {generationConfigMaxOutputTokens, ..}) <$> f generationConfigMaxOutputTokens+{-# INLINE generationConfigMaxOutputTokensL #-}++-- | 'generationConfigResponseMimeType' Lens+generationConfigResponseMimeTypeL :: Lens_' GenerationConfig (Maybe Text)+generationConfigResponseMimeTypeL f GenerationConfig {..} = (\generationConfigResponseMimeType -> GenerationConfig {generationConfigResponseMimeType, ..}) <$> f generationConfigResponseMimeType+{-# INLINE generationConfigResponseMimeTypeL #-}++-- * GoogleSearch++-- | 'googleSearchTimeRangeFilter' Lens+googleSearchTimeRangeFilterL :: Lens_' GoogleSearch (Maybe Interval)+googleSearchTimeRangeFilterL f GoogleSearch {..} = (\googleSearchTimeRangeFilter -> GoogleSearch {googleSearchTimeRangeFilter, ..}) <$> f googleSearchTimeRangeFilter+{-# INLINE googleSearchTimeRangeFilterL #-}++-- * GoogleSearchRetrieval++-- | 'googleSearchRetrievalDynamicRetrievalConfig' Lens+googleSearchRetrievalDynamicRetrievalConfigL :: Lens_' GoogleSearchRetrieval (Maybe DynamicRetrievalConfig)+googleSearchRetrievalDynamicRetrievalConfigL f GoogleSearchRetrieval {..} = (\googleSearchRetrievalDynamicRetrievalConfig -> GoogleSearchRetrieval {googleSearchRetrievalDynamicRetrievalConfig, ..}) <$> f googleSearchRetrievalDynamicRetrievalConfig+{-# INLINE googleSearchRetrievalDynamicRetrievalConfigL #-}++-- * GroundingAttribution++-- | 'groundingAttributionSourceId' Lens+groundingAttributionSourceIdL :: Lens_' GroundingAttribution (Maybe AttributionSourceId)+groundingAttributionSourceIdL f GroundingAttribution {..} = (\groundingAttributionSourceId -> GroundingAttribution {groundingAttributionSourceId, ..}) <$> f groundingAttributionSourceId+{-# INLINE groundingAttributionSourceIdL #-}++-- | 'groundingAttributionContent' Lens+groundingAttributionContentL :: Lens_' GroundingAttribution (Maybe Content)+groundingAttributionContentL f GroundingAttribution {..} = (\groundingAttributionContent -> GroundingAttribution {groundingAttributionContent, ..}) <$> f groundingAttributionContent+{-# INLINE groundingAttributionContentL #-}++-- * GroundingChunk++-- | 'groundingChunkWeb' Lens+groundingChunkWebL :: Lens_' GroundingChunk (Maybe Web)+groundingChunkWebL f GroundingChunk {..} = (\groundingChunkWeb -> GroundingChunk {groundingChunkWeb, ..}) <$> f groundingChunkWeb+{-# INLINE groundingChunkWebL #-}++-- * GroundingMetadata++-- | 'groundingMetadataRetrievalMetadata' Lens+groundingMetadataRetrievalMetadataL :: Lens_' GroundingMetadata (Maybe RetrievalMetadata)+groundingMetadataRetrievalMetadataL f GroundingMetadata {..} = (\groundingMetadataRetrievalMetadata -> GroundingMetadata {groundingMetadataRetrievalMetadata, ..}) <$> f groundingMetadataRetrievalMetadata+{-# INLINE groundingMetadataRetrievalMetadataL #-}++-- | 'groundingMetadataWebSearchQueries' Lens+groundingMetadataWebSearchQueriesL :: Lens_' GroundingMetadata (Maybe [Text])+groundingMetadataWebSearchQueriesL f GroundingMetadata {..} = (\groundingMetadataWebSearchQueries -> GroundingMetadata {groundingMetadataWebSearchQueries, ..}) <$> f groundingMetadataWebSearchQueries+{-# INLINE groundingMetadataWebSearchQueriesL #-}++-- | 'groundingMetadataGroundingChunks' Lens+groundingMetadataGroundingChunksL :: Lens_' GroundingMetadata (Maybe [GroundingChunk])+groundingMetadataGroundingChunksL f GroundingMetadata {..} = (\groundingMetadataGroundingChunks -> GroundingMetadata {groundingMetadataGroundingChunks, ..}) <$> f groundingMetadataGroundingChunks+{-# INLINE groundingMetadataGroundingChunksL #-}++-- | 'groundingMetadataSearchEntryPoint' Lens+groundingMetadataSearchEntryPointL :: Lens_' GroundingMetadata (Maybe SearchEntryPoint)+groundingMetadataSearchEntryPointL f GroundingMetadata {..} = (\groundingMetadataSearchEntryPoint -> GroundingMetadata {groundingMetadataSearchEntryPoint, ..}) <$> f groundingMetadataSearchEntryPoint+{-# INLINE groundingMetadataSearchEntryPointL #-}++-- | 'groundingMetadataGroundingSupports' Lens+groundingMetadataGroundingSupportsL :: Lens_' GroundingMetadata (Maybe [GroundingSupport])+groundingMetadataGroundingSupportsL f GroundingMetadata {..} = (\groundingMetadataGroundingSupports -> GroundingMetadata {groundingMetadataGroundingSupports, ..}) <$> f groundingMetadataGroundingSupports+{-# INLINE groundingMetadataGroundingSupportsL #-}++-- * GroundingPassage++-- | 'groundingPassageContent' Lens+groundingPassageContentL :: Lens_' GroundingPassage (Maybe Content)+groundingPassageContentL f GroundingPassage {..} = (\groundingPassageContent -> GroundingPassage {groundingPassageContent, ..}) <$> f groundingPassageContent+{-# INLINE groundingPassageContentL #-}++-- | 'groundingPassageId' Lens+groundingPassageIdL :: Lens_' GroundingPassage (Maybe Text)+groundingPassageIdL f GroundingPassage {..} = (\groundingPassageId -> GroundingPassage {groundingPassageId, ..}) <$> f groundingPassageId+{-# INLINE groundingPassageIdL #-}++-- * GroundingPassageId++-- | 'groundingPassageIdPassageId' Lens+groundingPassageIdPassageIdL :: Lens_' GroundingPassageId (Maybe Text)+groundingPassageIdPassageIdL f GroundingPassageId {..} = (\groundingPassageIdPassageId -> GroundingPassageId {groundingPassageIdPassageId, ..}) <$> f groundingPassageIdPassageId+{-# INLINE groundingPassageIdPassageIdL #-}++-- | 'groundingPassageIdPartIndex' Lens+groundingPassageIdPartIndexL :: Lens_' GroundingPassageId (Maybe Int)+groundingPassageIdPartIndexL f GroundingPassageId {..} = (\groundingPassageIdPartIndex -> GroundingPassageId {groundingPassageIdPartIndex, ..}) <$> f groundingPassageIdPartIndex+{-# INLINE groundingPassageIdPartIndexL #-}++-- * GroundingPassages++-- | 'groundingPassagesPassages' Lens+groundingPassagesPassagesL :: Lens_' GroundingPassages (Maybe [GroundingPassage])+groundingPassagesPassagesL f GroundingPassages {..} = (\groundingPassagesPassages -> GroundingPassages {groundingPassagesPassages, ..}) <$> f groundingPassagesPassages+{-# INLINE groundingPassagesPassagesL #-}++-- * GroundingSupport++-- | 'groundingSupportConfidenceScores' Lens+groundingSupportConfidenceScoresL :: Lens_' GroundingSupport (Maybe [Float])+groundingSupportConfidenceScoresL f GroundingSupport {..} = (\groundingSupportConfidenceScores -> GroundingSupport {groundingSupportConfidenceScores, ..}) <$> f groundingSupportConfidenceScores+{-# INLINE groundingSupportConfidenceScoresL #-}++-- | 'groundingSupportGroundingChunkIndices' Lens+groundingSupportGroundingChunkIndicesL :: Lens_' GroundingSupport (Maybe [Int])+groundingSupportGroundingChunkIndicesL f GroundingSupport {..} = (\groundingSupportGroundingChunkIndices -> GroundingSupport {groundingSupportGroundingChunkIndices, ..}) <$> f groundingSupportGroundingChunkIndices+{-# INLINE groundingSupportGroundingChunkIndicesL #-}++-- | 'groundingSupportSegment' Lens+groundingSupportSegmentL :: Lens_' GroundingSupport (Maybe Segment)+groundingSupportSegmentL f GroundingSupport {..} = (\groundingSupportSegment -> GroundingSupport {groundingSupportSegment, ..}) <$> f groundingSupportSegment+{-# INLINE groundingSupportSegmentL #-}++-- * HarmCategory++-- * Hyperparameters++-- | 'hyperparametersEpochCount' Lens+hyperparametersEpochCountL :: Lens_' Hyperparameters (Maybe Int)+hyperparametersEpochCountL f Hyperparameters {..} = (\hyperparametersEpochCount -> Hyperparameters {hyperparametersEpochCount, ..}) <$> f hyperparametersEpochCount+{-# INLINE hyperparametersEpochCountL #-}++-- | 'hyperparametersLearningRate' Lens+hyperparametersLearningRateL :: Lens_' Hyperparameters (Maybe Float)+hyperparametersLearningRateL f Hyperparameters {..} = (\hyperparametersLearningRate -> Hyperparameters {hyperparametersLearningRate, ..}) <$> f hyperparametersLearningRate+{-# INLINE hyperparametersLearningRateL #-}++-- | 'hyperparametersLearningRateMultiplier' Lens+hyperparametersLearningRateMultiplierL :: Lens_' Hyperparameters (Maybe Float)+hyperparametersLearningRateMultiplierL f Hyperparameters {..} = (\hyperparametersLearningRateMultiplier -> Hyperparameters {hyperparametersLearningRateMultiplier, ..}) <$> f hyperparametersLearningRateMultiplier+{-# INLINE hyperparametersLearningRateMultiplierL #-}++-- | 'hyperparametersBatchSize' Lens+hyperparametersBatchSizeL :: Lens_' Hyperparameters (Maybe Int)+hyperparametersBatchSizeL f Hyperparameters {..} = (\hyperparametersBatchSize -> Hyperparameters {hyperparametersBatchSize, ..}) <$> f hyperparametersBatchSize+{-# INLINE hyperparametersBatchSizeL #-}++-- * InputFeedback++-- | 'inputFeedbackSafetyRatings' Lens+inputFeedbackSafetyRatingsL :: Lens_' InputFeedback (Maybe [SafetyRating])+inputFeedbackSafetyRatingsL f InputFeedback {..} = (\inputFeedbackSafetyRatings -> InputFeedback {inputFeedbackSafetyRatings, ..}) <$> f inputFeedbackSafetyRatings+{-# INLINE inputFeedbackSafetyRatingsL #-}++-- | 'inputFeedbackBlockReason' Lens+inputFeedbackBlockReasonL :: Lens_' InputFeedback (Maybe E'BlockReason2)+inputFeedbackBlockReasonL f InputFeedback {..} = (\inputFeedbackBlockReason -> InputFeedback {inputFeedbackBlockReason, ..}) <$> f inputFeedbackBlockReason+{-# INLINE inputFeedbackBlockReasonL #-}++-- * Interval++-- | 'intervalStartTime' Lens+intervalStartTimeL :: Lens_' Interval (Maybe DateTime)+intervalStartTimeL f Interval {..} = (\intervalStartTime -> Interval {intervalStartTime, ..}) <$> f intervalStartTime+{-# INLINE intervalStartTimeL #-}++-- | 'intervalEndTime' Lens+intervalEndTimeL :: Lens_' Interval (Maybe DateTime)+intervalEndTimeL f Interval {..} = (\intervalEndTime -> Interval {intervalEndTime, ..}) <$> f intervalEndTime+{-# INLINE intervalEndTimeL #-}++-- * ListCachedContentsResponse++-- | 'listCachedContentsResponseNextPageToken' Lens+listCachedContentsResponseNextPageTokenL :: Lens_' ListCachedContentsResponse (Maybe Text)+listCachedContentsResponseNextPageTokenL f ListCachedContentsResponse {..} = (\listCachedContentsResponseNextPageToken -> ListCachedContentsResponse {listCachedContentsResponseNextPageToken, ..}) <$> f listCachedContentsResponseNextPageToken+{-# INLINE listCachedContentsResponseNextPageTokenL #-}++-- | 'listCachedContentsResponseCachedContents' Lens+listCachedContentsResponseCachedContentsL :: Lens_' ListCachedContentsResponse (Maybe [CachedContent])+listCachedContentsResponseCachedContentsL f ListCachedContentsResponse {..} = (\listCachedContentsResponseCachedContents -> ListCachedContentsResponse {listCachedContentsResponseCachedContents, ..}) <$> f listCachedContentsResponseCachedContents+{-# INLINE listCachedContentsResponseCachedContentsL #-}++-- * ListChunksResponse++-- | 'listChunksResponseNextPageToken' Lens+listChunksResponseNextPageTokenL :: Lens_' ListChunksResponse (Maybe Text)+listChunksResponseNextPageTokenL f ListChunksResponse {..} = (\listChunksResponseNextPageToken -> ListChunksResponse {listChunksResponseNextPageToken, ..}) <$> f listChunksResponseNextPageToken+{-# INLINE listChunksResponseNextPageTokenL #-}++-- | 'listChunksResponseChunks' Lens+listChunksResponseChunksL :: Lens_' ListChunksResponse (Maybe [Chunk])+listChunksResponseChunksL f ListChunksResponse {..} = (\listChunksResponseChunks -> ListChunksResponse {listChunksResponseChunks, ..}) <$> f listChunksResponseChunks+{-# INLINE listChunksResponseChunksL #-}++-- * ListCorporaResponse++-- | 'listCorporaResponseCorpora' Lens+listCorporaResponseCorporaL :: Lens_' ListCorporaResponse (Maybe [Corpus])+listCorporaResponseCorporaL f ListCorporaResponse {..} = (\listCorporaResponseCorpora -> ListCorporaResponse {listCorporaResponseCorpora, ..}) <$> f listCorporaResponseCorpora+{-# INLINE listCorporaResponseCorporaL #-}++-- | 'listCorporaResponseNextPageToken' Lens+listCorporaResponseNextPageTokenL :: Lens_' ListCorporaResponse (Maybe Text)+listCorporaResponseNextPageTokenL f ListCorporaResponse {..} = (\listCorporaResponseNextPageToken -> ListCorporaResponse {listCorporaResponseNextPageToken, ..}) <$> f listCorporaResponseNextPageToken+{-# INLINE listCorporaResponseNextPageTokenL #-}++-- * ListDocumentsResponse++-- | 'listDocumentsResponseNextPageToken' Lens+listDocumentsResponseNextPageTokenL :: Lens_' ListDocumentsResponse (Maybe Text)+listDocumentsResponseNextPageTokenL f ListDocumentsResponse {..} = (\listDocumentsResponseNextPageToken -> ListDocumentsResponse {listDocumentsResponseNextPageToken, ..}) <$> f listDocumentsResponseNextPageToken+{-# INLINE listDocumentsResponseNextPageTokenL #-}++-- | 'listDocumentsResponseDocuments' Lens+listDocumentsResponseDocumentsL :: Lens_' ListDocumentsResponse (Maybe [Document])+listDocumentsResponseDocumentsL f ListDocumentsResponse {..} = (\listDocumentsResponseDocuments -> ListDocumentsResponse {listDocumentsResponseDocuments, ..}) <$> f listDocumentsResponseDocuments+{-# INLINE listDocumentsResponseDocumentsL #-}++-- * ListFilesResponse++-- | 'listFilesResponseNextPageToken' Lens+listFilesResponseNextPageTokenL :: Lens_' ListFilesResponse (Maybe Text)+listFilesResponseNextPageTokenL f ListFilesResponse {..} = (\listFilesResponseNextPageToken -> ListFilesResponse {listFilesResponseNextPageToken, ..}) <$> f listFilesResponseNextPageToken+{-# INLINE listFilesResponseNextPageTokenL #-}++-- | 'listFilesResponseFiles' Lens+listFilesResponseFilesL :: Lens_' ListFilesResponse (Maybe [File])+listFilesResponseFilesL f ListFilesResponse {..} = (\listFilesResponseFiles -> ListFilesResponse {listFilesResponseFiles, ..}) <$> f listFilesResponseFiles+{-# INLINE listFilesResponseFilesL #-}++-- * ListGeneratedFilesResponse++-- | 'listGeneratedFilesResponseNextPageToken' Lens+listGeneratedFilesResponseNextPageTokenL :: Lens_' ListGeneratedFilesResponse (Maybe Text)+listGeneratedFilesResponseNextPageTokenL f ListGeneratedFilesResponse {..} = (\listGeneratedFilesResponseNextPageToken -> ListGeneratedFilesResponse {listGeneratedFilesResponseNextPageToken, ..}) <$> f listGeneratedFilesResponseNextPageToken+{-# INLINE listGeneratedFilesResponseNextPageTokenL #-}++-- | 'listGeneratedFilesResponseGeneratedFiles' Lens+listGeneratedFilesResponseGeneratedFilesL :: Lens_' ListGeneratedFilesResponse (Maybe [GeneratedFile])+listGeneratedFilesResponseGeneratedFilesL f ListGeneratedFilesResponse {..} = (\listGeneratedFilesResponseGeneratedFiles -> ListGeneratedFilesResponse {listGeneratedFilesResponseGeneratedFiles, ..}) <$> f listGeneratedFilesResponseGeneratedFiles+{-# INLINE listGeneratedFilesResponseGeneratedFilesL #-}++-- * ListModelsResponse++-- | 'listModelsResponseModels' Lens+listModelsResponseModelsL :: Lens_' ListModelsResponse (Maybe [Model])+listModelsResponseModelsL f ListModelsResponse {..} = (\listModelsResponseModels -> ListModelsResponse {listModelsResponseModels, ..}) <$> f listModelsResponseModels+{-# INLINE listModelsResponseModelsL #-}++-- | 'listModelsResponseNextPageToken' Lens+listModelsResponseNextPageTokenL :: Lens_' ListModelsResponse (Maybe Text)+listModelsResponseNextPageTokenL f ListModelsResponse {..} = (\listModelsResponseNextPageToken -> ListModelsResponse {listModelsResponseNextPageToken, ..}) <$> f listModelsResponseNextPageToken+{-# INLINE listModelsResponseNextPageTokenL #-}++-- * ListOperationsResponse++-- | 'listOperationsResponseNextPageToken' Lens+listOperationsResponseNextPageTokenL :: Lens_' ListOperationsResponse (Maybe Text)+listOperationsResponseNextPageTokenL f ListOperationsResponse {..} = (\listOperationsResponseNextPageToken -> ListOperationsResponse {listOperationsResponseNextPageToken, ..}) <$> f listOperationsResponseNextPageToken+{-# INLINE listOperationsResponseNextPageTokenL #-}++-- | 'listOperationsResponseOperations' Lens+listOperationsResponseOperationsL :: Lens_' ListOperationsResponse (Maybe [Operation])+listOperationsResponseOperationsL f ListOperationsResponse {..} = (\listOperationsResponseOperations -> ListOperationsResponse {listOperationsResponseOperations, ..}) <$> f listOperationsResponseOperations+{-# INLINE listOperationsResponseOperationsL #-}++-- * ListPermissionsResponse++-- | 'listPermissionsResponsePermissions' Lens+listPermissionsResponsePermissionsL :: Lens_' ListPermissionsResponse (Maybe [Permission])+listPermissionsResponsePermissionsL f ListPermissionsResponse {..} = (\listPermissionsResponsePermissions -> ListPermissionsResponse {listPermissionsResponsePermissions, ..}) <$> f listPermissionsResponsePermissions+{-# INLINE listPermissionsResponsePermissionsL #-}++-- | 'listPermissionsResponseNextPageToken' Lens+listPermissionsResponseNextPageTokenL :: Lens_' ListPermissionsResponse (Maybe Text)+listPermissionsResponseNextPageTokenL f ListPermissionsResponse {..} = (\listPermissionsResponseNextPageToken -> ListPermissionsResponse {listPermissionsResponseNextPageToken, ..}) <$> f listPermissionsResponseNextPageToken+{-# INLINE listPermissionsResponseNextPageTokenL #-}++-- * ListTunedModelsResponse++-- | 'listTunedModelsResponseNextPageToken' Lens+listTunedModelsResponseNextPageTokenL :: Lens_' ListTunedModelsResponse (Maybe Text)+listTunedModelsResponseNextPageTokenL f ListTunedModelsResponse {..} = (\listTunedModelsResponseNextPageToken -> ListTunedModelsResponse {listTunedModelsResponseNextPageToken, ..}) <$> f listTunedModelsResponseNextPageToken+{-# INLINE listTunedModelsResponseNextPageTokenL #-}++-- | 'listTunedModelsResponseTunedModels' Lens+listTunedModelsResponseTunedModelsL :: Lens_' ListTunedModelsResponse (Maybe [TunedModel])+listTunedModelsResponseTunedModelsL f ListTunedModelsResponse {..} = (\listTunedModelsResponseTunedModels -> ListTunedModelsResponse {listTunedModelsResponseTunedModels, ..}) <$> f listTunedModelsResponseTunedModels+{-# INLINE listTunedModelsResponseTunedModelsL #-}++-- * LogprobsResult++-- | 'logprobsResultChosenCandidates' Lens+logprobsResultChosenCandidatesL :: Lens_' LogprobsResult (Maybe [LogprobsResultCandidate])+logprobsResultChosenCandidatesL f LogprobsResult {..} = (\logprobsResultChosenCandidates -> LogprobsResult {logprobsResultChosenCandidates, ..}) <$> f logprobsResultChosenCandidates+{-# INLINE logprobsResultChosenCandidatesL #-}++-- | 'logprobsResultTopCandidates' Lens+logprobsResultTopCandidatesL :: Lens_' LogprobsResult (Maybe [TopCandidates])+logprobsResultTopCandidatesL f LogprobsResult {..} = (\logprobsResultTopCandidates -> LogprobsResult {logprobsResultTopCandidates, ..}) <$> f logprobsResultTopCandidates+{-# INLINE logprobsResultTopCandidatesL #-}++-- * LogprobsResultCandidate++-- | 'logprobsResultCandidateLogProbability' Lens+logprobsResultCandidateLogProbabilityL :: Lens_' LogprobsResultCandidate (Maybe Float)+logprobsResultCandidateLogProbabilityL f LogprobsResultCandidate {..} = (\logprobsResultCandidateLogProbability -> LogprobsResultCandidate {logprobsResultCandidateLogProbability, ..}) <$> f logprobsResultCandidateLogProbability+{-# INLINE logprobsResultCandidateLogProbabilityL #-}++-- | 'logprobsResultCandidateTokenId' Lens+logprobsResultCandidateTokenIdL :: Lens_' LogprobsResultCandidate (Maybe Int)+logprobsResultCandidateTokenIdL f LogprobsResultCandidate {..} = (\logprobsResultCandidateTokenId -> LogprobsResultCandidate {logprobsResultCandidateTokenId, ..}) <$> f logprobsResultCandidateTokenId+{-# INLINE logprobsResultCandidateTokenIdL #-}++-- | 'logprobsResultCandidateToken' Lens+logprobsResultCandidateTokenL :: Lens_' LogprobsResultCandidate (Maybe Text)+logprobsResultCandidateTokenL f LogprobsResultCandidate {..} = (\logprobsResultCandidateToken -> LogprobsResultCandidate {logprobsResultCandidateToken, ..}) <$> f logprobsResultCandidateToken+{-# INLINE logprobsResultCandidateTokenL #-}++-- * Media++-- | 'mediaVideo' Lens+mediaVideoL :: Lens_' Media (Maybe Video)+mediaVideoL f Media {..} = (\mediaVideo -> Media {mediaVideo, ..}) <$> f mediaVideo+{-# INLINE mediaVideoL #-}++-- * Message++-- | 'messageCitationMetadata' Lens+messageCitationMetadataL :: Lens_' Message (Maybe CitationMetadata)+messageCitationMetadataL f Message {..} = (\messageCitationMetadata -> Message {messageCitationMetadata, ..}) <$> f messageCitationMetadata+{-# INLINE messageCitationMetadataL #-}++-- | 'messageAuthor' Lens+messageAuthorL :: Lens_' Message (Maybe Text)+messageAuthorL f Message {..} = (\messageAuthor -> Message {messageAuthor, ..}) <$> f messageAuthor+{-# INLINE messageAuthorL #-}++-- | 'messageContent' Lens+messageContentL :: Lens_' Message (Text)+messageContentL f Message {..} = (\messageContent -> Message {messageContent, ..}) <$> f messageContent+{-# INLINE messageContentL #-}++-- * MessagePrompt++-- | 'messagePromptContext' Lens+messagePromptContextL :: Lens_' MessagePrompt (Maybe Text)+messagePromptContextL f MessagePrompt {..} = (\messagePromptContext -> MessagePrompt {messagePromptContext, ..}) <$> f messagePromptContext+{-# INLINE messagePromptContextL #-}++-- | 'messagePromptMessages' Lens+messagePromptMessagesL :: Lens_' MessagePrompt ([Message])+messagePromptMessagesL f MessagePrompt {..} = (\messagePromptMessages -> MessagePrompt {messagePromptMessages, ..}) <$> f messagePromptMessages+{-# INLINE messagePromptMessagesL #-}++-- | 'messagePromptExamples' Lens+messagePromptExamplesL :: Lens_' MessagePrompt (Maybe [Example])+messagePromptExamplesL f MessagePrompt {..} = (\messagePromptExamples -> MessagePrompt {messagePromptExamples, ..}) <$> f messagePromptExamples+{-# INLINE messagePromptExamplesL #-}++-- * MetadataFilter++-- | 'metadataFilterConditions' Lens+metadataFilterConditionsL :: Lens_' MetadataFilter ([Condition])+metadataFilterConditionsL f MetadataFilter {..} = (\metadataFilterConditions -> MetadataFilter {metadataFilterConditions, ..}) <$> f metadataFilterConditions+{-# INLINE metadataFilterConditionsL #-}++-- | 'metadataFilterKey' Lens+metadataFilterKeyL :: Lens_' MetadataFilter (Text)+metadataFilterKeyL f MetadataFilter {..} = (\metadataFilterKey -> MetadataFilter {metadataFilterKey, ..}) <$> f metadataFilterKey+{-# INLINE metadataFilterKeyL #-}++-- * Modality++-- * ModalityTokenCount++-- | 'modalityTokenCountTokenCount' Lens+modalityTokenCountTokenCountL :: Lens_' ModalityTokenCount (Maybe Int)+modalityTokenCountTokenCountL f ModalityTokenCount {..} = (\modalityTokenCountTokenCount -> ModalityTokenCount {modalityTokenCountTokenCount, ..}) <$> f modalityTokenCountTokenCount+{-# INLINE modalityTokenCountTokenCountL #-}++-- | 'modalityTokenCountModality' Lens+modalityTokenCountModalityL :: Lens_' ModalityTokenCount (Maybe Modality)+modalityTokenCountModalityL f ModalityTokenCount {..} = (\modalityTokenCountModality -> ModalityTokenCount {modalityTokenCountModality, ..}) <$> f modalityTokenCountModality+{-# INLINE modalityTokenCountModalityL #-}++-- * Model++-- | 'modelTopK' Lens+modelTopKL :: Lens_' Model (Maybe Int)+modelTopKL f Model {..} = (\modelTopK -> Model {modelTopK, ..}) <$> f modelTopK+{-# INLINE modelTopKL #-}++-- | 'modelName' Lens+modelNameL :: Lens_' Model (Text)+modelNameL f Model {..} = (\modelName -> Model {modelName, ..}) <$> f modelName+{-# INLINE modelNameL #-}++-- | 'modelBaseModelId' Lens+modelBaseModelIdL :: Lens_' Model (Text)+modelBaseModelIdL f Model {..} = (\modelBaseModelId -> Model {modelBaseModelId, ..}) <$> f modelBaseModelId+{-# INLINE modelBaseModelIdL #-}++-- | 'modelVersion' Lens+modelVersionL :: Lens_' Model (Text)+modelVersionL f Model {..} = (\modelVersion -> Model {modelVersion, ..}) <$> f modelVersion+{-# INLINE modelVersionL #-}++-- | 'modelInputTokenLimit' Lens+modelInputTokenLimitL :: Lens_' Model (Maybe Int)+modelInputTokenLimitL f Model {..} = (\modelInputTokenLimit -> Model {modelInputTokenLimit, ..}) <$> f modelInputTokenLimit+{-# INLINE modelInputTokenLimitL #-}++-- | 'modelTopP' Lens+modelTopPL :: Lens_' Model (Maybe Float)+modelTopPL f Model {..} = (\modelTopP -> Model {modelTopP, ..}) <$> f modelTopP+{-# INLINE modelTopPL #-}++-- | 'modelSupportedGenerationMethods' Lens+modelSupportedGenerationMethodsL :: Lens_' Model (Maybe [Text])+modelSupportedGenerationMethodsL f Model {..} = (\modelSupportedGenerationMethods -> Model {modelSupportedGenerationMethods, ..}) <$> f modelSupportedGenerationMethods+{-# INLINE modelSupportedGenerationMethodsL #-}++-- | 'modelTemperature' Lens+modelTemperatureL :: Lens_' Model (Maybe Float)+modelTemperatureL f Model {..} = (\modelTemperature -> Model {modelTemperature, ..}) <$> f modelTemperature+{-# INLINE modelTemperatureL #-}++-- | 'modelDisplayName' Lens+modelDisplayNameL :: Lens_' Model (Maybe Text)+modelDisplayNameL f Model {..} = (\modelDisplayName -> Model {modelDisplayName, ..}) <$> f modelDisplayName+{-# INLINE modelDisplayNameL #-}++-- | 'modelDescription' Lens+modelDescriptionL :: Lens_' Model (Maybe Text)+modelDescriptionL f Model {..} = (\modelDescription -> Model {modelDescription, ..}) <$> f modelDescription+{-# INLINE modelDescriptionL #-}++-- | 'modelMaxTemperature' Lens+modelMaxTemperatureL :: Lens_' Model (Maybe Float)+modelMaxTemperatureL f Model {..} = (\modelMaxTemperature -> Model {modelMaxTemperature, ..}) <$> f modelMaxTemperature+{-# INLINE modelMaxTemperatureL #-}++-- | 'modelOutputTokenLimit' Lens+modelOutputTokenLimitL :: Lens_' Model (Maybe Int)+modelOutputTokenLimitL f Model {..} = (\modelOutputTokenLimit -> Model {modelOutputTokenLimit, ..}) <$> f modelOutputTokenLimit+{-# INLINE modelOutputTokenLimitL #-}++-- * ModelType++-- * MultiSpeakerVoiceConfig++-- | 'multiSpeakerVoiceConfigSpeakerVoiceConfigs' Lens+multiSpeakerVoiceConfigSpeakerVoiceConfigsL :: Lens_' MultiSpeakerVoiceConfig ([SpeakerVoiceConfig])+multiSpeakerVoiceConfigSpeakerVoiceConfigsL f MultiSpeakerVoiceConfig {..} = (\multiSpeakerVoiceConfigSpeakerVoiceConfigs -> MultiSpeakerVoiceConfig {multiSpeakerVoiceConfigSpeakerVoiceConfigs, ..}) <$> f multiSpeakerVoiceConfigSpeakerVoiceConfigs+{-# INLINE multiSpeakerVoiceConfigSpeakerVoiceConfigsL #-}++-- * Operation++-- | 'operationDone' Lens+operationDoneL :: Lens_' Operation (Maybe Bool)+operationDoneL f Operation {..} = (\operationDone -> Operation {operationDone, ..}) <$> f operationDone+{-# INLINE operationDoneL #-}++-- | 'operationName' Lens+operationNameL :: Lens_' Operation (Maybe Text)+operationNameL f Operation {..} = (\operationName -> Operation {operationName, ..}) <$> f operationName+{-# INLINE operationNameL #-}++-- | 'operationError' Lens+operationErrorL :: Lens_' Operation (Maybe Status)+operationErrorL f Operation {..} = (\operationError -> Operation {operationError, ..}) <$> f operationError+{-# INLINE operationErrorL #-}++-- | 'operationMetadata' Lens+operationMetadataL :: Lens_' Operation (Maybe (Map.Map String String))+operationMetadataL f Operation {..} = (\operationMetadata -> Operation {operationMetadata, ..}) <$> f operationMetadata+{-# INLINE operationMetadataL #-}++-- | 'operationResponse' Lens+operationResponseL :: Lens_' Operation (Maybe (Map.Map String String))+operationResponseL f Operation {..} = (\operationResponse -> Operation {operationResponse, ..}) <$> f operationResponse+{-# INLINE operationResponseL #-}++-- * Part++-- | 'partInlineData' Lens+partInlineDataL :: Lens_' Part (Maybe Blob)+partInlineDataL f Part {..} = (\partInlineData -> Part {partInlineData, ..}) <$> f partInlineData+{-# INLINE partInlineDataL #-}++-- | 'partFunctionResponse' Lens+partFunctionResponseL :: Lens_' Part (Maybe FunctionResponse)+partFunctionResponseL f Part {..} = (\partFunctionResponse -> Part {partFunctionResponse, ..}) <$> f partFunctionResponse+{-# INLINE partFunctionResponseL #-}++-- | 'partCodeExecutionResult' Lens+partCodeExecutionResultL :: Lens_' Part (Maybe CodeExecutionResult)+partCodeExecutionResultL f Part {..} = (\partCodeExecutionResult -> Part {partCodeExecutionResult, ..}) <$> f partCodeExecutionResult+{-# INLINE partCodeExecutionResultL #-}++-- | 'partFileData' Lens+partFileDataL :: Lens_' Part (Maybe FileData)+partFileDataL f Part {..} = (\partFileData -> Part {partFileData, ..}) <$> f partFileData+{-# INLINE partFileDataL #-}++-- | 'partExecutableCode' Lens+partExecutableCodeL :: Lens_' Part (Maybe ExecutableCode)+partExecutableCodeL f Part {..} = (\partExecutableCode -> Part {partExecutableCode, ..}) <$> f partExecutableCode+{-# INLINE partExecutableCodeL #-}++-- | 'partVideoMetadata' Lens+partVideoMetadataL :: Lens_' Part (Maybe VideoMetadata)+partVideoMetadataL f Part {..} = (\partVideoMetadata -> Part {partVideoMetadata, ..}) <$> f partVideoMetadata+{-# INLINE partVideoMetadataL #-}++-- | 'partThought' Lens+partThoughtL :: Lens_' Part (Maybe Bool)+partThoughtL f Part {..} = (\partThought -> Part {partThought, ..}) <$> f partThought+{-# INLINE partThoughtL #-}++-- | 'partText' Lens+partTextL :: Lens_' Part (Maybe Text)+partTextL f Part {..} = (\partText -> Part {partText, ..}) <$> f partText+{-# INLINE partTextL #-}++-- | 'partThoughtSignature' Lens+partThoughtSignatureL :: Lens_' Part (Maybe ByteArray)+partThoughtSignatureL f Part {..} = (\partThoughtSignature -> Part {partThoughtSignature, ..}) <$> f partThoughtSignature+{-# INLINE partThoughtSignatureL #-}++-- | 'partFunctionCall' Lens+partFunctionCallL :: Lens_' Part (Maybe FunctionCall)+partFunctionCallL f Part {..} = (\partFunctionCall -> Part {partFunctionCall, ..}) <$> f partFunctionCall+{-# INLINE partFunctionCallL #-}++-- * Permission++-- | 'permissionName' Lens+permissionNameL :: Lens_' Permission (Maybe Text)+permissionNameL f Permission {..} = (\permissionName -> Permission {permissionName, ..}) <$> f permissionName+{-# INLINE permissionNameL #-}++-- | 'permissionGranteeType' Lens+permissionGranteeTypeL :: Lens_' Permission (Maybe E'GranteeType)+permissionGranteeTypeL f Permission {..} = (\permissionGranteeType -> Permission {permissionGranteeType, ..}) <$> f permissionGranteeType+{-# INLINE permissionGranteeTypeL #-}++-- | 'permissionRole' Lens+permissionRoleL :: Lens_' Permission (E'Role)+permissionRoleL f Permission {..} = (\permissionRole -> Permission {permissionRole, ..}) <$> f permissionRole+{-# INLINE permissionRoleL #-}++-- | 'permissionEmailAddress' Lens+permissionEmailAddressL :: Lens_' Permission (Maybe Text)+permissionEmailAddressL f Permission {..} = (\permissionEmailAddress -> Permission {permissionEmailAddress, ..}) <$> f permissionEmailAddress+{-# INLINE permissionEmailAddressL #-}++-- * PrebuiltVoiceConfig++-- | 'prebuiltVoiceConfigVoiceName' Lens+prebuiltVoiceConfigVoiceNameL :: Lens_' PrebuiltVoiceConfig (Maybe Text)+prebuiltVoiceConfigVoiceNameL f PrebuiltVoiceConfig {..} = (\prebuiltVoiceConfigVoiceName -> PrebuiltVoiceConfig {prebuiltVoiceConfigVoiceName, ..}) <$> f prebuiltVoiceConfigVoiceName+{-# INLINE prebuiltVoiceConfigVoiceNameL #-}++-- * PredictLongRunningOperation++-- | 'predictLongRunningOperationDone' Lens+predictLongRunningOperationDoneL :: Lens_' PredictLongRunningOperation (Maybe Bool)+predictLongRunningOperationDoneL f PredictLongRunningOperation {..} = (\predictLongRunningOperationDone -> PredictLongRunningOperation {predictLongRunningOperationDone, ..}) <$> f predictLongRunningOperationDone+{-# INLINE predictLongRunningOperationDoneL #-}++-- | 'predictLongRunningOperationName' Lens+predictLongRunningOperationNameL :: Lens_' PredictLongRunningOperation (Maybe Text)+predictLongRunningOperationNameL f PredictLongRunningOperation {..} = (\predictLongRunningOperationName -> PredictLongRunningOperation {predictLongRunningOperationName, ..}) <$> f predictLongRunningOperationName+{-# INLINE predictLongRunningOperationNameL #-}++-- | 'predictLongRunningOperationError' Lens+predictLongRunningOperationErrorL :: Lens_' PredictLongRunningOperation (Maybe Status)+predictLongRunningOperationErrorL f PredictLongRunningOperation {..} = (\predictLongRunningOperationError -> PredictLongRunningOperation {predictLongRunningOperationError, ..}) <$> f predictLongRunningOperationError+{-# INLINE predictLongRunningOperationErrorL #-}++-- | 'predictLongRunningOperationMetadata' Lens+predictLongRunningOperationMetadataL :: Lens_' PredictLongRunningOperation (Maybe A.Value)+predictLongRunningOperationMetadataL f PredictLongRunningOperation {..} = (\predictLongRunningOperationMetadata -> PredictLongRunningOperation {predictLongRunningOperationMetadata, ..}) <$> f predictLongRunningOperationMetadata+{-# INLINE predictLongRunningOperationMetadataL #-}++-- | 'predictLongRunningOperationResponse' Lens+predictLongRunningOperationResponseL :: Lens_' PredictLongRunningOperation (Maybe PredictLongRunningResponse)+predictLongRunningOperationResponseL f PredictLongRunningOperation {..} = (\predictLongRunningOperationResponse -> PredictLongRunningOperation {predictLongRunningOperationResponse, ..}) <$> f predictLongRunningOperationResponse+{-# INLINE predictLongRunningOperationResponseL #-}++-- * PredictLongRunningRequest++-- | 'predictLongRunningRequestParameters' Lens+predictLongRunningRequestParametersL :: Lens_' PredictLongRunningRequest (Maybe String)+predictLongRunningRequestParametersL f PredictLongRunningRequest {..} = (\predictLongRunningRequestParameters -> PredictLongRunningRequest {predictLongRunningRequestParameters, ..}) <$> f predictLongRunningRequestParameters+{-# INLINE predictLongRunningRequestParametersL #-}++-- | 'predictLongRunningRequestInstances' Lens+predictLongRunningRequestInstancesL :: Lens_' PredictLongRunningRequest ([String])+predictLongRunningRequestInstancesL f PredictLongRunningRequest {..} = (\predictLongRunningRequestInstances -> PredictLongRunningRequest {predictLongRunningRequestInstances, ..}) <$> f predictLongRunningRequestInstances+{-# INLINE predictLongRunningRequestInstancesL #-}++-- * PredictLongRunningResponse++-- | 'predictLongRunningResponseGenerateVideoResponse' Lens+predictLongRunningResponseGenerateVideoResponseL :: Lens_' PredictLongRunningResponse (Maybe GenerateVideoResponse)+predictLongRunningResponseGenerateVideoResponseL f PredictLongRunningResponse {..} = (\predictLongRunningResponseGenerateVideoResponse -> PredictLongRunningResponse {predictLongRunningResponseGenerateVideoResponse, ..}) <$> f predictLongRunningResponseGenerateVideoResponse+{-# INLINE predictLongRunningResponseGenerateVideoResponseL #-}++-- * PredictRequest++-- | 'predictRequestInstances' Lens+predictRequestInstancesL :: Lens_' PredictRequest ([String])+predictRequestInstancesL f PredictRequest {..} = (\predictRequestInstances -> PredictRequest {predictRequestInstances, ..}) <$> f predictRequestInstances+{-# INLINE predictRequestInstancesL #-}++-- | 'predictRequestParameters' Lens+predictRequestParametersL :: Lens_' PredictRequest (Maybe String)+predictRequestParametersL f PredictRequest {..} = (\predictRequestParameters -> PredictRequest {predictRequestParameters, ..}) <$> f predictRequestParameters+{-# INLINE predictRequestParametersL #-}++-- * PredictResponse++-- | 'predictResponsePredictions' Lens+predictResponsePredictionsL :: Lens_' PredictResponse (Maybe [String])+predictResponsePredictionsL f PredictResponse {..} = (\predictResponsePredictions -> PredictResponse {predictResponsePredictions, ..}) <$> f predictResponsePredictions+{-# INLINE predictResponsePredictionsL #-}++-- * PromptFeedback++-- | 'promptFeedbackBlockReason' Lens+promptFeedbackBlockReasonL :: Lens_' PromptFeedback (Maybe E'BlockReason)+promptFeedbackBlockReasonL f PromptFeedback {..} = (\promptFeedbackBlockReason -> PromptFeedback {promptFeedbackBlockReason, ..}) <$> f promptFeedbackBlockReason+{-# INLINE promptFeedbackBlockReasonL #-}++-- | 'promptFeedbackSafetyRatings' Lens+promptFeedbackSafetyRatingsL :: Lens_' PromptFeedback (Maybe [SafetyRating])+promptFeedbackSafetyRatingsL f PromptFeedback {..} = (\promptFeedbackSafetyRatings -> PromptFeedback {promptFeedbackSafetyRatings, ..}) <$> f promptFeedbackSafetyRatings+{-# INLINE promptFeedbackSafetyRatingsL #-}++-- * QueryCorpusRequest++-- | 'queryCorpusRequestMetadataFilters' Lens+queryCorpusRequestMetadataFiltersL :: Lens_' QueryCorpusRequest (Maybe [MetadataFilter])+queryCorpusRequestMetadataFiltersL f QueryCorpusRequest {..} = (\queryCorpusRequestMetadataFilters -> QueryCorpusRequest {queryCorpusRequestMetadataFilters, ..}) <$> f queryCorpusRequestMetadataFilters+{-# INLINE queryCorpusRequestMetadataFiltersL #-}++-- | 'queryCorpusRequestQuery' Lens+queryCorpusRequestQueryL :: Lens_' QueryCorpusRequest (Text)+queryCorpusRequestQueryL f QueryCorpusRequest {..} = (\queryCorpusRequestQuery -> QueryCorpusRequest {queryCorpusRequestQuery, ..}) <$> f queryCorpusRequestQuery+{-# INLINE queryCorpusRequestQueryL #-}++-- | 'queryCorpusRequestResultsCount' Lens+queryCorpusRequestResultsCountL :: Lens_' QueryCorpusRequest (Maybe Int)+queryCorpusRequestResultsCountL f QueryCorpusRequest {..} = (\queryCorpusRequestResultsCount -> QueryCorpusRequest {queryCorpusRequestResultsCount, ..}) <$> f queryCorpusRequestResultsCount+{-# INLINE queryCorpusRequestResultsCountL #-}++-- * QueryCorpusResponse++-- | 'queryCorpusResponseRelevantChunks' Lens+queryCorpusResponseRelevantChunksL :: Lens_' QueryCorpusResponse (Maybe [RelevantChunk])+queryCorpusResponseRelevantChunksL f QueryCorpusResponse {..} = (\queryCorpusResponseRelevantChunks -> QueryCorpusResponse {queryCorpusResponseRelevantChunks, ..}) <$> f queryCorpusResponseRelevantChunks+{-# INLINE queryCorpusResponseRelevantChunksL #-}++-- * QueryDocumentRequest++-- | 'queryDocumentRequestQuery' Lens+queryDocumentRequestQueryL :: Lens_' QueryDocumentRequest (Text)+queryDocumentRequestQueryL f QueryDocumentRequest {..} = (\queryDocumentRequestQuery -> QueryDocumentRequest {queryDocumentRequestQuery, ..}) <$> f queryDocumentRequestQuery+{-# INLINE queryDocumentRequestQueryL #-}++-- | 'queryDocumentRequestResultsCount' Lens+queryDocumentRequestResultsCountL :: Lens_' QueryDocumentRequest (Maybe Int)+queryDocumentRequestResultsCountL f QueryDocumentRequest {..} = (\queryDocumentRequestResultsCount -> QueryDocumentRequest {queryDocumentRequestResultsCount, ..}) <$> f queryDocumentRequestResultsCount+{-# INLINE queryDocumentRequestResultsCountL #-}++-- | 'queryDocumentRequestMetadataFilters' Lens+queryDocumentRequestMetadataFiltersL :: Lens_' QueryDocumentRequest (Maybe [MetadataFilter])+queryDocumentRequestMetadataFiltersL f QueryDocumentRequest {..} = (\queryDocumentRequestMetadataFilters -> QueryDocumentRequest {queryDocumentRequestMetadataFilters, ..}) <$> f queryDocumentRequestMetadataFilters+{-# INLINE queryDocumentRequestMetadataFiltersL #-}++-- * QueryDocumentResponse++-- | 'queryDocumentResponseRelevantChunks' Lens+queryDocumentResponseRelevantChunksL :: Lens_' QueryDocumentResponse (Maybe [RelevantChunk])+queryDocumentResponseRelevantChunksL f QueryDocumentResponse {..} = (\queryDocumentResponseRelevantChunks -> QueryDocumentResponse {queryDocumentResponseRelevantChunks, ..}) <$> f queryDocumentResponseRelevantChunks+{-# INLINE queryDocumentResponseRelevantChunksL #-}++-- * RelevantChunk++-- | 'relevantChunkChunk' Lens+relevantChunkChunkL :: Lens_' RelevantChunk (Maybe Chunk)+relevantChunkChunkL f RelevantChunk {..} = (\relevantChunkChunk -> RelevantChunk {relevantChunkChunk, ..}) <$> f relevantChunkChunk+{-# INLINE relevantChunkChunkL #-}++-- | 'relevantChunkChunkRelevanceScore' Lens+relevantChunkChunkRelevanceScoreL :: Lens_' RelevantChunk (Maybe Float)+relevantChunkChunkRelevanceScoreL f RelevantChunk {..} = (\relevantChunkChunkRelevanceScore -> RelevantChunk {relevantChunkChunkRelevanceScore, ..}) <$> f relevantChunkChunkRelevanceScore+{-# INLINE relevantChunkChunkRelevanceScoreL #-}++-- * RetrievalMetadata++-- | 'retrievalMetadataGoogleSearchDynamicRetrievalScore' Lens+retrievalMetadataGoogleSearchDynamicRetrievalScoreL :: Lens_' RetrievalMetadata (Maybe Float)+retrievalMetadataGoogleSearchDynamicRetrievalScoreL f RetrievalMetadata {..} = (\retrievalMetadataGoogleSearchDynamicRetrievalScore -> RetrievalMetadata {retrievalMetadataGoogleSearchDynamicRetrievalScore, ..}) <$> f retrievalMetadataGoogleSearchDynamicRetrievalScore+{-# INLINE retrievalMetadataGoogleSearchDynamicRetrievalScoreL #-}++-- * SafetyFeedback++-- | 'safetyFeedbackSetting' Lens+safetyFeedbackSettingL :: Lens_' SafetyFeedback (Maybe SafetySetting)+safetyFeedbackSettingL f SafetyFeedback {..} = (\safetyFeedbackSetting -> SafetyFeedback {safetyFeedbackSetting, ..}) <$> f safetyFeedbackSetting+{-# INLINE safetyFeedbackSettingL #-}++-- | 'safetyFeedbackRating' Lens+safetyFeedbackRatingL :: Lens_' SafetyFeedback (Maybe SafetyRating)+safetyFeedbackRatingL f SafetyFeedback {..} = (\safetyFeedbackRating -> SafetyFeedback {safetyFeedbackRating, ..}) <$> f safetyFeedbackRating+{-# INLINE safetyFeedbackRatingL #-}++-- * SafetyRating++-- | 'safetyRatingCategory' Lens+safetyRatingCategoryL :: Lens_' SafetyRating (HarmCategory)+safetyRatingCategoryL f SafetyRating {..} = (\safetyRatingCategory -> SafetyRating {safetyRatingCategory, ..}) <$> f safetyRatingCategory+{-# INLINE safetyRatingCategoryL #-}++-- | 'safetyRatingBlocked' Lens+safetyRatingBlockedL :: Lens_' SafetyRating (Maybe Bool)+safetyRatingBlockedL f SafetyRating {..} = (\safetyRatingBlocked -> SafetyRating {safetyRatingBlocked, ..}) <$> f safetyRatingBlocked+{-# INLINE safetyRatingBlockedL #-}++-- | 'safetyRatingProbability' Lens+safetyRatingProbabilityL :: Lens_' SafetyRating (E'Probability)+safetyRatingProbabilityL f SafetyRating {..} = (\safetyRatingProbability -> SafetyRating {safetyRatingProbability, ..}) <$> f safetyRatingProbability+{-# INLINE safetyRatingProbabilityL #-}++-- * SafetySetting++-- | 'safetySettingThreshold' Lens+safetySettingThresholdL :: Lens_' SafetySetting (E'Threshold)+safetySettingThresholdL f SafetySetting {..} = (\safetySettingThreshold -> SafetySetting {safetySettingThreshold, ..}) <$> f safetySettingThreshold+{-# INLINE safetySettingThresholdL #-}++-- | 'safetySettingCategory' Lens+safetySettingCategoryL :: Lens_' SafetySetting (HarmCategory)+safetySettingCategoryL f SafetySetting {..} = (\safetySettingCategory -> SafetySetting {safetySettingCategory, ..}) <$> f safetySettingCategory+{-# INLINE safetySettingCategoryL #-}++-- * Schema++-- | 'schemaItems' Lens+schemaItemsL :: Lens_' Schema (Maybe Schema)+schemaItemsL f Schema {..} = (\schemaItems -> Schema {schemaItems, ..}) <$> f schemaItems+{-# INLINE schemaItemsL #-}++-- | 'schemaAnyOf' Lens+schemaAnyOfL :: Lens_' Schema (Maybe [Schema])+schemaAnyOfL f Schema {..} = (\schemaAnyOf -> Schema {schemaAnyOf, ..}) <$> f schemaAnyOf+{-# INLINE schemaAnyOfL #-}++-- | 'schemaMinLength' Lens+schemaMinLengthL :: Lens_' Schema (Maybe Text)+schemaMinLengthL f Schema {..} = (\schemaMinLength -> Schema {schemaMinLength, ..}) <$> f schemaMinLength+{-# INLINE schemaMinLengthL #-}++-- | 'schemaMaximum' Lens+schemaMaximumL :: Lens_' Schema (Maybe Double)+schemaMaximumL f Schema {..} = (\schemaMaximum -> Schema {schemaMaximum, ..}) <$> f schemaMaximum+{-# INLINE schemaMaximumL #-}++-- | 'schemaPropertyOrdering' Lens+schemaPropertyOrderingL :: Lens_' Schema (Maybe [Text])+schemaPropertyOrderingL f Schema {..} = (\schemaPropertyOrdering -> Schema {schemaPropertyOrdering, ..}) <$> f schemaPropertyOrdering+{-# INLINE schemaPropertyOrderingL #-}++-- | 'schemaNullable' Lens+schemaNullableL :: Lens_' Schema (Maybe Bool)+schemaNullableL f Schema {..} = (\schemaNullable -> Schema {schemaNullable, ..}) <$> f schemaNullable+{-# INLINE schemaNullableL #-}++-- | 'schemaRequired' Lens+schemaRequiredL :: Lens_' Schema (Maybe [Text])+schemaRequiredL f Schema {..} = (\schemaRequired -> Schema {schemaRequired, ..}) <$> f schemaRequired+{-# INLINE schemaRequiredL #-}++-- | 'schemaMinProperties' Lens+schemaMinPropertiesL :: Lens_' Schema (Maybe Text)+schemaMinPropertiesL f Schema {..} = (\schemaMinProperties -> Schema {schemaMinProperties, ..}) <$> f schemaMinProperties+{-# INLINE schemaMinPropertiesL #-}++-- | 'schemaMaxItems' Lens+schemaMaxItemsL :: Lens_' Schema (Maybe Text)+schemaMaxItemsL f Schema {..} = (\schemaMaxItems -> Schema {schemaMaxItems, ..}) <$> f schemaMaxItems+{-# INLINE schemaMaxItemsL #-}++-- | 'schemaExample' Lens+schemaExampleL :: Lens_' Schema (Maybe String)+schemaExampleL f Schema {..} = (\schemaExample -> Schema {schemaExample, ..}) <$> f schemaExample+{-# INLINE schemaExampleL #-}++-- | 'schemaTitle' Lens+schemaTitleL :: Lens_' Schema (Maybe Text)+schemaTitleL f Schema {..} = (\schemaTitle -> Schema {schemaTitle, ..}) <$> f schemaTitle+{-# INLINE schemaTitleL #-}++-- | 'schemaMinItems' Lens+schemaMinItemsL :: Lens_' Schema (Maybe Text)+schemaMinItemsL f Schema {..} = (\schemaMinItems -> Schema {schemaMinItems, ..}) <$> f schemaMinItems+{-# INLINE schemaMinItemsL #-}++-- | 'schemaDescription' Lens+schemaDescriptionL :: Lens_' Schema (Maybe Text)+schemaDescriptionL f Schema {..} = (\schemaDescription -> Schema {schemaDescription, ..}) <$> f schemaDescription+{-# INLINE schemaDescriptionL #-}++-- | 'schemaType' Lens+schemaTypeL :: Lens_' Schema (ModelType)+schemaTypeL f Schema {..} = (\schemaType -> Schema {schemaType, ..}) <$> f schemaType+{-# INLINE schemaTypeL #-}++-- | 'schemaDefault' Lens+schemaDefaultL :: Lens_' Schema (Maybe String)+schemaDefaultL f Schema {..} = (\schemaDefault -> Schema {schemaDefault, ..}) <$> f schemaDefault+{-# INLINE schemaDefaultL #-}++-- | 'schemaMinimum' Lens+schemaMinimumL :: Lens_' Schema (Maybe Double)+schemaMinimumL f Schema {..} = (\schemaMinimum -> Schema {schemaMinimum, ..}) <$> f schemaMinimum+{-# INLINE schemaMinimumL #-}++-- | 'schemaPattern' Lens+schemaPatternL :: Lens_' Schema (Maybe Text)+schemaPatternL f Schema {..} = (\schemaPattern -> Schema {schemaPattern, ..}) <$> f schemaPattern+{-# INLINE schemaPatternL #-}++-- | 'schemaProperties' Lens+schemaPropertiesL :: Lens_' Schema (Maybe (Map.Map String Schema))+schemaPropertiesL f Schema {..} = (\schemaProperties -> Schema {schemaProperties, ..}) <$> f schemaProperties+{-# INLINE schemaPropertiesL #-}++-- | 'schemaMaxProperties' Lens+schemaMaxPropertiesL :: Lens_' Schema (Maybe Text)+schemaMaxPropertiesL f Schema {..} = (\schemaMaxProperties -> Schema {schemaMaxProperties, ..}) <$> f schemaMaxProperties+{-# INLINE schemaMaxPropertiesL #-}++-- | 'schemaFormat' Lens+schemaFormatL :: Lens_' Schema (Maybe Text)+schemaFormatL f Schema {..} = (\schemaFormat -> Schema {schemaFormat, ..}) <$> f schemaFormat+{-# INLINE schemaFormatL #-}++-- | 'schemaEnum' Lens+schemaEnumL :: Lens_' Schema (Maybe [Text])+schemaEnumL f Schema {..} = (\schemaEnum -> Schema {schemaEnum, ..}) <$> f schemaEnum+{-# INLINE schemaEnumL #-}++-- | 'schemaMaxLength' Lens+schemaMaxLengthL :: Lens_' Schema (Maybe Text)+schemaMaxLengthL f Schema {..} = (\schemaMaxLength -> Schema {schemaMaxLength, ..}) <$> f schemaMaxLength+{-# INLINE schemaMaxLengthL #-}++-- * SearchEntryPoint++-- | 'searchEntryPointSdkBlob' Lens+searchEntryPointSdkBlobL :: Lens_' SearchEntryPoint (Maybe ByteArray)+searchEntryPointSdkBlobL f SearchEntryPoint {..} = (\searchEntryPointSdkBlob -> SearchEntryPoint {searchEntryPointSdkBlob, ..}) <$> f searchEntryPointSdkBlob+{-# INLINE searchEntryPointSdkBlobL #-}++-- | 'searchEntryPointRenderedContent' Lens+searchEntryPointRenderedContentL :: Lens_' SearchEntryPoint (Maybe Text)+searchEntryPointRenderedContentL f SearchEntryPoint {..} = (\searchEntryPointRenderedContent -> SearchEntryPoint {searchEntryPointRenderedContent, ..}) <$> f searchEntryPointRenderedContent+{-# INLINE searchEntryPointRenderedContentL #-}++-- * Segment++-- | 'segmentPartIndex' Lens+segmentPartIndexL :: Lens_' Segment (Maybe Int)+segmentPartIndexL f Segment {..} = (\segmentPartIndex -> Segment {segmentPartIndex, ..}) <$> f segmentPartIndex+{-# INLINE segmentPartIndexL #-}++-- | 'segmentStartIndex' Lens+segmentStartIndexL :: Lens_' Segment (Maybe Int)+segmentStartIndexL f Segment {..} = (\segmentStartIndex -> Segment {segmentStartIndex, ..}) <$> f segmentStartIndex+{-# INLINE segmentStartIndexL #-}++-- | 'segmentText' Lens+segmentTextL :: Lens_' Segment (Maybe Text)+segmentTextL f Segment {..} = (\segmentText -> Segment {segmentText, ..}) <$> f segmentText+{-# INLINE segmentTextL #-}++-- | 'segmentEndIndex' Lens+segmentEndIndexL :: Lens_' Segment (Maybe Int)+segmentEndIndexL f Segment {..} = (\segmentEndIndex -> Segment {segmentEndIndex, ..}) <$> f segmentEndIndex+{-# INLINE segmentEndIndexL #-}++-- * SemanticRetrieverChunk++-- | 'semanticRetrieverChunkChunk' Lens+semanticRetrieverChunkChunkL :: Lens_' SemanticRetrieverChunk (Maybe Text)+semanticRetrieverChunkChunkL f SemanticRetrieverChunk {..} = (\semanticRetrieverChunkChunk -> SemanticRetrieverChunk {semanticRetrieverChunkChunk, ..}) <$> f semanticRetrieverChunkChunk+{-# INLINE semanticRetrieverChunkChunkL #-}++-- | 'semanticRetrieverChunkSource' Lens+semanticRetrieverChunkSourceL :: Lens_' SemanticRetrieverChunk (Maybe Text)+semanticRetrieverChunkSourceL f SemanticRetrieverChunk {..} = (\semanticRetrieverChunkSource -> SemanticRetrieverChunk {semanticRetrieverChunkSource, ..}) <$> f semanticRetrieverChunkSource+{-# INLINE semanticRetrieverChunkSourceL #-}++-- * SemanticRetrieverConfig++-- | 'semanticRetrieverConfigSource' Lens+semanticRetrieverConfigSourceL :: Lens_' SemanticRetrieverConfig (Text)+semanticRetrieverConfigSourceL f SemanticRetrieverConfig {..} = (\semanticRetrieverConfigSource -> SemanticRetrieverConfig {semanticRetrieverConfigSource, ..}) <$> f semanticRetrieverConfigSource+{-# INLINE semanticRetrieverConfigSourceL #-}++-- | 'semanticRetrieverConfigQuery' Lens+semanticRetrieverConfigQueryL :: Lens_' SemanticRetrieverConfig (Content)+semanticRetrieverConfigQueryL f SemanticRetrieverConfig {..} = (\semanticRetrieverConfigQuery -> SemanticRetrieverConfig {semanticRetrieverConfigQuery, ..}) <$> f semanticRetrieverConfigQuery+{-# INLINE semanticRetrieverConfigQueryL #-}++-- | 'semanticRetrieverConfigMaxChunksCount' Lens+semanticRetrieverConfigMaxChunksCountL :: Lens_' SemanticRetrieverConfig (Maybe Int)+semanticRetrieverConfigMaxChunksCountL f SemanticRetrieverConfig {..} = (\semanticRetrieverConfigMaxChunksCount -> SemanticRetrieverConfig {semanticRetrieverConfigMaxChunksCount, ..}) <$> f semanticRetrieverConfigMaxChunksCount+{-# INLINE semanticRetrieverConfigMaxChunksCountL #-}++-- | 'semanticRetrieverConfigMetadataFilters' Lens+semanticRetrieverConfigMetadataFiltersL :: Lens_' SemanticRetrieverConfig (Maybe [MetadataFilter])+semanticRetrieverConfigMetadataFiltersL f SemanticRetrieverConfig {..} = (\semanticRetrieverConfigMetadataFilters -> SemanticRetrieverConfig {semanticRetrieverConfigMetadataFilters, ..}) <$> f semanticRetrieverConfigMetadataFilters+{-# INLINE semanticRetrieverConfigMetadataFiltersL #-}++-- | 'semanticRetrieverConfigMinimumRelevanceScore' Lens+semanticRetrieverConfigMinimumRelevanceScoreL :: Lens_' SemanticRetrieverConfig (Maybe Float)+semanticRetrieverConfigMinimumRelevanceScoreL f SemanticRetrieverConfig {..} = (\semanticRetrieverConfigMinimumRelevanceScore -> SemanticRetrieverConfig {semanticRetrieverConfigMinimumRelevanceScore, ..}) <$> f semanticRetrieverConfigMinimumRelevanceScore+{-# INLINE semanticRetrieverConfigMinimumRelevanceScoreL #-}++-- * SpeakerVoiceConfig++-- | 'speakerVoiceConfigVoiceConfig' Lens+speakerVoiceConfigVoiceConfigL :: Lens_' SpeakerVoiceConfig (VoiceConfig)+speakerVoiceConfigVoiceConfigL f SpeakerVoiceConfig {..} = (\speakerVoiceConfigVoiceConfig -> SpeakerVoiceConfig {speakerVoiceConfigVoiceConfig, ..}) <$> f speakerVoiceConfigVoiceConfig+{-# INLINE speakerVoiceConfigVoiceConfigL #-}++-- | 'speakerVoiceConfigSpeaker' Lens+speakerVoiceConfigSpeakerL :: Lens_' SpeakerVoiceConfig (Text)+speakerVoiceConfigSpeakerL f SpeakerVoiceConfig {..} = (\speakerVoiceConfigSpeaker -> SpeakerVoiceConfig {speakerVoiceConfigSpeaker, ..}) <$> f speakerVoiceConfigSpeaker+{-# INLINE speakerVoiceConfigSpeakerL #-}++-- * SpeechConfig++-- | 'speechConfigVoiceConfig' Lens+speechConfigVoiceConfigL :: Lens_' SpeechConfig (Maybe VoiceConfig)+speechConfigVoiceConfigL f SpeechConfig {..} = (\speechConfigVoiceConfig -> SpeechConfig {speechConfigVoiceConfig, ..}) <$> f speechConfigVoiceConfig+{-# INLINE speechConfigVoiceConfigL #-}++-- | 'speechConfigLanguageCode' Lens+speechConfigLanguageCodeL :: Lens_' SpeechConfig (Maybe Text)+speechConfigLanguageCodeL f SpeechConfig {..} = (\speechConfigLanguageCode -> SpeechConfig {speechConfigLanguageCode, ..}) <$> f speechConfigLanguageCode+{-# INLINE speechConfigLanguageCodeL #-}++-- | 'speechConfigMultiSpeakerVoiceConfig' Lens+speechConfigMultiSpeakerVoiceConfigL :: Lens_' SpeechConfig (Maybe MultiSpeakerVoiceConfig)+speechConfigMultiSpeakerVoiceConfigL f SpeechConfig {..} = (\speechConfigMultiSpeakerVoiceConfig -> SpeechConfig {speechConfigMultiSpeakerVoiceConfig, ..}) <$> f speechConfigMultiSpeakerVoiceConfig+{-# INLINE speechConfigMultiSpeakerVoiceConfigL #-}++-- * Status++-- | 'statusCode' Lens+statusCodeL :: Lens_' Status (Maybe Int)+statusCodeL f Status {..} = (\statusCode -> Status {statusCode, ..}) <$> f statusCode+{-# INLINE statusCodeL #-}++-- | 'statusDetails' Lens+statusDetailsL :: Lens_' Status (Maybe [(Map.Map String String)])+statusDetailsL f Status {..} = (\statusDetails -> Status {statusDetails, ..}) <$> f statusDetails+{-# INLINE statusDetailsL #-}++-- | 'statusMessage' Lens+statusMessageL :: Lens_' Status (Maybe Text)+statusMessageL f Status {..} = (\statusMessage -> Status {statusMessage, ..}) <$> f statusMessage+{-# INLINE statusMessageL #-}++-- * StringList++-- | 'stringListValues' Lens+stringListValuesL :: Lens_' StringList (Maybe [Text])+stringListValuesL f StringList {..} = (\stringListValues -> StringList {stringListValues, ..}) <$> f stringListValues+{-# INLINE stringListValuesL #-}++-- * TaskType++-- * TextCompletion++-- | 'textCompletionSafetyRatings' Lens+textCompletionSafetyRatingsL :: Lens_' TextCompletion (Maybe [SafetyRating])+textCompletionSafetyRatingsL f TextCompletion {..} = (\textCompletionSafetyRatings -> TextCompletion {textCompletionSafetyRatings, ..}) <$> f textCompletionSafetyRatings+{-# INLINE textCompletionSafetyRatingsL #-}++-- | 'textCompletionOutput' Lens+textCompletionOutputL :: Lens_' TextCompletion (Maybe Text)+textCompletionOutputL f TextCompletion {..} = (\textCompletionOutput -> TextCompletion {textCompletionOutput, ..}) <$> f textCompletionOutput+{-# INLINE textCompletionOutputL #-}++-- | 'textCompletionCitationMetadata' Lens+textCompletionCitationMetadataL :: Lens_' TextCompletion (Maybe CitationMetadata)+textCompletionCitationMetadataL f TextCompletion {..} = (\textCompletionCitationMetadata -> TextCompletion {textCompletionCitationMetadata, ..}) <$> f textCompletionCitationMetadata+{-# INLINE textCompletionCitationMetadataL #-}++-- * TextPrompt++-- | 'textPromptText' Lens+textPromptTextL :: Lens_' TextPrompt (Text)+textPromptTextL f TextPrompt {..} = (\textPromptText -> TextPrompt {textPromptText, ..}) <$> f textPromptText+{-# INLINE textPromptTextL #-}++-- * ThinkingConfig++-- | 'thinkingConfigThinkingBudget' Lens+thinkingConfigThinkingBudgetL :: Lens_' ThinkingConfig (Maybe Int)+thinkingConfigThinkingBudgetL f ThinkingConfig {..} = (\thinkingConfigThinkingBudget -> ThinkingConfig {thinkingConfigThinkingBudget, ..}) <$> f thinkingConfigThinkingBudget+{-# INLINE thinkingConfigThinkingBudgetL #-}++-- | 'thinkingConfigIncludeThoughts' Lens+thinkingConfigIncludeThoughtsL :: Lens_' ThinkingConfig (Maybe Bool)+thinkingConfigIncludeThoughtsL f ThinkingConfig {..} = (\thinkingConfigIncludeThoughts -> ThinkingConfig {thinkingConfigIncludeThoughts, ..}) <$> f thinkingConfigIncludeThoughts+{-# INLINE thinkingConfigIncludeThoughtsL #-}++-- * Tool++-- | 'toolFunctionDeclarations' Lens+toolFunctionDeclarationsL :: Lens_' Tool (Maybe [FunctionDeclaration])+toolFunctionDeclarationsL f Tool {..} = (\toolFunctionDeclarations -> Tool {toolFunctionDeclarations, ..}) <$> f toolFunctionDeclarations+{-# INLINE toolFunctionDeclarationsL #-}++-- | 'toolGoogleSearchRetrieval' Lens+toolGoogleSearchRetrievalL :: Lens_' Tool (Maybe GoogleSearchRetrieval)+toolGoogleSearchRetrievalL f Tool {..} = (\toolGoogleSearchRetrieval -> Tool {toolGoogleSearchRetrieval, ..}) <$> f toolGoogleSearchRetrieval+{-# INLINE toolGoogleSearchRetrievalL #-}++-- | 'toolGoogleSearch' Lens+toolGoogleSearchL :: Lens_' Tool (Maybe GoogleSearch)+toolGoogleSearchL f Tool {..} = (\toolGoogleSearch -> Tool {toolGoogleSearch, ..}) <$> f toolGoogleSearch+{-# INLINE toolGoogleSearchL #-}++-- | 'toolCodeExecution' Lens+toolCodeExecutionL :: Lens_' Tool (Maybe A.Value)+toolCodeExecutionL f Tool {..} = (\toolCodeExecution -> Tool {toolCodeExecution, ..}) <$> f toolCodeExecution+{-# INLINE toolCodeExecutionL #-}++-- | 'toolUrlContext' Lens+toolUrlContextL :: Lens_' Tool (Maybe A.Value)+toolUrlContextL f Tool {..} = (\toolUrlContext -> Tool {toolUrlContext, ..}) <$> f toolUrlContext+{-# INLINE toolUrlContextL #-}++-- * ToolConfig++-- | 'toolConfigFunctionCallingConfig' Lens+toolConfigFunctionCallingConfigL :: Lens_' ToolConfig (Maybe FunctionCallingConfig)+toolConfigFunctionCallingConfigL f ToolConfig {..} = (\toolConfigFunctionCallingConfig -> ToolConfig {toolConfigFunctionCallingConfig, ..}) <$> f toolConfigFunctionCallingConfig+{-# INLINE toolConfigFunctionCallingConfigL #-}++-- * TopCandidates++-- | 'topCandidatesCandidates' Lens+topCandidatesCandidatesL :: Lens_' TopCandidates (Maybe [LogprobsResultCandidate])+topCandidatesCandidatesL f TopCandidates {..} = (\topCandidatesCandidates -> TopCandidates {topCandidatesCandidates, ..}) <$> f topCandidatesCandidates+{-# INLINE topCandidatesCandidatesL #-}++-- * TransferOwnershipRequest++-- | 'transferOwnershipRequestEmailAddress' Lens+transferOwnershipRequestEmailAddressL :: Lens_' TransferOwnershipRequest (Text)+transferOwnershipRequestEmailAddressL f TransferOwnershipRequest {..} = (\transferOwnershipRequestEmailAddress -> TransferOwnershipRequest {transferOwnershipRequestEmailAddress, ..}) <$> f transferOwnershipRequestEmailAddress+{-# INLINE transferOwnershipRequestEmailAddressL #-}++-- * TunedModel++-- | 'tunedModelUpdateTime' Lens+tunedModelUpdateTimeL :: Lens_' TunedModel (Maybe DateTime)+tunedModelUpdateTimeL f TunedModel {..} = (\tunedModelUpdateTime -> TunedModel {tunedModelUpdateTime, ..}) <$> f tunedModelUpdateTime+{-# INLINE tunedModelUpdateTimeL #-}++-- | 'tunedModelName' Lens+tunedModelNameL :: Lens_' TunedModel (Maybe Text)+tunedModelNameL f TunedModel {..} = (\tunedModelName -> TunedModel {tunedModelName, ..}) <$> f tunedModelName+{-# INLINE tunedModelNameL #-}++-- | 'tunedModelCreateTime' Lens+tunedModelCreateTimeL :: Lens_' TunedModel (Maybe DateTime)+tunedModelCreateTimeL f TunedModel {..} = (\tunedModelCreateTime -> TunedModel {tunedModelCreateTime, ..}) <$> f tunedModelCreateTime+{-# INLINE tunedModelCreateTimeL #-}++-- | 'tunedModelTuningTask' Lens+tunedModelTuningTaskL :: Lens_' TunedModel (TuningTask)+tunedModelTuningTaskL f TunedModel {..} = (\tunedModelTuningTask -> TunedModel {tunedModelTuningTask, ..}) <$> f tunedModelTuningTask+{-# INLINE tunedModelTuningTaskL #-}++-- | 'tunedModelTunedModelSource' Lens+tunedModelTunedModelSourceL :: Lens_' TunedModel (Maybe TunedModelSource)+tunedModelTunedModelSourceL f TunedModel {..} = (\tunedModelTunedModelSource -> TunedModel {tunedModelTunedModelSource, ..}) <$> f tunedModelTunedModelSource+{-# INLINE tunedModelTunedModelSourceL #-}++-- | 'tunedModelBaseModel' Lens+tunedModelBaseModelL :: Lens_' TunedModel (Maybe Text)+tunedModelBaseModelL f TunedModel {..} = (\tunedModelBaseModel -> TunedModel {tunedModelBaseModel, ..}) <$> f tunedModelBaseModel+{-# INLINE tunedModelBaseModelL #-}++-- | 'tunedModelReaderProjectNumbers' Lens+tunedModelReaderProjectNumbersL :: Lens_' TunedModel (Maybe [Text])+tunedModelReaderProjectNumbersL f TunedModel {..} = (\tunedModelReaderProjectNumbers -> TunedModel {tunedModelReaderProjectNumbers, ..}) <$> f tunedModelReaderProjectNumbers+{-# INLINE tunedModelReaderProjectNumbersL #-}++-- | 'tunedModelDisplayName' Lens+tunedModelDisplayNameL :: Lens_' TunedModel (Maybe Text)+tunedModelDisplayNameL f TunedModel {..} = (\tunedModelDisplayName -> TunedModel {tunedModelDisplayName, ..}) <$> f tunedModelDisplayName+{-# INLINE tunedModelDisplayNameL #-}++-- | 'tunedModelTemperature' Lens+tunedModelTemperatureL :: Lens_' TunedModel (Maybe Float)+tunedModelTemperatureL f TunedModel {..} = (\tunedModelTemperature -> TunedModel {tunedModelTemperature, ..}) <$> f tunedModelTemperature+{-# INLINE tunedModelTemperatureL #-}++-- | 'tunedModelDescription' Lens+tunedModelDescriptionL :: Lens_' TunedModel (Maybe Text)+tunedModelDescriptionL f TunedModel {..} = (\tunedModelDescription -> TunedModel {tunedModelDescription, ..}) <$> f tunedModelDescription+{-# INLINE tunedModelDescriptionL #-}++-- | 'tunedModelTopP' Lens+tunedModelTopPL :: Lens_' TunedModel (Maybe Float)+tunedModelTopPL f TunedModel {..} = (\tunedModelTopP -> TunedModel {tunedModelTopP, ..}) <$> f tunedModelTopP+{-# INLINE tunedModelTopPL #-}++-- | 'tunedModelTopK' Lens+tunedModelTopKL :: Lens_' TunedModel (Maybe Int)+tunedModelTopKL f TunedModel {..} = (\tunedModelTopK -> TunedModel {tunedModelTopK, ..}) <$> f tunedModelTopK+{-# INLINE tunedModelTopKL #-}++-- | 'tunedModelState' Lens+tunedModelStateL :: Lens_' TunedModel (Maybe E'State3)+tunedModelStateL f TunedModel {..} = (\tunedModelState -> TunedModel {tunedModelState, ..}) <$> f tunedModelState+{-# INLINE tunedModelStateL #-}++-- * TunedModelSource++-- | 'tunedModelSourceTunedModel' Lens+tunedModelSourceTunedModelL :: Lens_' TunedModelSource (Maybe Text)+tunedModelSourceTunedModelL f TunedModelSource {..} = (\tunedModelSourceTunedModel -> TunedModelSource {tunedModelSourceTunedModel, ..}) <$> f tunedModelSourceTunedModel+{-# INLINE tunedModelSourceTunedModelL #-}++-- | 'tunedModelSourceBaseModel' Lens+tunedModelSourceBaseModelL :: Lens_' TunedModelSource (Maybe Text)+tunedModelSourceBaseModelL f TunedModelSource {..} = (\tunedModelSourceBaseModel -> TunedModelSource {tunedModelSourceBaseModel, ..}) <$> f tunedModelSourceBaseModel+{-# INLINE tunedModelSourceBaseModelL #-}++-- * TuningExample++-- | 'tuningExampleTextInput' Lens+tuningExampleTextInputL :: Lens_' TuningExample (Maybe Text)+tuningExampleTextInputL f TuningExample {..} = (\tuningExampleTextInput -> TuningExample {tuningExampleTextInput, ..}) <$> f tuningExampleTextInput+{-# INLINE tuningExampleTextInputL #-}++-- | 'tuningExampleOutput' Lens+tuningExampleOutputL :: Lens_' TuningExample (Text)+tuningExampleOutputL f TuningExample {..} = (\tuningExampleOutput -> TuningExample {tuningExampleOutput, ..}) <$> f tuningExampleOutput+{-# INLINE tuningExampleOutputL #-}++-- * TuningExamples++-- | 'tuningExamplesExamples' Lens+tuningExamplesExamplesL :: Lens_' TuningExamples (Maybe [TuningExample])+tuningExamplesExamplesL f TuningExamples {..} = (\tuningExamplesExamples -> TuningExamples {tuningExamplesExamples, ..}) <$> f tuningExamplesExamples+{-# INLINE tuningExamplesExamplesL #-}++-- * TuningSnapshot++-- | 'tuningSnapshotMeanLoss' Lens+tuningSnapshotMeanLossL :: Lens_' TuningSnapshot (Maybe Float)+tuningSnapshotMeanLossL f TuningSnapshot {..} = (\tuningSnapshotMeanLoss -> TuningSnapshot {tuningSnapshotMeanLoss, ..}) <$> f tuningSnapshotMeanLoss+{-# INLINE tuningSnapshotMeanLossL #-}++-- | 'tuningSnapshotComputeTime' Lens+tuningSnapshotComputeTimeL :: Lens_' TuningSnapshot (Maybe DateTime)+tuningSnapshotComputeTimeL f TuningSnapshot {..} = (\tuningSnapshotComputeTime -> TuningSnapshot {tuningSnapshotComputeTime, ..}) <$> f tuningSnapshotComputeTime+{-# INLINE tuningSnapshotComputeTimeL #-}++-- | 'tuningSnapshotStep' Lens+tuningSnapshotStepL :: Lens_' TuningSnapshot (Maybe Int)+tuningSnapshotStepL f TuningSnapshot {..} = (\tuningSnapshotStep -> TuningSnapshot {tuningSnapshotStep, ..}) <$> f tuningSnapshotStep+{-# INLINE tuningSnapshotStepL #-}++-- | 'tuningSnapshotEpoch' Lens+tuningSnapshotEpochL :: Lens_' TuningSnapshot (Maybe Int)+tuningSnapshotEpochL f TuningSnapshot {..} = (\tuningSnapshotEpoch -> TuningSnapshot {tuningSnapshotEpoch, ..}) <$> f tuningSnapshotEpoch+{-# INLINE tuningSnapshotEpochL #-}++-- * TuningTask++-- | 'tuningTaskStartTime' Lens+tuningTaskStartTimeL :: Lens_' TuningTask (Maybe DateTime)+tuningTaskStartTimeL f TuningTask {..} = (\tuningTaskStartTime -> TuningTask {tuningTaskStartTime, ..}) <$> f tuningTaskStartTime+{-# INLINE tuningTaskStartTimeL #-}++-- | 'tuningTaskTrainingData' Lens+tuningTaskTrainingDataL :: Lens_' TuningTask (Dataset)+tuningTaskTrainingDataL f TuningTask {..} = (\tuningTaskTrainingData -> TuningTask {tuningTaskTrainingData, ..}) <$> f tuningTaskTrainingData+{-# INLINE tuningTaskTrainingDataL #-}++-- | 'tuningTaskHyperparameters' Lens+tuningTaskHyperparametersL :: Lens_' TuningTask (Maybe Hyperparameters)+tuningTaskHyperparametersL f TuningTask {..} = (\tuningTaskHyperparameters -> TuningTask {tuningTaskHyperparameters, ..}) <$> f tuningTaskHyperparameters+{-# INLINE tuningTaskHyperparametersL #-}++-- | 'tuningTaskCompleteTime' Lens+tuningTaskCompleteTimeL :: Lens_' TuningTask (Maybe DateTime)+tuningTaskCompleteTimeL f TuningTask {..} = (\tuningTaskCompleteTime -> TuningTask {tuningTaskCompleteTime, ..}) <$> f tuningTaskCompleteTime+{-# INLINE tuningTaskCompleteTimeL #-}++-- | 'tuningTaskSnapshots' Lens+tuningTaskSnapshotsL :: Lens_' TuningTask (Maybe [TuningSnapshot])+tuningTaskSnapshotsL f TuningTask {..} = (\tuningTaskSnapshots -> TuningTask {tuningTaskSnapshots, ..}) <$> f tuningTaskSnapshots+{-# INLINE tuningTaskSnapshotsL #-}++-- * UpdateChunkRequest++-- | 'updateChunkRequestUpdateMask' Lens+updateChunkRequestUpdateMaskL :: Lens_' UpdateChunkRequest (Text)+updateChunkRequestUpdateMaskL f UpdateChunkRequest {..} = (\updateChunkRequestUpdateMask -> UpdateChunkRequest {updateChunkRequestUpdateMask, ..}) <$> f updateChunkRequestUpdateMask+{-# INLINE updateChunkRequestUpdateMaskL #-}++-- | 'updateChunkRequestChunk' Lens+updateChunkRequestChunkL :: Lens_' UpdateChunkRequest (Chunk)+updateChunkRequestChunkL f UpdateChunkRequest {..} = (\updateChunkRequestChunk -> UpdateChunkRequest {updateChunkRequestChunk, ..}) <$> f updateChunkRequestChunk+{-# INLINE updateChunkRequestChunkL #-}++-- * UrlContextMetadata++-- | 'urlContextMetadataUrlMetadata' Lens+urlContextMetadataUrlMetadataL :: Lens_' UrlContextMetadata (Maybe [UrlMetadata])+urlContextMetadataUrlMetadataL f UrlContextMetadata {..} = (\urlContextMetadataUrlMetadata -> UrlContextMetadata {urlContextMetadataUrlMetadata, ..}) <$> f urlContextMetadataUrlMetadata+{-# INLINE urlContextMetadataUrlMetadataL #-}++-- * UrlMetadata++-- | 'urlMetadataRetrievedUrl' Lens+urlMetadataRetrievedUrlL :: Lens_' UrlMetadata (Maybe Text)+urlMetadataRetrievedUrlL f UrlMetadata {..} = (\urlMetadataRetrievedUrl -> UrlMetadata {urlMetadataRetrievedUrl, ..}) <$> f urlMetadataRetrievedUrl+{-# INLINE urlMetadataRetrievedUrlL #-}++-- | 'urlMetadataUrlRetrievalStatus' Lens+urlMetadataUrlRetrievalStatusL :: Lens_' UrlMetadata (Maybe E'UrlRetrievalStatus)+urlMetadataUrlRetrievalStatusL f UrlMetadata {..} = (\urlMetadataUrlRetrievalStatus -> UrlMetadata {urlMetadataUrlRetrievalStatus, ..}) <$> f urlMetadataUrlRetrievalStatus+{-# INLINE urlMetadataUrlRetrievalStatusL #-}++-- * UsageMetadata++-- | 'usageMetadataCandidatesTokensDetails' Lens+usageMetadataCandidatesTokensDetailsL :: Lens_' UsageMetadata (Maybe [ModalityTokenCount])+usageMetadataCandidatesTokensDetailsL f UsageMetadata {..} = (\usageMetadataCandidatesTokensDetails -> UsageMetadata {usageMetadataCandidatesTokensDetails, ..}) <$> f usageMetadataCandidatesTokensDetails+{-# INLINE usageMetadataCandidatesTokensDetailsL #-}++-- | 'usageMetadataThoughtsTokenCount' Lens+usageMetadataThoughtsTokenCountL :: Lens_' UsageMetadata (Maybe Int)+usageMetadataThoughtsTokenCountL f UsageMetadata {..} = (\usageMetadataThoughtsTokenCount -> UsageMetadata {usageMetadataThoughtsTokenCount, ..}) <$> f usageMetadataThoughtsTokenCount+{-# INLINE usageMetadataThoughtsTokenCountL #-}++-- | 'usageMetadataToolUsePromptTokenCount' Lens+usageMetadataToolUsePromptTokenCountL :: Lens_' UsageMetadata (Maybe Int)+usageMetadataToolUsePromptTokenCountL f UsageMetadata {..} = (\usageMetadataToolUsePromptTokenCount -> UsageMetadata {usageMetadataToolUsePromptTokenCount, ..}) <$> f usageMetadataToolUsePromptTokenCount+{-# INLINE usageMetadataToolUsePromptTokenCountL #-}++-- | 'usageMetadataCachedContentTokenCount' Lens+usageMetadataCachedContentTokenCountL :: Lens_' UsageMetadata (Maybe Int)+usageMetadataCachedContentTokenCountL f UsageMetadata {..} = (\usageMetadataCachedContentTokenCount -> UsageMetadata {usageMetadataCachedContentTokenCount, ..}) <$> f usageMetadataCachedContentTokenCount+{-# INLINE usageMetadataCachedContentTokenCountL #-}++-- | 'usageMetadataPromptTokenCount' Lens+usageMetadataPromptTokenCountL :: Lens_' UsageMetadata (Maybe Int)+usageMetadataPromptTokenCountL f UsageMetadata {..} = (\usageMetadataPromptTokenCount -> UsageMetadata {usageMetadataPromptTokenCount, ..}) <$> f usageMetadataPromptTokenCount+{-# INLINE usageMetadataPromptTokenCountL #-}++-- | 'usageMetadataCandidatesTokenCount' Lens+usageMetadataCandidatesTokenCountL :: Lens_' UsageMetadata (Maybe Int)+usageMetadataCandidatesTokenCountL f UsageMetadata {..} = (\usageMetadataCandidatesTokenCount -> UsageMetadata {usageMetadataCandidatesTokenCount, ..}) <$> f usageMetadataCandidatesTokenCount+{-# INLINE usageMetadataCandidatesTokenCountL #-}++-- | 'usageMetadataPromptTokensDetails' Lens+usageMetadataPromptTokensDetailsL :: Lens_' UsageMetadata (Maybe [ModalityTokenCount])+usageMetadataPromptTokensDetailsL f UsageMetadata {..} = (\usageMetadataPromptTokensDetails -> UsageMetadata {usageMetadataPromptTokensDetails, ..}) <$> f usageMetadataPromptTokensDetails+{-# INLINE usageMetadataPromptTokensDetailsL #-}++-- | 'usageMetadataTotalTokenCount' Lens+usageMetadataTotalTokenCountL :: Lens_' UsageMetadata (Maybe Int)+usageMetadataTotalTokenCountL f UsageMetadata {..} = (\usageMetadataTotalTokenCount -> UsageMetadata {usageMetadataTotalTokenCount, ..}) <$> f usageMetadataTotalTokenCount+{-# INLINE usageMetadataTotalTokenCountL #-}++-- | 'usageMetadataCacheTokensDetails' Lens+usageMetadataCacheTokensDetailsL :: Lens_' UsageMetadata (Maybe [ModalityTokenCount])+usageMetadataCacheTokensDetailsL f UsageMetadata {..} = (\usageMetadataCacheTokensDetails -> UsageMetadata {usageMetadataCacheTokensDetails, ..}) <$> f usageMetadataCacheTokensDetails+{-# INLINE usageMetadataCacheTokensDetailsL #-}++-- | 'usageMetadataToolUsePromptTokensDetails' Lens+usageMetadataToolUsePromptTokensDetailsL :: Lens_' UsageMetadata (Maybe [ModalityTokenCount])+usageMetadataToolUsePromptTokensDetailsL f UsageMetadata {..} = (\usageMetadataToolUsePromptTokensDetails -> UsageMetadata {usageMetadataToolUsePromptTokensDetails, ..}) <$> f usageMetadataToolUsePromptTokensDetails+{-# INLINE usageMetadataToolUsePromptTokensDetailsL #-}++-- * Video++-- | 'videoVideo' Lens+videoVideoL :: Lens_' Video (Maybe ByteArray)+videoVideoL f Video {..} = (\videoVideo -> Video {videoVideo, ..}) <$> f videoVideo+{-# INLINE videoVideoL #-}++-- | 'videoUri' Lens+videoUriL :: Lens_' Video (Maybe Text)+videoUriL f Video {..} = (\videoUri -> Video {videoUri, ..}) <$> f videoUri+{-# INLINE videoUriL #-}++-- * VideoFileMetadata++-- | 'videoFileMetadataVideoDuration' Lens+videoFileMetadataVideoDurationL :: Lens_' VideoFileMetadata (Maybe Text)+videoFileMetadataVideoDurationL f VideoFileMetadata {..} = (\videoFileMetadataVideoDuration -> VideoFileMetadata {videoFileMetadataVideoDuration, ..}) <$> f videoFileMetadataVideoDuration+{-# INLINE videoFileMetadataVideoDurationL #-}++-- * VideoMetadata++-- | 'videoMetadataEndOffset' Lens+videoMetadataEndOffsetL :: Lens_' VideoMetadata (Maybe Text)+videoMetadataEndOffsetL f VideoMetadata {..} = (\videoMetadataEndOffset -> VideoMetadata {videoMetadataEndOffset, ..}) <$> f videoMetadataEndOffset+{-# INLINE videoMetadataEndOffsetL #-}++-- | 'videoMetadataStartOffset' Lens+videoMetadataStartOffsetL :: Lens_' VideoMetadata (Maybe Text)+videoMetadataStartOffsetL f VideoMetadata {..} = (\videoMetadataStartOffset -> VideoMetadata {videoMetadataStartOffset, ..}) <$> f videoMetadataStartOffset+{-# INLINE videoMetadataStartOffsetL #-}++-- | 'videoMetadataFps' Lens+videoMetadataFpsL :: Lens_' VideoMetadata (Maybe Double)+videoMetadataFpsL f VideoMetadata {..} = (\videoMetadataFps -> VideoMetadata {videoMetadataFps, ..}) <$> f videoMetadataFps+{-# INLINE videoMetadataFpsL #-}++-- * VoiceConfig++-- | 'voiceConfigPrebuiltVoiceConfig' Lens+voiceConfigPrebuiltVoiceConfigL :: Lens_' VoiceConfig (Maybe PrebuiltVoiceConfig)+voiceConfigPrebuiltVoiceConfigL f VoiceConfig {..} = (\voiceConfigPrebuiltVoiceConfig -> VoiceConfig {voiceConfigPrebuiltVoiceConfig, ..}) <$> f voiceConfigPrebuiltVoiceConfig+{-# INLINE voiceConfigPrebuiltVoiceConfigL #-}++-- * Web++-- | 'webTitle' Lens+webTitleL :: Lens_' Web (Maybe Text)+webTitleL f Web {..} = (\webTitle -> Web {webTitle, ..}) <$> f webTitle+{-# INLINE webTitleL #-}++-- | 'webUri' Lens+webUriL :: Lens_' Web (Maybe Text)+webUriL f Web {..} = (\webUri -> Web {webUri, ..}) <$> f webUri+{-# INLINE webUriL #-}
+ openapi.yaml view
@@ -0,0 +1,12063 @@+openapi: 3.0.3+info:+ description: "The Gemini API allows developers to build generative AI applications\+ \ using Gemini models. Gemini is our most capable model, built from the ground\+ \ up to be multimodal. It can generalize and seamlessly understand, operate across,\+ \ and combine different types of information including language, images, audio,\+ \ video, and code. You can use the Gemini API for use cases like reasoning across\+ \ text and images, content generation, dialogue agents, summarization and classification\+ \ systems, and more."+ title: Generative Language API+ version: v1beta+ x-google-revision: "20250601"+externalDocs:+ description: Find more info here.+ url: https://developers.generativeai.google/api+servers:+- description: Global Endpoint+ url: https://generativelanguage.googleapis.com+paths:+ /v1beta/dynamic/{dynamicId}:streamGenerateContent:+ post:+ description: |-+ Generates a [streamed+ response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream)+ from the model given an input `GenerateContentRequest`.+ operationId: StreamGenerateContentByDynamicId+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: |-+ Part of `model`. Required. The name of the `Model` to use for generating the completion.++ Format: `models/{model}`.+ explode: false+ in: path+ name: dynamicId+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateContentRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateContentResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: StreamGenerateContent+ /v1beta/tunedModels/{tunedModel}:generateText:+ post:+ description: Generates a response from the model given an input message.+ operationId: GenerateTextByTunedModel+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateTextRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateTextResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: GenerateText+ /v1beta/corpora/{corpus}/documents:+ get:+ description: Lists all `Document`s in a `Corpus`.+ operationId: ListDocuments+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: |-+ Optional. The maximum number of `Document`s to return (per page).+ The service may return fewer `Document`s.++ If unspecified, at most 10 `Document`s will be returned.+ The maximum size limit is 20 `Document`s per page.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: |-+ Optional. A page token, received from a previous `ListDocuments` call.++ Provide the `next_page_token` returned in the response as an argument to+ the next request to retrieve the next page.++ When paginating, all other parameters provided to `ListDocuments`+ must match the call that provided the page token.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListDocumentsResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ post:+ description: Creates an empty `Document`.+ operationId: CreateDocument+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Document'+ description: Required. The `Document` to create.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Document'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/tunedModels/{tunedModel}/permissions:+ get:+ description: Lists permissions for the specific resource.+ operationId: ListPermissions+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ - description: |-+ Optional. The maximum number of `Permission`s to return (per page).+ The service may return fewer permissions.++ If unspecified, at most 10 permissions will be returned.+ This method returns at most 1000 permissions per page, even if you pass+ larger page_size.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: |-+ Optional. A page token, received from a previous `ListPermissions` call.++ Provide the `page_token` returned by one request as an argument to the+ next request to retrieve the next page.++ When paginating, all other parameters provided to `ListPermissions`+ must match the call that provided the page token.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListPermissionsResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ post:+ description: Create a permission to a specific resource.+ operationId: CreatePermission+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Permission'+ description: Required. The permission to create.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Permission'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/tunedModels/{tunedModel}/operations:+ get:+ description: |-+ Lists operations that match the specified filter in the request. If the+ server doesn't support this method, it returns `UNIMPLEMENTED`.+ operationId: ListOperations+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ - description: The standard list filter.+ explode: true+ in: query+ name: filter+ required: false+ schema:+ type: string+ style: form+ - description: The standard list page size.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: The standard list page token.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListOperationsResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}:generateMessage:+ post:+ description: Generates a response from the model given an input `MessagePrompt`.+ operationId: GenerateMessage+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateMessageRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateMessageResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/tunedModels:+ get:+ description: Lists created tuned models.+ operationId: ListTunedModels+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: |-+ Optional. The maximum number of `TunedModels` to return (per page).+ The service may return fewer tuned models.++ If unspecified, at most 10 tuned models will be returned.+ This method returns at most 1000 models per page, even if you pass a larger+ page_size.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: |-+ Optional. A page token, received from a previous `ListTunedModels` call.++ Provide the `page_token` returned by one request as an argument to the next+ request to retrieve the next page.++ When paginating, all other parameters provided to `ListTunedModels`+ must match the call that provided the page token.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ - description: |-+ Optional. A filter is a full text search over the tuned model's description and+ display name. By default, results will not include tuned models shared+ with everyone.++ Additional operators:+ - owner:me+ - writers:me+ - readers:me+ - readers:everyone++ Examples:+ "owner:me" returns all tuned models to which caller has owner role+ "readers:me" returns all tuned models to which caller has reader role+ "readers:everyone" returns all tuned models that are shared with everyone+ explode: true+ in: query+ name: filter+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListTunedModelsResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ post:+ description: |-+ Creates a tuned model.+ Check intermediate tuning progress (if any) through the+ [google.longrunning.Operations] service.++ Access status and results through the Operations service.+ Example:+ GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222+ operationId: CreateTunedModel+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: |-+ Optional. The unique id for the tuned model if specified.+ This value should be up to 40 characters, the first character must be a+ letter, the last could be a letter or a number. The id must match the+ regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`.+ explode: true+ in: query+ name: tunedModelId+ required: false+ schema:+ type: string+ style: form+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/TunedModel'+ description: Required. The tuned model to create.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CreateTunedModelOperation'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-lro: "true"+ /v1beta/models/{model}:streamGenerateContent:+ post:+ description: |-+ Generates a [streamed+ response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream)+ from the model given an input `GenerateContentRequest`.+ operationId: StreamGenerateContent+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateContentRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateContentResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/corpora/{corpus}/permissions/{permission}:+ delete:+ description: Deletes the permission.+ operationId: DeletePermissionByCorpusAndPermission+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: permission+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Empty'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: DeletePermission+ get:+ description: Gets information about a specific Permission.+ operationId: GetPermissionByCorpusAndPermission+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: permission+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Permission'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: GetPermission+ patch:+ description: Updates the permission.+ operationId: UpdatePermissionByCorpusAndPermission+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: permission+ required: true+ schema:+ type: string+ style: simple+ - description: |-+ Required. The list of fields to update. Accepted ones:+ - role (`Permission.role` field)+ explode: true+ in: query+ name: updateMask+ required: true+ schema:+ format: google-fieldmask+ pattern: "^(\\s*[^,\\s.]+(\\s*[,.]\\s*[^,\\s.]+)*)?$"+ type: string+ style: form+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Permission'+ description: |-+ Required. The permission to update.++ The permission's `name` field is used to identify the permission to update.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Permission'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: UpdatePermission+ /v1beta/models/{model}:generateAnswer:+ post:+ description: |-+ Generates a grounded answer from the model given an input+ `GenerateAnswerRequest`.+ operationId: GenerateAnswer+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateAnswerRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateAnswerResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}:embedContent:+ post:+ description: |-+ Generates a text embedding vector from the input `Content` using the+ specified [Gemini Embedding+ model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding).+ operationId: EmbedContent+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/EmbedContentRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/EmbedContentResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/corpora/{corpus}:+ delete:+ description: Deletes a `Corpus`.+ operationId: DeleteCorpus+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: |-+ Optional. If set to true, any `Document`s and objects related to this `Corpus` will+ also be deleted.++ If false (the default), a `FAILED_PRECONDITION` error will be returned if+ `Corpus` contains any `Document`s.+ explode: true+ in: query+ name: force+ required: false+ schema:+ type: boolean+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Empty'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ get:+ description: Gets information about a specific `Corpus`.+ operationId: GetCorpus+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Corpus'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ patch:+ description: Updates a `Corpus`.+ operationId: UpdateCorpus+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: |-+ Required. The list of fields to update.+ Currently, this only supports updating `display_name`.+ explode: true+ in: query+ name: updateMask+ required: true+ schema:+ format: google-fieldmask+ pattern: "^(\\s*[^,\\s.]+(\\s*[,.]\\s*[^,\\s.]+)*)?$"+ type: string+ style: form+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Corpus'+ description: Required. The `Corpus` to update.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Corpus'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}/operations:+ get:+ description: |-+ Lists operations that match the specified filter in the request. If the+ server doesn't support this method, it returns `UNIMPLEMENTED`.+ operationId: ListOperationsByModel+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ - description: The standard list filter.+ explode: true+ in: query+ name: filter+ required: false+ schema:+ type: string+ style: form+ - description: The standard list page size.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: The standard list page token.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListOperationsResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: ListOperations+ /v1beta/models/{model}:predictLongRunning:+ post:+ description: Same as Predict but returns an LRO.+ operationId: PredictLongRunning+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/PredictLongRunningRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/PredictLongRunningOperation'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-lro: "true"+ /v1beta/models/{model}:batchEmbedText:+ post:+ description: |-+ Generates multiple embeddings from the model given input text in a+ synchronous call.+ operationId: BatchEmbedText+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/BatchEmbedTextRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/BatchEmbedTextResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/corpora/{corpus}:query:+ post:+ description: Performs semantic search over a `Corpus`.+ operationId: QueryCorpus+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/QueryCorpusRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/QueryCorpusResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/batches:+ get:+ description: |-+ Lists operations that match the specified filter in the request. If the+ server doesn't support this method, it returns `UNIMPLEMENTED`.+ operationId: ListOperationsBy+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: The standard list filter.+ explode: true+ in: query+ name: filter+ required: false+ schema:+ type: string+ style: form+ - description: The standard list page size.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: The standard list page token.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListOperationsResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: ListOperations+ /v1beta/models:+ get:+ description: |-+ Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini)+ available through the Gemini API.+ operationId: ListModels+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: |-+ The maximum number of `Models` to return (per page).++ If unspecified, 50 models will be returned per page.+ This method returns at most 1000 models per page, even if you pass a larger+ page_size.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: |-+ A page token, received from a previous `ListModels` call.++ Provide the `page_token` returned by one request as an argument to the next+ request to retrieve the next page.++ When paginating, all other parameters provided to `ListModels` must match+ the call that provided the page token.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListModelsResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/files/{file}:download:+ get:+ description: Download the `File`.+ operationId: DownloadFile+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: file+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/DownloadFileResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}:countMessageTokens:+ post:+ description: Runs a model's tokenizer on a string and returns the token count.+ operationId: CountMessageTokens+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CountMessageTokensRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CountMessageTokensResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}:generateText:+ post:+ description: Generates a response from the model given an input message.+ operationId: GenerateText+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateTextRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateTextResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/tunedModels/{tunedModel}:streamGenerateContent:+ post:+ description: |-+ Generates a [streamed+ response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream)+ from the model given an input `GenerateContentRequest`.+ operationId: StreamGenerateContentByTunedModel+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateContentRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateContentResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: StreamGenerateContent+ /v1beta/tunedModels/{tunedModel}/permissions/{permission}:+ delete:+ description: Deletes the permission.+ operationId: DeletePermission+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: permission+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Empty'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ get:+ description: Gets information about a specific Permission.+ operationId: GetPermission+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: permission+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Permission'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ patch:+ description: Updates the permission.+ operationId: UpdatePermission+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: permission+ required: true+ schema:+ type: string+ style: simple+ - description: |-+ Required. The list of fields to update. Accepted ones:+ - role (`Permission.role` field)+ explode: true+ in: query+ name: updateMask+ required: true+ schema:+ format: google-fieldmask+ pattern: "^(\\s*[^,\\s.]+(\\s*[,.]\\s*[^,\\s.]+)*)?$"+ type: string+ style: form+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Permission'+ description: |-+ Required. The permission to update.++ The permission's `name` field is used to identify the permission to update.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Permission'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}:countTextTokens:+ post:+ description: Runs a model's tokenizer on a text and returns the token count.+ operationId: CountTextTokens+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CountTextTokensRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CountTextTokensResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/tunedModels/{tunedModel}:generateContent:+ post:+ description: |-+ Generates a model response given an input `GenerateContentRequest`.+ Refer to the [text generation+ guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed+ usage information. Input capabilities differ between models, including+ tuned models. Refer to the [model+ guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning+ guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.+ operationId: GenerateContentByTunedModel+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateContentRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateContentResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: GenerateContent+ /v1beta/corpora/{corpus}/documents/{document}/chunks:batchDelete:+ post:+ description: Batch delete `Chunk`s.+ operationId: BatchDeleteChunks+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: document+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/BatchDeleteChunksRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Empty'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/tunedModels/{tunedModel}:+ delete:+ description: Deletes a tuned model.+ operationId: DeleteTunedModel+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Empty'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ get:+ description: Gets information about a specific TunedModel.+ operationId: GetTunedModel+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/TunedModel'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ patch:+ description: Updates a tuned model.+ operationId: UpdateTunedModel+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ - description: Optional. The list of fields to update.+ explode: true+ in: query+ name: updateMask+ required: false+ schema:+ format: google-fieldmask+ pattern: "^(\\s*[^,\\s.]+(\\s*[,.]\\s*[^,\\s.]+)*)?$"+ type: string+ style: form+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/TunedModel'+ description: Required. The tuned model to update.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/TunedModel'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/corpora/{corpus}/documents/{document}/chunks:batchUpdate:+ post:+ description: Batch update `Chunk`s.+ operationId: BatchUpdateChunks+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: document+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/BatchUpdateChunksRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/BatchUpdateChunksResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}:+ get:+ description: |-+ Gets information about a specific `Model` such as its version number, token+ limits,+ [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters)+ and other metadata. Refer to the [Gemini models+ guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed+ model information.+ operationId: GetModel+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Model'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/batches/{generateContentBatch}:+ get:+ description: |-+ Gets the latest state of a long-running operation. Clients can use this+ method to poll the operation result at intervals as recommended by the API+ service.+ operationId: GetOperationByGenerateContentBatch+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: generateContentBatch+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Operation'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: GetOperation+ /v1beta/corpora/{corpus}/documents/{document}/chunks:+ get:+ description: Lists all `Chunk`s in a `Document`.+ operationId: ListChunks+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: document+ required: true+ schema:+ type: string+ style: simple+ - description: |-+ Optional. The maximum number of `Chunk`s to return (per page).+ The service may return fewer `Chunk`s.++ If unspecified, at most 10 `Chunk`s will be returned.+ The maximum size limit is 100 `Chunk`s per page.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: |-+ Optional. A page token, received from a previous `ListChunks` call.++ Provide the `next_page_token` returned in the response as an argument to+ the next request to retrieve the next page.++ When paginating, all other parameters provided to `ListChunks`+ must match the call that provided the page token.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListChunksResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ post:+ description: Creates a `Chunk`.+ operationId: CreateChunk+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: document+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Chunk'+ description: Required. The `Chunk` to create.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Chunk'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/tunedModels/{tunedModel}:transferOwnership:+ post:+ description: |-+ Transfers ownership of the tuned model.+ This is the only way to change ownership of the tuned model.+ The current owner will be downgraded to writer role.+ operationId: TransferOwnership+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/TransferOwnershipRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/TransferOwnershipResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/files/{file}:+ delete:+ description: Deletes the `File`.+ operationId: DeleteFile+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: file+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Empty'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ get:+ description: Gets the metadata for the given `File`.+ operationId: GetFile+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: file+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/File'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/cachedContents/{id}:+ delete:+ description: Deletes CachedContent resource.+ operationId: DeleteCachedContent+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: id+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Empty'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ get:+ description: Reads CachedContent resource.+ operationId: GetCachedContent+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: id+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CachedContent'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ patch:+ description: Updates CachedContent resource (only expiration is updatable).+ operationId: UpdateCachedContent+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: id+ required: true+ schema:+ type: string+ style: simple+ - description: The list of fields to update.+ explode: true+ in: query+ name: updateMask+ required: false+ schema:+ format: google-fieldmask+ pattern: "^(\\s*[^,\\s.]+(\\s*[,.]\\s*[^,\\s.]+)*)?$"+ type: string+ style: form+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CachedContent'+ description: Required. The content cache entry to update+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CachedContent'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/dynamic/{dynamicId}:generateContent:+ post:+ description: |-+ Generates a model response given an input `GenerateContentRequest`.+ Refer to the [text generation+ guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed+ usage information. Input capabilities differ between models, including+ tuned models. Refer to the [model+ guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning+ guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.+ operationId: GenerateContentByDynamicId+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: |-+ Part of `model`. Required. The name of the `Model` to use for generating the completion.++ Format: `models/{model}`.+ explode: false+ in: path+ name: dynamicId+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateContentRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateContentResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: GenerateContent+ /v1beta/corpora/{corpus}/documents/{document}:query:+ post:+ description: Performs semantic search over a `Document`.+ operationId: QueryDocument+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: document+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/QueryDocumentRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/QueryDocumentResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}:generateContent:+ post:+ description: |-+ Generates a model response given an input `GenerateContentRequest`.+ Refer to the [text generation+ guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed+ usage information. Input capabilities differ between models, including+ tuned models. Refer to the [model+ guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning+ guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.+ operationId: GenerateContent+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateContentRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GenerateContentResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/corpora:+ get:+ description: Lists all `Corpora` owned by the user.+ operationId: ListCorpora+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: |-+ Optional. The maximum number of `Corpora` to return (per page).+ The service may return fewer `Corpora`.++ If unspecified, at most 10 `Corpora` will be returned.+ The maximum size limit is 20 `Corpora` per page.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: |-+ Optional. A page token, received from a previous `ListCorpora` call.++ Provide the `next_page_token` returned in the response as an argument to+ the next request to retrieve the next page.++ When paginating, all other parameters provided to `ListCorpora`+ must match the call that provided the page token.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListCorporaResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ post:+ description: Creates an empty `Corpus`.+ operationId: CreateCorpus+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Corpus'+ description: Required. The `Corpus` to create.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Corpus'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}:predict:+ post:+ description: Performs a prediction request.+ operationId: Predict+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/PredictRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/PredictResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}/operations/{operation}:+ get:+ description: |-+ Gets the latest state of a long-running operation. Clients can use this+ method to poll the operation result at intervals as recommended by the API+ service.+ operationId: GetOperationByModelAndOperation+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: operation+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Operation'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: GetOperation+ /v1beta/cachedContents:+ get:+ description: Lists CachedContents.+ operationId: ListCachedContents+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: |-+ Optional. The maximum number of cached contents to return. The service may return+ fewer than this value.+ If unspecified, some default (under maximum) number of items will be+ returned.+ The maximum value is 1000; values above 1000 will be coerced to 1000.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: |-+ Optional. A page token, received from a previous `ListCachedContents` call.+ Provide this to retrieve the subsequent page.++ When paginating, all other parameters provided to `ListCachedContents` must+ match the call that provided the page token.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListCachedContentsResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ post:+ description: Creates CachedContent resource.+ operationId: CreateCachedContent+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CachedContent'+ description: Required. The cached content to create.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CachedContent'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/generatedFiles/{generatedFile}:+ get:+ description: |-+ Gets a generated file. When calling this method via REST, only the metadata+ of the generated file is returned. To retrieve the file content via REST,+ add alt=media as a query parameter.+ operationId: GetGeneratedFile+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: generatedFile+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/GeneratedFile'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/corpora/{corpus}/permissions:+ get:+ description: Lists permissions for the specific resource.+ operationId: ListPermissionsByCorpus+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: |-+ Optional. The maximum number of `Permission`s to return (per page).+ The service may return fewer permissions.++ If unspecified, at most 10 permissions will be returned.+ This method returns at most 1000 permissions per page, even if you pass+ larger page_size.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: |-+ Optional. A page token, received from a previous `ListPermissions` call.++ Provide the `page_token` returned by one request as an argument to the+ next request to retrieve the next page.++ When paginating, all other parameters provided to `ListPermissions`+ must match the call that provided the page token.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListPermissionsResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: ListPermissions+ post:+ description: Create a permission to a specific resource.+ operationId: CreatePermissionByCorpus+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Permission'+ description: Required. The permission to create.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Permission'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: CreatePermission+ /v1beta/batches/{generateContentBatch}:cancel:+ post:+ description: |-+ Starts asynchronous cancellation on a long-running operation. The server+ makes a best effort to cancel the operation, but success is not+ guaranteed. If the server doesn't support this method, it returns+ `google.rpc.Code.UNIMPLEMENTED`. Clients can use+ Operations.GetOperation or+ other methods to check whether the cancellation succeeded or whether the+ operation completed despite cancellation. On successful cancellation,+ the operation is not deleted; instead, it becomes an operation with+ an Operation.error value with a google.rpc.Status.code of `1`,+ corresponding to `Code.CANCELLED`.+ operationId: CancelOperation+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: generateContentBatch+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Empty'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}:batchEmbedContents:+ post:+ description: |-+ Generates multiple embedding vectors from the input `Content` which+ consists of a batch of strings represented as `EmbedContentRequest`+ objects.+ operationId: BatchEmbedContents+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/BatchEmbedContentsRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/BatchEmbedContentsResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/corpora/{corpus}/documents/{document}/chunks:batchCreate:+ post:+ description: Batch create `Chunk`s.+ operationId: BatchCreateChunks+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: document+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/BatchCreateChunksRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/BatchCreateChunksResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/tunedModels/{tunedModel}/operations/{operation}:+ get:+ description: |-+ Gets the latest state of a long-running operation. Clients can use this+ method to poll the operation result at intervals as recommended by the API+ service.+ operationId: GetOperation+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: tunedModel+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: operation+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Operation'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/corpora/{corpus}/documents/{document}/chunks/{chunk}:+ delete:+ description: Deletes a `Chunk`.+ operationId: DeleteChunk+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: document+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: chunk+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Empty'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ get:+ description: Gets information about a specific `Chunk`.+ operationId: GetChunk+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: document+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: chunk+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Chunk'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ patch:+ description: Updates a `Chunk`.+ operationId: UpdateChunk+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: document+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: chunk+ required: true+ schema:+ type: string+ style: simple+ - description: |-+ Required. The list of fields to update.+ Currently, this only supports updating `custom_metadata` and `data`.+ explode: true+ in: query+ name: updateMask+ required: true+ schema:+ format: google-fieldmask+ pattern: "^(\\s*[^,\\s.]+(\\s*[,.]\\s*[^,\\s.]+)*)?$"+ type: string+ style: form+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Chunk'+ description: Required. The `Chunk` to update.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Chunk'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}:countTokens:+ post:+ description: |-+ Runs a model's tokenizer on input `Content` and returns the token count.+ Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens)+ to learn more about tokens.+ operationId: CountTokens+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CountTokensRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CountTokensResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/generatedFiles/{generatedFile}/operations/{operation}:+ get:+ description: |-+ Gets the latest state of a long-running operation. Clients can use this+ method to poll the operation result at intervals as recommended by the API+ service.+ operationId: GetOperationByGeneratedFileAndOperation+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: generatedFile+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: operation+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Operation'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ x-google-operation-name: GetOperation+ /v1beta/corpora/{corpus}/documents/{document}:+ delete:+ description: Deletes a `Document`.+ operationId: DeleteDocument+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: document+ required: true+ schema:+ type: string+ style: simple+ - description: |-+ Optional. If set to true, any `Chunk`s and objects related to this `Document` will+ also be deleted.++ If false (the default), a `FAILED_PRECONDITION` error will be returned if+ `Document` contains any `Chunk`s.+ explode: true+ in: query+ name: force+ required: false+ schema:+ type: boolean+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Empty'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ get:+ description: Gets information about a specific `Document`.+ operationId: GetDocument+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: document+ required: true+ schema:+ type: string+ style: simple+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Document'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ patch:+ description: Updates a `Document`.+ operationId: UpdateDocument+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: corpus+ required: true+ schema:+ type: string+ style: simple+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: document+ required: true+ schema:+ type: string+ style: simple+ - description: |-+ Required. The list of fields to update.+ Currently, this only supports updating `display_name` and+ `custom_metadata`.+ explode: true+ in: query+ name: updateMask+ required: true+ schema:+ format: google-fieldmask+ pattern: "^(\\s*[^,\\s.]+(\\s*[,.]\\s*[^,\\s.]+)*)?$"+ type: string+ style: form+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Document'+ description: Required. The `Document` to update.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Document'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/models/{model}:embedText:+ post:+ description: Generates an embedding from the model given an input message.+ operationId: EmbedText+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: Resource ID segment making up resource `name`. It identifies+ the resource within its parent collection as described in https://google.aip.dev/122.+ explode: false+ in: path+ name: model+ required: true+ schema:+ type: string+ style: simple+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/EmbedTextRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/EmbedTextResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/files:+ get:+ description: Lists the metadata for `File`s owned by the requesting project.+ operationId: ListFiles+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: |-+ Optional. Maximum number of `File`s to return per page.+ If unspecified, defaults to 10. Maximum `page_size` is 100.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: Optional. A page token from a previous `ListFiles` call.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListFilesResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ post:+ description: Creates a `File`.+ operationId: CreateFile+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CreateFileRequest'+ description: The request body.+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CreateFileResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+ /v1beta/generatedFiles:+ get:+ description: Lists the generated files owned by the requesting project.+ operationId: ListGeneratedFiles+ parameters:+ - description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ - description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ - description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ - description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ - description: |-+ Optional. Maximum number of `GeneratedFile`s to return per page.+ If unspecified, defaults to 10. Maximum `page_size` is 50.+ explode: true+ in: query+ name: pageSize+ required: false+ schema:+ format: int32+ type: integer+ style: form+ - description: Optional. A page token from a previous `ListGeneratedFiles` call.+ explode: true+ in: query+ name: pageToken+ required: false+ schema:+ type: string+ style: form+ responses:+ default:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListGeneratedFilesResponse'+ description: Successful operation+ security: []+ tags:+ - generativelanguage+components:+ parameters:+ _.xgafv:+ description: V1 error format.+ explode: true+ in: query+ name: $.xgafv+ required: false+ schema:+ enum:+ - "1"+ - "2"+ type: string+ x-google-enum-descriptions:+ - v1 error format+ - v2 error format+ style: form+ callback:+ description: JSONP+ explode: true+ in: query+ name: $callback+ required: false+ schema:+ type: string+ style: form+ alt:+ description: Data format for response.+ explode: true+ in: query+ name: $alt+ required: false+ schema:+ default: json+ enum:+ - json+ - media+ - proto+ type: string+ x-google-enum-descriptions:+ - Responses with Content-Type of application/json+ - Media download with context-dependent Content-Type+ - Responses with Content-Type of application/x-protobuf+ style: form+ prettyPrint:+ description: Returns response with indentations and line breaks.+ explode: true+ in: query+ name: $prettyPrint+ required: false+ schema:+ default: true+ type: boolean+ style: form+ schemas:+ Message:+ description: |-+ The base unit of structured text.++ A `Message` includes an `author` and the `content` of+ the `Message`.++ The `author` is used to tag messages when they are fed to the+ model as text.+ example:+ citationMetadata: ""+ author: author+ content: content+ properties:+ citationMetadata:+ allOf:+ - $ref: '#/components/schemas/CitationMetadata'+ description: |-+ Output only. Citation information for model-generated `content` in this `Message`.++ If this `Message` was generated as output from the model, this field may be+ populated with attribution information for any text included in the+ `content`. This field is used only on output.+ readOnly: true+ author:+ description: |-+ Optional. The author of this Message.++ This serves as a key for tagging+ the content of this Message when it is fed to the model as text.++ The author can be any alphanumeric string.+ type: string+ content:+ description: Required. The text content of the structured `Message`.+ type: string+ required:+ - content+ type: object+ CreateFileRequest:+ description: Request for `CreateFile`.+ example:+ file: ""+ properties:+ file:+ allOf:+ - $ref: '#/components/schemas/File'+ description: Optional. Metadata for the file to create.+ type: object+ GroundingAttribution:+ description: Attribution for a source that contributed to an answer.+ example:+ sourceId: ""+ content: ""+ properties:+ sourceId:+ allOf:+ - $ref: '#/components/schemas/AttributionSourceId'+ description: Output only. Identifier for the source contributing to this+ attribution.+ readOnly: true+ content:+ allOf:+ - $ref: '#/components/schemas/Content'+ description: Grounding source content that makes up this attribution.+ type: object+ GroundingPassageId:+ description: Identifier for a part within a `GroundingPassage`.+ properties:+ passageId:+ description: |-+ Output only. ID of the passage matching the `GenerateAnswerRequest`'s+ `GroundingPassage.id`.+ readOnly: true+ type: string+ partIndex:+ description: |-+ Output only. Index of the part within the `GenerateAnswerRequest`'s+ `GroundingPassage.content`.+ format: int32+ readOnly: true+ type: integer+ type: object+ EmbedTextRequest:+ description: Request to get a text embedding from the model.+ example:+ model: model+ text: text+ properties:+ text:+ description: Optional. The free-form input text that the model will turn+ into an embedding.+ type: string+ model:+ description: "Required. The model name to use with the format model=models/{model}."+ type: string+ required:+ - model+ type: object+ Part:+ description: |-+ A datatype containing media that is part of a multi-part `Content` message.++ A `Part` consists of data which has an associated datatype. A `Part` can only+ contain one of the accepted types in `Part.data`.++ A `Part` must have a fixed IANA MIME type identifying the type and subtype+ of the media if the `inline_data` field is filled with raw bytes.+ example:+ functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ properties:+ inlineData:+ allOf:+ - $ref: '#/components/schemas/Blob'+ description: Inline media bytes.+ functionResponse:+ allOf:+ - $ref: '#/components/schemas/FunctionResponse'+ description: |-+ The result output of a `FunctionCall` that contains a string+ representing the `FunctionDeclaration.name` and a structured JSON+ object containing any output from the function is used as context to+ the model.+ codeExecutionResult:+ allOf:+ - $ref: '#/components/schemas/CodeExecutionResult'+ description: Result of executing the `ExecutableCode`.+ fileData:+ allOf:+ - $ref: '#/components/schemas/FileData'+ description: URI based data.+ executableCode:+ allOf:+ - $ref: '#/components/schemas/ExecutableCode'+ description: Code generated by the model that is meant to be executed.+ videoMetadata:+ allOf:+ - $ref: '#/components/schemas/VideoMetadata'+ description: |-+ Optional. Video metadata. The metadata should only be specified while the video+ data is presented in inline_data or file_data.+ thought:+ description: Optional. Indicates if the part is thought from the model.+ type: boolean+ text:+ description: Inline text.+ type: string+ thoughtSignature:+ description: |-+ Optional. An opaque signature for the thought so it can be reused in subsequent+ requests.+ format: byte+ type: string+ functionCall:+ allOf:+ - $ref: '#/components/schemas/FunctionCall'+ description: |-+ A predicted `FunctionCall` returned from the model that contains+ a string representing the `FunctionDeclaration.name` with the+ arguments and their values.+ type: object+ CitationSource:+ description: A citation to a source for a portion of a specific response.+ properties:+ startIndex:+ description: |-+ Optional. Start of segment of the response that is attributed to this source.++ Index indicates the start of the segment, measured in bytes.+ format: int32+ type: integer+ uri:+ description: Optional. URI that is attributed as a source for a portion+ of the text.+ type: string+ endIndex:+ description: "Optional. End of the attributed segment, exclusive."+ format: int32+ type: integer+ license:+ description: |-+ Optional. License for the GitHub project that is attributed as a source for segment.++ License info is required for code citations.+ type: string+ type: object+ GenerateVideoResponse:+ description: Veo response.+ properties:+ generatedSamples:+ description: The generated samples.+ items:+ $ref: '#/components/schemas/Media'+ type: array+ raiMediaFilteredCount:+ description: Returns if any videos were filtered due to RAI policies.+ format: int32+ type: integer+ raiMediaFilteredReasons:+ description: Returns rai failure reasons if any.+ items:+ type: string+ type: array+ type: object+ TuningTask:+ description: Tuning tasks that create tuned models.+ properties:+ startTime:+ description: Output only. The timestamp when tuning this model started.+ format: date-time+ readOnly: true+ type: string+ trainingData:+ allOf:+ - $ref: '#/components/schemas/Dataset'+ description: Required. Input only. Immutable. The model training data.+ writeOnly: true+ x-google-immutable: true+ hyperparameters:+ allOf:+ - $ref: '#/components/schemas/Hyperparameters'+ description: |-+ Immutable. Hyperparameters controlling the tuning process. If not provided, default+ values will be used.+ x-google-immutable: true+ completeTime:+ description: Output only. The timestamp when tuning this model completed.+ format: date-time+ readOnly: true+ type: string+ snapshots:+ description: Output only. Metrics collected during tuning.+ items:+ $ref: '#/components/schemas/TuningSnapshot'+ readOnly: true+ type: array+ required:+ - trainingData+ type: object+ ToolConfig:+ description: |-+ The Tool configuration containing parameters for specifying `Tool` use+ in the request.+ properties:+ functionCallingConfig:+ allOf:+ - $ref: '#/components/schemas/FunctionCallingConfig'+ description: Optional. Function calling config.+ type: object+ DeleteChunkRequest:+ description: Request to delete a `Chunk`.+ example:+ name: name+ properties:+ name:+ description: |-+ Required. The resource name of the `Chunk` to delete.+ Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`+ type: string+ required:+ - name+ type: object+ ListCorporaResponse:+ description: |-+ Response from `ListCorpora` containing a paginated list of `Corpora`.+ The results are sorted by ascending `corpus.create_time`.+ example:+ nextPageToken: nextPageToken+ corpora:+ - createTime: 2000-01-23T04:56:07.000+00:00+ displayName: displayName+ name: name+ updateTime: 2000-01-23T04:56:07.000+00:00+ - createTime: 2000-01-23T04:56:07.000+00:00+ displayName: displayName+ name: name+ updateTime: 2000-01-23T04:56:07.000+00:00+ properties:+ corpora:+ description: The returned corpora.+ items:+ $ref: '#/components/schemas/Corpus'+ type: array+ nextPageToken:+ description: |-+ A token, which can be sent as `page_token` to retrieve the next page.+ If this field is omitted, there are no more pages.+ type: string+ type: object+ FunctionCall:+ description: |-+ A predicted `FunctionCall` returned from the model that contains+ a string representing the `FunctionDeclaration.name` with the+ arguments and their values.+ properties:+ args:+ additionalProperties:+ description: Properties of the object.+ description: Optional. The function parameters and values in JSON object+ format.+ type: object+ id:+ description: |-+ Optional. The unique id of the function call. If populated, the client to execute the+ `function_call` and return the response with the matching `id`.+ type: string+ name:+ description: |-+ Required. The name of the function to call.+ Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum+ length of 63.+ type: string+ required:+ - name+ type: object+ BaseOperation:+ description: |-+ This resource represents a long-running operation that is the result of a+ network API call.+ properties:+ done:+ description: |-+ If the value is `false`, it means the operation is still in progress.+ If `true`, the operation is completed, and either `error` or `response` is+ available.+ type: boolean+ name:+ description: |-+ The server-assigned name, which is only unique within the same service that+ originally returns it. If you use the default HTTP mapping, the+ `name` should be a resource name ending with `operations/{unique_id}`.+ type: string+ error:+ allOf:+ - $ref: '#/components/schemas/Status'+ description: The error result of the operation in case of failure or cancellation.+ type: object+ GenerateContentRequest:+ description: |-+ Request to generate a completion from the model.+ NEXT ID: 13+ example:+ cachedContent: cachedContent+ toolConfig: ""+ safetySettings:+ - threshold: HARM_BLOCK_THRESHOLD_UNSPECIFIED+ category: ""+ - threshold: HARM_BLOCK_THRESHOLD_UNSPECIFIED+ category: ""+ contents:+ - role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ generationConfig: ""+ systemInstruction: ""+ model: model+ tools:+ - googleSearchRetrieval: ""+ googleSearch: ""+ codeExecution: ""+ urlContext: ""+ functionDeclarations:+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - googleSearchRetrieval: ""+ googleSearch: ""+ codeExecution: ""+ urlContext: ""+ functionDeclarations:+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ properties:+ toolConfig:+ allOf:+ - $ref: '#/components/schemas/ToolConfig'+ description: |-+ Optional. Tool configuration for any `Tool` specified in the request. Refer to the+ [Function calling+ guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode)+ for a usage example.+ tools:+ description: |-+ Optional. A list of `Tools` the `Model` may use to generate the next response.++ A `Tool` is a piece of code that enables the system to interact with+ external systems to perform an action, or set of actions, outside of+ knowledge and scope of the `Model`. Supported `Tool`s are `Function` and+ `code_execution`. Refer to the [Function+ calling](https://ai.google.dev/gemini-api/docs/function-calling) and the+ [Code execution](https://ai.google.dev/gemini-api/docs/code-execution)+ guides to learn more.+ items:+ $ref: '#/components/schemas/Tool'+ type: array+ contents:+ description: |-+ Required. The content of the current conversation with the model.++ For single-turn queries, this is a single instance. For multi-turn queries+ like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat),+ this is a repeated field that contains the conversation history and the+ latest request.+ items:+ $ref: '#/components/schemas/Content'+ type: array+ systemInstruction:+ allOf:+ - $ref: '#/components/schemas/Content'+ description: |-+ Optional. Developer set [system+ instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions).+ Currently, text only.+ cachedContent:+ description: |-+ Optional. The name of the content+ [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context+ to serve the prediction. Format: `cachedContents/{cachedContent}`+ type: string+ safetySettings:+ description: |-+ Optional. A list of unique `SafetySetting` instances for blocking unsafe content.++ This will be enforced on the `GenerateContentRequest.contents` and+ `GenerateContentResponse.candidates`. There should not be more than one+ setting for each `SafetyCategory` type. The API will block any contents and+ responses that fail to meet the thresholds set by these settings. This list+ overrides the default settings for each `SafetyCategory` specified in the+ safety_settings. If there is no `SafetySetting` for a given+ `SafetyCategory` provided in the list, the API will use the default safety+ setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH,+ HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT,+ HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported.+ Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings)+ for detailed information on available safety settings. Also refer to the+ [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to+ learn how to incorporate safety considerations in your AI applications.+ items:+ $ref: '#/components/schemas/SafetySetting'+ type: array+ model:+ description: |-+ Required. The name of the `Model` to use for generating the completion.++ Format: `models/{model}`.+ type: string+ generationConfig:+ allOf:+ - $ref: '#/components/schemas/GenerationConfig'+ description: Optional. Configuration options for model generation and outputs.+ required:+ - contents+ - model+ type: object+ CountTokensRequest:+ description: |-+ Counts the number of tokens in the `prompt` sent to a model.++ Models may tokenize text differently, so each model may return a different+ `token_count`.+ example:+ generateContentRequest: ""+ contents:+ - role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ properties:+ contents:+ description: |-+ Optional. The input given to the model as a prompt. This field is ignored when+ `generate_content_request` is set.+ items:+ $ref: '#/components/schemas/Content'+ type: array+ generateContentRequest:+ allOf:+ - $ref: '#/components/schemas/GenerateContentRequest'+ description: |-+ Optional. The overall input given to the `Model`. This includes the prompt as well as+ other model steering information like [system+ instructions](https://ai.google.dev/gemini-api/docs/system-instructions),+ and/or function declarations for [function+ calling](https://ai.google.dev/gemini-api/docs/function-calling).+ `Model`s/`Content`s and `generate_content_request`s are mutually+ exclusive. You can either send `Model` + `Content`s or a+ `generate_content_request`, but never both.+ type: object+ Permission:+ description: |-+ Permission resource grants user, group or the rest of the world access to the+ PaLM API resource (e.g. a tuned model, corpus).++ A role is a collection of permitted operations that allows users to perform+ specific actions on PaLM API resources. To make them available to users,+ groups, or service accounts, you assign roles. When you assign a role, you+ grant permissions that the role contains.++ There are three concentric roles. Each role is a superset of the previous+ role's permitted operations:++ - reader can use the resource (e.g. tuned model, corpus) for inference+ - writer has reader's permissions and additionally can edit and share+ - owner has writer's permissions and additionally can delete+ example:+ emailAddress: emailAddress+ role: ROLE_UNSPECIFIED+ name: name+ granteeType: GRANTEE_TYPE_UNSPECIFIED+ properties:+ name:+ description: |-+ Output only. Identifier. The permission name. A unique name will be generated on create.+ Examples:+ tunedModels/{tuned_model}/permissions/{permission}+ corpora/{corpus}/permissions/{permission}+ Output only.+ readOnly: true+ type: string+ x-google-identifier: true+ granteeType:+ description: Optional. Immutable. The type of the grantee.+ enum:+ - GRANTEE_TYPE_UNSPECIFIED+ - USER+ - GROUP+ - EVERYONE+ type: string+ x-google-immutable: true+ x-google-enum-descriptions:+ - The default value. This value is unused.+ - "Represents a user. When set, you must provide email_address for the user."+ - |-+ Represents a group. When set, you must provide email_address for the+ group.+ - Represents access to everyone. No extra information is required.+ role:+ description: Required. The role granted by this permission.+ enum:+ - ROLE_UNSPECIFIED+ - OWNER+ - WRITER+ - READER+ type: string+ x-google-enum-descriptions:+ - The default value. This value is unused.+ - "Owner can use, update, share and delete the resource."+ - "Writer can use, update and share the resource."+ - Reader can use the resource.+ emailAddress:+ description: |-+ Optional. Immutable. The email address of the user of group which this permission refers.+ Field is not set when permission's grantee type is EVERYONE.+ type: string+ x-google-immutable: true+ required:+ - role+ type: object+ CachedContentUsageMetadata:+ description: Metadata on the usage of the cached content.+ properties:+ totalTokenCount:+ description: Total number of tokens that the cached content consumes.+ format: int32+ type: integer+ type: object+ MetadataFilter:+ description: |-+ User provided filter to limit retrieval based on `Chunk` or `Document` level+ metadata values.+ Example (genre = drama OR genre = action):+ key = "document.custom_metadata.genre"+ conditions = [{string_value = "drama", operation = EQUAL},+ {string_value = "action", operation = EQUAL}]+ example:+ conditions:+ - stringValue: stringValue+ numericValue: 0.8008282+ operation: OPERATOR_UNSPECIFIED+ - stringValue: stringValue+ numericValue: 0.8008282+ operation: OPERATOR_UNSPECIFIED+ key: key+ properties:+ conditions:+ description: |-+ Required. The `Condition`s for the given key that will trigger this filter. Multiple+ `Condition`s are joined by logical ORs.+ items:+ $ref: '#/components/schemas/Condition'+ type: array+ key:+ description: Required. The key of the metadata to filter on.+ type: string+ required:+ - conditions+ - key+ type: object+ MessagePrompt:+ description: |-+ All of the structured input text passed to the model as a prompt.++ A `MessagePrompt` contains a structured set of fields that provide context+ for the conversation, examples of user input/model output message pairs that+ prime the model to respond in different ways, and the conversation history+ or list of messages representing the alternating turns of the conversation+ between the user and the model.+ properties:+ context:+ description: |-+ Optional. Text that should be provided to the model first to ground the response.++ If not empty, this `context` will be given to the model first before the+ `examples` and `messages`. When using a `context` be sure to provide it+ with every request to maintain continuity.++ This field can be a description of your prompt to the model to help provide+ context and guide the responses. Examples: "Translate the phrase from+ English to French." or "Given a statement, classify the sentiment as happy,+ sad or neutral."++ Anything included in this field will take precedence over message history+ if the total input size exceeds the model's `input_token_limit` and the+ input request is truncated.+ type: string+ messages:+ description: |-+ Required. A snapshot of the recent conversation history sorted chronologically.++ Turns alternate between two authors.++ If the total input size exceeds the model's `input_token_limit` the input+ will be truncated: The oldest items will be dropped from `messages`.+ items:+ $ref: '#/components/schemas/Message'+ type: array+ examples:+ description: |-+ Optional. Examples of what the model should generate.++ This includes both user input and the response that the model should+ emulate.++ These `examples` are treated identically to conversation messages except+ that they take precedence over the history in `messages`:+ If the total input size exceeds the model's `input_token_limit` the input+ will be truncated. Items will be dropped from `messages` before `examples`.+ items:+ $ref: '#/components/schemas/Example'+ type: array+ required:+ - messages+ type: object+ BatchUpdateChunksRequest:+ description: Request to batch update `Chunk`s.+ example:+ requests:+ - chunk: ""+ updateMask: updateMask+ - chunk: ""+ updateMask: updateMask+ properties:+ requests:+ description: |-+ Required. The request messages specifying the `Chunk`s to update.+ A maximum of 100 `Chunk`s can be updated in a batch.+ items:+ $ref: '#/components/schemas/UpdateChunkRequest'+ type: array+ required:+ - requests+ type: object+ TuningSnapshot:+ description: Record for a single tuning step.+ example:+ meanLoss: 5.962134+ computeTime: 2000-01-23T04:56:07.000+00:00+ step: 5+ epoch: 2+ properties:+ meanLoss:+ description: Output only. The mean loss of the training examples for this+ step.+ format: float+ readOnly: true+ type: number+ computeTime:+ description: Output only. The timestamp when this metric was computed.+ format: date-time+ readOnly: true+ type: string+ step:+ description: Output only. The tuning step.+ format: int32+ readOnly: true+ type: integer+ epoch:+ description: Output only. The epoch this step was part of.+ format: int32+ readOnly: true+ type: integer+ type: object+ DownloadFileResponse:+ description: Response for `DownloadFile`.+ type: object+ Dataset:+ description: Dataset for training or validation.+ properties:+ examples:+ allOf:+ - $ref: '#/components/schemas/TuningExamples'+ description: Optional. Inline examples with simple input/output text.+ type: object+ TextCompletion:+ description: Output text returned from a model.+ example:+ output: output+ citationMetadata: ""+ safetyRatings:+ - blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ - blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ properties:+ safetyRatings:+ description: |-+ Ratings for the safety of a response.++ There is at most one rating per category.+ items:+ $ref: '#/components/schemas/SafetyRating'+ type: array+ output:+ description: Output only. The generated text returned from the model.+ readOnly: true+ type: string+ citationMetadata:+ allOf:+ - $ref: '#/components/schemas/CitationMetadata'+ description: |-+ Output only. Citation information for model-generated `output` in this+ `TextCompletion`.++ This field may be populated with attribution information for any text+ included in the `output`.+ readOnly: true+ type: object+ GenerateTextResponse:+ description: "The response from the model, including candidate completions."+ example:+ candidates:+ - output: output+ citationMetadata: ""+ safetyRatings:+ - blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ - blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ - output: output+ citationMetadata: ""+ safetyRatings:+ - blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ - blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ filters:+ - reason: BLOCKED_REASON_UNSPECIFIED+ message: message+ - reason: BLOCKED_REASON_UNSPECIFIED+ message: message+ safetyFeedback:+ - rating: ""+ setting: ""+ - rating: ""+ setting: ""+ properties:+ safetyFeedback:+ description: Returns any safety feedback related to content filtering.+ items:+ $ref: '#/components/schemas/SafetyFeedback'+ type: array+ candidates:+ description: Candidate responses from the model.+ items:+ $ref: '#/components/schemas/TextCompletion'+ type: array+ filters:+ description: |-+ A set of content filtering metadata for the prompt and response+ text.++ This indicates which `SafetyCategory`(s) blocked a+ candidate from this response, the lowest `HarmProbability`+ that triggered a block, and the HarmThreshold setting for that category.+ This indicates the smallest change to the `SafetySettings` that would be+ necessary to unblock at least 1 response.++ The blocking is configured by the `SafetySettings` in the request (or the+ default `SafetySettings` of the API).+ items:+ $ref: '#/components/schemas/ContentFilter'+ type: array+ type: object+ FunctionDeclaration:+ description: |-+ Structured representation of a function declaration as defined by the+ [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included+ in this declaration are the function name and parameters. This+ FunctionDeclaration is a representation of a block of code that can be used+ as a `Tool` by the model and executed by the client.+ example:+ responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ properties:+ parameters:+ allOf:+ - $ref: '#/components/schemas/Schema'+ description: |-+ Optional. Describes the parameters to this function. Reflects the Open API 3.03+ Parameter Object string Key: the name of the parameter. Parameter names are+ case sensitive. Schema Value: the Schema defining the type used for the+ parameter.+ name:+ description: |-+ Required. The name of the function.+ Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum+ length of 63.+ type: string+ behavior:+ description: |-+ Optional. Specifies the function Behavior.+ Currently only supported by the BidiGenerateContent method.+ enum:+ - UNSPECIFIED+ - BLOCKING+ - NON_BLOCKING+ type: string+ x-google-enum-descriptions:+ - This value is unused.+ - |-+ If set, the system will wait to receive the function response before+ continuing the conversation.+ - |-+ If set, the system will not wait to receive the function response.+ Instead, it will attempt to handle function responses as they become+ available while maintaining the conversation between the user and the+ model.+ description:+ description: Required. A brief description of the function.+ type: string+ response:+ allOf:+ - $ref: '#/components/schemas/Schema'+ description: |-+ Optional. Describes the output from this function in JSON Schema format. Reflects the+ Open API 3.03 Response Object. The Schema defines the type used for the+ response value of the function.+ responseJsonSchema:+ description: |-+ Optional. Describes the output from this function in JSON Schema format. The value+ specified by the schema is the response value of the function.++ This field is mutually exclusive with `response`.+ parametersJsonSchema:+ description: |-+ Optional. Describes the parameters to the function in JSON Schema format. The schema+ must describe an object where the properties are the parameters to the+ function. For example:++ ```+ {+ "type": "object",+ "properties": {+ "name": { "type": "string" },+ "age": { "type": "integer" }+ },+ "additionalProperties": false,+ "required": ["name", "age"],+ "propertyOrdering": ["name", "age"]+ }+ ```++ This field is mutually exclusive with `parameters`.+ required:+ - description+ - name+ type: object+ Hyperparameters:+ description: |-+ Hyperparameters controlling the tuning process. Read more at+ https://ai.google.dev/docs/model_tuning_guidance+ properties:+ epochCount:+ description: |-+ Immutable. The number of training epochs. An epoch is one pass through the training+ data.+ If not set, a default of 5 will be used.+ format: int32+ type: integer+ x-google-immutable: true+ learningRate:+ description: |-+ Optional. Immutable. The learning rate hyperparameter for tuning.+ If not set, a default of 0.001 or 0.0002 will be calculated based on the+ number of training examples.+ format: float+ type: number+ x-google-immutable: true+ learningRateMultiplier:+ description: |-+ Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate+ based on the default (recommended) value.+ Actual learning rate := learning_rate_multiplier * default learning rate+ Default learning rate is dependent on base model and dataset size.+ If not set, a default of 1.0 will be used.+ format: float+ type: number+ x-google-immutable: true+ batchSize:+ description: |-+ Immutable. The batch size hyperparameter for tuning.+ If not set, a default of 4 or 16 will be used based on the number of+ training examples.+ format: int32+ type: integer+ x-google-immutable: true+ type: object+ GoogleSearchRetrieval:+ description: "Tool to retrieve public web data for grounding, powered by Google."+ properties:+ dynamicRetrievalConfig:+ allOf:+ - $ref: '#/components/schemas/DynamicRetrievalConfig'+ description: Specifies the dynamic retrieval configuration for the given+ source.+ type: object+ GenerateTextRequest:+ description: Request to generate a text completion response from the model.+ example:+ topK: 1+ safetySettings:+ - threshold: HARM_BLOCK_THRESHOLD_UNSPECIFIED+ category: ""+ - threshold: HARM_BLOCK_THRESHOLD_UNSPECIFIED+ category: ""+ stopSequences:+ - stopSequences+ - stopSequences+ temperature: 6.0274563+ prompt: ""+ maxOutputTokens: 0+ topP: 5.962134+ candidateCount: 5+ properties:+ stopSequences:+ description: |-+ The set of character sequences (up to 5) that will stop output generation.+ If specified, the API will stop at the first appearance of a stop+ sequence. The stop sequence will not be included as part of the response.+ items:+ type: string+ type: array+ prompt:+ allOf:+ - $ref: '#/components/schemas/TextPrompt'+ description: |-+ Required. The free-form input text given to the model as a prompt.++ Given a prompt, the model will generate a TextCompletion response it+ predicts as the completion of the input text.+ maxOutputTokens:+ description: |-+ Optional. The maximum number of tokens to include in a candidate.++ If unset, this will default to output_token_limit specified in the `Model`+ specification.+ format: int32+ type: integer+ safetySettings:+ description: |-+ Optional. A list of unique `SafetySetting` instances for blocking unsafe content.++ that will be enforced on the `GenerateTextRequest.prompt` and+ `GenerateTextResponse.candidates`. There should not be more than one+ setting for each `SafetyCategory` type. The API will block any prompts and+ responses that fail to meet the thresholds set by these settings. This list+ overrides the default settings for each `SafetyCategory` specified in the+ safety_settings. If there is no `SafetySetting` for a given+ `SafetyCategory` provided in the list, the API will use the default safety+ setting for that category. Harm categories HARM_CATEGORY_DEROGATORY,+ HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL,+ HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text+ service.+ items:+ $ref: '#/components/schemas/SafetySetting'+ type: array+ temperature:+ description: |-+ Optional. Controls the randomness of the output.+ Note: The default value varies by model, see the `Model.temperature`+ attribute of the `Model` returned the `getModel` function.++ Values can range from [0.0,1.0],+ inclusive. A value closer to 1.0 will produce responses that are more+ varied and creative, while a value closer to 0.0 will typically result in+ more straightforward responses from the model.+ format: float+ type: number+ topK:+ description: |-+ Optional. The maximum number of tokens to consider when sampling.++ The model uses combined Top-k and nucleus sampling.++ Top-k sampling considers the set of `top_k` most probable tokens.+ Defaults to 40.++ Note: The default value varies by model, see the `Model.top_k`+ attribute of the `Model` returned the `getModel` function.+ format: int32+ type: integer+ topP:+ description: |-+ Optional. The maximum cumulative probability of tokens to consider when sampling.++ The model uses combined Top-k and nucleus sampling.++ Tokens are sorted based on their assigned probabilities so that only the+ most likely tokens are considered. Top-k sampling directly limits the+ maximum number of tokens to consider, while Nucleus sampling limits number+ of tokens based on the cumulative probability.++ Note: The default value varies by model, see the `Model.top_p`+ attribute of the `Model` returned the `getModel` function.+ format: float+ type: number+ candidateCount:+ description: |-+ Optional. Number of generated responses to return.++ This value must be between [1, 8], inclusive. If unset, this will default+ to 1.+ format: int32+ type: integer+ required:+ - prompt+ type: object+ TuningExamples:+ description: A set of tuning examples. Can be training or validation data.+ properties:+ examples:+ description: |-+ The examples. Example input can be for text or discuss, but all examples+ in a set must be of the same type.+ items:+ $ref: '#/components/schemas/TuningExample'+ type: array+ type: object+ StringList:+ description: User provided string values assigned to a single metadata key.+ properties:+ values:+ description: The string values of the metadata to store.+ items:+ type: string+ type: array+ type: object+ Web:+ description: Chunk from the web.+ properties:+ title:+ description: Title of the chunk.+ type: string+ uri:+ description: URI reference of the chunk.+ type: string+ type: object+ MultiSpeakerVoiceConfig:+ description: The configuration for the multi-speaker setup.+ properties:+ speakerVoiceConfigs:+ description: Required. All the enabled speaker voices.+ items:+ $ref: '#/components/schemas/SpeakerVoiceConfig'+ type: array+ required:+ - speakerVoiceConfigs+ type: object+ PredictLongRunningRequest:+ description: "Request message for [PredictionService.PredictLongRunning]."+ example:+ instances:+ - ""+ - ""+ parameters: ""+ properties:+ parameters:+ description: Optional. The parameters that govern the prediction call.+ instances:+ description: Required. The instances that are the input to the prediction+ call.+ items: {}+ type: array+ required:+ - instances+ type: object+ ListCachedContentsResponse:+ description: Response with CachedContents list.+ example:+ nextPageToken: nextPageToken+ cachedContents:+ - toolConfig: ""+ expireTime: 2000-01-23T04:56:07.000+00:00+ contents:+ - role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ createTime: 2000-01-23T04:56:07.000+00:00+ displayName: displayName+ systemInstruction: ""+ name: name+ model: model+ updateTime: 2000-01-23T04:56:07.000+00:00+ usageMetadata: ""+ tools:+ - googleSearchRetrieval: ""+ googleSearch: ""+ codeExecution: ""+ urlContext: ""+ functionDeclarations:+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - googleSearchRetrieval: ""+ googleSearch: ""+ codeExecution: ""+ urlContext: ""+ functionDeclarations:+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ ttl: ttl+ - toolConfig: ""+ expireTime: 2000-01-23T04:56:07.000+00:00+ contents:+ - role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ createTime: 2000-01-23T04:56:07.000+00:00+ displayName: displayName+ systemInstruction: ""+ name: name+ model: model+ updateTime: 2000-01-23T04:56:07.000+00:00+ usageMetadata: ""+ tools:+ - googleSearchRetrieval: ""+ googleSearch: ""+ codeExecution: ""+ urlContext: ""+ functionDeclarations:+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - googleSearchRetrieval: ""+ googleSearch: ""+ codeExecution: ""+ urlContext: ""+ functionDeclarations:+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ ttl: ttl+ properties:+ nextPageToken:+ description: |-+ A token, which can be sent as `page_token` to retrieve the next page.+ If this field is omitted, there are no subsequent pages.+ type: string+ cachedContents:+ description: List of cached contents.+ items:+ $ref: '#/components/schemas/CachedContent'+ type: array+ type: object+ CitationMetadata:+ description: A collection of source attributions for a piece of content.+ properties:+ citationSources:+ description: Citations to sources for a specific response.+ items:+ $ref: '#/components/schemas/CitationSource'+ type: array+ type: object+ Tool:+ description: |-+ Tool details that the model may use to generate response.++ A `Tool` is a piece of code that enables the system to interact with+ external systems to perform an action, or set of actions, outside of+ knowledge and scope of the model.+ example:+ googleSearchRetrieval: ""+ googleSearch: ""+ codeExecution: ""+ urlContext: ""+ functionDeclarations:+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ properties:+ functionDeclarations:+ description: |-+ Optional. A list of `FunctionDeclarations` available to the model that can be used+ for function calling.++ The model or system does not execute the function. Instead the defined+ function may be returned as a FunctionCall+ with arguments to the client side for execution. The model may decide to+ call a subset of these functions by populating+ FunctionCall in the response. The next+ conversation turn may contain a+ FunctionResponse+ with the Content.role "function" generation context for the next model+ turn.+ items:+ $ref: '#/components/schemas/FunctionDeclaration'+ type: array+ googleSearchRetrieval:+ allOf:+ - $ref: '#/components/schemas/GoogleSearchRetrieval'+ description: Optional. Retrieval tool that is powered by Google search.+ googleSearch:+ allOf:+ - $ref: '#/components/schemas/GoogleSearch'+ description: |-+ Optional. GoogleSearch tool type.+ Tool to support Google Search in Model. Powered by Google.+ codeExecution:+ allOf:+ - $ref: '#/components/schemas/CodeExecution'+ description: Optional. Enables the model to execute code as part of generation.+ urlContext:+ allOf:+ - $ref: '#/components/schemas/UrlContext'+ description: Optional. Tool to support URL context retrieval.+ type: object+ TopCandidates:+ description: Candidates with top log probabilities at each decoding step.+ properties:+ candidates:+ description: Sorted by log probability in descending order.+ items:+ $ref: '#/components/schemas/LogprobsResultCandidate'+ type: array+ type: object+ GroundingPassage:+ description: Passage included inline with a grounding configuration.+ properties:+ content:+ allOf:+ - $ref: '#/components/schemas/Content'+ description: Content of the passage.+ id:+ description: |-+ Identifier for the passage for attributing this passage in grounded+ answers.+ type: string+ type: object+ FileData:+ description: URI based data.+ properties:+ mimeType:+ description: Optional. The IANA standard MIME type of the source data.+ type: string+ fileUri:+ description: Required. URI.+ type: string+ required:+ - fileUri+ type: object+ CreateFileResponse:+ description: Response for `CreateFile`.+ example:+ file: ""+ properties:+ file:+ allOf:+ - $ref: '#/components/schemas/File'+ description: Metadata for the created file.+ type: object+ ListDocumentsResponse:+ description: |-+ Response from `ListDocuments` containing a paginated list of `Document`s.+ The `Document`s are sorted by ascending `document.create_time`.+ example:+ documents:+ - createTime: 2000-01-23T04:56:07.000+00:00+ displayName: displayName+ name: name+ customMetadata:+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ updateTime: 2000-01-23T04:56:07.000+00:00+ - createTime: 2000-01-23T04:56:07.000+00:00+ displayName: displayName+ name: name+ customMetadata:+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ updateTime: 2000-01-23T04:56:07.000+00:00+ nextPageToken: nextPageToken+ properties:+ nextPageToken:+ description: |-+ A token, which can be sent as `page_token` to retrieve the next page.+ If this field is omitted, there are no more pages.+ type: string+ documents:+ description: The returned `Document`s.+ items:+ $ref: '#/components/schemas/Document'+ type: array+ type: object+ Empty:+ description: |-+ A generic empty message that you can re-use to avoid defining duplicated+ empty messages in your APIs. A typical example is to use it as the request+ or the response type of an API method. For instance:++ service Foo {+ rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);+ }+ type: object+ TunedModelSource:+ description: Tuned model as a source for training a new model.+ properties:+ tunedModel:+ description: |-+ Immutable. The name of the `TunedModel` to use as the starting point for+ training the new model.+ Example: `tunedModels/my-tuned-model`+ type: string+ x-google-immutable: true+ baseModel:+ description: |-+ Output only. The name of the base `Model` this `TunedModel` was tuned from.+ Example: `models/gemini-1.5-flash-001`+ readOnly: true+ type: string+ type: object+ GroundingMetadata:+ description: Metadata returned to client when grounding is enabled.+ properties:+ retrievalMetadata:+ allOf:+ - $ref: '#/components/schemas/RetrievalMetadata'+ description: Metadata related to retrieval in the grounding flow.+ webSearchQueries:+ description: Web search queries for the following-up web search.+ items:+ type: string+ type: array+ groundingChunks:+ description: List of supporting references retrieved from specified grounding+ source.+ items:+ $ref: '#/components/schemas/GroundingChunk'+ type: array+ searchEntryPoint:+ allOf:+ - $ref: '#/components/schemas/SearchEntryPoint'+ description: Optional. Google search entry for the following-up web searches.+ groundingSupports:+ description: List of grounding support.+ items:+ $ref: '#/components/schemas/GroundingSupport'+ type: array+ type: object+ File:+ description: |-+ A file uploaded to the API.+ Next ID: 15+ example:+ displayName: displayName+ updateTime: 2000-01-23T04:56:07.000+00:00+ source: SOURCE_UNSPECIFIED+ mimeType: mimeType+ downloadUri: downloadUri+ error: ""+ uri: uri+ videoMetadata: ""+ sizeBytes: sizeBytes+ createTime: 2000-01-23T04:56:07.000+00:00+ sha256Hash: sha256Hash+ expirationTime: 2000-01-23T04:56:07.000+00:00+ name: name+ state: STATE_UNSPECIFIED+ properties:+ uri:+ description: Output only. The uri of the `File`.+ readOnly: true+ type: string+ name:+ description: |-+ Immutable. Identifier. The `File` resource name. The ID (name excluding the "files/" prefix) can+ contain up to 40 characters that are lowercase alphanumeric or dashes (-).+ The ID cannot start or end with a dash. If the name is empty on create, a+ unique name will be generated.+ Example: `files/123-456`+ type: string+ x-google-immutable: true+ x-google-identifier: true+ expirationTime:+ description: |-+ Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is+ scheduled to expire.+ format: date-time+ readOnly: true+ type: string+ displayName:+ description: |-+ Optional. The human-readable display name for the `File`. The display name must be+ no more than 512 characters in length, including spaces.+ Example: "Welcome Image"+ type: string+ videoMetadata:+ allOf:+ - $ref: '#/components/schemas/VideoFileMetadata'+ description: Output only. Metadata for a video.+ readOnly: true+ state:+ description: Output only. Processing state of the File.+ enum:+ - STATE_UNSPECIFIED+ - PROCESSING+ - ACTIVE+ - FAILED+ readOnly: true+ type: string+ x-google-enum-descriptions:+ - The default value. This value is used if the state is omitted.+ - File is being processed and cannot be used for inference yet.+ - File is processed and available for inference.+ - File failed processing.+ source:+ description: Source of the File.+ enum:+ - SOURCE_UNSPECIFIED+ - UPLOADED+ - GENERATED+ type: string+ x-google-enum-descriptions:+ - Used if source is not specified.+ - Indicates the file is uploaded by the user.+ - Indicates the file is generated by Google.+ mimeType:+ description: Output only. MIME type of the file.+ readOnly: true+ type: string+ createTime:+ description: Output only. The timestamp of when the `File` was created.+ format: date-time+ readOnly: true+ type: string+ error:+ allOf:+ - $ref: '#/components/schemas/Status'+ description: Output only. Error status if File processing failed.+ readOnly: true+ downloadUri:+ description: Output only. The download uri of the `File`.+ readOnly: true+ type: string+ sizeBytes:+ description: Output only. Size of the file in bytes.+ format: int64+ readOnly: true+ type: string+ sha256Hash:+ description: Output only. SHA-256 hash of the uploaded bytes.+ format: byte+ readOnly: true+ type: string+ updateTime:+ description: Output only. The timestamp of when the `File` was last updated.+ format: date-time+ readOnly: true+ type: string+ type: object+ Content:+ description: |-+ The base structured datatype containing multi-part content of a message.++ A `Content` includes a `role` field designating the producer of the `Content`+ and a `parts` field containing multi-part data that contains the content of+ the message turn.+ example:+ role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ properties:+ parts:+ description: |-+ Ordered `Parts` that constitute a single message. Parts may have different+ MIME types.+ items:+ $ref: '#/components/schemas/Part'+ type: array+ role:+ description: |-+ Optional. The producer of the content. Must be either 'user' or 'model'.++ Useful to set for multi-turn conversations, otherwise can be left blank+ or unset.+ type: string+ type: object+ AttributionSourceId:+ description: Identifier for the source contributing to this attribution.+ properties:+ groundingPassage:+ allOf:+ - $ref: '#/components/schemas/GroundingPassageId'+ description: Identifier for an inline passage.+ semanticRetrieverChunk:+ allOf:+ - $ref: '#/components/schemas/SemanticRetrieverChunk'+ description: Identifier for a `Chunk` fetched via Semantic Retriever.+ type: object+ CodeExecution:+ description: |-+ Tool that executes code generated by the model, and automatically returns+ the result to the model.++ See also `ExecutableCode` and `CodeExecutionResult` which are only generated+ when using this tool.+ type: object+ TaskType:+ enum:+ - TASK_TYPE_UNSPECIFIED+ - RETRIEVAL_QUERY+ - RETRIEVAL_DOCUMENT+ - SEMANTIC_SIMILARITY+ - CLASSIFICATION+ - CLUSTERING+ - QUESTION_ANSWERING+ - FACT_VERIFICATION+ - CODE_RETRIEVAL_QUERY+ type: string+ x-google-enum-descriptions:+ - "Unset value, which will default to one of the other enum values."+ - Specifies the given text is a query in a search/retrieval setting.+ - Specifies the given text is a document from the corpus being searched.+ - Specifies the given text will be used for STS.+ - Specifies that the given text will be classified.+ - Specifies that the embeddings will be used for clustering.+ - Specifies that the given text will be used for question answering.+ - Specifies that the given text will be used for fact verification.+ - Specifies that the given text will be used for code retrieval.+ LogprobsResultCandidate:+ description: Candidate for the logprobs token and score.+ properties:+ logProbability:+ description: The candidate's log probability.+ format: float+ type: number+ tokenId:+ description: The candidate’s token id value.+ format: int32+ type: integer+ token:+ description: The candidate’s token string value.+ type: string+ type: object+ Example:+ description: |-+ An input/output example used to instruct the Model.++ It demonstrates how the model should respond or format its response.+ properties:+ output:+ allOf:+ - $ref: '#/components/schemas/Message'+ description: Required. An example of what the model should output given+ the input.+ input:+ allOf:+ - $ref: '#/components/schemas/Message'+ description: Required. An example of an input `Message` from the user.+ required:+ - input+ - output+ type: object+ TextPrompt:+ description: |-+ Text given to the model as a prompt.++ The Model will use this TextPrompt to Generate a text completion.+ properties:+ text:+ description: Required. The prompt text.+ type: string+ required:+ - text+ type: object+ GeneratedFile:+ description: A file generated on behalf of a user.+ example:+ name: name+ state: STATE_UNSPECIFIED+ mimeType: mimeType+ error: ""+ properties:+ error:+ allOf:+ - $ref: '#/components/schemas/Status'+ description: Error details if the GeneratedFile ends up in the STATE_FAILED+ state.+ name:+ description: |-+ Identifier. The name of the generated file.+ Example: `generatedFiles/abc-123`+ type: string+ x-google-identifier: true+ state:+ description: Output only. The state of the GeneratedFile.+ enum:+ - STATE_UNSPECIFIED+ - GENERATING+ - GENERATED+ - FAILED+ readOnly: true+ type: string+ x-google-enum-descriptions:+ - The default value. This value is used if the state is omitted.+ - Being generated.+ - Generated and is ready for download.+ - Failed to generate the GeneratedFile.+ mimeType:+ description: MIME type of the generatedFile.+ type: string+ type: object+ TransferOwnershipRequest:+ description: Request to transfer the ownership of the tuned model.+ example:+ emailAddress: emailAddress+ properties:+ emailAddress:+ description: |-+ Required. The email address of the user to whom the tuned model is being transferred+ to.+ type: string+ required:+ - emailAddress+ type: object+ UsageMetadata:+ description: Metadata on the generation request's token usage.+ properties:+ candidatesTokensDetails:+ description: Output only. List of modalities that were returned in the response.+ items:+ $ref: '#/components/schemas/ModalityTokenCount'+ readOnly: true+ type: array+ thoughtsTokenCount:+ description: Output only. Number of tokens of thoughts for thinking models.+ format: int32+ readOnly: true+ type: integer+ toolUsePromptTokenCount:+ description: Output only. Number of tokens present in tool-use prompt(s).+ format: int32+ readOnly: true+ type: integer+ cachedContentTokenCount:+ description: Number of tokens in the cached part of the prompt (the cached+ content)+ format: int32+ type: integer+ promptTokenCount:+ description: |-+ Number of tokens in the prompt. When `cached_content` is set, this is+ still the total effective prompt size meaning this includes the number of+ tokens in the cached content.+ format: int32+ type: integer+ candidatesTokenCount:+ description: Total number of tokens across all the generated response candidates.+ format: int32+ type: integer+ promptTokensDetails:+ description: Output only. List of modalities that were processed in the+ request input.+ items:+ $ref: '#/components/schemas/ModalityTokenCount'+ readOnly: true+ type: array+ totalTokenCount:+ description: |-+ Total token count for the generation request (prompt + response+ candidates).+ format: int32+ type: integer+ cacheTokensDetails:+ description: Output only. List of modalities of the cached content in the+ request input.+ items:+ $ref: '#/components/schemas/ModalityTokenCount'+ readOnly: true+ type: array+ toolUsePromptTokensDetails:+ description: Output only. List of modalities that were processed for tool-use+ request inputs.+ items:+ $ref: '#/components/schemas/ModalityTokenCount'+ readOnly: true+ type: array+ type: object+ ListGeneratedFilesResponse:+ description: Response for `ListGeneratedFiles`.+ example:+ generatedFiles:+ - name: name+ state: STATE_UNSPECIFIED+ mimeType: mimeType+ error: ""+ - name: name+ state: STATE_UNSPECIFIED+ mimeType: mimeType+ error: ""+ nextPageToken: nextPageToken+ properties:+ nextPageToken:+ description: |-+ A token that can be sent as a `page_token` into a subsequent+ `ListGeneratedFiles` call.+ type: string+ generatedFiles:+ description: The list of `GeneratedFile`s.+ items:+ $ref: '#/components/schemas/GeneratedFile'+ type: array+ type: object+ SafetyRating:+ description: |-+ Safety rating for a piece of content.++ The safety rating contains the category of harm and the+ harm probability level in that category for a piece of content.+ Content is classified for safety across a number of+ harm categories and the probability of the harm classification is included+ here.+ example:+ blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ properties:+ category:+ allOf:+ - $ref: '#/components/schemas/HarmCategory'+ description: Required. The category for this rating.+ blocked:+ description: Was this content blocked because of this rating?+ type: boolean+ probability:+ description: Required. The probability of harm for this content.+ enum:+ - HARM_PROBABILITY_UNSPECIFIED+ - NEGLIGIBLE+ - LOW+ - MEDIUM+ - HIGH+ type: string+ x-google-enum-descriptions:+ - Probability is unspecified.+ - Content has a negligible chance of being unsafe.+ - Content has a low chance of being unsafe.+ - Content has a medium chance of being unsafe.+ - Content has a high chance of being unsafe.+ required:+ - category+ - probability+ type: object+ EmbedContentResponse:+ description: The response to an `EmbedContentRequest`.+ example:+ embedding: ""+ properties:+ embedding:+ allOf:+ - $ref: '#/components/schemas/ContentEmbedding'+ description: Output only. The embedding generated from the input content.+ readOnly: true+ type: object+ GenerationConfig:+ description: |-+ Configuration options for model generation and outputs. Not all parameters+ are configurable for every model.+ properties:+ responseSchema:+ allOf:+ - $ref: '#/components/schemas/Schema'+ description: |-+ Optional. Output schema of the generated candidate text. Schemas must be a+ subset of the [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema)+ and can be objects, primitives or arrays.++ If set, a compatible `response_mime_type` must also be set.+ Compatible MIME types:+ `application/json`: Schema for JSON response.+ Refer to the [JSON text generation+ guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details.+ thinkingConfig:+ allOf:+ - $ref: '#/components/schemas/ThinkingConfig'+ description: |-+ Optional. Config for thinking features.+ An error will be returned if this field is set for models that don't+ support thinking.+ logprobs:+ description: |-+ Optional. Only valid if response_logprobs=True.+ This sets the number of top logprobs to return at each decoding step in the+ Candidate.logprobs_result.+ format: int32+ type: integer+ mediaResolution:+ description: "Optional. If specified, the media resolution specified will\+ \ be used."+ enum:+ - MEDIA_RESOLUTION_UNSPECIFIED+ - MEDIA_RESOLUTION_LOW+ - MEDIA_RESOLUTION_MEDIUM+ - MEDIA_RESOLUTION_HIGH+ type: string+ x-google-enum-descriptions:+ - Media resolution has not been set.+ - Media resolution set to low (64 tokens).+ - Media resolution set to medium (256 tokens).+ - Media resolution set to high (zoomed reframing with 256 tokens).+ stopSequences:+ description: |-+ Optional. The set of character sequences (up to 5) that will stop output generation.+ If specified, the API will stop at the first appearance of a+ `stop_sequence`. The stop sequence will not be included as part of the+ response.+ items:+ type: string+ type: array+ speechConfig:+ allOf:+ - $ref: '#/components/schemas/SpeechConfig'+ description: Optional. The speech generation config.+ responseJsonSchema:+ description: |-+ Optional. Output schema of the generated response. This is an alternative to+ `response_schema` that accepts [JSON Schema](https://json-schema.org/).++ If set, `response_schema` must be omitted, but `response_mime_type` is+ required.++ While the full JSON Schema may be sent, not all features are supported.+ Specifically, only the following properties are supported:++ - `$id`+ - `$defs`+ - `$ref`+ - `$anchor`+ - `type`+ - `format`+ - `title`+ - `description`+ - `enum` (for strings and numbers)+ - `items`+ - `prefixItems`+ - `minItems`+ - `maxItems`+ - `minimum`+ - `maximum`+ - `anyOf`+ - `oneOf` (interpreted the same as `anyOf`)+ - `properties`+ - `additionalProperties`+ - `required`++ The non-standard `propertyOrdering` property may also be set.++ Cyclic references are unrolled to a limited degree and, as such, may only+ be used within non-required properties. (Nullable properties are not+ sufficient.) If `$ref` is set on a sub-schema, no other properties, except+ for than those starting as a `$`, may be set.+ presencePenalty:+ description: |-+ Optional. Presence penalty applied to the next token's logprobs if the token has+ already been seen in the response.++ This penalty is binary on/off and not dependant on the number of times the+ token is used (after the first). Use+ frequency_penalty+ for a penalty that increases with each use.++ A positive penalty will discourage the use of tokens that have already+ been used in the response, increasing the vocabulary.++ A negative penalty will encourage the use of tokens that have already been+ used in the response, decreasing the vocabulary.+ format: float+ type: number+ topP:+ description: |-+ Optional. The maximum cumulative probability of tokens to consider when sampling.++ The model uses combined Top-k and Top-p (nucleus) sampling.++ Tokens are sorted based on their assigned probabilities so that only the+ most likely tokens are considered. Top-k sampling directly limits the+ maximum number of tokens to consider, while Nucleus sampling limits the+ number of tokens based on the cumulative probability.++ Note: The default value varies by `Model` and is specified by+ the`Model.top_p` attribute returned from the `getModel` function. An empty+ `top_k` attribute indicates that the model doesn't apply top-k sampling+ and doesn't allow setting `top_k` on requests.+ format: float+ type: number+ temperature:+ description: |-+ Optional. Controls the randomness of the output.++ Note: The default value varies by model, see the `Model.temperature`+ attribute of the `Model` returned from the `getModel` function.++ Values can range from [0.0, 2.0].+ format: float+ type: number+ topK:+ description: |-+ Optional. The maximum number of tokens to consider when sampling.++ Gemini models use Top-p (nucleus) sampling or a combination of Top-k and+ nucleus sampling. Top-k sampling considers the set of `top_k` most probable+ tokens. Models running with nucleus sampling don't allow top_k setting.++ Note: The default value varies by `Model` and is specified by+ the`Model.top_p` attribute returned from the `getModel` function. An empty+ `top_k` attribute indicates that the model doesn't apply top-k sampling+ and doesn't allow setting `top_k` on requests.+ format: int32+ type: integer+ candidateCount:+ description: |-+ Optional. Number of generated responses to return. If unset, this will default+ to 1. Please note that this doesn't work for previous generation+ models (Gemini 1.0 family)+ format: int32+ type: integer+ enableEnhancedCivicAnswers:+ description: Optional. Enables enhanced civic answers. It may not be available+ for all models.+ type: boolean+ responseLogprobs:+ description: "Optional. If true, export the logprobs results in response."+ type: boolean+ responseModalities:+ description: |-+ Optional. The requested modalities of the response. Represents the set of modalities+ that the model can return, and should be expected in the response. This is+ an exact match to the modalities of the response.++ A model may have multiple combinations of supported modalities. If the+ requested modalities do not match any of the supported combinations, an+ error will be returned.++ An empty list is equivalent to requesting only text.+ items:+ enum:+ - MODALITY_UNSPECIFIED+ - TEXT+ - IMAGE+ - AUDIO+ type: string+ x-google-enum-descriptions:+ - Default value.+ - Indicates the model should return text.+ - Indicates the model should return images.+ - Indicates the model should return audio.+ type: array+ frequencyPenalty:+ description: |-+ Optional. Frequency penalty applied to the next token's logprobs, multiplied by the+ number of times each token has been seen in the respponse so far.++ A positive penalty will discourage the use of tokens that have already+ been used, proportional to the number of times the token has been used:+ The more a token is used, the more difficult it is for the model to use+ that token again increasing the vocabulary of responses.++ Caution: A _negative_ penalty will encourage the model to reuse tokens+ proportional to the number of times the token has been used. Small+ negative values will reduce the vocabulary of a response. Larger negative+ values will cause the model to start repeating a common token until it+ hits the max_output_tokens+ limit.+ format: float+ type: number+ seed:+ description: |-+ Optional. Seed used in decoding. If not set, the request uses a randomly generated+ seed.+ format: int32+ type: integer+ maxOutputTokens:+ description: |-+ Optional. The maximum number of tokens to include in a response candidate.++ Note: The default value varies by model, see the `Model.output_token_limit`+ attribute of the `Model` returned from the `getModel` function.+ format: int32+ type: integer+ responseMimeType:+ description: |-+ Optional. MIME type of the generated candidate text.+ Supported MIME types are:+ `text/plain`: (default) Text output.+ `application/json`: JSON response in the response candidates.+ `text/x.enum`: ENUM as a string response in the response candidates.+ Refer to the+ [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats)+ for a list of all supported text MIME types.+ type: string+ type: object+ CodeExecutionResult:+ description: |-+ Result of executing the `ExecutableCode`.++ Only generated when using the `CodeExecution`, and always follows a `part`+ containing the `ExecutableCode`.+ properties:+ outcome:+ description: Required. Outcome of the code execution.+ enum:+ - OUTCOME_UNSPECIFIED+ - OUTCOME_OK+ - OUTCOME_FAILED+ - OUTCOME_DEADLINE_EXCEEDED+ type: string+ x-google-enum-descriptions:+ - Unspecified status. This value should not be used.+ - Code execution completed successfully.+ - |-+ Code execution finished but with a failure. `stderr` should contain the+ reason.+ - |-+ Code execution ran for too long, and was cancelled. There may or may not+ be a partial output present.+ output:+ description: |-+ Optional. Contains stdout when code execution is successful, stderr or other+ description otherwise.+ type: string+ required:+ - outcome+ type: object+ ListChunksResponse:+ description: |-+ Response from `ListChunks` containing a paginated list of `Chunk`s.+ The `Chunk`s are sorted by ascending `chunk.create_time`.+ example:+ nextPageToken: nextPageToken+ chunks:+ - data: ""+ createTime: 2000-01-23T04:56:07.000+00:00+ customMetadata:+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ name: name+ updateTime: 2000-01-23T04:56:07.000+00:00+ state: STATE_UNSPECIFIED+ - data: ""+ createTime: 2000-01-23T04:56:07.000+00:00+ customMetadata:+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ name: name+ updateTime: 2000-01-23T04:56:07.000+00:00+ state: STATE_UNSPECIFIED+ properties:+ nextPageToken:+ description: |-+ A token, which can be sent as `page_token` to retrieve the next page.+ If this field is omitted, there are no more pages.+ type: string+ chunks:+ description: The returned `Chunk`s.+ items:+ $ref: '#/components/schemas/Chunk'+ type: array+ type: object+ ThinkingConfig:+ description: Config for thinking features.+ properties:+ thinkingBudget:+ description: The number of thoughts tokens that the model should generate.+ format: int32+ type: integer+ includeThoughts:+ description: |-+ Indicates whether to include thoughts in the response.+ If true, thoughts are returned only when available.+ type: boolean+ type: object+ BatchEmbedTextResponse:+ description: The response to a EmbedTextRequest.+ example:+ embeddings:+ - value:+ - 0.8008282+ - 0.8008282+ - value:+ - 0.8008282+ - 0.8008282+ properties:+ embeddings:+ description: Output only. The embeddings generated from the input text.+ items:+ $ref: '#/components/schemas/Embedding'+ readOnly: true+ type: array+ type: object+ BatchDeleteChunksRequest:+ description: Request to batch delete `Chunk`s.+ example:+ requests:+ - name: name+ - name: name+ properties:+ requests:+ description: Required. The request messages specifying the `Chunk`s to delete.+ items:+ $ref: '#/components/schemas/DeleteChunkRequest'+ type: array+ required:+ - requests+ type: object+ SemanticRetrieverConfig:+ description: |-+ Configuration for retrieving grounding content from a `Corpus` or+ `Document` created using the Semantic Retriever API.+ properties:+ source:+ description: |-+ Required. Name of the resource for retrieval. Example: `corpora/123` or+ `corpora/123/documents/abc`.+ type: string+ query:+ allOf:+ - $ref: '#/components/schemas/Content'+ description: Required. Query to use for matching `Chunk`s in the given resource+ by similarity.+ maxChunksCount:+ description: Optional. Maximum number of relevant `Chunk`s to retrieve.+ format: int32+ type: integer+ metadataFilters:+ description: Optional. Filters for selecting `Document`s and/or `Chunk`s+ from the resource.+ items:+ $ref: '#/components/schemas/MetadataFilter'+ type: array+ minimumRelevanceScore:+ description: Optional. Minimum relevance score for retrieved relevant `Chunk`s.+ format: float+ type: number+ required:+ - query+ - source+ type: object+ TunedModel:+ description: A fine-tuned model created using ModelService.CreateTunedModel.+ example:+ topK: 1+ baseModel: baseModel+ displayName: displayName+ description: description+ updateTime: 2000-01-23T04:56:07.000+00:00+ topP: 6.0274563+ createTime: 2000-01-23T04:56:07.000+00:00+ tunedModelSource: ""+ readerProjectNumbers:+ - readerProjectNumbers+ - readerProjectNumbers+ name: name+ temperature: 0.8008282+ state: STATE_UNSPECIFIED+ tuningTask: ""+ properties:+ updateTime:+ description: Output only. The timestamp when this model was updated.+ format: date-time+ readOnly: true+ type: string+ name:+ description: |-+ Output only. The tuned model name. A unique name will be generated on create.+ Example: `tunedModels/az2mb0bpw6i`+ If display_name is set on create, the id portion of the name will be set+ by concatenating the words of the display_name with hyphens and adding a+ random portion for uniqueness.++ Example:++ * display_name = `Sentence Translator`+ * name = `tunedModels/sentence-translator-u3b7m`+ readOnly: true+ type: string+ createTime:+ description: Output only. The timestamp when this model was created.+ format: date-time+ readOnly: true+ type: string+ tuningTask:+ allOf:+ - $ref: '#/components/schemas/TuningTask'+ description: Required. The tuning task that creates the tuned model.+ tunedModelSource:+ allOf:+ - $ref: '#/components/schemas/TunedModelSource'+ description: Optional. TunedModel to use as the starting point for training+ the new model.+ baseModel:+ description: |-+ Immutable. The name of the `Model` to tune.+ Example: `models/gemini-1.5-flash-001`+ type: string+ x-google-immutable: true+ readerProjectNumbers:+ description: Optional. List of project numbers that have read access to+ the tuned model.+ items:+ format: int64+ type: string+ type: array+ displayName:+ description: |-+ Optional. The name to display for this model in user interfaces.+ The display name must be up to 40 characters including spaces.+ type: string+ temperature:+ description: |-+ Optional. Controls the randomness of the output.++ Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will+ produce responses that are more varied, while a value closer to `0.0` will+ typically result in less surprising responses from the model.++ This value specifies default to be the one used by the base model while+ creating the model.+ format: float+ type: number+ description:+ description: Optional. A short description of this model.+ type: string+ topP:+ description: |-+ Optional. For Nucleus sampling.++ Nucleus sampling considers the smallest set of tokens whose probability+ sum is at least `top_p`.++ This value specifies default to be the one used by the base model while+ creating the model.+ format: float+ type: number+ topK:+ description: |-+ Optional. For Top-k sampling.++ Top-k sampling considers the set of `top_k` most probable tokens.+ This value specifies default to be used by the backend while making the+ call to the model.++ This value specifies default to be the one used by the base model while+ creating the model.+ format: int32+ type: integer+ state:+ description: Output only. The state of the tuned model.+ enum:+ - STATE_UNSPECIFIED+ - CREATING+ - ACTIVE+ - FAILED+ readOnly: true+ type: string+ x-google-enum-descriptions:+ - The default value. This value is unused.+ - The model is being created.+ - The model is ready to be used.+ - The model failed to be created.+ required:+ - tuningTask+ type: object+ GenerateContentResponse:+ description: |-+ Response from the model supporting multiple candidate responses.++ Safety ratings and content filtering are reported for both+ prompt in `GenerateContentResponse.prompt_feedback` and for each candidate+ in `finish_reason` and in `safety_ratings`. The API:+ - Returns either all requested candidates or none of them+ - Returns no candidates at all only if there was something wrong with the+ prompt (check `prompt_feedback`)+ - Reports feedback on each candidate in `finish_reason` and+ `safety_ratings`.+ example:+ candidates:+ - urlContextMetadata: ""+ groundingMetadata: ""+ citationMetadata: ""+ groundingAttributions:+ - sourceId: ""+ content: ""+ - sourceId: ""+ content: ""+ avgLogprobs: 0.8008281904610115+ finishReason: FINISH_REASON_UNSPECIFIED+ index: 6+ tokenCount: 1+ safetyRatings:+ - blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ - blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ logprobsResult: ""+ content: ""+ - urlContextMetadata: ""+ groundingMetadata: ""+ citationMetadata: ""+ groundingAttributions:+ - sourceId: ""+ content: ""+ - sourceId: ""+ content: ""+ avgLogprobs: 0.8008281904610115+ finishReason: FINISH_REASON_UNSPECIFIED+ index: 6+ tokenCount: 1+ safetyRatings:+ - blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ - blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ logprobsResult: ""+ content: ""+ promptFeedback: ""+ modelVersion: modelVersion+ usageMetadata: ""+ responseId: responseId+ properties:+ candidates:+ description: Candidate responses from the model.+ items:+ $ref: '#/components/schemas/Candidate'+ type: array+ usageMetadata:+ allOf:+ - $ref: '#/components/schemas/UsageMetadata'+ description: Output only. Metadata on the generation requests' token usage.+ readOnly: true+ modelVersion:+ description: Output only. The model version used to generate the response.+ readOnly: true+ type: string+ promptFeedback:+ allOf:+ - $ref: '#/components/schemas/PromptFeedback'+ description: Returns the prompt's feedback related to the content filters.+ responseId:+ description: Output only. response_id is used to identify each response.+ readOnly: true+ type: string+ type: object+ Operation:+ allOf:+ - $ref: '#/components/schemas/BaseOperation'+ - properties:+ metadata:+ additionalProperties:+ description: Properties of the object. Contains field @type with type+ URL.+ description: |-+ Service-specific metadata associated with the operation. It typically+ contains progress information and common metadata such as create time.+ Some services might not provide such metadata. Any method that returns a+ long-running operation should document the metadata type, if any.+ type: object+ response:+ additionalProperties:+ description: Properties of the object. Contains field @type with type+ URL.+ description: |-+ The normal, successful response of the operation. If the original+ method returns no data on success, such as `Delete`, the response is+ `google.protobuf.Empty`. If the original method is standard+ `Get`/`Create`/`Update`, the response should be the resource. For other+ methods, the response should have the type `XxxResponse`, where `Xxx`+ is the original method name. For example, if the original method name+ is `TakeSnapshot()`, the inferred response type is+ `TakeSnapshotResponse`.+ type: object+ type: object+ description: |-+ This resource represents a long-running operation that is the result of a+ network API call.+ example:+ metadata:+ key: ""+ response:+ key: ""+ name: name+ error: ""+ done: true+ type: object+ DynamicRetrievalConfig:+ description: Describes the options to customize dynamic retrieval.+ properties:+ dynamicThreshold:+ description: |-+ The threshold to be used in dynamic retrieval.+ If not set, a system default value is used.+ format: float+ type: number+ mode:+ description: The mode of the predictor to be used in dynamic retrieval.+ enum:+ - MODE_UNSPECIFIED+ - MODE_DYNAMIC+ type: string+ x-google-enum-descriptions:+ - Always trigger retrieval.+ - Run retrieval only when system decides it is necessary.+ type: object+ UrlMetadata:+ description: Context of the a single url retrieval.+ properties:+ retrievedUrl:+ description: Retrieved url by the tool.+ type: string+ urlRetrievalStatus:+ description: Status of the url retrieval.+ enum:+ - URL_RETRIEVAL_STATUS_UNSPECIFIED+ - URL_RETRIEVAL_STATUS_SUCCESS+ - URL_RETRIEVAL_STATUS_ERROR+ type: string+ x-google-enum-descriptions:+ - Default value. This value is unused.+ - Url retrieval is successful.+ - Url retrieval is failed due to error.+ type: object+ Candidate:+ description: A response candidate generated from the model.+ example:+ urlContextMetadata: ""+ groundingMetadata: ""+ citationMetadata: ""+ groundingAttributions:+ - sourceId: ""+ content: ""+ - sourceId: ""+ content: ""+ avgLogprobs: 0.8008281904610115+ finishReason: FINISH_REASON_UNSPECIFIED+ index: 6+ tokenCount: 1+ safetyRatings:+ - blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ - blocked: true+ probability: HARM_PROBABILITY_UNSPECIFIED+ category: ""+ logprobsResult: ""+ content: ""+ properties:+ citationMetadata:+ allOf:+ - $ref: '#/components/schemas/CitationMetadata'+ description: |-+ Output only. Citation information for model-generated candidate.++ This field may be populated with recitation information for any text+ included in the `content`. These are passages that are "recited" from+ copyrighted material in the foundational LLM's training data.+ readOnly: true+ groundingMetadata:+ allOf:+ - $ref: '#/components/schemas/GroundingMetadata'+ description: |-+ Output only. Grounding metadata for the candidate.++ This field is populated for `GenerateContent` calls.+ readOnly: true+ urlContextMetadata:+ allOf:+ - $ref: '#/components/schemas/UrlContextMetadata'+ description: Output only. Metadata related to url context retrieval tool.+ readOnly: true+ groundingAttributions:+ description: |-+ Output only. Attribution information for sources that contributed to a grounded answer.++ This field is populated for `GenerateAnswer` calls.+ items:+ $ref: '#/components/schemas/GroundingAttribution'+ readOnly: true+ type: array+ logprobsResult:+ allOf:+ - $ref: '#/components/schemas/LogprobsResult'+ description: Output only. Log-likelihood scores for the response tokens+ and top tokens+ readOnly: true+ content:+ allOf:+ - $ref: '#/components/schemas/Content'+ description: Output only. Generated content returned from the model.+ readOnly: true+ avgLogprobs:+ description: Output only. Average log probability score of the candidate.+ format: double+ readOnly: true+ type: number+ index:+ description: Output only. Index of the candidate in the list of response+ candidates.+ format: int32+ readOnly: true+ type: integer+ finishReason:+ description: |-+ Optional. Output only. The reason why the model stopped generating tokens.++ If empty, the model has not stopped generating tokens.+ enum:+ - FINISH_REASON_UNSPECIFIED+ - STOP+ - MAX_TOKENS+ - SAFETY+ - RECITATION+ - LANGUAGE+ - OTHER+ - BLOCKLIST+ - PROHIBITED_CONTENT+ - SPII+ - MALFORMED_FUNCTION_CALL+ - IMAGE_SAFETY+ readOnly: true+ type: string+ x-google-enum-descriptions:+ - Default value. This value is unused.+ - Natural stop point of the model or provided stop sequence.+ - The maximum number of tokens as specified in the request was reached.+ - The response candidate content was flagged for safety reasons.+ - The response candidate content was flagged for recitation reasons.+ - |-+ The response candidate content was flagged for using an unsupported+ language.+ - Unknown reason.+ - Token generation stopped because the content contains forbidden terms.+ - Token generation stopped for potentially containing prohibited content.+ - |-+ Token generation stopped because the content potentially contains+ Sensitive Personally Identifiable Information (SPII).+ - The function call generated by the model is invalid.+ - |-+ Token generation stopped because generated images contain safety+ violations.+ safetyRatings:+ description: |-+ List of ratings for the safety of a response candidate.++ There is at most one rating per category.+ items:+ $ref: '#/components/schemas/SafetyRating'+ type: array+ tokenCount:+ description: Output only. Token count for this candidate.+ format: int32+ readOnly: true+ type: integer+ type: object+ UrlContext:+ description: Tool to support URL context retrieval.+ type: object+ BatchCreateChunksResponse:+ description: Response from `BatchCreateChunks` containing a list of created+ `Chunk`s.+ example:+ chunks:+ - data: ""+ createTime: 2000-01-23T04:56:07.000+00:00+ customMetadata:+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ name: name+ updateTime: 2000-01-23T04:56:07.000+00:00+ state: STATE_UNSPECIFIED+ - data: ""+ createTime: 2000-01-23T04:56:07.000+00:00+ customMetadata:+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ name: name+ updateTime: 2000-01-23T04:56:07.000+00:00+ state: STATE_UNSPECIFIED+ properties:+ chunks:+ description: '`Chunk`s created.'+ items:+ $ref: '#/components/schemas/Chunk'+ type: array+ type: object+ GenerateAnswerRequest:+ description: Request to generate a grounded answer from the `Model`.+ example:+ safetySettings:+ - threshold: HARM_BLOCK_THRESHOLD_UNSPECIFIED+ category: ""+ - threshold: HARM_BLOCK_THRESHOLD_UNSPECIFIED+ category: ""+ semanticRetriever: ""+ answerStyle: ANSWER_STYLE_UNSPECIFIED+ contents:+ - role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ inlinePassages: ""+ temperature: 0.8008282+ properties:+ semanticRetriever:+ allOf:+ - $ref: '#/components/schemas/SemanticRetrieverConfig'+ description: |-+ Content retrieved from resources created via the Semantic Retriever+ API.+ temperature:+ description: |-+ Optional. Controls the randomness of the output.++ Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will+ produce responses that are more varied and creative, while a value closer+ to 0.0 will typically result in more straightforward responses from the+ model. A low temperature (~0.2) is usually recommended for+ Attributed-Question-Answering use cases.+ format: float+ type: number+ answerStyle:+ description: Required. Style in which answers should be returned.+ enum:+ - ANSWER_STYLE_UNSPECIFIED+ - ABSTRACTIVE+ - EXTRACTIVE+ - VERBOSE+ type: string+ x-google-enum-descriptions:+ - Unspecified answer style.+ - Succint but abstract style.+ - Very brief and extractive style.+ - |-+ Verbose style including extra details. The response may be formatted as a+ sentence, paragraph, multiple paragraphs, or bullet points, etc.+ contents:+ description: |-+ Required. The content of the current conversation with the `Model`. For single-turn+ queries, this is a single question to answer. For multi-turn queries, this+ is a repeated field that contains conversation history and the last+ `Content` in the list containing the question.++ Note: `GenerateAnswer` only supports queries in English.+ items:+ $ref: '#/components/schemas/Content'+ type: array+ safetySettings:+ description: |-+ Optional. A list of unique `SafetySetting` instances for blocking unsafe content.++ This will be enforced on the `GenerateAnswerRequest.contents` and+ `GenerateAnswerResponse.candidate`. There should not be more than one+ setting for each `SafetyCategory` type. The API will block any contents and+ responses that fail to meet the thresholds set by these settings. This list+ overrides the default settings for each `SafetyCategory` specified in the+ safety_settings. If there is no `SafetySetting` for a given+ `SafetyCategory` provided in the list, the API will use the default safety+ setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH,+ HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT,+ HARM_CATEGORY_HARASSMENT are supported.+ Refer to the+ [guide](https://ai.google.dev/gemini-api/docs/safety-settings)+ for detailed information on available safety settings. Also refer to the+ [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to+ learn how to incorporate safety considerations in your AI applications.+ items:+ $ref: '#/components/schemas/SafetySetting'+ type: array+ inlinePassages:+ allOf:+ - $ref: '#/components/schemas/GroundingPassages'+ description: Passages provided inline with the request.+ required:+ - answerStyle+ - contents+ type: object+ CountMessageTokensResponse:+ description: |-+ A response from `CountMessageTokens`.++ It returns the model's `token_count` for the `prompt`.+ example:+ tokenCount: 0+ properties:+ tokenCount:+ description: |-+ The number of tokens that the `model` tokenizes the `prompt` into.++ Always non-negative.+ format: int32+ type: integer+ type: object+ Model:+ description: Information about a Generative Language Model.+ example:+ topK: 0+ supportedGenerationMethods:+ - supportedGenerationMethods+ - supportedGenerationMethods+ maxTemperature: 5.637377+ inputTokenLimit: 6+ displayName: displayName+ name: name+ temperature: 5.962134+ description: description+ outputTokenLimit: 2+ baseModelId: baseModelId+ version: version+ topP: 1.4658129+ properties:+ topK:+ description: |-+ For Top-k sampling.++ Top-k sampling considers the set of `top_k` most probable tokens.+ This value specifies default to be used by the backend while making the+ call to the model.+ If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't+ allowed as a generation parameter.+ format: int32+ type: integer+ name:+ description: |-+ Required. The resource name of the `Model`. Refer to [Model+ variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations)+ for all allowed values.++ Format: `models/{model}` with a `{model}` naming convention of:++ * "{base_model_id}-{version}"++ Examples:++ * `models/gemini-1.5-flash-001`+ type: string+ baseModelId:+ description: |-+ Required. The name of the base model, pass this to the generation request.++ Examples:++ * `gemini-1.5-flash`+ type: string+ version:+ description: |-+ Required. The version number of the model.++ This represents the major version (`1.0` or `1.5`)+ type: string+ inputTokenLimit:+ description: Maximum number of input tokens allowed for this model.+ format: int32+ type: integer+ topP:+ description: |-+ For [Nucleus+ sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p).++ Nucleus sampling considers the smallest set of tokens whose probability+ sum is at least `top_p`.+ This value specifies default to be used by the backend while making the+ call to the model.+ format: float+ type: number+ supportedGenerationMethods:+ description: |-+ The model's supported generation methods.++ The corresponding API method names are defined as Pascal case+ strings, such as `generateMessage` and `generateContent`.+ items:+ type: string+ type: array+ temperature:+ description: |-+ Controls the randomness of the output.++ Values can range over `[0.0,max_temperature]`, inclusive. A higher value+ will produce responses that are more varied, while a value closer to `0.0`+ will typically result in less surprising responses from the model.+ This value specifies default to be used by the backend while making the+ call to the model.+ format: float+ type: number+ displayName:+ description: |-+ The human-readable name of the model. E.g. "Gemini 1.5 Flash".++ The name can be up to 128 characters long and can consist of any UTF-8+ characters.+ type: string+ description:+ description: A short description of the model.+ type: string+ maxTemperature:+ description: The maximum temperature this model can use.+ format: float+ type: number+ outputTokenLimit:+ description: Maximum number of output tokens available for this model.+ format: int32+ type: integer+ required:+ - baseModelId+ - name+ - version+ type: object+ Schema:+ description: |-+ The `Schema` object allows the definition of input and output data types.+ These types can be objects, but also primitives and arrays.+ Represents a select subset of an [OpenAPI 3.0 schema+ object](https://spec.openapis.org/oas/v3.0.3#schema).+ properties:+ items:+ allOf:+ - $ref: '#/components/schemas/Schema'+ description: Optional. Schema of the elements of Type.ARRAY.+ anyOf:+ description: |-+ Optional. The value should be validated against any (one or more) of the subschemas+ in the list.+ items:+ $ref: '#/components/schemas/Schema'+ type: array+ minLength:+ description: |-+ Optional. SCHEMA FIELDS FOR TYPE STRING+ Minimum length of the Type.STRING+ format: int64+ type: string+ maximum:+ description: Optional. Maximum value of the Type.INTEGER and Type.NUMBER+ format: double+ type: number+ propertyOrdering:+ description: |-+ Optional. The order of the properties.+ Not a standard field in open api spec. Used to determine the order of the+ properties in the response.+ items:+ type: string+ type: array+ nullable:+ description: Optional. Indicates if the value may be null.+ type: boolean+ required:+ description: Optional. Required properties of Type.OBJECT.+ items:+ type: string+ type: array+ minProperties:+ description: Optional. Minimum number of the properties for Type.OBJECT.+ format: int64+ type: string+ maxItems:+ description: Optional. Maximum number of the elements for Type.ARRAY.+ format: int64+ type: string+ example:+ description: Optional. Example of the object. Will only populated when the+ object is the root.+ title:+ description: Optional. The title of the schema.+ type: string+ minItems:+ description: Optional. Minimum number of the elements for Type.ARRAY.+ format: int64+ type: string+ description:+ description: |-+ Optional. A brief description of the parameter. This could contain examples of use.+ Parameter description may be formatted as Markdown.+ type: string+ type:+ allOf:+ - $ref: '#/components/schemas/Type'+ description: Required. Data type.+ default:+ description: |-+ Optional. Default value of the field. Per JSON Schema, this field is intended for+ documentation generators and doesn't affect validation. Thus it's included+ here and ignored so that developers who send schemas with a `default` field+ don't get unknown-field errors.+ minimum:+ description: |-+ Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER+ Minimum value of the Type.INTEGER and Type.NUMBER+ format: double+ type: number+ pattern:+ description: Optional. Pattern of the Type.STRING to restrict a string to+ a regular expression.+ type: string+ properties:+ additionalProperties:+ $ref: '#/components/schemas/Schema'+ description: Optional. Properties of Type.OBJECT.+ type: object+ maxProperties:+ description: Optional. Maximum number of the properties for Type.OBJECT.+ format: int64+ type: string+ format:+ description: |-+ Optional. The format of the data. This is used only for primitive datatypes.+ Supported formats:+ for NUMBER type: float, double+ for INTEGER type: int32, int64+ for STRING type: enum, date-time+ type: string+ enum:+ description: |-+ Optional. Possible values of the element of Type.STRING with enum format.+ For example we can define an Enum Direction as :+ {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}+ items:+ type: string+ type: array+ maxLength:+ description: Optional. Maximum length of the Type.STRING+ format: int64+ type: string+ required:+ - type+ type: object+ SafetyFeedback:+ description: |-+ Safety feedback for an entire request.++ This field is populated if content in the input and/or response is blocked+ due to safety settings. SafetyFeedback may not exist for every HarmCategory.+ Each SafetyFeedback will return the safety settings used by the request as+ well as the lowest HarmProbability that should be allowed in order to return+ a result.+ example:+ rating: ""+ setting: ""+ properties:+ setting:+ allOf:+ - $ref: '#/components/schemas/SafetySetting'+ description: Safety settings applied to the request.+ rating:+ allOf:+ - $ref: '#/components/schemas/SafetyRating'+ description: Safety rating evaluated from content.+ type: object+ VideoMetadata:+ description: Metadata describes the input video content.+ properties:+ endOffset:+ description: Optional. The end offset of the video.+ format: google-duration+ type: string+ startOffset:+ description: Optional. The start offset of the video.+ format: google-duration+ type: string+ fps:+ description: |-+ Optional. The frame rate of the video sent to the model. If not specified, the+ default value will be 1.0.+ The fps range is (0.0, 24.0].+ format: double+ type: number+ type: object+ CountMessageTokensRequest:+ description: |-+ Counts the number of tokens in the `prompt` sent to a model.++ Models may tokenize text differently, so each model may return a different+ `token_count`.+ example:+ prompt: ""+ properties:+ prompt:+ allOf:+ - $ref: '#/components/schemas/MessagePrompt'+ description: "Required. The prompt, whose token count is to be returned."+ required:+ - prompt+ type: object+ CreateTunedModelMetadata:+ description: |-+ Metadata about the state and progress of creating a tuned model returned from+ the long-running operation+ example:+ completedSteps: 6+ snapshots:+ - meanLoss: 5.962134+ computeTime: 2000-01-23T04:56:07.000+00:00+ step: 5+ epoch: 2+ - meanLoss: 5.962134+ computeTime: 2000-01-23T04:56:07.000+00:00+ step: 5+ epoch: 2+ tunedModel: tunedModel+ totalSteps: 1+ completedPercent: 0.8008282+ properties:+ completedPercent:+ description: The completed percentage for the tuning operation.+ format: float+ type: number+ completedSteps:+ description: The number of steps completed.+ format: int32+ type: integer+ totalSteps:+ description: The total number of tuning steps.+ format: int32+ type: integer+ snapshots:+ description: Metrics collected during tuning.+ items:+ $ref: '#/components/schemas/TuningSnapshot'+ type: array+ tunedModel:+ description: Name of the tuned model associated with the tuning operation.+ type: string+ type: object+ SafetySetting:+ description: |-+ Safety setting, affecting the safety-blocking behavior.++ Passing a safety setting for a category changes the allowed probability that+ content is blocked.+ example:+ threshold: HARM_BLOCK_THRESHOLD_UNSPECIFIED+ category: ""+ properties:+ threshold:+ description: Required. Controls the probability threshold at which harm+ is blocked.+ enum:+ - HARM_BLOCK_THRESHOLD_UNSPECIFIED+ - BLOCK_LOW_AND_ABOVE+ - BLOCK_MEDIUM_AND_ABOVE+ - BLOCK_ONLY_HIGH+ - BLOCK_NONE+ - "OFF"+ type: string+ x-google-enum-descriptions:+ - Threshold is unspecified.+ - Content with NEGLIGIBLE will be allowed.+ - Content with NEGLIGIBLE and LOW will be allowed.+ - "Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed."+ - All content will be allowed.+ - Turn off the safety filter.+ category:+ allOf:+ - $ref: '#/components/schemas/HarmCategory'+ description: Required. The category for this setting.+ required:+ - category+ - threshold+ type: object+ BatchUpdateChunksResponse:+ description: Response from `BatchUpdateChunks` containing a list of updated+ `Chunk`s.+ example:+ chunks:+ - data: ""+ createTime: 2000-01-23T04:56:07.000+00:00+ customMetadata:+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ name: name+ updateTime: 2000-01-23T04:56:07.000+00:00+ state: STATE_UNSPECIFIED+ - data: ""+ createTime: 2000-01-23T04:56:07.000+00:00+ customMetadata:+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ name: name+ updateTime: 2000-01-23T04:56:07.000+00:00+ state: STATE_UNSPECIFIED+ properties:+ chunks:+ description: '`Chunk`s updated.'+ items:+ $ref: '#/components/schemas/Chunk'+ type: array+ type: object+ PredictLongRunningResponse:+ description: "Response message for [PredictionService.PredictLongRunning]"+ example:+ generateVideoResponse: ""+ properties:+ generateVideoResponse:+ allOf:+ - $ref: '#/components/schemas/GenerateVideoResponse'+ description: The response of the video generation prediction.+ type: object+ Media:+ description: A proto encapsulate various type of media.+ properties:+ video:+ allOf:+ - $ref: '#/components/schemas/Video'+ description: Video as the only one for now. This is mimicking Vertex proto.+ type: object+ CountTextTokensRequest:+ description: |-+ Counts the number of tokens in the `prompt` sent to a model.++ Models may tokenize text differently, so each model may return a different+ `token_count`.+ example:+ prompt: ""+ properties:+ prompt:+ allOf:+ - $ref: '#/components/schemas/TextPrompt'+ description: Required. The free-form input text given to the model as a+ prompt.+ required:+ - prompt+ type: object+ PrebuiltVoiceConfig:+ description: The configuration for the prebuilt speaker to use.+ properties:+ voiceName:+ description: The name of the preset voice to use.+ type: string+ type: object+ QueryDocumentResponse:+ description: Response from `QueryDocument` containing a list of relevant chunks.+ example:+ relevantChunks:+ - chunkRelevanceScore: 0.8008282+ chunk: ""+ - chunkRelevanceScore: 0.8008282+ chunk: ""+ properties:+ relevantChunks:+ description: The returned relevant chunks.+ items:+ $ref: '#/components/schemas/RelevantChunk'+ type: array+ type: object+ EmbedContentRequest:+ description: Request containing the `Content` for the model to embed.+ example:+ taskType: ""+ outputDimensionality: 0+ model: model+ title: title+ content: ""+ properties:+ taskType:+ allOf:+ - $ref: '#/components/schemas/TaskType'+ description: |-+ Optional. Optional task type for which the embeddings will be used. Not supported on+ earlier models (`models/embedding-001`).+ content:+ allOf:+ - $ref: '#/components/schemas/Content'+ description: Required. The content to embed. Only the `parts.text` fields+ will be counted.+ outputDimensionality:+ description: |-+ Optional. Optional reduced dimension for the output embedding. If set, excessive+ values in the output embedding are truncated from the end. Supported by+ newer models since 2024 only. You cannot set this value if using the+ earlier model (`models/embedding-001`).+ format: int32+ type: integer+ model:+ description: |-+ Required. The model's resource name. This serves as an ID for the Model to use.++ This name should match a model name returned by the `ListModels` method.++ Format: `models/{model}`+ type: string+ title:+ description: |-+ Optional. An optional title for the text. Only applicable when TaskType is+ `RETRIEVAL_DOCUMENT`.++ Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality+ embeddings for retrieval.+ type: string+ required:+ - content+ - model+ type: object+ ChunkData:+ description: Extracted data that represents the `Chunk` content.+ properties:+ stringValue:+ description: |-+ The `Chunk` content as a string.+ The maximum number of tokens per chunk is 2043.+ type: string+ type: object+ CustomMetadata:+ description: User provided metadata stored as key-value pairs.+ example:+ stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ properties:+ stringListValue:+ allOf:+ - $ref: '#/components/schemas/StringList'+ description: The StringList value of the metadata to store.+ stringValue:+ description: The string value of the metadata to store.+ type: string+ key:+ description: Required. The key of the metadata to store.+ type: string+ numericValue:+ description: The numeric value of the metadata to store.+ format: float+ type: number+ required:+ - key+ type: object+ EmbedTextResponse:+ description: The response to a EmbedTextRequest.+ example:+ embedding: ""+ properties:+ embedding:+ allOf:+ - $ref: '#/components/schemas/Embedding'+ description: Output only. The embedding generated from the input text.+ readOnly: true+ type: object+ UrlContextMetadata:+ description: Metadata related to url context retrieval tool.+ properties:+ urlMetadata:+ description: List of url context.+ items:+ $ref: '#/components/schemas/UrlMetadata'+ type: array+ type: object+ Interval:+ description: |-+ Represents a time interval, encoded as a Timestamp start (inclusive) and a+ Timestamp end (exclusive).++ The start must be less than or equal to the end.+ When the start equals the end, the interval is empty (matches no time).+ When both start and end are unspecified, the interval matches any time.+ properties:+ startTime:+ description: |-+ Optional. Inclusive start of the interval.++ If specified, a Timestamp matching this interval will have to be the same+ or after the start.+ format: date-time+ type: string+ endTime:+ description: |-+ Optional. Exclusive end of the interval.++ If specified, a Timestamp matching this interval will have to be before the+ end.+ format: date-time+ type: string+ type: object+ Video:+ description: Representation of a video.+ properties:+ video:+ description: Raw bytes.+ format: byte+ type: string+ uri:+ description: Path to another storage.+ type: string+ type: object+ QueryCorpusResponse:+ description: Response from `QueryCorpus` containing a list of relevant chunks.+ example:+ relevantChunks:+ - chunkRelevanceScore: 0.8008282+ chunk: ""+ - chunkRelevanceScore: 0.8008282+ chunk: ""+ properties:+ relevantChunks:+ description: The relevant chunks.+ items:+ $ref: '#/components/schemas/RelevantChunk'+ type: array+ type: object+ TuningExample:+ description: A single example for tuning.+ properties:+ textInput:+ description: Optional. Text model input.+ type: string+ output:+ description: Required. The expected model output.+ type: string+ required:+ - output+ type: object+ CachedContent:+ description: |-+ Content that has been preprocessed and can be used in subsequent request+ to GenerativeService.++ Cached content can be only used with model it was created for.+ example:+ toolConfig: ""+ expireTime: 2000-01-23T04:56:07.000+00:00+ contents:+ - role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - role: role+ parts:+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ - functionResponse: ""+ executableCode: ""+ codeExecutionResult: ""+ thought: true+ fileData: ""+ functionCall: ""+ inlineData: ""+ text: text+ thoughtSignature: thoughtSignature+ videoMetadata: ""+ createTime: 2000-01-23T04:56:07.000+00:00+ displayName: displayName+ systemInstruction: ""+ name: name+ model: model+ updateTime: 2000-01-23T04:56:07.000+00:00+ usageMetadata: ""+ tools:+ - googleSearchRetrieval: ""+ googleSearch: ""+ codeExecution: ""+ urlContext: ""+ functionDeclarations:+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - googleSearchRetrieval: ""+ googleSearch: ""+ codeExecution: ""+ urlContext: ""+ functionDeclarations:+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ - responseJsonSchema: ""+ response: ""+ parametersJsonSchema: ""+ name: name+ description: description+ behavior: UNSPECIFIED+ parameters: ""+ ttl: ttl+ properties:+ tools:+ description: Optional. Input only. Immutable. A list of `Tools` the model+ may use to generate the next response+ items:+ $ref: '#/components/schemas/Tool'+ type: array+ writeOnly: true+ x-google-immutable: true+ displayName:+ description: |-+ Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum+ 128 Unicode characters.+ type: string+ x-google-immutable: true+ model:+ description: |-+ Required. Immutable. The name of the `Model` to use for cached content+ Format: `models/{model}`+ type: string+ x-google-immutable: true+ expireTime:+ description: |-+ Timestamp in UTC of when this resource is considered expired.+ This is *always* provided on output, regardless of what was sent+ on input.+ format: date-time+ type: string+ usageMetadata:+ allOf:+ - $ref: '#/components/schemas/CachedContentUsageMetadata'+ description: Output only. Metadata on the usage of the cached content.+ readOnly: true+ name:+ description: |-+ Output only. Identifier. The resource name referring to the cached content.+ Format: `cachedContents/{id}`+ readOnly: true+ type: string+ x-google-identifier: true+ contents:+ description: Optional. Input only. Immutable. The content to cache.+ items:+ $ref: '#/components/schemas/Content'+ type: array+ writeOnly: true+ x-google-immutable: true+ systemInstruction:+ allOf:+ - $ref: '#/components/schemas/Content'+ description: Optional. Input only. Immutable. Developer set system instruction.+ Currently text only.+ writeOnly: true+ x-google-immutable: true+ toolConfig:+ allOf:+ - $ref: '#/components/schemas/ToolConfig'+ description: Optional. Input only. Immutable. Tool config. This config is+ shared for all tools.+ writeOnly: true+ x-google-immutable: true+ createTime:+ description: Output only. Creation time of the cache entry.+ format: date-time+ readOnly: true+ type: string+ ttl:+ description: "Input only. New TTL for this resource, input only."+ format: google-duration+ type: string+ writeOnly: true+ updateTime:+ description: Output only. When the cache entry was last updated in UTC time.+ format: date-time+ readOnly: true+ type: string+ required:+ - model+ type: object+ GroundingChunk:+ description: Grounding chunk.+ properties:+ web:+ allOf:+ - $ref: '#/components/schemas/Web'+ description: Grounding chunk from the web.+ type: object+ PredictLongRunningMetadata:+ description: Metadata for PredictLongRunning long running operations.+ type: object+ SearchEntryPoint:+ description: Google search entry point.+ properties:+ sdkBlob:+ description: Optional. Base64 encoded JSON representing array of tuple.+ format: byte+ type: string+ renderedContent:+ description: Optional. Web content snippet that can be embedded in a web+ page or an app webview.+ type: string+ type: object+ ModalityTokenCount:+ description: Represents token counting info for a single modality.+ example:+ modality: ""+ tokenCount: 0+ properties:+ tokenCount:+ description: Number of tokens.+ format: int32+ type: integer+ modality:+ allOf:+ - $ref: '#/components/schemas/Modality'+ description: The modality associated with this token count.+ type: object+ ExecutableCode:+ description: |-+ Code generated by the model that is meant to be executed, and the result+ returned to the model.++ Only generated when using the `CodeExecution` tool, in which the code will+ be automatically executed, and a corresponding `CodeExecutionResult` will+ also be generated.+ properties:+ language:+ description: Required. Programming language of the `code`.+ enum:+ - LANGUAGE_UNSPECIFIED+ - PYTHON+ type: string+ x-google-enum-descriptions:+ - Unspecified language. This value should not be used.+ - "Python >= 3.10, with numpy and simpy available."+ code:+ description: Required. The code to be executed.+ type: string+ required:+ - code+ - language+ type: object+ ContentFilter:+ description: |-+ Content filtering metadata associated with processing a single request.++ ContentFilter contains a reason and an optional supporting string. The reason+ may be unspecified.+ example:+ reason: BLOCKED_REASON_UNSPECIFIED+ message: message+ properties:+ reason:+ description: The reason content was blocked during request processing.+ enum:+ - BLOCKED_REASON_UNSPECIFIED+ - SAFETY+ - OTHER+ type: string+ x-google-enum-descriptions:+ - A blocked reason was not specified.+ - Content was blocked by safety settings.+ - "Content was blocked, but the reason is uncategorized."+ message:+ description: A string that describes the filtering behavior in more detail.+ type: string+ type: object+ QueryCorpusRequest:+ description: Request for querying a `Corpus`.+ example:+ query: query+ resultsCount: 6+ metadataFilters:+ - conditions:+ - stringValue: stringValue+ numericValue: 0.8008282+ operation: OPERATOR_UNSPECIFIED+ - stringValue: stringValue+ numericValue: 0.8008282+ operation: OPERATOR_UNSPECIFIED+ key: key+ - conditions:+ - stringValue: stringValue+ numericValue: 0.8008282+ operation: OPERATOR_UNSPECIFIED+ - stringValue: stringValue+ numericValue: 0.8008282+ operation: OPERATOR_UNSPECIFIED+ key: key+ properties:+ metadataFilters:+ description: |-+ Optional. Filter for `Chunk` and `Document` metadata. Each `MetadataFilter` object+ should correspond to a unique key. Multiple `MetadataFilter` objects are+ joined by logical "AND"s.++ Example query at document level:+ (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action)++ `MetadataFilter` object list:+ metadata_filters = [+ {key = "document.custom_metadata.year"+ conditions = [{int_value = 2020, operation = GREATER_EQUAL},+ {int_value = 2010, operation = LESS}]},+ {key = "document.custom_metadata.year"+ conditions = [{int_value = 2020, operation = GREATER_EQUAL},+ {int_value = 2010, operation = LESS}]},+ {key = "document.custom_metadata.genre"+ conditions = [{string_value = "drama", operation = EQUAL},+ {string_value = "action", operation = EQUAL}]}]++ Example query at chunk level for a numeric range of values:+ (year > 2015 AND year <= 2020)++ `MetadataFilter` object list:+ metadata_filters = [+ {key = "chunk.custom_metadata.year"+ conditions = [{int_value = 2015, operation = GREATER}]},+ {key = "chunk.custom_metadata.year"+ conditions = [{int_value = 2020, operation = LESS_EQUAL}]}]++ Note: "AND"s for the same key are only supported for numeric values. String+ values only support "OR"s for the same key.+ items:+ $ref: '#/components/schemas/MetadataFilter'+ type: array+ query:+ description: Required. Query string to perform semantic search.+ type: string+ resultsCount:+ description: |-+ Optional. The maximum number of `Chunk`s to return.+ The service may return fewer `Chunk`s.++ If unspecified, at most 10 `Chunk`s will be returned.+ The maximum specified result count is 100.+ format: int32+ type: integer+ required:+ - query+ type: object+ PredictRequest:+ description: Request message for PredictionService.Predict.+ example:+ instances:+ - ""+ - ""+ parameters: ""+ properties:+ instances:+ description: Required. The instances that are the input to the prediction+ call.+ items: {}+ type: array+ parameters:+ description: Optional. The parameters that govern the prediction call.+ required:+ - instances+ type: object+ GenerateAnswerResponse:+ description: Response from the model for a grounded answer.+ example:+ answer: ""+ answerableProbability: 0.8008282+ inputFeedback: ""+ properties:+ answer:+ allOf:+ - $ref: '#/components/schemas/Candidate'+ description: |-+ Candidate answer from the model.++ Note: The model *always* attempts to provide a grounded answer, even when+ the answer is unlikely to be answerable from the given passages.+ In that case, a low-quality or ungrounded answer may be provided, along+ with a low `answerable_probability`.+ inputFeedback:+ allOf:+ - $ref: '#/components/schemas/InputFeedback'+ description: |-+ Output only. Feedback related to the input data used to answer the question, as opposed+ to the model-generated response to the question.++ The input data can be one or more of the following:++ - Question specified by the last entry in `GenerateAnswerRequest.content`+ - Conversation history specified by the other entries in+ `GenerateAnswerRequest.content`+ - Grounding sources (`GenerateAnswerRequest.semantic_retriever` or+ `GenerateAnswerRequest.inline_passages`)+ readOnly: true+ answerableProbability:+ description: |-+ Output only. The model's estimate of the probability that its answer is correct and+ grounded in the input passages.++ A low `answerable_probability` indicates that the answer might not be+ grounded in the sources.++ When `answerable_probability` is low, you may want to:++ * Display a message to the effect of "We couldn’t answer that question" to+ the user.+ * Fall back to a general-purpose LLM that answers the question from world+ knowledge. The threshold and nature of such fallbacks will depend on+ individual use cases. `0.5` is a good starting threshold.+ format: float+ readOnly: true+ type: number+ type: object+ Embedding:+ description: A list of floats representing the embedding.+ example:+ value:+ - 0.8008282+ - 0.8008282+ properties:+ value:+ description: The embedding values.+ items:+ format: float+ type: number+ type: array+ type: object+ BatchCreateChunksRequest:+ description: Request to batch create `Chunk`s.+ example:+ requests:+ - parent: parent+ chunk: ""+ - parent: parent+ chunk: ""+ properties:+ requests:+ description: |-+ Required. The request messages specifying the `Chunk`s to create.+ A maximum of 100 `Chunk`s can be created in a batch.+ items:+ $ref: '#/components/schemas/CreateChunkRequest'+ type: array+ required:+ - requests+ type: object+ PredictLongRunningOperation:+ allOf:+ - $ref: '#/components/schemas/BaseOperation'+ - properties:+ metadata:+ $ref: '#/components/schemas/PredictLongRunningMetadata'+ response:+ $ref: '#/components/schemas/PredictLongRunningResponse'+ type: object+ description: This resource represents a long-running operation where metadata+ and response fields are strongly typed.+ example:+ metadata: null+ response:+ generateVideoResponse: ""+ name: name+ error: ""+ done: true+ type: object+ SemanticRetrieverChunk:+ description: |-+ Identifier for a `Chunk` retrieved via Semantic Retriever specified in the+ `GenerateAnswerRequest` using `SemanticRetrieverConfig`.+ properties:+ chunk:+ description: |-+ Output only. Name of the `Chunk` containing the attributed text.+ Example: `corpora/123/documents/abc/chunks/xyz`+ readOnly: true+ type: string+ source:+ description: |-+ Output only. Name of the source matching the request's+ `SemanticRetrieverConfig.source`. Example: `corpora/123` or+ `corpora/123/documents/abc`+ readOnly: true+ type: string+ type: object+ Condition:+ description: Filter condition applicable to a single key.+ example:+ stringValue: stringValue+ numericValue: 0.8008282+ operation: OPERATOR_UNSPECIFIED+ properties:+ numericValue:+ description: The numeric value to filter the metadata on.+ format: float+ type: number+ operation:+ description: Required. Operator applied to the given key-value pair to trigger+ the condition.+ enum:+ - OPERATOR_UNSPECIFIED+ - LESS+ - LESS_EQUAL+ - EQUAL+ - GREATER_EQUAL+ - GREATER+ - NOT_EQUAL+ - INCLUDES+ - EXCLUDES+ type: string+ x-google-enum-descriptions:+ - The default value. This value is unused.+ - Supported by numeric.+ - Supported by numeric.+ - Supported by numeric & string.+ - Supported by numeric.+ - Supported by numeric.+ - Supported by numeric & string.+ - |-+ Supported by string only when `CustomMetadata` value type for the given+ key has a `string_list_value`.+ - |-+ Supported by string only when `CustomMetadata` value type for the given+ key has a `string_list_value`.+ stringValue:+ description: The string value to filter the metadata on.+ type: string+ required:+ - operation+ type: object+ Document:+ description: |-+ A `Document` is a collection of `Chunk`s.+ A `Corpus` can have a maximum of 10,000 `Document`s.+ example:+ createTime: 2000-01-23T04:56:07.000+00:00+ displayName: displayName+ name: name+ customMetadata:+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ updateTime: 2000-01-23T04:56:07.000+00:00+ properties:+ updateTime:+ description: Output only. The Timestamp of when the `Document` was last+ updated.+ format: date-time+ readOnly: true+ type: string+ name:+ description: |-+ Immutable. Identifier. The `Document` resource name. The ID (name excluding the+ "corpora/*/documents/" prefix) can contain up to 40 characters that are+ lowercase alphanumeric or dashes (-). The ID cannot start or end with a+ dash. If the name is empty on create, a unique name will be derived from+ `display_name` along with a 12 character random suffix.+ Example: `corpora/{corpus_id}/documents/my-awesome-doc-123a456b789c`+ type: string+ x-google-immutable: true+ x-google-identifier: true+ customMetadata:+ description: |-+ Optional. User provided custom metadata stored as key-value pairs used for querying.+ A `Document` can have a maximum of 20 `CustomMetadata`.+ items:+ $ref: '#/components/schemas/CustomMetadata'+ type: array+ createTime:+ description: Output only. The Timestamp of when the `Document` was created.+ format: date-time+ readOnly: true+ type: string+ displayName:+ description: |-+ Optional. The human-readable display name for the `Document`. The display name must+ be no more than 512 characters in length, including spaces.+ Example: "Semantic Retriever Documentation"+ type: string+ type: object+ Corpus:+ description: |-+ A `Corpus` is a collection of `Document`s.+ A project can create up to 5 corpora.+ example:+ createTime: 2000-01-23T04:56:07.000+00:00+ displayName: displayName+ name: name+ updateTime: 2000-01-23T04:56:07.000+00:00+ properties:+ updateTime:+ description: Output only. The Timestamp of when the `Corpus` was last updated.+ format: date-time+ readOnly: true+ type: string+ createTime:+ description: Output only. The Timestamp of when the `Corpus` was created.+ format: date-time+ readOnly: true+ type: string+ displayName:+ description: |-+ Optional. The human-readable display name for the `Corpus`. The display name must be+ no more than 512 characters in length, including spaces.+ Example: "Docs on Semantic Retriever"+ type: string+ name:+ description: |-+ Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the "corpora/" prefix)+ can contain up to 40 characters that are lowercase alphanumeric or dashes+ (-). The ID cannot start or end with a dash. If the name is empty on+ create, a unique name will be derived from `display_name` along with a 12+ character random suffix.+ Example: `corpora/my-awesome-corpora-123a456b789c`+ type: string+ x-google-immutable: true+ x-google-identifier: true+ type: object+ FunctionCallingConfig:+ description: Configuration for specifying function calling behavior.+ properties:+ mode:+ description: |-+ Optional. Specifies the mode in which function calling should execute. If+ unspecified, the default value will be set to AUTO.+ enum:+ - MODE_UNSPECIFIED+ - AUTO+ - ANY+ - NONE+ - VALIDATED+ type: string+ x-google-enum-descriptions:+ - Unspecified function calling mode. This value should not be used.+ - |-+ Default model behavior, model decides to predict either a function call+ or a natural language response.+ - |-+ Model is constrained to always predicting a function call only.+ If "allowed_function_names" are set, the predicted function call will be+ limited to any one of "allowed_function_names", else the predicted+ function call will be any one of the provided "function_declarations".+ - |-+ Model will not predict any function call. Model behavior is same as when+ not passing any function declarations.+ - |-+ Model decides to predict either a function call+ or a natural language response, but will validate function calls with+ constrained decoding.+ allowedFunctionNames:+ description: |-+ Optional. A set of function names that, when provided, limits the functions the model+ will call.++ This should only be set when the Mode is ANY. Function names+ should match [FunctionDeclaration.name]. With mode set to ANY, model will+ predict a function call from the set of function names provided.+ items:+ type: string+ type: array+ type: object+ BatchEmbedContentsResponse:+ description: The response to a `BatchEmbedContentsRequest`.+ example:+ embeddings:+ - values:+ - 0.8008282+ - 0.8008282+ - values:+ - 0.8008282+ - 0.8008282+ properties:+ embeddings:+ description: |-+ Output only. The embeddings for each request, in the same order as provided in the batch+ request.+ items:+ $ref: '#/components/schemas/ContentEmbedding'+ readOnly: true+ type: array+ type: object+ HarmCategory:+ enum:+ - HARM_CATEGORY_UNSPECIFIED+ - HARM_CATEGORY_DEROGATORY+ - HARM_CATEGORY_TOXICITY+ - HARM_CATEGORY_VIOLENCE+ - HARM_CATEGORY_SEXUAL+ - HARM_CATEGORY_MEDICAL+ - HARM_CATEGORY_DANGEROUS+ - HARM_CATEGORY_HARASSMENT+ - HARM_CATEGORY_HATE_SPEECH+ - HARM_CATEGORY_SEXUALLY_EXPLICIT+ - HARM_CATEGORY_DANGEROUS_CONTENT+ - HARM_CATEGORY_CIVIC_INTEGRITY+ type: string+ x-google-enum-descriptions:+ - Category is unspecified.+ - |-+ **PaLM** - Negative or harmful comments targeting identity and/or protected+ attribute.+ - "**PaLM** - Content that is rude, disrespectful, or profane."+ - |-+ **PaLM** - Describes scenarios depicting violence against an individual or+ group, or general descriptions of gore.+ - '**PaLM** - Contains references to sexual acts or other lewd content.'+ - '**PaLM** - Promotes unchecked medical advice.'+ - |-+ **PaLM** - Dangerous content that promotes, facilitates, or encourages+ harmful acts.+ - '**Gemini** - Harassment content.'+ - '**Gemini** - Hate speech and content.'+ - '**Gemini** - Sexually explicit content.'+ - '**Gemini** - Dangerous content.'+ - '**Gemini** - Content that may be used to harm civic integrity.'+ CountTokensResponse:+ description: |-+ A response from `CountTokens`.++ It returns the model's `token_count` for the `prompt`.+ example:+ promptTokensDetails:+ - modality: ""+ tokenCount: 0+ - modality: ""+ tokenCount: 0+ cachedContentTokenCount: 1+ totalTokens: 6+ cacheTokensDetails:+ - modality: ""+ tokenCount: 0+ - modality: ""+ tokenCount: 0+ properties:+ cacheTokensDetails:+ description: Output only. List of modalities that were processed in the+ cached content.+ items:+ $ref: '#/components/schemas/ModalityTokenCount'+ readOnly: true+ type: array+ promptTokensDetails:+ description: Output only. List of modalities that were processed in the+ request input.+ items:+ $ref: '#/components/schemas/ModalityTokenCount'+ readOnly: true+ type: array+ totalTokens:+ description: |-+ The number of tokens that the `Model` tokenizes the `prompt` into. Always+ non-negative.+ format: int32+ type: integer+ cachedContentTokenCount:+ description: Number of tokens in the cached part of the prompt (the cached+ content).+ format: int32+ type: integer+ type: object+ ContentEmbedding:+ description: A list of floats representing an embedding.+ example:+ values:+ - 0.8008282+ - 0.8008282+ properties:+ values:+ description: The embedding values.+ items:+ format: float+ type: number+ type: array+ type: object+ RetrievalMetadata:+ description: Metadata related to retrieval in the grounding flow.+ properties:+ googleSearchDynamicRetrievalScore:+ description: |-+ Optional. Score indicating how likely information from google search could help+ answer the prompt. The score is in the range [0, 1], where 0 is the least+ likely and 1 is the most likely. This score is only populated when+ google search grounding and dynamic retrieval is enabled. It will be+ compared to the threshold to determine whether to trigger google search.+ format: float+ type: number+ type: object+ GroundingPassages:+ description: A repeated list of passages.+ properties:+ passages:+ description: List of passages.+ items:+ $ref: '#/components/schemas/GroundingPassage'+ type: array+ type: object+ VideoFileMetadata:+ description: Metadata for a video `File`.+ properties:+ videoDuration:+ description: Duration of the video.+ format: google-duration+ type: string+ type: object+ GenerateMessageRequest:+ description: Request to generate a message response from the model.+ example:+ topK: 5+ temperature: 0.8008282+ topP: 6.0274563+ prompt: ""+ candidateCount: 1+ properties:+ temperature:+ description: |-+ Optional. Controls the randomness of the output.++ Values can range over `[0.0,1.0]`,+ inclusive. A value closer to `1.0` will produce responses that are more+ varied, while a value closer to `0.0` will typically result in+ less surprising responses from the model.+ format: float+ type: number+ topP:+ description: |-+ Optional. The maximum cumulative probability of tokens to consider when sampling.++ The model uses combined Top-k and nucleus sampling.++ Nucleus sampling considers the smallest set of tokens whose probability+ sum is at least `top_p`.+ format: float+ type: number+ candidateCount:+ description: |-+ Optional. The number of generated response messages to return.++ This value must be between+ `[1, 8]`, inclusive. If unset, this will default to `1`.+ format: int32+ type: integer+ topK:+ description: |-+ Optional. The maximum number of tokens to consider when sampling.++ The model uses combined Top-k and nucleus sampling.++ Top-k sampling considers the set of `top_k` most probable tokens.+ format: int32+ type: integer+ prompt:+ allOf:+ - $ref: '#/components/schemas/MessagePrompt'+ description: |-+ Required. The structured textual input given to the model as a prompt.++ Given a+ prompt, the model will return what it predicts is the next message in the+ discussion.+ required:+ - prompt+ type: object+ LogprobsResult:+ description: Logprobs Result+ properties:+ chosenCandidates:+ description: |-+ Length = total number of decoding steps.+ The chosen candidates may or may not be in top_candidates.+ items:+ $ref: '#/components/schemas/LogprobsResultCandidate'+ type: array+ topCandidates:+ description: Length = total number of decoding steps.+ items:+ $ref: '#/components/schemas/TopCandidates'+ type: array+ type: object+ CountTextTokensResponse:+ description: |-+ A response from `CountTextTokens`.++ It returns the model's `token_count` for the `prompt`.+ example:+ tokenCount: 0+ properties:+ tokenCount:+ description: |-+ The number of tokens that the `model` tokenizes the `prompt` into.++ Always non-negative.+ format: int32+ type: integer+ type: object+ VoiceConfig:+ description: The configuration for the voice to use.+ properties:+ prebuiltVoiceConfig:+ allOf:+ - $ref: '#/components/schemas/PrebuiltVoiceConfig'+ description: The configuration for the prebuilt voice to use.+ type: object+ ListModelsResponse:+ description: Response from `ListModel` containing a paginated list of Models.+ example:+ models:+ - topK: 0+ supportedGenerationMethods:+ - supportedGenerationMethods+ - supportedGenerationMethods+ maxTemperature: 5.637377+ inputTokenLimit: 6+ displayName: displayName+ name: name+ temperature: 5.962134+ description: description+ outputTokenLimit: 2+ baseModelId: baseModelId+ version: version+ topP: 1.4658129+ - topK: 0+ supportedGenerationMethods:+ - supportedGenerationMethods+ - supportedGenerationMethods+ maxTemperature: 5.637377+ inputTokenLimit: 6+ displayName: displayName+ name: name+ temperature: 5.962134+ description: description+ outputTokenLimit: 2+ baseModelId: baseModelId+ version: version+ topP: 1.4658129+ nextPageToken: nextPageToken+ properties:+ models:+ description: The returned Models.+ items:+ $ref: '#/components/schemas/Model'+ type: array+ nextPageToken:+ description: |-+ A token, which can be sent as `page_token` to retrieve the next page.++ If this field is omitted, there are no more pages.+ type: string+ type: object+ ListPermissionsResponse:+ description: |-+ Response from `ListPermissions` containing a paginated list of+ permissions.+ example:+ permissions:+ - emailAddress: emailAddress+ role: ROLE_UNSPECIFIED+ name: name+ granteeType: GRANTEE_TYPE_UNSPECIFIED+ - emailAddress: emailAddress+ role: ROLE_UNSPECIFIED+ name: name+ granteeType: GRANTEE_TYPE_UNSPECIFIED+ nextPageToken: nextPageToken+ properties:+ permissions:+ description: Returned permissions.+ items:+ $ref: '#/components/schemas/Permission'+ type: array+ nextPageToken:+ description: |-+ A token, which can be sent as `page_token` to retrieve the next page.++ If this field is omitted, there are no more pages.+ type: string+ type: object+ CreateTunedModelOperation:+ allOf:+ - $ref: '#/components/schemas/BaseOperation'+ - properties:+ metadata:+ $ref: '#/components/schemas/CreateTunedModelMetadata'+ response:+ $ref: '#/components/schemas/TunedModel'+ type: object+ description: This resource represents a long-running operation where metadata+ and response fields are strongly typed.+ example:+ metadata:+ completedSteps: 6+ snapshots:+ - meanLoss: 5.962134+ computeTime: 2000-01-23T04:56:07.000+00:00+ step: 5+ epoch: 2+ - meanLoss: 5.962134+ computeTime: 2000-01-23T04:56:07.000+00:00+ step: 5+ epoch: 2+ tunedModel: tunedModel+ totalSteps: 1+ completedPercent: 0.8008282+ response:+ topK: 1+ baseModel: baseModel+ displayName: displayName+ description: description+ updateTime: 2000-01-23T04:56:07.000+00:00+ topP: 6.0274563+ createTime: 2000-01-23T04:56:07.000+00:00+ tunedModelSource: ""+ readerProjectNumbers:+ - readerProjectNumbers+ - readerProjectNumbers+ name: name+ temperature: 0.8008282+ state: STATE_UNSPECIFIED+ tuningTask: ""+ name: name+ error: ""+ done: true+ type: object+ Blob:+ description: |-+ Raw media bytes.++ Text should not be sent as raw bytes, use the 'text' field.+ properties:+ data:+ description: Raw bytes for media formats.+ format: byte+ type: string+ mimeType:+ description: |-+ The IANA standard MIME type of the source data.+ Examples:+ - image/png+ - image/jpeg+ If an unsupported MIME type is provided, an error will be returned. For a+ complete list of supported types, see [Supported file+ formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).+ type: string+ type: object+ ListOperationsResponse:+ description: The response message for Operations.ListOperations.+ example:+ operations:+ - metadata:+ key: ""+ response:+ key: ""+ name: name+ error: ""+ done: true+ - metadata:+ key: ""+ response:+ key: ""+ name: name+ error: ""+ done: true+ nextPageToken: nextPageToken+ properties:+ nextPageToken:+ description: The standard List next-page token.+ type: string+ operations:+ description: A list of operations that matches the specified filter in the+ request.+ items:+ $ref: '#/components/schemas/Operation'+ type: array+ type: object+ SpeechConfig:+ description: The speech generation config.+ properties:+ voiceConfig:+ allOf:+ - $ref: '#/components/schemas/VoiceConfig'+ description: The configuration in case of single-voice output.+ languageCode:+ description: |-+ Optional. Language code (in BCP 47 format, e.g. "en-US") for speech synthesis.++ Valid values are: de-DE, en-AU, en-GB, en-IN, en-US, es-US, fr-FR, hi-IN,+ pt-BR, ar-XA, es-ES, fr-CA, id-ID, it-IT, ja-JP, tr-TR, vi-VN, bn-IN,+ gu-IN, kn-IN, ml-IN, mr-IN, ta-IN, te-IN, nl-NL, ko-KR, cmn-CN, pl-PL,+ ru-RU, and th-TH.+ type: string+ multiSpeakerVoiceConfig:+ allOf:+ - $ref: '#/components/schemas/MultiSpeakerVoiceConfig'+ description: |-+ Optional. The configuration for the multi-speaker setup.+ It is mutually exclusive with the voice_config field.+ type: object+ GroundingSupport:+ description: Grounding support.+ properties:+ confidenceScores:+ description: |-+ Confidence score of the support references. Ranges from 0 to 1. 1 is the+ most confident. This list must have the same size as the+ grounding_chunk_indices.+ items:+ format: float+ type: number+ type: array+ groundingChunkIndices:+ description: |-+ A list of indices (into 'grounding_chunk') specifying the+ citations associated with the claim. For instance [1,3,4] means+ that grounding_chunk[1], grounding_chunk[3],+ grounding_chunk[4] are the retrieved content attributed to the claim.+ items:+ format: int32+ type: integer+ type: array+ segment:+ allOf:+ - $ref: '#/components/schemas/Segment'+ description: Segment of the content this support belongs to.+ type: object+ ListFilesResponse:+ description: Response for `ListFiles`.+ example:+ nextPageToken: nextPageToken+ files:+ - displayName: displayName+ updateTime: 2000-01-23T04:56:07.000+00:00+ source: SOURCE_UNSPECIFIED+ mimeType: mimeType+ downloadUri: downloadUri+ error: ""+ uri: uri+ videoMetadata: ""+ sizeBytes: sizeBytes+ createTime: 2000-01-23T04:56:07.000+00:00+ sha256Hash: sha256Hash+ expirationTime: 2000-01-23T04:56:07.000+00:00+ name: name+ state: STATE_UNSPECIFIED+ - displayName: displayName+ updateTime: 2000-01-23T04:56:07.000+00:00+ source: SOURCE_UNSPECIFIED+ mimeType: mimeType+ downloadUri: downloadUri+ error: ""+ uri: uri+ videoMetadata: ""+ sizeBytes: sizeBytes+ createTime: 2000-01-23T04:56:07.000+00:00+ sha256Hash: sha256Hash+ expirationTime: 2000-01-23T04:56:07.000+00:00+ name: name+ state: STATE_UNSPECIFIED+ properties:+ nextPageToken:+ description: |-+ A token that can be sent as a `page_token` into a subsequent `ListFiles`+ call.+ type: string+ files:+ description: The list of `File`s.+ items:+ $ref: '#/components/schemas/File'+ type: array+ type: object+ Type:+ enum:+ - TYPE_UNSPECIFIED+ - STRING+ - NUMBER+ - INTEGER+ - BOOLEAN+ - ARRAY+ - OBJECT+ - "NULL"+ type: string+ x-google-enum-descriptions:+ - "Not specified, should not be used."+ - String type.+ - Number type.+ - Integer type.+ - Boolean type.+ - Array type.+ - Object type.+ - Null type.+ BatchEmbedContentsRequest:+ description: Batch request to get embeddings from the model for a list of prompts.+ example:+ requests:+ - taskType: ""+ outputDimensionality: 0+ model: model+ title: title+ content: ""+ - taskType: ""+ outputDimensionality: 0+ model: model+ title: title+ content: ""+ properties:+ requests:+ description: |-+ Required. Embed requests for the batch. The model in each of these requests must+ match the model specified `BatchEmbedContentsRequest.model`.+ items:+ $ref: '#/components/schemas/EmbedContentRequest'+ type: array+ required:+ - requests+ type: object+ TransferOwnershipResponse:+ description: Response from `TransferOwnership`.+ type: object+ PromptFeedback:+ description: |-+ A set of the feedback metadata the prompt specified in+ `GenerateContentRequest.content`.+ properties:+ blockReason:+ description: |-+ Optional. If set, the prompt was blocked and no candidates are returned.+ Rephrase the prompt.+ enum:+ - BLOCK_REASON_UNSPECIFIED+ - SAFETY+ - OTHER+ - BLOCKLIST+ - PROHIBITED_CONTENT+ - IMAGE_SAFETY+ type: string+ x-google-enum-descriptions:+ - Default value. This value is unused.+ - |-+ Prompt was blocked due to safety reasons. Inspect `safety_ratings`+ to understand which safety category blocked it.+ - Prompt was blocked due to unknown reasons.+ - |-+ Prompt was blocked due to the terms which are included from the+ terminology blocklist.+ - Prompt was blocked due to prohibited content.+ - Candidates blocked due to unsafe image generation content.+ safetyRatings:+ description: |-+ Ratings for safety of the prompt.+ There is at most one rating per category.+ items:+ $ref: '#/components/schemas/SafetyRating'+ type: array+ type: object+ InputFeedback:+ description: |-+ Feedback related to the input data used to answer the question, as opposed+ to the model-generated response to the question.+ properties:+ safetyRatings:+ description: |-+ Ratings for safety of the input.+ There is at most one rating per category.+ items:+ $ref: '#/components/schemas/SafetyRating'+ type: array+ blockReason:+ description: |-+ Optional. If set, the input was blocked and no candidates are returned.+ Rephrase the input.+ enum:+ - BLOCK_REASON_UNSPECIFIED+ - SAFETY+ - OTHER+ type: string+ x-google-enum-descriptions:+ - Default value. This value is unused.+ - |-+ Input was blocked due to safety reasons. Inspect+ `safety_ratings` to understand which safety category blocked it.+ - Input was blocked due to other reasons.+ type: object+ RelevantChunk:+ description: The information for a chunk relevant to a query.+ example:+ chunkRelevanceScore: 0.8008282+ chunk: ""+ properties:+ chunk:+ allOf:+ - $ref: '#/components/schemas/Chunk'+ description: '`Chunk` associated with the query.'+ chunkRelevanceScore:+ description: '`Chunk` relevance to the query.'+ format: float+ type: number+ type: object+ QueryDocumentRequest:+ description: Request for querying a `Document`.+ example:+ query: query+ resultsCount: 0+ metadataFilters:+ - conditions:+ - stringValue: stringValue+ numericValue: 0.8008282+ operation: OPERATOR_UNSPECIFIED+ - stringValue: stringValue+ numericValue: 0.8008282+ operation: OPERATOR_UNSPECIFIED+ key: key+ - conditions:+ - stringValue: stringValue+ numericValue: 0.8008282+ operation: OPERATOR_UNSPECIFIED+ - stringValue: stringValue+ numericValue: 0.8008282+ operation: OPERATOR_UNSPECIFIED+ key: key+ properties:+ query:+ description: Required. Query string to perform semantic search.+ type: string+ resultsCount:+ description: |-+ Optional. The maximum number of `Chunk`s to return.+ The service may return fewer `Chunk`s.++ If unspecified, at most 10 `Chunk`s will be returned.+ The maximum specified result count is 100.+ format: int32+ type: integer+ metadataFilters:+ description: |-+ Optional. Filter for `Chunk` metadata. Each `MetadataFilter` object should+ correspond to a unique key. Multiple `MetadataFilter` objects are joined by+ logical "AND"s.++ Note: `Document`-level filtering is not supported for this request because+ a `Document` name is already specified.++ Example query:+ (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action)++ `MetadataFilter` object list:+ metadata_filters = [+ {key = "chunk.custom_metadata.year"+ conditions = [{int_value = 2020, operation = GREATER_EQUAL},+ {int_value = 2010, operation = LESS}},+ {key = "chunk.custom_metadata.genre"+ conditions = [{string_value = "drama", operation = EQUAL},+ {string_value = "action", operation = EQUAL}}]++ Example query for a numeric range of values:+ (year > 2015 AND year <= 2020)++ `MetadataFilter` object list:+ metadata_filters = [+ {key = "chunk.custom_metadata.year"+ conditions = [{int_value = 2015, operation = GREATER}]},+ {key = "chunk.custom_metadata.year"+ conditions = [{int_value = 2020, operation = LESS_EQUAL}]}]++ Note: "AND"s for the same key are only supported for numeric values. String+ values only support "OR"s for the same key.+ items:+ $ref: '#/components/schemas/MetadataFilter'+ type: array+ required:+ - query+ type: object+ FunctionResponse:+ description: |-+ The result output from a `FunctionCall` that contains a string+ representing the `FunctionDeclaration.name` and a structured JSON+ object containing any output from the function is used as context to+ the model. This should contain the result of a`FunctionCall` made+ based on model prediction.+ properties:+ scheduling:+ description: |-+ Optional. Specifies how the response should be scheduled in the conversation.+ Only applicable to NON_BLOCKING function calls, is ignored otherwise.+ Defaults to WHEN_IDLE.+ enum:+ - SCHEDULING_UNSPECIFIED+ - SILENT+ - WHEN_IDLE+ - INTERRUPT+ type: string+ x-google-enum-descriptions:+ - This value is unused.+ - |-+ Only add the result to the conversation context, do not interrupt or+ trigger generation.+ - |-+ Add the result to the conversation context, and prompt to generate output+ without interrupting ongoing generation.+ - |-+ Add the result to the conversation context, interrupt ongoing generation+ and prompt to generate output.+ id:+ description: |-+ Optional. The id of the function call this response is for. Populated by the client+ to match the corresponding function call `id`.+ type: string+ willContinue:+ description: |-+ Optional. Signals that function call continues, and more responses will be+ returned, turning the function call into a generator.+ Is only applicable to NON_BLOCKING function calls, is ignored otherwise.+ If set to false, future responses will not be considered.+ It is allowed to return empty `response` with `will_continue=False` to+ signal that the function call is finished. This may still trigger the model+ generation. To avoid triggering the generation and finish the function+ call, additionally set `scheduling` to `SILENT`.+ type: boolean+ name:+ description: |-+ Required. The name of the function to call.+ Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum+ length of 63.+ type: string+ response:+ additionalProperties:+ description: Properties of the object.+ description: Required. The function response in JSON object format.+ type: object+ required:+ - name+ - response+ type: object+ CreateChunkRequest:+ description: Request to create a `Chunk`.+ example:+ parent: parent+ chunk: ""+ properties:+ parent:+ description: |-+ Required. The name of the `Document` where this `Chunk` will be created.+ Example: `corpora/my-corpus-123/documents/the-doc-abc`+ type: string+ chunk:+ allOf:+ - $ref: '#/components/schemas/Chunk'+ description: Required. The `Chunk` to create.+ required:+ - chunk+ - parent+ type: object+ BatchEmbedTextRequest:+ description: Batch request to get a text embedding from the model.+ example:+ texts:+ - texts+ - texts+ requests:+ - model: model+ text: text+ - model: model+ text: text+ properties:+ requests:+ description: Optional. Embed requests for the batch. Only one of `texts`+ or `requests` can be set.+ items:+ $ref: '#/components/schemas/EmbedTextRequest'+ type: array+ texts:+ description: |-+ Optional. The free-form input texts that the model will turn into an embedding. The+ current limit is 100 texts, over which an error will be thrown.+ items:+ type: string+ type: array+ type: object+ SpeakerVoiceConfig:+ description: The configuration for a single speaker in a multi speaker setup.+ properties:+ voiceConfig:+ allOf:+ - $ref: '#/components/schemas/VoiceConfig'+ description: Required. The configuration for the voice to use.+ speaker:+ description: Required. The name of the speaker to use. Should be the same+ as in the prompt.+ type: string+ required:+ - speaker+ - voiceConfig+ type: object+ ListTunedModelsResponse:+ description: Response from `ListTunedModels` containing a paginated list of+ Models.+ example:+ nextPageToken: nextPageToken+ tunedModels:+ - topK: 1+ baseModel: baseModel+ displayName: displayName+ description: description+ updateTime: 2000-01-23T04:56:07.000+00:00+ topP: 6.0274563+ createTime: 2000-01-23T04:56:07.000+00:00+ tunedModelSource: ""+ readerProjectNumbers:+ - readerProjectNumbers+ - readerProjectNumbers+ name: name+ temperature: 0.8008282+ state: STATE_UNSPECIFIED+ tuningTask: ""+ - topK: 1+ baseModel: baseModel+ displayName: displayName+ description: description+ updateTime: 2000-01-23T04:56:07.000+00:00+ topP: 6.0274563+ createTime: 2000-01-23T04:56:07.000+00:00+ tunedModelSource: ""+ readerProjectNumbers:+ - readerProjectNumbers+ - readerProjectNumbers+ name: name+ temperature: 0.8008282+ state: STATE_UNSPECIFIED+ tuningTask: ""+ properties:+ nextPageToken:+ description: |-+ A token, which can be sent as `page_token` to retrieve the next page.++ If this field is omitted, there are no more pages.+ type: string+ tunedModels:+ description: The returned Models.+ items:+ $ref: '#/components/schemas/TunedModel'+ type: array+ type: object+ Modality:+ enum:+ - MODALITY_UNSPECIFIED+ - TEXT+ - IMAGE+ - VIDEO+ - AUDIO+ - DOCUMENT+ type: string+ x-google-enum-descriptions:+ - Unspecified modality.+ - Plain text.+ - Image.+ - Video.+ - Audio.+ - "Document, e.g. PDF."+ Chunk:+ description: |-+ A `Chunk` is a subpart of a `Document` that is treated as an independent unit+ for the purposes of vector representation and storage.+ A `Corpus` can have a maximum of 1 million `Chunk`s.+ example:+ data: ""+ createTime: 2000-01-23T04:56:07.000+00:00+ customMetadata:+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ - stringValue: stringValue+ stringListValue: ""+ numericValue: 0.8008282+ key: key+ name: name+ updateTime: 2000-01-23T04:56:07.000+00:00+ state: STATE_UNSPECIFIED+ properties:+ createTime:+ description: Output only. The Timestamp of when the `Chunk` was created.+ format: date-time+ readOnly: true+ type: string+ customMetadata:+ description: |-+ Optional. User provided custom metadata stored as key-value pairs.+ The maximum number of `CustomMetadata` per chunk is 20.+ items:+ $ref: '#/components/schemas/CustomMetadata'+ type: array+ data:+ allOf:+ - $ref: '#/components/schemas/ChunkData'+ description: |-+ Required. The content for the `Chunk`, such as the text string.+ The maximum number of tokens per chunk is 2043.+ updateTime:+ description: Output only. The Timestamp of when the `Chunk` was last updated.+ format: date-time+ readOnly: true+ type: string+ state:+ description: Output only. Current state of the `Chunk`.+ enum:+ - STATE_UNSPECIFIED+ - STATE_PENDING_PROCESSING+ - STATE_ACTIVE+ - STATE_FAILED+ readOnly: true+ type: string+ x-google-enum-descriptions:+ - The default value. This value is used if the state is omitted.+ - '`Chunk` is being processed (embedding and vector storage).'+ - '`Chunk` is processed and available for querying.'+ - '`Chunk` failed processing.'+ name:+ description: |-+ Immutable. Identifier. The `Chunk` resource name. The ID (name excluding the+ "corpora/*/documents/*/chunks/" prefix) can contain up to 40 characters+ that are lowercase alphanumeric or dashes (-). The ID cannot start or end+ with a dash. If the name is empty on create, a random 12-character unique+ ID will be generated.+ Example: `corpora/{corpus_id}/documents/{document_id}/chunks/123a456b789c`+ type: string+ x-google-immutable: true+ x-google-identifier: true+ required:+ - data+ type: object+ GenerateMessageResponse:+ description: |-+ The response from the model.++ This includes candidate messages and+ conversation history in the form of chronologically-ordered messages.+ example:+ candidates:+ - citationMetadata: ""+ author: author+ content: content+ - citationMetadata: ""+ author: author+ content: content+ messages:+ - citationMetadata: ""+ author: author+ content: content+ - citationMetadata: ""+ author: author+ content: content+ filters:+ - reason: BLOCKED_REASON_UNSPECIFIED+ message: message+ - reason: BLOCKED_REASON_UNSPECIFIED+ message: message+ properties:+ candidates:+ description: Candidate response messages from the model.+ items:+ $ref: '#/components/schemas/Message'+ type: array+ messages:+ description: The conversation history used by the model.+ items:+ $ref: '#/components/schemas/Message'+ type: array+ filters:+ description: |-+ A set of content filtering metadata for the prompt and response+ text.++ This indicates which `SafetyCategory`(s) blocked a+ candidate from this response, the lowest `HarmProbability`+ that triggered a block, and the HarmThreshold setting for that category.+ items:+ $ref: '#/components/schemas/ContentFilter'+ type: array+ type: object+ UpdateChunkRequest:+ description: Request to update a `Chunk`.+ example:+ chunk: ""+ updateMask: updateMask+ properties:+ updateMask:+ description: |-+ Required. The list of fields to update.+ Currently, this only supports updating `custom_metadata` and `data`.+ format: google-fieldmask+ pattern: "^(\\s*[^,\\s.]+(\\s*[,.]\\s*[^,\\s.]+)*)?$"+ type: string+ chunk:+ allOf:+ - $ref: '#/components/schemas/Chunk'+ description: Required. The `Chunk` to update.+ required:+ - chunk+ - updateMask+ type: object+ GoogleSearch:+ description: |-+ GoogleSearch tool type.+ Tool to support Google Search in Model. Powered by Google.+ properties:+ timeRangeFilter:+ allOf:+ - $ref: '#/components/schemas/Interval'+ description: |-+ Optional. Filter search results to a specific time range.+ If customers set a start time, they must set an end time (and vice+ versa).+ type: object+ PredictResponse:+ description: "Response message for [PredictionService.Predict]."+ example:+ predictions:+ - ""+ - ""+ properties:+ predictions:+ description: The outputs of the prediction call.+ items: {}+ type: array+ type: object+ Status:+ description: |-+ The `Status` type defines a logical error model that is suitable for+ different programming environments, including REST APIs and RPC APIs. It is+ used by [gRPC](https://github.com/grpc). Each `Status` message contains+ three pieces of data: error code, error message, and error details.++ You can find out more about this error model and how to work with it in the+ [API Design Guide](https://cloud.google.com/apis/design/errors).+ properties:+ code:+ description: "The status code, which should be an enum value of google.rpc.Code."+ format: int32+ type: integer+ details:+ description: |-+ A list of messages that carry the error details. There is a common set of+ message types for APIs to use.+ items:+ additionalProperties:+ description: Properties of the object. Contains field @type with type+ URL.+ type: object+ type: array+ message:+ description: |-+ A developer-facing error message, which should be in English. Any+ user-facing error message should be localized and sent in the+ google.rpc.Status.details field, or localized by the client.+ type: string+ type: object+ Segment:+ description: Segment of the content.+ properties:+ partIndex:+ description: Output only. The index of a Part object within its parent Content+ object.+ format: int32+ readOnly: true+ type: integer+ startIndex:+ description: |-+ Output only. Start index in the given Part, measured in bytes. Offset from the start of+ the Part, inclusive, starting at zero.+ format: int32+ readOnly: true+ type: integer+ text:+ description: Output only. The text corresponding to the segment from the+ response.+ readOnly: true+ type: string+ endIndex:+ description: |-+ Output only. End index in the given Part, measured in bytes. Offset from the start of+ the Part, exclusive, starting at zero.+ format: int32+ readOnly: true+ type: integer+ type: object+ securitySchemes: {}
+ tests/ApproxEq.hs view
@@ -0,0 +1,98 @@+{-# LANGUAGE DefaultSignatures #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeOperators #-}+{-# OPTIONS_GHC -fno-warn-orphans #-}++module ApproxEq where++import Data.Text (Text)+import Data.Time.Clock+import GHC.Generics as G+import Test.QuickCheck++(==~) ::+ (ApproxEq a, Show a) =>+ a ->+ a ->+ Property+a ==~ b = counterexample (show a ++ " !=~ " ++ show b) (a =~ b)++class GApproxEq f where+ gApproxEq :: f a -> f a -> Bool++instance GApproxEq U1 where+ gApproxEq U1 U1 = True++instance+ (GApproxEq a, GApproxEq b) =>+ GApproxEq (a :+: b)+ where+ gApproxEq (L1 a) (L1 b) = gApproxEq a b+ gApproxEq (R1 a) (R1 b) = gApproxEq a b+ gApproxEq _ _ = False++instance+ (GApproxEq a, GApproxEq b) =>+ GApproxEq (a :*: b)+ where+ gApproxEq (a1 :*: b1) (a2 :*: b2) = gApproxEq a1 a2 && gApproxEq b1 b2++instance+ (ApproxEq a) =>+ GApproxEq (K1 i a)+ where+ gApproxEq (K1 a) (K1 b) = a =~ b++instance+ (GApproxEq f) =>+ GApproxEq (M1 i t f)+ where+ gApproxEq (M1 a) (M1 b) = gApproxEq a b++class ApproxEq a where+ (=~) :: a -> a -> Bool+ default (=~) :: (Generic a, GApproxEq (Rep a)) => a -> a -> Bool+ a =~ b = gApproxEq (G.from a) (G.from b)++instance ApproxEq Text where+ (=~) = (==)++instance ApproxEq Char where+ (=~) = (==)++instance ApproxEq Bool where+ (=~) = (==)++instance ApproxEq Int where+ (=~) = (==)++instance ApproxEq Double where+ (=~) = (==)++instance+ (ApproxEq a) =>+ ApproxEq (Maybe a)++instance ApproxEq UTCTime where+ (=~) = (==)++instance+ (ApproxEq a) =>+ ApproxEq [a]+ where+ as =~ bs = and (zipWith (=~) as bs)++instance+ (ApproxEq l, ApproxEq r) =>+ ApproxEq (Either l r)+ where+ Left a =~ Left b = a =~ b+ Right a =~ Right b = a =~ b+ _ =~ _ = False++instance+ (ApproxEq l, ApproxEq r) =>+ ApproxEq (l, r)+ where+ (=~) (l1, r1) (l2, r2) = l1 =~ l2 && r1 =~ r2
+ tests/Instances.hs view
@@ -0,0 +1,1682 @@+{-# LANGUAGE CPP #-}+{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-matches #-}++module Instances where++import GenAI.Client.Core+import GenAI.Client.Model++import Data.Aeson qualified as A+import Data.ByteString.Lazy qualified as BL+import Data.HashMap.Strict qualified as HM+import Data.Set qualified as Set+import Data.String (fromString)+import Data.Text qualified as T+import Data.Time qualified as TI+import Data.Vector qualified as V++import Control.Monad+import Data.Char (isSpace)+import Data.List (sort)+import Test.QuickCheck++import ApproxEq++instance Arbitrary T.Text where+ arbitrary = T.pack <$> arbitrary++instance Arbitrary TI.Day where+ arbitrary = TI.ModifiedJulianDay . (2000 +) <$> arbitrary+ shrink = (TI.ModifiedJulianDay <$>) . shrink . TI.toModifiedJulianDay++instance Arbitrary TI.UTCTime where+ arbitrary =+ TI.UTCTime <$> arbitrary <*> (TI.secondsToDiffTime <$> choose (0, 86401))++instance Arbitrary BL.ByteString where+ arbitrary = BL.pack <$> arbitrary+ shrink xs = BL.pack <$> shrink (BL.unpack xs)++instance Arbitrary ByteArray where+ arbitrary = ByteArray <$> arbitrary+ shrink (ByteArray xs) = ByteArray <$> shrink xs++instance Arbitrary Binary where+ arbitrary = Binary <$> arbitrary+ shrink (Binary xs) = Binary <$> shrink xs++instance Arbitrary DateTime where+ arbitrary = DateTime <$> arbitrary+ shrink (DateTime xs) = DateTime <$> shrink xs++instance Arbitrary Date where+ arbitrary = Date <$> arbitrary+ shrink (Date xs) = Date <$> shrink xs++#if MIN_VERSION_aeson(2,0,0)+#else+-- | A naive Arbitrary instance for A.Value:+instance Arbitrary A.Value where+ arbitrary = arbitraryValue+#endif++arbitraryValue :: Gen A.Value+arbitraryValue =+ frequency [(3, simpleTypes), (1, arrayTypes), (1, objectTypes)]+ where+ simpleTypes :: Gen A.Value+ simpleTypes =+ frequency+ [ (1, return A.Null)+ , (2, liftM A.Bool (arbitrary :: Gen Bool))+ , (2, liftM (A.Number . fromIntegral) (arbitrary :: Gen Int))+ , (2, liftM (A.String . T.pack) (arbitrary :: Gen String))+ ]+ mapF (k, v) = (fromString k, v)+ simpleAndArrays = frequency [(1, sized sizedArray), (4, simpleTypes)]+ arrayTypes = sized sizedArray+ objectTypes = sized sizedObject+ sizedArray n = liftM (A.Array . V.fromList) $ replicateM n simpleTypes+ sizedObject n =+ liftM (A.object . map mapF) $+ replicateM n $+ (,) <$> (arbitrary :: Gen String) <*> simpleAndArrays++-- | Checks if a given list has no duplicates in _O(n log n)_.+hasNoDups ::+ (Ord a) =>+ [a] ->+ Bool+hasNoDups = go Set.empty+ where+ go _ [] = True+ go s (x : xs)+ | s' <- Set.insert x s+ , Set.size s' > Set.size s =+ go s' xs+ | otherwise = False++instance ApproxEq TI.Day where+ (=~) = (==)++arbitraryReduced :: (Arbitrary a) => Int -> Gen a+arbitraryReduced n = resize (n `div` 2) arbitrary++arbitraryReducedMaybe :: (Arbitrary a) => Int -> Gen (Maybe a)+arbitraryReducedMaybe 0 = elements [Nothing]+arbitraryReducedMaybe n = arbitraryReduced n++arbitraryReducedMaybeValue :: Int -> Gen (Maybe A.Value)+arbitraryReducedMaybeValue 0 = elements [Nothing]+arbitraryReducedMaybeValue n = do+ generated <- arbitraryReduced n+ if generated == Just A.Null+ then return Nothing+ else return generated++-- * Models++instance Arbitrary AttributionSourceId where+ arbitrary = sized genAttributionSourceId++genAttributionSourceId :: Int -> Gen AttributionSourceId+genAttributionSourceId n =+ AttributionSourceId+ <$> arbitraryReducedMaybe n -- attributionSourceIdGroundingPassage :: Maybe GroundingPassageId+ <*> arbitraryReducedMaybe n -- attributionSourceIdSemanticRetrieverChunk :: Maybe SemanticRetrieverChunk++instance Arbitrary BaseOperation where+ arbitrary = sized genBaseOperation++genBaseOperation :: Int -> Gen BaseOperation+genBaseOperation n =+ BaseOperation+ <$> arbitraryReducedMaybe n -- baseOperationDone :: Maybe Bool+ <*> arbitraryReducedMaybe n -- baseOperationName :: Maybe Text+ <*> arbitraryReducedMaybe n -- baseOperationError :: Maybe Status++instance Arbitrary BatchCreateChunksRequest where+ arbitrary = sized genBatchCreateChunksRequest++genBatchCreateChunksRequest :: Int -> Gen BatchCreateChunksRequest+genBatchCreateChunksRequest n =+ BatchCreateChunksRequest+ <$> arbitraryReduced n -- batchCreateChunksRequestRequests :: [CreateChunkRequest]++instance Arbitrary BatchCreateChunksResponse where+ arbitrary = sized genBatchCreateChunksResponse++genBatchCreateChunksResponse :: Int -> Gen BatchCreateChunksResponse+genBatchCreateChunksResponse n =+ BatchCreateChunksResponse+ <$> arbitraryReducedMaybe n -- batchCreateChunksResponseChunks :: Maybe [Chunk]++instance Arbitrary BatchDeleteChunksRequest where+ arbitrary = sized genBatchDeleteChunksRequest++genBatchDeleteChunksRequest :: Int -> Gen BatchDeleteChunksRequest+genBatchDeleteChunksRequest n =+ BatchDeleteChunksRequest+ <$> arbitraryReduced n -- batchDeleteChunksRequestRequests :: [DeleteChunkRequest]++instance Arbitrary BatchEmbedContentsRequest where+ arbitrary = sized genBatchEmbedContentsRequest++genBatchEmbedContentsRequest :: Int -> Gen BatchEmbedContentsRequest+genBatchEmbedContentsRequest n =+ BatchEmbedContentsRequest+ <$> arbitraryReduced n -- batchEmbedContentsRequestRequests :: [EmbedContentRequest]++instance Arbitrary BatchEmbedContentsResponse where+ arbitrary = sized genBatchEmbedContentsResponse++genBatchEmbedContentsResponse :: Int -> Gen BatchEmbedContentsResponse+genBatchEmbedContentsResponse n =+ BatchEmbedContentsResponse+ <$> arbitraryReducedMaybe n -- batchEmbedContentsResponseEmbeddings :: Maybe [ContentEmbedding]++instance Arbitrary BatchEmbedTextRequest where+ arbitrary = sized genBatchEmbedTextRequest++genBatchEmbedTextRequest :: Int -> Gen BatchEmbedTextRequest+genBatchEmbedTextRequest n =+ BatchEmbedTextRequest+ <$> arbitraryReducedMaybe n -- batchEmbedTextRequestRequests :: Maybe [EmbedTextRequest]+ <*> arbitraryReducedMaybe n -- batchEmbedTextRequestTexts :: Maybe [Text]++instance Arbitrary BatchEmbedTextResponse where+ arbitrary = sized genBatchEmbedTextResponse++genBatchEmbedTextResponse :: Int -> Gen BatchEmbedTextResponse+genBatchEmbedTextResponse n =+ BatchEmbedTextResponse+ <$> arbitraryReducedMaybe n -- batchEmbedTextResponseEmbeddings :: Maybe [Embedding]++instance Arbitrary BatchUpdateChunksRequest where+ arbitrary = sized genBatchUpdateChunksRequest++genBatchUpdateChunksRequest :: Int -> Gen BatchUpdateChunksRequest+genBatchUpdateChunksRequest n =+ BatchUpdateChunksRequest+ <$> arbitraryReduced n -- batchUpdateChunksRequestRequests :: [UpdateChunkRequest]++instance Arbitrary BatchUpdateChunksResponse where+ arbitrary = sized genBatchUpdateChunksResponse++genBatchUpdateChunksResponse :: Int -> Gen BatchUpdateChunksResponse+genBatchUpdateChunksResponse n =+ BatchUpdateChunksResponse+ <$> arbitraryReducedMaybe n -- batchUpdateChunksResponseChunks :: Maybe [Chunk]++instance Arbitrary Blob where+ arbitrary = sized genBlob++genBlob :: Int -> Gen Blob+genBlob n =+ Blob+ <$> arbitraryReducedMaybe n -- blobData :: Maybe ByteArray+ <*> arbitraryReducedMaybe n -- blobMimeType :: Maybe Text++instance Arbitrary CachedContent where+ arbitrary = sized genCachedContent++genCachedContent :: Int -> Gen CachedContent+genCachedContent n =+ CachedContent+ <$> arbitraryReducedMaybe n -- cachedContentTools :: Maybe [Tool]+ <*> arbitraryReducedMaybe n -- cachedContentDisplayName :: Maybe Text+ <*> arbitrary -- cachedContentModel :: Text+ <*> arbitraryReducedMaybe n -- cachedContentExpireTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- cachedContentUsageMetadata :: Maybe CachedContentUsageMetadata+ <*> arbitraryReducedMaybe n -- cachedContentName :: Maybe Text+ <*> arbitraryReducedMaybe n -- cachedContentContents :: Maybe [Content]+ <*> arbitraryReducedMaybe n -- cachedContentSystemInstruction :: Maybe Content+ <*> arbitraryReducedMaybe n -- cachedContentToolConfig :: Maybe ToolConfig+ <*> arbitraryReducedMaybe n -- cachedContentCreateTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- cachedContentTtl :: Maybe Text+ <*> arbitraryReducedMaybe n -- cachedContentUpdateTime :: Maybe DateTime++instance Arbitrary CachedContentUsageMetadata where+ arbitrary = sized genCachedContentUsageMetadata++genCachedContentUsageMetadata :: Int -> Gen CachedContentUsageMetadata+genCachedContentUsageMetadata n =+ CachedContentUsageMetadata+ <$> arbitraryReducedMaybe n -- cachedContentUsageMetadataTotalTokenCount :: Maybe Int++instance Arbitrary Candidate where+ arbitrary = sized genCandidate++genCandidate :: Int -> Gen Candidate+genCandidate n =+ Candidate+ <$> arbitraryReducedMaybe n -- candidateCitationMetadata :: Maybe CitationMetadata+ <*> arbitraryReducedMaybe n -- candidateGroundingMetadata :: Maybe GroundingMetadata+ <*> arbitraryReducedMaybe n -- candidateUrlContextMetadata :: Maybe UrlContextMetadata+ <*> arbitraryReducedMaybe n -- candidateGroundingAttributions :: Maybe [GroundingAttribution]+ <*> arbitraryReducedMaybe n -- candidateLogprobsResult :: Maybe LogprobsResult+ <*> arbitraryReducedMaybe n -- candidateContent :: Maybe Content+ <*> arbitraryReducedMaybe n -- candidateAvgLogprobs :: Maybe Double+ <*> arbitraryReducedMaybe n -- candidateIndex :: Maybe Int+ <*> arbitraryReducedMaybe n -- candidateFinishReason :: Maybe E'FinishReason+ <*> arbitraryReducedMaybe n -- candidateSafetyRatings :: Maybe [SafetyRating]+ <*> arbitraryReducedMaybe n -- candidateTokenCount :: Maybe Int++instance Arbitrary Chunk where+ arbitrary = sized genChunk++genChunk :: Int -> Gen Chunk+genChunk n =+ Chunk+ <$> arbitraryReducedMaybe n -- chunkCreateTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- chunkCustomMetadata :: Maybe [CustomMetadata]+ <*> arbitraryReduced n -- chunkData :: ChunkData+ <*> arbitraryReducedMaybe n -- chunkUpdateTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- chunkState :: Maybe E'State4+ <*> arbitraryReducedMaybe n -- chunkName :: Maybe Text++instance Arbitrary ChunkData where+ arbitrary = sized genChunkData++genChunkData :: Int -> Gen ChunkData+genChunkData n =+ ChunkData+ <$> arbitraryReducedMaybe n -- chunkDataStringValue :: Maybe Text++instance Arbitrary CitationMetadata where+ arbitrary = sized genCitationMetadata++genCitationMetadata :: Int -> Gen CitationMetadata+genCitationMetadata n =+ CitationMetadata+ <$> arbitraryReducedMaybe n -- citationMetadataCitationSources :: Maybe [CitationSource]++instance Arbitrary CitationSource where+ arbitrary = sized genCitationSource++genCitationSource :: Int -> Gen CitationSource+genCitationSource n =+ CitationSource+ <$> arbitraryReducedMaybe n -- citationSourceStartIndex :: Maybe Int+ <*> arbitraryReducedMaybe n -- citationSourceUri :: Maybe Text+ <*> arbitraryReducedMaybe n -- citationSourceEndIndex :: Maybe Int+ <*> arbitraryReducedMaybe n -- citationSourceLicense :: Maybe Text++instance Arbitrary CodeExecutionResult where+ arbitrary = sized genCodeExecutionResult++genCodeExecutionResult :: Int -> Gen CodeExecutionResult+genCodeExecutionResult n =+ CodeExecutionResult+ <$> arbitrary -- codeExecutionResultOutcome :: E'Outcome+ <*> arbitraryReducedMaybe n -- codeExecutionResultOutput :: Maybe Text++instance Arbitrary Condition where+ arbitrary = sized genCondition++genCondition :: Int -> Gen Condition+genCondition n =+ Condition+ <$> arbitraryReducedMaybe n -- conditionNumericValue :: Maybe Float+ <*> arbitrary -- conditionOperation :: E'Operation+ <*> arbitraryReducedMaybe n -- conditionStringValue :: Maybe Text++instance Arbitrary Content where+ arbitrary = sized genContent++genContent :: Int -> Gen Content+genContent n =+ Content+ <$> arbitraryReducedMaybe n -- contentParts :: Maybe [Part]+ <*> arbitraryReducedMaybe n -- contentRole :: Maybe Text++instance Arbitrary ContentEmbedding where+ arbitrary = sized genContentEmbedding++genContentEmbedding :: Int -> Gen ContentEmbedding+genContentEmbedding n =+ ContentEmbedding+ <$> arbitraryReducedMaybe n -- contentEmbeddingValues :: Maybe [Float]++instance Arbitrary ContentFilter where+ arbitrary = sized genContentFilter++genContentFilter :: Int -> Gen ContentFilter+genContentFilter n =+ ContentFilter+ <$> arbitraryReducedMaybe n -- contentFilterReason :: Maybe E'Reason+ <*> arbitraryReducedMaybe n -- contentFilterMessage :: Maybe Text++instance Arbitrary Corpus where+ arbitrary = sized genCorpus++genCorpus :: Int -> Gen Corpus+genCorpus n =+ Corpus+ <$> arbitraryReducedMaybe n -- corpusUpdateTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- corpusCreateTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- corpusDisplayName :: Maybe Text+ <*> arbitraryReducedMaybe n -- corpusName :: Maybe Text++instance Arbitrary CountMessageTokensRequest where+ arbitrary = sized genCountMessageTokensRequest++genCountMessageTokensRequest :: Int -> Gen CountMessageTokensRequest+genCountMessageTokensRequest n =+ CountMessageTokensRequest+ <$> arbitraryReduced n -- countMessageTokensRequestPrompt :: MessagePrompt++instance Arbitrary CountMessageTokensResponse where+ arbitrary = sized genCountMessageTokensResponse++genCountMessageTokensResponse :: Int -> Gen CountMessageTokensResponse+genCountMessageTokensResponse n =+ CountMessageTokensResponse+ <$> arbitraryReducedMaybe n -- countMessageTokensResponseTokenCount :: Maybe Int++instance Arbitrary CountTextTokensRequest where+ arbitrary = sized genCountTextTokensRequest++genCountTextTokensRequest :: Int -> Gen CountTextTokensRequest+genCountTextTokensRequest n =+ CountTextTokensRequest+ <$> arbitraryReduced n -- countTextTokensRequestPrompt :: TextPrompt++instance Arbitrary CountTextTokensResponse where+ arbitrary = sized genCountTextTokensResponse++genCountTextTokensResponse :: Int -> Gen CountTextTokensResponse+genCountTextTokensResponse n =+ CountTextTokensResponse+ <$> arbitraryReducedMaybe n -- countTextTokensResponseTokenCount :: Maybe Int++instance Arbitrary CountTokensRequest where+ arbitrary = sized genCountTokensRequest++genCountTokensRequest :: Int -> Gen CountTokensRequest+genCountTokensRequest n =+ CountTokensRequest+ <$> arbitraryReducedMaybe n -- countTokensRequestContents :: Maybe [Content]+ <*> arbitraryReducedMaybe n -- countTokensRequestGenerateContentRequest :: Maybe GenerateContentRequest++instance Arbitrary CountTokensResponse where+ arbitrary = sized genCountTokensResponse++genCountTokensResponse :: Int -> Gen CountTokensResponse+genCountTokensResponse n =+ CountTokensResponse+ <$> arbitraryReducedMaybe n -- countTokensResponseCacheTokensDetails :: Maybe [ModalityTokenCount]+ <*> arbitraryReducedMaybe n -- countTokensResponsePromptTokensDetails :: Maybe [ModalityTokenCount]+ <*> arbitraryReducedMaybe n -- countTokensResponseTotalTokens :: Maybe Int+ <*> arbitraryReducedMaybe n -- countTokensResponseCachedContentTokenCount :: Maybe Int++instance Arbitrary CreateChunkRequest where+ arbitrary = sized genCreateChunkRequest++genCreateChunkRequest :: Int -> Gen CreateChunkRequest+genCreateChunkRequest n =+ CreateChunkRequest+ <$> arbitrary -- createChunkRequestParent :: Text+ <*> arbitraryReduced n -- createChunkRequestChunk :: Chunk++instance Arbitrary CreateFileRequest where+ arbitrary = sized genCreateFileRequest++genCreateFileRequest :: Int -> Gen CreateFileRequest+genCreateFileRequest n =+ CreateFileRequest+ <$> arbitraryReducedMaybe n -- createFileRequestFile :: Maybe File++instance Arbitrary CreateFileResponse where+ arbitrary = sized genCreateFileResponse++genCreateFileResponse :: Int -> Gen CreateFileResponse+genCreateFileResponse n =+ CreateFileResponse+ <$> arbitraryReducedMaybe n -- createFileResponseFile :: Maybe File++instance Arbitrary CreateTunedModelMetadata where+ arbitrary = sized genCreateTunedModelMetadata++genCreateTunedModelMetadata :: Int -> Gen CreateTunedModelMetadata+genCreateTunedModelMetadata n =+ CreateTunedModelMetadata+ <$> arbitraryReducedMaybe n -- createTunedModelMetadataCompletedPercent :: Maybe Float+ <*> arbitraryReducedMaybe n -- createTunedModelMetadataCompletedSteps :: Maybe Int+ <*> arbitraryReducedMaybe n -- createTunedModelMetadataTotalSteps :: Maybe Int+ <*> arbitraryReducedMaybe n -- createTunedModelMetadataSnapshots :: Maybe [TuningSnapshot]+ <*> arbitraryReducedMaybe n -- createTunedModelMetadataTunedModel :: Maybe Text++instance Arbitrary CreateTunedModelOperation where+ arbitrary = sized genCreateTunedModelOperation++genCreateTunedModelOperation :: Int -> Gen CreateTunedModelOperation+genCreateTunedModelOperation n =+ CreateTunedModelOperation+ <$> arbitraryReducedMaybe n -- createTunedModelOperationDone :: Maybe Bool+ <*> arbitraryReducedMaybe n -- createTunedModelOperationName :: Maybe Text+ <*> arbitraryReducedMaybe n -- createTunedModelOperationError :: Maybe Status+ <*> arbitraryReducedMaybe n -- createTunedModelOperationMetadata :: Maybe CreateTunedModelMetadata+ <*> arbitraryReducedMaybe n -- createTunedModelOperationResponse :: Maybe TunedModel++instance Arbitrary CustomMetadata where+ arbitrary = sized genCustomMetadata++genCustomMetadata :: Int -> Gen CustomMetadata+genCustomMetadata n =+ CustomMetadata+ <$> arbitraryReducedMaybe n -- customMetadataStringListValue :: Maybe StringList+ <*> arbitraryReducedMaybe n -- customMetadataStringValue :: Maybe Text+ <*> arbitrary -- customMetadataKey :: Text+ <*> arbitraryReducedMaybe n -- customMetadataNumericValue :: Maybe Float++instance Arbitrary Dataset where+ arbitrary = sized genDataset++genDataset :: Int -> Gen Dataset+genDataset n =+ Dataset+ <$> arbitraryReducedMaybe n -- datasetExamples :: Maybe TuningExamples++instance Arbitrary DeleteChunkRequest where+ arbitrary = sized genDeleteChunkRequest++genDeleteChunkRequest :: Int -> Gen DeleteChunkRequest+genDeleteChunkRequest n =+ DeleteChunkRequest+ <$> arbitrary -- deleteChunkRequestName :: Text++instance Arbitrary Document where+ arbitrary = sized genDocument++genDocument :: Int -> Gen Document+genDocument n =+ Document+ <$> arbitraryReducedMaybe n -- documentUpdateTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- documentName :: Maybe Text+ <*> arbitraryReducedMaybe n -- documentCustomMetadata :: Maybe [CustomMetadata]+ <*> arbitraryReducedMaybe n -- documentCreateTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- documentDisplayName :: Maybe Text++instance Arbitrary DynamicRetrievalConfig where+ arbitrary = sized genDynamicRetrievalConfig++genDynamicRetrievalConfig :: Int -> Gen DynamicRetrievalConfig+genDynamicRetrievalConfig n =+ DynamicRetrievalConfig+ <$> arbitraryReducedMaybe n -- dynamicRetrievalConfigDynamicThreshold :: Maybe Float+ <*> arbitraryReducedMaybe n -- dynamicRetrievalConfigMode :: Maybe E'Mode++instance Arbitrary EmbedContentRequest where+ arbitrary = sized genEmbedContentRequest++genEmbedContentRequest :: Int -> Gen EmbedContentRequest+genEmbedContentRequest n =+ EmbedContentRequest+ <$> arbitraryReducedMaybe n -- embedContentRequestTaskType :: Maybe TaskType+ <*> arbitraryReduced n -- embedContentRequestContent :: Content+ <*> arbitraryReducedMaybe n -- embedContentRequestOutputDimensionality :: Maybe Int+ <*> arbitrary -- embedContentRequestModel :: Text+ <*> arbitraryReducedMaybe n -- embedContentRequestTitle :: Maybe Text++instance Arbitrary EmbedContentResponse where+ arbitrary = sized genEmbedContentResponse++genEmbedContentResponse :: Int -> Gen EmbedContentResponse+genEmbedContentResponse n =+ EmbedContentResponse+ <$> arbitraryReducedMaybe n -- embedContentResponseEmbedding :: Maybe ContentEmbedding++instance Arbitrary EmbedTextRequest where+ arbitrary = sized genEmbedTextRequest++genEmbedTextRequest :: Int -> Gen EmbedTextRequest+genEmbedTextRequest n =+ EmbedTextRequest+ <$> arbitraryReducedMaybe n -- embedTextRequestText :: Maybe Text+ <*> arbitrary -- embedTextRequestModel :: Text++instance Arbitrary EmbedTextResponse where+ arbitrary = sized genEmbedTextResponse++genEmbedTextResponse :: Int -> Gen EmbedTextResponse+genEmbedTextResponse n =+ EmbedTextResponse+ <$> arbitraryReducedMaybe n -- embedTextResponseEmbedding :: Maybe Embedding++instance Arbitrary Embedding where+ arbitrary = sized genEmbedding++genEmbedding :: Int -> Gen Embedding+genEmbedding n =+ Embedding+ <$> arbitraryReducedMaybe n -- embeddingValue :: Maybe [Float]++instance Arbitrary Example where+ arbitrary = sized genExample++genExample :: Int -> Gen Example+genExample n =+ Example+ <$> arbitraryReduced n -- exampleOutput :: Message+ <*> arbitraryReduced n -- exampleInput :: Message++instance Arbitrary ExecutableCode where+ arbitrary = sized genExecutableCode++genExecutableCode :: Int -> Gen ExecutableCode+genExecutableCode n =+ ExecutableCode+ <$> arbitrary -- executableCodeLanguage :: E'Language+ <*> arbitrary -- executableCodeCode :: Text++instance Arbitrary File where+ arbitrary = sized genFile++genFile :: Int -> Gen File+genFile n =+ File+ <$> arbitraryReducedMaybe n -- fileUri :: Maybe Text+ <*> arbitraryReducedMaybe n -- fileName :: Maybe Text+ <*> arbitraryReducedMaybe n -- fileExpirationTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- fileDisplayName :: Maybe Text+ <*> arbitraryReducedMaybe n -- fileVideoMetadata :: Maybe VideoFileMetadata+ <*> arbitraryReducedMaybe n -- fileState :: Maybe E'State+ <*> arbitraryReducedMaybe n -- fileSource :: Maybe E'Source+ <*> arbitraryReducedMaybe n -- fileMimeType :: Maybe Text+ <*> arbitraryReducedMaybe n -- fileCreateTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- fileError :: Maybe Status+ <*> arbitraryReducedMaybe n -- fileDownloadUri :: Maybe Text+ <*> arbitraryReducedMaybe n -- fileSizeBytes :: Maybe Text+ <*> arbitraryReducedMaybe n -- fileSha256Hash :: Maybe ByteArray+ <*> arbitraryReducedMaybe n -- fileUpdateTime :: Maybe DateTime++instance Arbitrary FileData where+ arbitrary = sized genFileData++genFileData :: Int -> Gen FileData+genFileData n =+ FileData+ <$> arbitraryReducedMaybe n -- fileDataMimeType :: Maybe Text+ <*> arbitrary -- fileDataFileUri :: Text++instance Arbitrary FunctionCall where+ arbitrary = sized genFunctionCall++genFunctionCall :: Int -> Gen FunctionCall+genFunctionCall n =+ FunctionCall+ <$> arbitraryReducedMaybe n -- functionCallArgs :: Maybe (Map.Map String String)+ <*> arbitraryReducedMaybe n -- functionCallId :: Maybe Text+ <*> arbitrary -- functionCallName :: Text++instance Arbitrary FunctionCallingConfig where+ arbitrary = sized genFunctionCallingConfig++genFunctionCallingConfig :: Int -> Gen FunctionCallingConfig+genFunctionCallingConfig n =+ FunctionCallingConfig+ <$> arbitraryReducedMaybe n -- functionCallingConfigMode :: Maybe E'Mode2+ <*> arbitraryReducedMaybe n -- functionCallingConfigAllowedFunctionNames :: Maybe [Text]++instance Arbitrary FunctionDeclaration where+ arbitrary = sized genFunctionDeclaration++genFunctionDeclaration :: Int -> Gen FunctionDeclaration+genFunctionDeclaration n =+ FunctionDeclaration+ <$> arbitraryReducedMaybe n -- functionDeclarationParameters :: Maybe Schema+ <*> arbitrary -- functionDeclarationName :: Text+ <*> arbitraryReducedMaybe n -- functionDeclarationBehavior :: Maybe E'Behavior+ <*> arbitrary -- functionDeclarationDescription :: Text+ <*> arbitraryReducedMaybe n -- functionDeclarationResponse :: Maybe Schema+ <*> arbitraryReducedMaybe n -- functionDeclarationResponseJsonSchema :: Maybe String+ <*> arbitraryReducedMaybe n -- functionDeclarationParametersJsonSchema :: Maybe String++instance Arbitrary FunctionResponse where+ arbitrary = sized genFunctionResponse++genFunctionResponse :: Int -> Gen FunctionResponse+genFunctionResponse n =+ FunctionResponse+ <$> arbitraryReducedMaybe n -- functionResponseScheduling :: Maybe E'Scheduling+ <*> arbitraryReducedMaybe n -- functionResponseId :: Maybe Text+ <*> arbitraryReducedMaybe n -- functionResponseWillContinue :: Maybe Bool+ <*> arbitrary -- functionResponseName :: Text+ <*> arbitrary -- functionResponseResponse :: (Map.Map String String)++instance Arbitrary GenerateAnswerRequest where+ arbitrary = sized genGenerateAnswerRequest++genGenerateAnswerRequest :: Int -> Gen GenerateAnswerRequest+genGenerateAnswerRequest n =+ GenerateAnswerRequest+ <$> arbitraryReducedMaybe n -- generateAnswerRequestSemanticRetriever :: Maybe SemanticRetrieverConfig+ <*> arbitraryReducedMaybe n -- generateAnswerRequestTemperature :: Maybe Float+ <*> arbitrary -- generateAnswerRequestAnswerStyle :: E'AnswerStyle+ <*> arbitraryReduced n -- generateAnswerRequestContents :: [Content]+ <*> arbitraryReducedMaybe n -- generateAnswerRequestSafetySettings :: Maybe [SafetySetting]+ <*> arbitraryReducedMaybe n -- generateAnswerRequestInlinePassages :: Maybe GroundingPassages++instance Arbitrary GenerateAnswerResponse where+ arbitrary = sized genGenerateAnswerResponse++genGenerateAnswerResponse :: Int -> Gen GenerateAnswerResponse+genGenerateAnswerResponse n =+ GenerateAnswerResponse+ <$> arbitraryReducedMaybe n -- generateAnswerResponseAnswer :: Maybe Candidate+ <*> arbitraryReducedMaybe n -- generateAnswerResponseInputFeedback :: Maybe InputFeedback+ <*> arbitraryReducedMaybe n -- generateAnswerResponseAnswerableProbability :: Maybe Float++instance Arbitrary GenerateContentRequest where+ arbitrary = sized genGenerateContentRequest++genGenerateContentRequest :: Int -> Gen GenerateContentRequest+genGenerateContentRequest n =+ GenerateContentRequest+ <$> arbitraryReducedMaybe n -- generateContentRequestToolConfig :: Maybe ToolConfig+ <*> arbitraryReducedMaybe n -- generateContentRequestTools :: Maybe [Tool]+ <*> arbitraryReduced n -- generateContentRequestContents :: [Content]+ <*> arbitraryReducedMaybe n -- generateContentRequestSystemInstruction :: Maybe Content+ <*> arbitraryReducedMaybe n -- generateContentRequestCachedContent :: Maybe Text+ <*> arbitraryReducedMaybe n -- generateContentRequestSafetySettings :: Maybe [SafetySetting]+ <*> arbitrary -- generateContentRequestModel :: Text+ <*> arbitraryReducedMaybe n -- generateContentRequestGenerationConfig :: Maybe GenerationConfig++instance Arbitrary GenerateContentResponse where+ arbitrary = sized genGenerateContentResponse++genGenerateContentResponse :: Int -> Gen GenerateContentResponse+genGenerateContentResponse n =+ GenerateContentResponse+ <$> arbitraryReducedMaybe n -- generateContentResponseCandidates :: Maybe [Candidate]+ <*> arbitraryReducedMaybe n -- generateContentResponseUsageMetadata :: Maybe UsageMetadata+ <*> arbitraryReducedMaybe n -- generateContentResponseModelVersion :: Maybe Text+ <*> arbitraryReducedMaybe n -- generateContentResponsePromptFeedback :: Maybe PromptFeedback+ <*> arbitraryReducedMaybe n -- generateContentResponseResponseId :: Maybe Text++instance Arbitrary GenerateMessageRequest where+ arbitrary = sized genGenerateMessageRequest++genGenerateMessageRequest :: Int -> Gen GenerateMessageRequest+genGenerateMessageRequest n =+ GenerateMessageRequest+ <$> arbitraryReducedMaybe n -- generateMessageRequestTemperature :: Maybe Float+ <*> arbitraryReducedMaybe n -- generateMessageRequestTopP :: Maybe Float+ <*> arbitraryReducedMaybe n -- generateMessageRequestCandidateCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- generateMessageRequestTopK :: Maybe Int+ <*> arbitraryReduced n -- generateMessageRequestPrompt :: MessagePrompt++instance Arbitrary GenerateMessageResponse where+ arbitrary = sized genGenerateMessageResponse++genGenerateMessageResponse :: Int -> Gen GenerateMessageResponse+genGenerateMessageResponse n =+ GenerateMessageResponse+ <$> arbitraryReducedMaybe n -- generateMessageResponseCandidates :: Maybe [Message]+ <*> arbitraryReducedMaybe n -- generateMessageResponseMessages :: Maybe [Message]+ <*> arbitraryReducedMaybe n -- generateMessageResponseFilters :: Maybe [ContentFilter]++instance Arbitrary GenerateTextRequest where+ arbitrary = sized genGenerateTextRequest++genGenerateTextRequest :: Int -> Gen GenerateTextRequest+genGenerateTextRequest n =+ GenerateTextRequest+ <$> arbitraryReducedMaybe n -- generateTextRequestStopSequences :: Maybe [Text]+ <*> arbitraryReduced n -- generateTextRequestPrompt :: TextPrompt+ <*> arbitraryReducedMaybe n -- generateTextRequestMaxOutputTokens :: Maybe Int+ <*> arbitraryReducedMaybe n -- generateTextRequestSafetySettings :: Maybe [SafetySetting]+ <*> arbitraryReducedMaybe n -- generateTextRequestTemperature :: Maybe Float+ <*> arbitraryReducedMaybe n -- generateTextRequestTopK :: Maybe Int+ <*> arbitraryReducedMaybe n -- generateTextRequestTopP :: Maybe Float+ <*> arbitraryReducedMaybe n -- generateTextRequestCandidateCount :: Maybe Int++instance Arbitrary GenerateTextResponse where+ arbitrary = sized genGenerateTextResponse++genGenerateTextResponse :: Int -> Gen GenerateTextResponse+genGenerateTextResponse n =+ GenerateTextResponse+ <$> arbitraryReducedMaybe n -- generateTextResponseSafetyFeedback :: Maybe [SafetyFeedback]+ <*> arbitraryReducedMaybe n -- generateTextResponseCandidates :: Maybe [TextCompletion]+ <*> arbitraryReducedMaybe n -- generateTextResponseFilters :: Maybe [ContentFilter]++instance Arbitrary GenerateVideoResponse where+ arbitrary = sized genGenerateVideoResponse++genGenerateVideoResponse :: Int -> Gen GenerateVideoResponse+genGenerateVideoResponse n =+ GenerateVideoResponse+ <$> arbitraryReducedMaybe n -- generateVideoResponseGeneratedSamples :: Maybe [Media]+ <*> arbitraryReducedMaybe n -- generateVideoResponseRaiMediaFilteredCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- generateVideoResponseRaiMediaFilteredReasons :: Maybe [Text]++instance Arbitrary GeneratedFile where+ arbitrary = sized genGeneratedFile++genGeneratedFile :: Int -> Gen GeneratedFile+genGeneratedFile n =+ GeneratedFile+ <$> arbitraryReducedMaybe n -- generatedFileError :: Maybe Status+ <*> arbitraryReducedMaybe n -- generatedFileName :: Maybe Text+ <*> arbitraryReducedMaybe n -- generatedFileState :: Maybe E'State2+ <*> arbitraryReducedMaybe n -- generatedFileMimeType :: Maybe Text++instance Arbitrary GenerationConfig where+ arbitrary = sized genGenerationConfig++genGenerationConfig :: Int -> Gen GenerationConfig+genGenerationConfig n =+ GenerationConfig+ <$> arbitraryReducedMaybe n -- generationConfigResponseSchema :: Maybe Schema+ <*> arbitraryReducedMaybe n -- generationConfigThinkingConfig :: Maybe ThinkingConfig+ <*> arbitraryReducedMaybe n -- generationConfigLogprobs :: Maybe Int+ <*> arbitraryReducedMaybe n -- generationConfigMediaResolution :: Maybe E'MediaResolution+ <*> arbitraryReducedMaybe n -- generationConfigStopSequences :: Maybe [Text]+ <*> arbitraryReducedMaybe n -- generationConfigSpeechConfig :: Maybe SpeechConfig+ <*> arbitraryReducedMaybe n -- generationConfigResponseJsonSchema :: Maybe String+ <*> arbitraryReducedMaybe n -- generationConfigPresencePenalty :: Maybe Float+ <*> arbitraryReducedMaybe n -- generationConfigTopP :: Maybe Float+ <*> arbitraryReducedMaybe n -- generationConfigTemperature :: Maybe Float+ <*> arbitraryReducedMaybe n -- generationConfigTopK :: Maybe Int+ <*> arbitraryReducedMaybe n -- generationConfigCandidateCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- generationConfigEnableEnhancedCivicAnswers :: Maybe Bool+ <*> arbitraryReducedMaybe n -- generationConfigResponseLogprobs :: Maybe Bool+ <*> arbitraryReducedMaybe n -- generationConfigResponseModalities :: Maybe [E'ResponseModalities]+ <*> arbitraryReducedMaybe n -- generationConfigFrequencyPenalty :: Maybe Float+ <*> arbitraryReducedMaybe n -- generationConfigSeed :: Maybe Int+ <*> arbitraryReducedMaybe n -- generationConfigMaxOutputTokens :: Maybe Int+ <*> arbitraryReducedMaybe n -- generationConfigResponseMimeType :: Maybe Text++instance Arbitrary GoogleSearch where+ arbitrary = sized genGoogleSearch++genGoogleSearch :: Int -> Gen GoogleSearch+genGoogleSearch n =+ GoogleSearch+ <$> arbitraryReducedMaybe n -- googleSearchTimeRangeFilter :: Maybe Interval++instance Arbitrary GoogleSearchRetrieval where+ arbitrary = sized genGoogleSearchRetrieval++genGoogleSearchRetrieval :: Int -> Gen GoogleSearchRetrieval+genGoogleSearchRetrieval n =+ GoogleSearchRetrieval+ <$> arbitraryReducedMaybe n -- googleSearchRetrievalDynamicRetrievalConfig :: Maybe DynamicRetrievalConfig++instance Arbitrary GroundingAttribution where+ arbitrary = sized genGroundingAttribution++genGroundingAttribution :: Int -> Gen GroundingAttribution+genGroundingAttribution n =+ GroundingAttribution+ <$> arbitraryReducedMaybe n -- groundingAttributionSourceId :: Maybe AttributionSourceId+ <*> arbitraryReducedMaybe n -- groundingAttributionContent :: Maybe Content++instance Arbitrary GroundingChunk where+ arbitrary = sized genGroundingChunk++genGroundingChunk :: Int -> Gen GroundingChunk+genGroundingChunk n =+ GroundingChunk+ <$> arbitraryReducedMaybe n -- groundingChunkWeb :: Maybe Web++instance Arbitrary GroundingMetadata where+ arbitrary = sized genGroundingMetadata++genGroundingMetadata :: Int -> Gen GroundingMetadata+genGroundingMetadata n =+ GroundingMetadata+ <$> arbitraryReducedMaybe n -- groundingMetadataRetrievalMetadata :: Maybe RetrievalMetadata+ <*> arbitraryReducedMaybe n -- groundingMetadataWebSearchQueries :: Maybe [Text]+ <*> arbitraryReducedMaybe n -- groundingMetadataGroundingChunks :: Maybe [GroundingChunk]+ <*> arbitraryReducedMaybe n -- groundingMetadataSearchEntryPoint :: Maybe SearchEntryPoint+ <*> arbitraryReducedMaybe n -- groundingMetadataGroundingSupports :: Maybe [GroundingSupport]++instance Arbitrary GroundingPassage where+ arbitrary = sized genGroundingPassage++genGroundingPassage :: Int -> Gen GroundingPassage+genGroundingPassage n =+ GroundingPassage+ <$> arbitraryReducedMaybe n -- groundingPassageContent :: Maybe Content+ <*> arbitraryReducedMaybe n -- groundingPassageId :: Maybe Text++instance Arbitrary GroundingPassageId where+ arbitrary = sized genGroundingPassageId++genGroundingPassageId :: Int -> Gen GroundingPassageId+genGroundingPassageId n =+ GroundingPassageId+ <$> arbitraryReducedMaybe n -- groundingPassageIdPassageId :: Maybe Text+ <*> arbitraryReducedMaybe n -- groundingPassageIdPartIndex :: Maybe Int++instance Arbitrary GroundingPassages where+ arbitrary = sized genGroundingPassages++genGroundingPassages :: Int -> Gen GroundingPassages+genGroundingPassages n =+ GroundingPassages+ <$> arbitraryReducedMaybe n -- groundingPassagesPassages :: Maybe [GroundingPassage]++instance Arbitrary GroundingSupport where+ arbitrary = sized genGroundingSupport++genGroundingSupport :: Int -> Gen GroundingSupport+genGroundingSupport n =+ GroundingSupport+ <$> arbitraryReducedMaybe n -- groundingSupportConfidenceScores :: Maybe [Float]+ <*> arbitraryReducedMaybe n -- groundingSupportGroundingChunkIndices :: Maybe [Int]+ <*> arbitraryReducedMaybe n -- groundingSupportSegment :: Maybe Segment++instance Arbitrary Hyperparameters where+ arbitrary = sized genHyperparameters++genHyperparameters :: Int -> Gen Hyperparameters+genHyperparameters n =+ Hyperparameters+ <$> arbitraryReducedMaybe n -- hyperparametersEpochCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- hyperparametersLearningRate :: Maybe Float+ <*> arbitraryReducedMaybe n -- hyperparametersLearningRateMultiplier :: Maybe Float+ <*> arbitraryReducedMaybe n -- hyperparametersBatchSize :: Maybe Int++instance Arbitrary InputFeedback where+ arbitrary = sized genInputFeedback++genInputFeedback :: Int -> Gen InputFeedback+genInputFeedback n =+ InputFeedback+ <$> arbitraryReducedMaybe n -- inputFeedbackSafetyRatings :: Maybe [SafetyRating]+ <*> arbitraryReducedMaybe n -- inputFeedbackBlockReason :: Maybe E'BlockReason2++instance Arbitrary Interval where+ arbitrary = sized genInterval++genInterval :: Int -> Gen Interval+genInterval n =+ Interval+ <$> arbitraryReducedMaybe n -- intervalStartTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- intervalEndTime :: Maybe DateTime++instance Arbitrary ListCachedContentsResponse where+ arbitrary = sized genListCachedContentsResponse++genListCachedContentsResponse :: Int -> Gen ListCachedContentsResponse+genListCachedContentsResponse n =+ ListCachedContentsResponse+ <$> arbitraryReducedMaybe n -- listCachedContentsResponseNextPageToken :: Maybe Text+ <*> arbitraryReducedMaybe n -- listCachedContentsResponseCachedContents :: Maybe [CachedContent]++instance Arbitrary ListChunksResponse where+ arbitrary = sized genListChunksResponse++genListChunksResponse :: Int -> Gen ListChunksResponse+genListChunksResponse n =+ ListChunksResponse+ <$> arbitraryReducedMaybe n -- listChunksResponseNextPageToken :: Maybe Text+ <*> arbitraryReducedMaybe n -- listChunksResponseChunks :: Maybe [Chunk]++instance Arbitrary ListCorporaResponse where+ arbitrary = sized genListCorporaResponse++genListCorporaResponse :: Int -> Gen ListCorporaResponse+genListCorporaResponse n =+ ListCorporaResponse+ <$> arbitraryReducedMaybe n -- listCorporaResponseCorpora :: Maybe [Corpus]+ <*> arbitraryReducedMaybe n -- listCorporaResponseNextPageToken :: Maybe Text++instance Arbitrary ListDocumentsResponse where+ arbitrary = sized genListDocumentsResponse++genListDocumentsResponse :: Int -> Gen ListDocumentsResponse+genListDocumentsResponse n =+ ListDocumentsResponse+ <$> arbitraryReducedMaybe n -- listDocumentsResponseNextPageToken :: Maybe Text+ <*> arbitraryReducedMaybe n -- listDocumentsResponseDocuments :: Maybe [Document]++instance Arbitrary ListFilesResponse where+ arbitrary = sized genListFilesResponse++genListFilesResponse :: Int -> Gen ListFilesResponse+genListFilesResponse n =+ ListFilesResponse+ <$> arbitraryReducedMaybe n -- listFilesResponseNextPageToken :: Maybe Text+ <*> arbitraryReducedMaybe n -- listFilesResponseFiles :: Maybe [File]++instance Arbitrary ListGeneratedFilesResponse where+ arbitrary = sized genListGeneratedFilesResponse++genListGeneratedFilesResponse :: Int -> Gen ListGeneratedFilesResponse+genListGeneratedFilesResponse n =+ ListGeneratedFilesResponse+ <$> arbitraryReducedMaybe n -- listGeneratedFilesResponseNextPageToken :: Maybe Text+ <*> arbitraryReducedMaybe n -- listGeneratedFilesResponseGeneratedFiles :: Maybe [GeneratedFile]++instance Arbitrary ListModelsResponse where+ arbitrary = sized genListModelsResponse++genListModelsResponse :: Int -> Gen ListModelsResponse+genListModelsResponse n =+ ListModelsResponse+ <$> arbitraryReducedMaybe n -- listModelsResponseModels :: Maybe [Model]+ <*> arbitraryReducedMaybe n -- listModelsResponseNextPageToken :: Maybe Text++instance Arbitrary ListOperationsResponse where+ arbitrary = sized genListOperationsResponse++genListOperationsResponse :: Int -> Gen ListOperationsResponse+genListOperationsResponse n =+ ListOperationsResponse+ <$> arbitraryReducedMaybe n -- listOperationsResponseNextPageToken :: Maybe Text+ <*> arbitraryReducedMaybe n -- listOperationsResponseOperations :: Maybe [Operation]++instance Arbitrary ListPermissionsResponse where+ arbitrary = sized genListPermissionsResponse++genListPermissionsResponse :: Int -> Gen ListPermissionsResponse+genListPermissionsResponse n =+ ListPermissionsResponse+ <$> arbitraryReducedMaybe n -- listPermissionsResponsePermissions :: Maybe [Permission]+ <*> arbitraryReducedMaybe n -- listPermissionsResponseNextPageToken :: Maybe Text++instance Arbitrary ListTunedModelsResponse where+ arbitrary = sized genListTunedModelsResponse++genListTunedModelsResponse :: Int -> Gen ListTunedModelsResponse+genListTunedModelsResponse n =+ ListTunedModelsResponse+ <$> arbitraryReducedMaybe n -- listTunedModelsResponseNextPageToken :: Maybe Text+ <*> arbitraryReducedMaybe n -- listTunedModelsResponseTunedModels :: Maybe [TunedModel]++instance Arbitrary LogprobsResult where+ arbitrary = sized genLogprobsResult++genLogprobsResult :: Int -> Gen LogprobsResult+genLogprobsResult n =+ LogprobsResult+ <$> arbitraryReducedMaybe n -- logprobsResultChosenCandidates :: Maybe [LogprobsResultCandidate]+ <*> arbitraryReducedMaybe n -- logprobsResultTopCandidates :: Maybe [TopCandidates]++instance Arbitrary LogprobsResultCandidate where+ arbitrary = sized genLogprobsResultCandidate++genLogprobsResultCandidate :: Int -> Gen LogprobsResultCandidate+genLogprobsResultCandidate n =+ LogprobsResultCandidate+ <$> arbitraryReducedMaybe n -- logprobsResultCandidateLogProbability :: Maybe Float+ <*> arbitraryReducedMaybe n -- logprobsResultCandidateTokenId :: Maybe Int+ <*> arbitraryReducedMaybe n -- logprobsResultCandidateToken :: Maybe Text++instance Arbitrary Media where+ arbitrary = sized genMedia++genMedia :: Int -> Gen Media+genMedia n =+ Media+ <$> arbitraryReducedMaybe n -- mediaVideo :: Maybe Video++instance Arbitrary Message where+ arbitrary = sized genMessage++genMessage :: Int -> Gen Message+genMessage n =+ Message+ <$> arbitraryReducedMaybe n -- messageCitationMetadata :: Maybe CitationMetadata+ <*> arbitraryReducedMaybe n -- messageAuthor :: Maybe Text+ <*> arbitrary -- messageContent :: Text++instance Arbitrary MessagePrompt where+ arbitrary = sized genMessagePrompt++genMessagePrompt :: Int -> Gen MessagePrompt+genMessagePrompt n =+ MessagePrompt+ <$> arbitraryReducedMaybe n -- messagePromptContext :: Maybe Text+ <*> arbitraryReduced n -- messagePromptMessages :: [Message]+ <*> arbitraryReducedMaybe n -- messagePromptExamples :: Maybe [Example]++instance Arbitrary MetadataFilter where+ arbitrary = sized genMetadataFilter++genMetadataFilter :: Int -> Gen MetadataFilter+genMetadataFilter n =+ MetadataFilter+ <$> arbitraryReduced n -- metadataFilterConditions :: [Condition]+ <*> arbitrary -- metadataFilterKey :: Text++instance Arbitrary ModalityTokenCount where+ arbitrary = sized genModalityTokenCount++genModalityTokenCount :: Int -> Gen ModalityTokenCount+genModalityTokenCount n =+ ModalityTokenCount+ <$> arbitraryReducedMaybe n -- modalityTokenCountTokenCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- modalityTokenCountModality :: Maybe Modality++instance Arbitrary Model where+ arbitrary = sized genModel++genModel :: Int -> Gen Model+genModel n =+ Model+ <$> arbitraryReducedMaybe n -- modelTopK :: Maybe Int+ <*> arbitrary -- modelName :: Text+ <*> arbitrary -- modelBaseModelId :: Text+ <*> arbitrary -- modelVersion :: Text+ <*> arbitraryReducedMaybe n -- modelInputTokenLimit :: Maybe Int+ <*> arbitraryReducedMaybe n -- modelTopP :: Maybe Float+ <*> arbitraryReducedMaybe n -- modelSupportedGenerationMethods :: Maybe [Text]+ <*> arbitraryReducedMaybe n -- modelTemperature :: Maybe Float+ <*> arbitraryReducedMaybe n -- modelDisplayName :: Maybe Text+ <*> arbitraryReducedMaybe n -- modelDescription :: Maybe Text+ <*> arbitraryReducedMaybe n -- modelMaxTemperature :: Maybe Float+ <*> arbitraryReducedMaybe n -- modelOutputTokenLimit :: Maybe Int++instance Arbitrary MultiSpeakerVoiceConfig where+ arbitrary = sized genMultiSpeakerVoiceConfig++genMultiSpeakerVoiceConfig :: Int -> Gen MultiSpeakerVoiceConfig+genMultiSpeakerVoiceConfig n =+ MultiSpeakerVoiceConfig+ <$> arbitraryReduced n -- multiSpeakerVoiceConfigSpeakerVoiceConfigs :: [SpeakerVoiceConfig]++instance Arbitrary Operation where+ arbitrary = sized genOperation++genOperation :: Int -> Gen Operation+genOperation n =+ Operation+ <$> arbitraryReducedMaybe n -- operationDone :: Maybe Bool+ <*> arbitraryReducedMaybe n -- operationName :: Maybe Text+ <*> arbitraryReducedMaybe n -- operationError :: Maybe Status+ <*> arbitraryReducedMaybe n -- operationMetadata :: Maybe (Map.Map String String)+ <*> arbitraryReducedMaybe n -- operationResponse :: Maybe (Map.Map String String)++instance Arbitrary Part where+ arbitrary = sized genPart++genPart :: Int -> Gen Part+genPart n =+ Part+ <$> arbitraryReducedMaybe n -- partInlineData :: Maybe Blob+ <*> arbitraryReducedMaybe n -- partFunctionResponse :: Maybe FunctionResponse+ <*> arbitraryReducedMaybe n -- partCodeExecutionResult :: Maybe CodeExecutionResult+ <*> arbitraryReducedMaybe n -- partFileData :: Maybe FileData+ <*> arbitraryReducedMaybe n -- partExecutableCode :: Maybe ExecutableCode+ <*> arbitraryReducedMaybe n -- partVideoMetadata :: Maybe VideoMetadata+ <*> arbitraryReducedMaybe n -- partThought :: Maybe Bool+ <*> arbitraryReducedMaybe n -- partText :: Maybe Text+ <*> arbitraryReducedMaybe n -- partThoughtSignature :: Maybe ByteArray+ <*> arbitraryReducedMaybe n -- partFunctionCall :: Maybe FunctionCall++instance Arbitrary Permission where+ arbitrary = sized genPermission++genPermission :: Int -> Gen Permission+genPermission n =+ Permission+ <$> arbitraryReducedMaybe n -- permissionName :: Maybe Text+ <*> arbitraryReducedMaybe n -- permissionGranteeType :: Maybe E'GranteeType+ <*> arbitrary -- permissionRole :: E'Role+ <*> arbitraryReducedMaybe n -- permissionEmailAddress :: Maybe Text++instance Arbitrary PrebuiltVoiceConfig where+ arbitrary = sized genPrebuiltVoiceConfig++genPrebuiltVoiceConfig :: Int -> Gen PrebuiltVoiceConfig+genPrebuiltVoiceConfig n =+ PrebuiltVoiceConfig+ <$> arbitraryReducedMaybe n -- prebuiltVoiceConfigVoiceName :: Maybe Text++instance Arbitrary PredictLongRunningOperation where+ arbitrary = sized genPredictLongRunningOperation++genPredictLongRunningOperation :: Int -> Gen PredictLongRunningOperation+genPredictLongRunningOperation n =+ PredictLongRunningOperation+ <$> arbitraryReducedMaybe n -- predictLongRunningOperationDone :: Maybe Bool+ <*> arbitraryReducedMaybe n -- predictLongRunningOperationName :: Maybe Text+ <*> arbitraryReducedMaybe n -- predictLongRunningOperationError :: Maybe Status+ <*> arbitraryReducedMaybeValue n -- predictLongRunningOperationMetadata :: Maybe A.Value+ <*> arbitraryReducedMaybe n -- predictLongRunningOperationResponse :: Maybe PredictLongRunningResponse++instance Arbitrary PredictLongRunningRequest where+ arbitrary = sized genPredictLongRunningRequest++genPredictLongRunningRequest :: Int -> Gen PredictLongRunningRequest+genPredictLongRunningRequest n =+ PredictLongRunningRequest+ <$> arbitraryReducedMaybe n -- predictLongRunningRequestParameters :: Maybe String+ <*> arbitrary -- predictLongRunningRequestInstances :: [String]++instance Arbitrary PredictLongRunningResponse where+ arbitrary = sized genPredictLongRunningResponse++genPredictLongRunningResponse :: Int -> Gen PredictLongRunningResponse+genPredictLongRunningResponse n =+ PredictLongRunningResponse+ <$> arbitraryReducedMaybe n -- predictLongRunningResponseGenerateVideoResponse :: Maybe GenerateVideoResponse++instance Arbitrary PredictRequest where+ arbitrary = sized genPredictRequest++genPredictRequest :: Int -> Gen PredictRequest+genPredictRequest n =+ PredictRequest+ <$> arbitrary -- predictRequestInstances :: [String]+ <*> arbitraryReducedMaybe n -- predictRequestParameters :: Maybe String++instance Arbitrary PredictResponse where+ arbitrary = sized genPredictResponse++genPredictResponse :: Int -> Gen PredictResponse+genPredictResponse n =+ PredictResponse+ <$> arbitraryReducedMaybe n -- predictResponsePredictions :: Maybe [String]++instance Arbitrary PromptFeedback where+ arbitrary = sized genPromptFeedback++genPromptFeedback :: Int -> Gen PromptFeedback+genPromptFeedback n =+ PromptFeedback+ <$> arbitraryReducedMaybe n -- promptFeedbackBlockReason :: Maybe E'BlockReason+ <*> arbitraryReducedMaybe n -- promptFeedbackSafetyRatings :: Maybe [SafetyRating]++instance Arbitrary QueryCorpusRequest where+ arbitrary = sized genQueryCorpusRequest++genQueryCorpusRequest :: Int -> Gen QueryCorpusRequest+genQueryCorpusRequest n =+ QueryCorpusRequest+ <$> arbitraryReducedMaybe n -- queryCorpusRequestMetadataFilters :: Maybe [MetadataFilter]+ <*> arbitrary -- queryCorpusRequestQuery :: Text+ <*> arbitraryReducedMaybe n -- queryCorpusRequestResultsCount :: Maybe Int++instance Arbitrary QueryCorpusResponse where+ arbitrary = sized genQueryCorpusResponse++genQueryCorpusResponse :: Int -> Gen QueryCorpusResponse+genQueryCorpusResponse n =+ QueryCorpusResponse+ <$> arbitraryReducedMaybe n -- queryCorpusResponseRelevantChunks :: Maybe [RelevantChunk]++instance Arbitrary QueryDocumentRequest where+ arbitrary = sized genQueryDocumentRequest++genQueryDocumentRequest :: Int -> Gen QueryDocumentRequest+genQueryDocumentRequest n =+ QueryDocumentRequest+ <$> arbitrary -- queryDocumentRequestQuery :: Text+ <*> arbitraryReducedMaybe n -- queryDocumentRequestResultsCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- queryDocumentRequestMetadataFilters :: Maybe [MetadataFilter]++instance Arbitrary QueryDocumentResponse where+ arbitrary = sized genQueryDocumentResponse++genQueryDocumentResponse :: Int -> Gen QueryDocumentResponse+genQueryDocumentResponse n =+ QueryDocumentResponse+ <$> arbitraryReducedMaybe n -- queryDocumentResponseRelevantChunks :: Maybe [RelevantChunk]++instance Arbitrary RelevantChunk where+ arbitrary = sized genRelevantChunk++genRelevantChunk :: Int -> Gen RelevantChunk+genRelevantChunk n =+ RelevantChunk+ <$> arbitraryReducedMaybe n -- relevantChunkChunk :: Maybe Chunk+ <*> arbitraryReducedMaybe n -- relevantChunkChunkRelevanceScore :: Maybe Float++instance Arbitrary RetrievalMetadata where+ arbitrary = sized genRetrievalMetadata++genRetrievalMetadata :: Int -> Gen RetrievalMetadata+genRetrievalMetadata n =+ RetrievalMetadata+ <$> arbitraryReducedMaybe n -- retrievalMetadataGoogleSearchDynamicRetrievalScore :: Maybe Float++instance Arbitrary SafetyFeedback where+ arbitrary = sized genSafetyFeedback++genSafetyFeedback :: Int -> Gen SafetyFeedback+genSafetyFeedback n =+ SafetyFeedback+ <$> arbitraryReducedMaybe n -- safetyFeedbackSetting :: Maybe SafetySetting+ <*> arbitraryReducedMaybe n -- safetyFeedbackRating :: Maybe SafetyRating++instance Arbitrary SafetyRating where+ arbitrary = sized genSafetyRating++genSafetyRating :: Int -> Gen SafetyRating+genSafetyRating n =+ SafetyRating+ <$> arbitraryReduced n -- safetyRatingCategory :: HarmCategory+ <*> arbitraryReducedMaybe n -- safetyRatingBlocked :: Maybe Bool+ <*> arbitrary -- safetyRatingProbability :: E'Probability++instance Arbitrary SafetySetting where+ arbitrary = sized genSafetySetting++genSafetySetting :: Int -> Gen SafetySetting+genSafetySetting n =+ SafetySetting+ <$> arbitrary -- safetySettingThreshold :: E'Threshold+ <*> arbitraryReduced n -- safetySettingCategory :: HarmCategory++instance Arbitrary Schema where+ arbitrary = sized genSchema++genSchema :: Int -> Gen Schema+genSchema n =+ Schema+ <$> arbitraryReducedMaybe n -- schemaItems :: Maybe Schema+ <*> arbitraryReducedMaybe n -- schemaAnyOf :: Maybe [Schema]+ <*> arbitraryReducedMaybe n -- schemaMinLength :: Maybe Text+ <*> arbitraryReducedMaybe n -- schemaMaximum :: Maybe Double+ <*> arbitraryReducedMaybe n -- schemaPropertyOrdering :: Maybe [Text]+ <*> arbitraryReducedMaybe n -- schemaNullable :: Maybe Bool+ <*> arbitraryReducedMaybe n -- schemaRequired :: Maybe [Text]+ <*> arbitraryReducedMaybe n -- schemaMinProperties :: Maybe Text+ <*> arbitraryReducedMaybe n -- schemaMaxItems :: Maybe Text+ <*> arbitraryReducedMaybe n -- schemaExample :: Maybe String+ <*> arbitraryReducedMaybe n -- schemaTitle :: Maybe Text+ <*> arbitraryReducedMaybe n -- schemaMinItems :: Maybe Text+ <*> arbitraryReducedMaybe n -- schemaDescription :: Maybe Text+ <*> arbitraryReduced n -- schemaType :: ModelType+ <*> arbitraryReducedMaybe n -- schemaDefault :: Maybe String+ <*> arbitraryReducedMaybe n -- schemaMinimum :: Maybe Double+ <*> arbitraryReducedMaybe n -- schemaPattern :: Maybe Text+ <*> arbitraryReducedMaybe n -- schemaProperties :: Maybe (Map.Map String Schema)+ <*> arbitraryReducedMaybe n -- schemaMaxProperties :: Maybe Text+ <*> arbitraryReducedMaybe n -- schemaFormat :: Maybe Text+ <*> arbitraryReducedMaybe n -- schemaEnum :: Maybe [Text]+ <*> arbitraryReducedMaybe n -- schemaMaxLength :: Maybe Text++instance Arbitrary SearchEntryPoint where+ arbitrary = sized genSearchEntryPoint++genSearchEntryPoint :: Int -> Gen SearchEntryPoint+genSearchEntryPoint n =+ SearchEntryPoint+ <$> arbitraryReducedMaybe n -- searchEntryPointSdkBlob :: Maybe ByteArray+ <*> arbitraryReducedMaybe n -- searchEntryPointRenderedContent :: Maybe Text++instance Arbitrary Segment where+ arbitrary = sized genSegment++genSegment :: Int -> Gen Segment+genSegment n =+ Segment+ <$> arbitraryReducedMaybe n -- segmentPartIndex :: Maybe Int+ <*> arbitraryReducedMaybe n -- segmentStartIndex :: Maybe Int+ <*> arbitraryReducedMaybe n -- segmentText :: Maybe Text+ <*> arbitraryReducedMaybe n -- segmentEndIndex :: Maybe Int++instance Arbitrary SemanticRetrieverChunk where+ arbitrary = sized genSemanticRetrieverChunk++genSemanticRetrieverChunk :: Int -> Gen SemanticRetrieverChunk+genSemanticRetrieverChunk n =+ SemanticRetrieverChunk+ <$> arbitraryReducedMaybe n -- semanticRetrieverChunkChunk :: Maybe Text+ <*> arbitraryReducedMaybe n -- semanticRetrieverChunkSource :: Maybe Text++instance Arbitrary SemanticRetrieverConfig where+ arbitrary = sized genSemanticRetrieverConfig++genSemanticRetrieverConfig :: Int -> Gen SemanticRetrieverConfig+genSemanticRetrieverConfig n =+ SemanticRetrieverConfig+ <$> arbitrary -- semanticRetrieverConfigSource :: Text+ <*> arbitraryReduced n -- semanticRetrieverConfigQuery :: Content+ <*> arbitraryReducedMaybe n -- semanticRetrieverConfigMaxChunksCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- semanticRetrieverConfigMetadataFilters :: Maybe [MetadataFilter]+ <*> arbitraryReducedMaybe n -- semanticRetrieverConfigMinimumRelevanceScore :: Maybe Float++instance Arbitrary SpeakerVoiceConfig where+ arbitrary = sized genSpeakerVoiceConfig++genSpeakerVoiceConfig :: Int -> Gen SpeakerVoiceConfig+genSpeakerVoiceConfig n =+ SpeakerVoiceConfig+ <$> arbitraryReduced n -- speakerVoiceConfigVoiceConfig :: VoiceConfig+ <*> arbitrary -- speakerVoiceConfigSpeaker :: Text++instance Arbitrary SpeechConfig where+ arbitrary = sized genSpeechConfig++genSpeechConfig :: Int -> Gen SpeechConfig+genSpeechConfig n =+ SpeechConfig+ <$> arbitraryReducedMaybe n -- speechConfigVoiceConfig :: Maybe VoiceConfig+ <*> arbitraryReducedMaybe n -- speechConfigLanguageCode :: Maybe Text+ <*> arbitraryReducedMaybe n -- speechConfigMultiSpeakerVoiceConfig :: Maybe MultiSpeakerVoiceConfig++instance Arbitrary Status where+ arbitrary = sized genStatus++genStatus :: Int -> Gen Status+genStatus n =+ Status+ <$> arbitraryReducedMaybe n -- statusCode :: Maybe Int+ <*> arbitraryReducedMaybe n -- statusDetails :: Maybe [(Map.Map String String)]+ <*> arbitraryReducedMaybe n -- statusMessage :: Maybe Text++instance Arbitrary StringList where+ arbitrary = sized genStringList++genStringList :: Int -> Gen StringList+genStringList n =+ StringList+ <$> arbitraryReducedMaybe n -- stringListValues :: Maybe [Text]++instance Arbitrary TextCompletion where+ arbitrary = sized genTextCompletion++genTextCompletion :: Int -> Gen TextCompletion+genTextCompletion n =+ TextCompletion+ <$> arbitraryReducedMaybe n -- textCompletionSafetyRatings :: Maybe [SafetyRating]+ <*> arbitraryReducedMaybe n -- textCompletionOutput :: Maybe Text+ <*> arbitraryReducedMaybe n -- textCompletionCitationMetadata :: Maybe CitationMetadata++instance Arbitrary TextPrompt where+ arbitrary = sized genTextPrompt++genTextPrompt :: Int -> Gen TextPrompt+genTextPrompt n =+ TextPrompt+ <$> arbitrary -- textPromptText :: Text++instance Arbitrary ThinkingConfig where+ arbitrary = sized genThinkingConfig++genThinkingConfig :: Int -> Gen ThinkingConfig+genThinkingConfig n =+ ThinkingConfig+ <$> arbitraryReducedMaybe n -- thinkingConfigThinkingBudget :: Maybe Int+ <*> arbitraryReducedMaybe n -- thinkingConfigIncludeThoughts :: Maybe Bool++instance Arbitrary Tool where+ arbitrary = sized genTool++genTool :: Int -> Gen Tool+genTool n =+ Tool+ <$> arbitraryReducedMaybe n -- toolFunctionDeclarations :: Maybe [FunctionDeclaration]+ <*> arbitraryReducedMaybe n -- toolGoogleSearchRetrieval :: Maybe GoogleSearchRetrieval+ <*> arbitraryReducedMaybe n -- toolGoogleSearch :: Maybe GoogleSearch+ <*> arbitraryReducedMaybeValue n -- toolCodeExecution :: Maybe A.Value+ <*> arbitraryReducedMaybeValue n -- toolUrlContext :: Maybe A.Value++instance Arbitrary ToolConfig where+ arbitrary = sized genToolConfig++genToolConfig :: Int -> Gen ToolConfig+genToolConfig n =+ ToolConfig+ <$> arbitraryReducedMaybe n -- toolConfigFunctionCallingConfig :: Maybe FunctionCallingConfig++instance Arbitrary TopCandidates where+ arbitrary = sized genTopCandidates++genTopCandidates :: Int -> Gen TopCandidates+genTopCandidates n =+ TopCandidates+ <$> arbitraryReducedMaybe n -- topCandidatesCandidates :: Maybe [LogprobsResultCandidate]++instance Arbitrary TransferOwnershipRequest where+ arbitrary = sized genTransferOwnershipRequest++genTransferOwnershipRequest :: Int -> Gen TransferOwnershipRequest+genTransferOwnershipRequest n =+ TransferOwnershipRequest+ <$> arbitrary -- transferOwnershipRequestEmailAddress :: Text++instance Arbitrary TunedModel where+ arbitrary = sized genTunedModel++genTunedModel :: Int -> Gen TunedModel+genTunedModel n =+ TunedModel+ <$> arbitraryReducedMaybe n -- tunedModelUpdateTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- tunedModelName :: Maybe Text+ <*> arbitraryReducedMaybe n -- tunedModelCreateTime :: Maybe DateTime+ <*> arbitraryReduced n -- tunedModelTuningTask :: TuningTask+ <*> arbitraryReducedMaybe n -- tunedModelTunedModelSource :: Maybe TunedModelSource+ <*> arbitraryReducedMaybe n -- tunedModelBaseModel :: Maybe Text+ <*> arbitraryReducedMaybe n -- tunedModelReaderProjectNumbers :: Maybe [Text]+ <*> arbitraryReducedMaybe n -- tunedModelDisplayName :: Maybe Text+ <*> arbitraryReducedMaybe n -- tunedModelTemperature :: Maybe Float+ <*> arbitraryReducedMaybe n -- tunedModelDescription :: Maybe Text+ <*> arbitraryReducedMaybe n -- tunedModelTopP :: Maybe Float+ <*> arbitraryReducedMaybe n -- tunedModelTopK :: Maybe Int+ <*> arbitraryReducedMaybe n -- tunedModelState :: Maybe E'State3++instance Arbitrary TunedModelSource where+ arbitrary = sized genTunedModelSource++genTunedModelSource :: Int -> Gen TunedModelSource+genTunedModelSource n =+ TunedModelSource+ <$> arbitraryReducedMaybe n -- tunedModelSourceTunedModel :: Maybe Text+ <*> arbitraryReducedMaybe n -- tunedModelSourceBaseModel :: Maybe Text++instance Arbitrary TuningExample where+ arbitrary = sized genTuningExample++genTuningExample :: Int -> Gen TuningExample+genTuningExample n =+ TuningExample+ <$> arbitraryReducedMaybe n -- tuningExampleTextInput :: Maybe Text+ <*> arbitrary -- tuningExampleOutput :: Text++instance Arbitrary TuningExamples where+ arbitrary = sized genTuningExamples++genTuningExamples :: Int -> Gen TuningExamples+genTuningExamples n =+ TuningExamples+ <$> arbitraryReducedMaybe n -- tuningExamplesExamples :: Maybe [TuningExample]++instance Arbitrary TuningSnapshot where+ arbitrary = sized genTuningSnapshot++genTuningSnapshot :: Int -> Gen TuningSnapshot+genTuningSnapshot n =+ TuningSnapshot+ <$> arbitraryReducedMaybe n -- tuningSnapshotMeanLoss :: Maybe Float+ <*> arbitraryReducedMaybe n -- tuningSnapshotComputeTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- tuningSnapshotStep :: Maybe Int+ <*> arbitraryReducedMaybe n -- tuningSnapshotEpoch :: Maybe Int++instance Arbitrary TuningTask where+ arbitrary = sized genTuningTask++genTuningTask :: Int -> Gen TuningTask+genTuningTask n =+ TuningTask+ <$> arbitraryReducedMaybe n -- tuningTaskStartTime :: Maybe DateTime+ <*> arbitraryReduced n -- tuningTaskTrainingData :: Dataset+ <*> arbitraryReducedMaybe n -- tuningTaskHyperparameters :: Maybe Hyperparameters+ <*> arbitraryReducedMaybe n -- tuningTaskCompleteTime :: Maybe DateTime+ <*> arbitraryReducedMaybe n -- tuningTaskSnapshots :: Maybe [TuningSnapshot]++instance Arbitrary UpdateChunkRequest where+ arbitrary = sized genUpdateChunkRequest++genUpdateChunkRequest :: Int -> Gen UpdateChunkRequest+genUpdateChunkRequest n =+ UpdateChunkRequest+ <$> arbitrary -- updateChunkRequestUpdateMask :: Text+ <*> arbitraryReduced n -- updateChunkRequestChunk :: Chunk++instance Arbitrary UrlContextMetadata where+ arbitrary = sized genUrlContextMetadata++genUrlContextMetadata :: Int -> Gen UrlContextMetadata+genUrlContextMetadata n =+ UrlContextMetadata+ <$> arbitraryReducedMaybe n -- urlContextMetadataUrlMetadata :: Maybe [UrlMetadata]++instance Arbitrary UrlMetadata where+ arbitrary = sized genUrlMetadata++genUrlMetadata :: Int -> Gen UrlMetadata+genUrlMetadata n =+ UrlMetadata+ <$> arbitraryReducedMaybe n -- urlMetadataRetrievedUrl :: Maybe Text+ <*> arbitraryReducedMaybe n -- urlMetadataUrlRetrievalStatus :: Maybe E'UrlRetrievalStatus++instance Arbitrary UsageMetadata where+ arbitrary = sized genUsageMetadata++genUsageMetadata :: Int -> Gen UsageMetadata+genUsageMetadata n =+ UsageMetadata+ <$> arbitraryReducedMaybe n -- usageMetadataCandidatesTokensDetails :: Maybe [ModalityTokenCount]+ <*> arbitraryReducedMaybe n -- usageMetadataThoughtsTokenCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- usageMetadataToolUsePromptTokenCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- usageMetadataCachedContentTokenCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- usageMetadataPromptTokenCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- usageMetadataCandidatesTokenCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- usageMetadataPromptTokensDetails :: Maybe [ModalityTokenCount]+ <*> arbitraryReducedMaybe n -- usageMetadataTotalTokenCount :: Maybe Int+ <*> arbitraryReducedMaybe n -- usageMetadataCacheTokensDetails :: Maybe [ModalityTokenCount]+ <*> arbitraryReducedMaybe n -- usageMetadataToolUsePromptTokensDetails :: Maybe [ModalityTokenCount]++instance Arbitrary Video where+ arbitrary = sized genVideo++genVideo :: Int -> Gen Video+genVideo n =+ Video+ <$> arbitraryReducedMaybe n -- videoVideo :: Maybe ByteArray+ <*> arbitraryReducedMaybe n -- videoUri :: Maybe Text++instance Arbitrary VideoFileMetadata where+ arbitrary = sized genVideoFileMetadata++genVideoFileMetadata :: Int -> Gen VideoFileMetadata+genVideoFileMetadata n =+ VideoFileMetadata+ <$> arbitraryReducedMaybe n -- videoFileMetadataVideoDuration :: Maybe Text++instance Arbitrary VideoMetadata where+ arbitrary = sized genVideoMetadata++genVideoMetadata :: Int -> Gen VideoMetadata+genVideoMetadata n =+ VideoMetadata+ <$> arbitraryReducedMaybe n -- videoMetadataEndOffset :: Maybe Text+ <*> arbitraryReducedMaybe n -- videoMetadataStartOffset :: Maybe Text+ <*> arbitraryReducedMaybe n -- videoMetadataFps :: Maybe Double++instance Arbitrary VoiceConfig where+ arbitrary = sized genVoiceConfig++genVoiceConfig :: Int -> Gen VoiceConfig+genVoiceConfig n =+ VoiceConfig+ <$> arbitraryReducedMaybe n -- voiceConfigPrebuiltVoiceConfig :: Maybe PrebuiltVoiceConfig++instance Arbitrary Web where+ arbitrary = sized genWeb++genWeb :: Int -> Gen Web+genWeb n =+ Web+ <$> arbitraryReducedMaybe n -- webTitle :: Maybe Text+ <*> arbitraryReducedMaybe n -- webUri :: Maybe Text++instance Arbitrary E'Alt where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'AnswerStyle where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Behavior where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'BlockReason where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'BlockReason2 where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'FinishReason where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'GranteeType where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Language where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'MediaResolution where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Mode where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Mode2 where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Operation where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Outcome where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Probability where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Reason where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'ResponseModalities where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Role where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Scheduling where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Source where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'State where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'State2 where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'State3 where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'State4 where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Threshold where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'UrlRetrievalStatus where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary E'Xgafv where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary HarmCategory where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary Modality where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary ModelType where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary TaskType where+ arbitrary = arbitraryBoundedEnum
+ tests/PropMime.hs view
@@ -0,0 +1,55 @@+{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++module PropMime where++import Data.Aeson+import Data.Aeson.Types (parseEither)+import Data.ByteString.Lazy.Char8 qualified as BL8+import Data.Monoid ((<>))+import Data.Typeable (Proxy (..), Typeable, typeOf)+import Test.Hspec+import Test.Hspec.QuickCheck (prop)+import Test.QuickCheck+import Test.QuickCheck.Property++import GenAI.Client.MimeTypes++import ApproxEq++-- * Type Aliases++type ArbitraryMime mime a = ArbitraryRoundtrip (MimeUnrender mime) (MimeRender mime) a++type ArbitraryRoundtrip from to a = (from a, to a, Arbitrary' a)++type Arbitrary' a = (Arbitrary a, Show a, Typeable a)++-- * Mime++propMime ::+ forall a b mime.+ (ArbitraryMime mime a, Testable b) =>+ String ->+ (a -> a -> b) ->+ mime ->+ Proxy a ->+ Spec+propMime eqDescr eq m _ =+ prop+ (show (typeOf (undefined :: a)) <> " " <> show (typeOf (undefined :: mime)) <> " roundtrip " <> eqDescr)+ $ \(x :: a) ->+ let rendered = mimeRender' m x+ actual = mimeUnrender' m rendered+ expected = Right x+ failMsg =+ "ACTUAL: " <> show actual <> "\nRENDERED: " <> BL8.unpack rendered+ in counterexample failMsg $+ either reject property (eq <$> actual <*> expected)+ where+ reject = property . const rejected++propMimeEq :: (ArbitraryMime mime a, Eq a) => mime -> Proxy a -> Spec+propMimeEq = propMime "(EQ)" (==)
+ tests/Test.hs view
@@ -0,0 +1,172 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PartialTypeSignatures #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE ScopedTypeVariables #-}++module Main where++import Data.Typeable (Proxy (..))+import Test.Hspec hiding (Example) -- TODO: 'hiding' should be automatically added when generating the test suite+import Test.Hspec.QuickCheck++import Instances ()+import PropMime++import GenAI.Client.MimeTypes+import GenAI.Client.Model++main :: IO ()+main =+ hspec $ modifyMaxSize (const 10) $ do+ describe "JSON instances" $ do+ pure ()+ propMimeEq MimeJSON (Proxy :: Proxy AttributionSourceId)+ propMimeEq MimeJSON (Proxy :: Proxy BaseOperation)+ propMimeEq MimeJSON (Proxy :: Proxy BatchCreateChunksRequest)+ propMimeEq MimeJSON (Proxy :: Proxy BatchCreateChunksResponse)+ propMimeEq MimeJSON (Proxy :: Proxy BatchDeleteChunksRequest)+ propMimeEq MimeJSON (Proxy :: Proxy BatchEmbedContentsRequest)+ propMimeEq MimeJSON (Proxy :: Proxy BatchEmbedContentsResponse)+ propMimeEq MimeJSON (Proxy :: Proxy BatchEmbedTextRequest)+ propMimeEq MimeJSON (Proxy :: Proxy BatchEmbedTextResponse)+ propMimeEq MimeJSON (Proxy :: Proxy BatchUpdateChunksRequest)+ propMimeEq MimeJSON (Proxy :: Proxy BatchUpdateChunksResponse)+ propMimeEq MimeJSON (Proxy :: Proxy Blob)+ propMimeEq MimeJSON (Proxy :: Proxy CachedContent)+ propMimeEq MimeJSON (Proxy :: Proxy CachedContentUsageMetadata)+ propMimeEq MimeJSON (Proxy :: Proxy Candidate)+ propMimeEq MimeJSON (Proxy :: Proxy Chunk)+ propMimeEq MimeJSON (Proxy :: Proxy ChunkData)+ propMimeEq MimeJSON (Proxy :: Proxy CitationMetadata)+ propMimeEq MimeJSON (Proxy :: Proxy CitationSource)+ propMimeEq MimeJSON (Proxy :: Proxy CodeExecutionResult)+ propMimeEq MimeJSON (Proxy :: Proxy Condition)+ propMimeEq MimeJSON (Proxy :: Proxy Content)+ propMimeEq MimeJSON (Proxy :: Proxy ContentEmbedding)+ propMimeEq MimeJSON (Proxy :: Proxy ContentFilter)+ propMimeEq MimeJSON (Proxy :: Proxy Corpus)+ propMimeEq MimeJSON (Proxy :: Proxy CountMessageTokensRequest)+ propMimeEq MimeJSON (Proxy :: Proxy CountMessageTokensResponse)+ propMimeEq MimeJSON (Proxy :: Proxy CountTextTokensRequest)+ propMimeEq MimeJSON (Proxy :: Proxy CountTextTokensResponse)+ propMimeEq MimeJSON (Proxy :: Proxy CountTokensRequest)+ propMimeEq MimeJSON (Proxy :: Proxy CountTokensResponse)+ propMimeEq MimeJSON (Proxy :: Proxy CreateChunkRequest)+ propMimeEq MimeJSON (Proxy :: Proxy CreateFileRequest)+ propMimeEq MimeJSON (Proxy :: Proxy CreateFileResponse)+ propMimeEq MimeJSON (Proxy :: Proxy CreateTunedModelMetadata)+ propMimeEq MimeJSON (Proxy :: Proxy CreateTunedModelOperation)+ propMimeEq MimeJSON (Proxy :: Proxy CustomMetadata)+ propMimeEq MimeJSON (Proxy :: Proxy Dataset)+ propMimeEq MimeJSON (Proxy :: Proxy DeleteChunkRequest)+ propMimeEq MimeJSON (Proxy :: Proxy Document)+ propMimeEq MimeJSON (Proxy :: Proxy DynamicRetrievalConfig)+ propMimeEq MimeJSON (Proxy :: Proxy EmbedContentRequest)+ propMimeEq MimeJSON (Proxy :: Proxy EmbedContentResponse)+ propMimeEq MimeJSON (Proxy :: Proxy EmbedTextRequest)+ propMimeEq MimeJSON (Proxy :: Proxy EmbedTextResponse)+ propMimeEq MimeJSON (Proxy :: Proxy Embedding)+ propMimeEq MimeJSON (Proxy :: Proxy Example)+ propMimeEq MimeJSON (Proxy :: Proxy ExecutableCode)+ propMimeEq MimeJSON (Proxy :: Proxy File)+ propMimeEq MimeJSON (Proxy :: Proxy FileData)+ propMimeEq MimeJSON (Proxy :: Proxy FunctionCall)+ propMimeEq MimeJSON (Proxy :: Proxy FunctionCallingConfig)+ propMimeEq MimeJSON (Proxy :: Proxy FunctionDeclaration)+ propMimeEq MimeJSON (Proxy :: Proxy FunctionResponse)+ propMimeEq MimeJSON (Proxy :: Proxy GenerateAnswerRequest)+ propMimeEq MimeJSON (Proxy :: Proxy GenerateAnswerResponse)+ propMimeEq MimeJSON (Proxy :: Proxy GenerateContentRequest)+ propMimeEq MimeJSON (Proxy :: Proxy GenerateContentResponse)+ propMimeEq MimeJSON (Proxy :: Proxy GenerateMessageRequest)+ propMimeEq MimeJSON (Proxy :: Proxy GenerateMessageResponse)+ propMimeEq MimeJSON (Proxy :: Proxy GenerateTextRequest)+ propMimeEq MimeJSON (Proxy :: Proxy GenerateTextResponse)+ propMimeEq MimeJSON (Proxy :: Proxy GenerateVideoResponse)+ propMimeEq MimeJSON (Proxy :: Proxy GeneratedFile)+ propMimeEq MimeJSON (Proxy :: Proxy GenerationConfig)+ propMimeEq MimeJSON (Proxy :: Proxy GoogleSearch)+ propMimeEq MimeJSON (Proxy :: Proxy GoogleSearchRetrieval)+ propMimeEq MimeJSON (Proxy :: Proxy GroundingAttribution)+ propMimeEq MimeJSON (Proxy :: Proxy GroundingChunk)+ propMimeEq MimeJSON (Proxy :: Proxy GroundingMetadata)+ propMimeEq MimeJSON (Proxy :: Proxy GroundingPassage)+ propMimeEq MimeJSON (Proxy :: Proxy GroundingPassageId)+ propMimeEq MimeJSON (Proxy :: Proxy GroundingPassages)+ propMimeEq MimeJSON (Proxy :: Proxy GroundingSupport)+ propMimeEq MimeJSON (Proxy :: Proxy HarmCategory)+ propMimeEq MimeJSON (Proxy :: Proxy Hyperparameters)+ propMimeEq MimeJSON (Proxy :: Proxy InputFeedback)+ propMimeEq MimeJSON (Proxy :: Proxy Interval)+ propMimeEq MimeJSON (Proxy :: Proxy ListCachedContentsResponse)+ propMimeEq MimeJSON (Proxy :: Proxy ListChunksResponse)+ propMimeEq MimeJSON (Proxy :: Proxy ListCorporaResponse)+ propMimeEq MimeJSON (Proxy :: Proxy ListDocumentsResponse)+ propMimeEq MimeJSON (Proxy :: Proxy ListFilesResponse)+ propMimeEq MimeJSON (Proxy :: Proxy ListGeneratedFilesResponse)+ propMimeEq MimeJSON (Proxy :: Proxy ListModelsResponse)+ propMimeEq MimeJSON (Proxy :: Proxy ListOperationsResponse)+ propMimeEq MimeJSON (Proxy :: Proxy ListPermissionsResponse)+ propMimeEq MimeJSON (Proxy :: Proxy ListTunedModelsResponse)+ propMimeEq MimeJSON (Proxy :: Proxy LogprobsResult)+ propMimeEq MimeJSON (Proxy :: Proxy LogprobsResultCandidate)+ propMimeEq MimeJSON (Proxy :: Proxy Media)+ propMimeEq MimeJSON (Proxy :: Proxy Message)+ propMimeEq MimeJSON (Proxy :: Proxy MessagePrompt)+ propMimeEq MimeJSON (Proxy :: Proxy MetadataFilter)+ propMimeEq MimeJSON (Proxy :: Proxy Modality)+ propMimeEq MimeJSON (Proxy :: Proxy ModalityTokenCount)+ propMimeEq MimeJSON (Proxy :: Proxy Model)+ propMimeEq MimeJSON (Proxy :: Proxy ModelType)+ propMimeEq MimeJSON (Proxy :: Proxy MultiSpeakerVoiceConfig)+ propMimeEq MimeJSON (Proxy :: Proxy Operation)+ propMimeEq MimeJSON (Proxy :: Proxy Part)+ propMimeEq MimeJSON (Proxy :: Proxy Permission)+ propMimeEq MimeJSON (Proxy :: Proxy PrebuiltVoiceConfig)+ propMimeEq MimeJSON (Proxy :: Proxy PredictLongRunningOperation)+ propMimeEq MimeJSON (Proxy :: Proxy PredictLongRunningRequest)+ propMimeEq MimeJSON (Proxy :: Proxy PredictLongRunningResponse)+ propMimeEq MimeJSON (Proxy :: Proxy PredictRequest)+ propMimeEq MimeJSON (Proxy :: Proxy PredictResponse)+ propMimeEq MimeJSON (Proxy :: Proxy PromptFeedback)+ propMimeEq MimeJSON (Proxy :: Proxy QueryCorpusRequest)+ propMimeEq MimeJSON (Proxy :: Proxy QueryCorpusResponse)+ propMimeEq MimeJSON (Proxy :: Proxy QueryDocumentRequest)+ propMimeEq MimeJSON (Proxy :: Proxy QueryDocumentResponse)+ propMimeEq MimeJSON (Proxy :: Proxy RelevantChunk)+ propMimeEq MimeJSON (Proxy :: Proxy RetrievalMetadata)+ propMimeEq MimeJSON (Proxy :: Proxy SafetyFeedback)+ propMimeEq MimeJSON (Proxy :: Proxy SafetyRating)+ propMimeEq MimeJSON (Proxy :: Proxy SafetySetting)+ propMimeEq MimeJSON (Proxy :: Proxy Schema)+ propMimeEq MimeJSON (Proxy :: Proxy SearchEntryPoint)+ propMimeEq MimeJSON (Proxy :: Proxy Segment)+ propMimeEq MimeJSON (Proxy :: Proxy SemanticRetrieverChunk)+ propMimeEq MimeJSON (Proxy :: Proxy SemanticRetrieverConfig)+ propMimeEq MimeJSON (Proxy :: Proxy SpeakerVoiceConfig)+ propMimeEq MimeJSON (Proxy :: Proxy SpeechConfig)+ propMimeEq MimeJSON (Proxy :: Proxy Status)+ propMimeEq MimeJSON (Proxy :: Proxy StringList)+ propMimeEq MimeJSON (Proxy :: Proxy TaskType)+ propMimeEq MimeJSON (Proxy :: Proxy TextCompletion)+ propMimeEq MimeJSON (Proxy :: Proxy TextPrompt)+ propMimeEq MimeJSON (Proxy :: Proxy ThinkingConfig)+ propMimeEq MimeJSON (Proxy :: Proxy Tool)+ propMimeEq MimeJSON (Proxy :: Proxy ToolConfig)+ propMimeEq MimeJSON (Proxy :: Proxy TopCandidates)+ propMimeEq MimeJSON (Proxy :: Proxy TransferOwnershipRequest)+ propMimeEq MimeJSON (Proxy :: Proxy TunedModel)+ propMimeEq MimeJSON (Proxy :: Proxy TunedModelSource)+ propMimeEq MimeJSON (Proxy :: Proxy TuningExample)+ propMimeEq MimeJSON (Proxy :: Proxy TuningExamples)+ propMimeEq MimeJSON (Proxy :: Proxy TuningSnapshot)+ propMimeEq MimeJSON (Proxy :: Proxy TuningTask)+ propMimeEq MimeJSON (Proxy :: Proxy UpdateChunkRequest)+ propMimeEq MimeJSON (Proxy :: Proxy UrlContextMetadata)+ propMimeEq MimeJSON (Proxy :: Proxy UrlMetadata)+ propMimeEq MimeJSON (Proxy :: Proxy UsageMetadata)+ propMimeEq MimeJSON (Proxy :: Proxy Video)+ propMimeEq MimeJSON (Proxy :: Proxy VideoFileMetadata)+ propMimeEq MimeJSON (Proxy :: Proxy VideoMetadata)+ propMimeEq MimeJSON (Proxy :: Proxy VoiceConfig)+ propMimeEq MimeJSON (Proxy :: Proxy Web)