GET
/v1/schemas/gemini/chat/v1beta/tunedModels/{tunedModelsId}:generateText
Accept:
| field | recorded source |
|---|---|
| schema | Source linked above.Source tracea748582f6d8fbdd416a20a987ed1a5b0d8d74a4256cd1e170211e7e0db3f4592{
"fetchedAt": 1783573297,
"extractorVersion": "1",
"verifiedAt": null
} |
Request body
8 properties · 0 required · 2 $defs| property | type | description | constraints |
|---|---|---|---|
| topK | integer | 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_… | format: int32 |
| safetySettings | SafetySetting[] | 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… | |
| stopSequences | string[] | 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. | |
| maxOutputTokens | integer | 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 |
| topP | number | 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 dir… | format: float |
| prompt | TextPrompt | Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion. | |
| temperature | number | 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 resp… | format: float |
| candidateCount | integer | Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1. | format: int32 |
Types
2 $defsSafetySettingobject
Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.
| threshold | enum | Required. Controls the probability threshold at which harm is blocked. | HARM_BLOCK_THRESHOLD_UNSPECIFIE… | BLOCK_LOW_AND_ABOVE | BLOCK_MEDIUM_AND_ABOVE | BLOCK_ONLY_HIGH | BLOCK_NONE | OFF |
| category | enum | Required. The category for this setting. | HARM_CATEGORY_UNSPECIFIED | HARM_CATEGORY_DEROGATORY | HARM_CATEGORY_TOXICITY | HARM_CATEGORY_VIOLENCE | HARM_CATEGORY_SEXUAL | HARM_CATEGORY_MEDICAL · +7 more |
TextPromptobject
Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.
| text | string | Required. The prompt text. |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"gemini","endpointId":"v1beta/tunedModels/{tunedModelsId}:generateText","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}