GET
/v1/schemas/gemini/chat/v1beta/models/{modelsId}:generateMessage
Accept:
| field | recorded source |
|---|---|
| schema | Source linked above.Source tracef697c69526f2d0f93e6e022d34a6a98146776f0f982cc56727132c048329221c{
"fetchedAt": 1783328683,
"extractorVersion": "1",
"verifiedAt": null
} |
Request body
5 properties · 0 required · 5 $defs| property | type | description | constraints |
|---|---|---|---|
| temperature | number | 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 |
| prompt | 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 wa… | |
| topP | number | 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 |
| 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. | format: int32 |
| candidateCount | integer | 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 |
Types
5 $defsCitationMetadataobject
A collection of source attributions for a piece of content.
| citationSources | CitationSource[] | Citations to sources for a specific response. |
CitationSourceobject
A citation to a source for a portion of a specific response.
| startIndex | integer | 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 |
| license | string | Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations. | |
| endIndex | integer | Optional. End of the attributed segment, exclusive. | format: int32 |
| uri | string | Optional. URI that is attributed as a source for a portion of the text. |
Exampleobject
An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.
| output | 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. | |
| input | 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. |
Messageobject
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.
| content | string | Required. The text content of the structured `Message`. | |
| author | string | 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. | |
| citationMetadata | CitationMetadata | A collection of source attributions for a piece of content. |
MessagePromptobject
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 wa…
| messages | Message[] | 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`. | |
| context | string | 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 co… | |
| examples | Example[] | 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… |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"gemini","endpointId":"v1beta/models/{modelsId}:generateMessage","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}