Table: cohereai_generation
Create generations for a given text prompt.
Notes:
- A
prompt
orsettings -> 'prompt'
where qualifier is required for all queries. - The fields
likelihood
andtoken_likelihoods
will only return values ifreturn_likelihoods
is set either asGENERATION
orALL
.*
The return_likelihoods
can be set to GENERATION
or ALL
. If the former is selected, the API would respond with the likelihood for only the generation text, else for the later, the likelihood will br given for both generated and prompt text (Default in the plugin is GENERATION
).
Examples
Basic example with simple prompt
select generationfrom cohereai_generationwhere prompt = 'Give suggestions for a title for a science-fiction novel.';
Generation with specific settings(model, number of responses, etc.)
select generationfrom cohereai_generationwhere settings = '{ "model": "command-light", "num_generations": 3, "max_tokens": 100, "temperature": 0.9, "top_p": 1.0, "frequency_penalty": 0.0 }' and prompt = 'Give suggestions for a title for a science-fiction novel.';
Pass the prompt string through settings
select generationfrom cohereai_generationwhere settings = '{ "prompt": "Write app ideas for AI-realted domains."}';
Spell check a piece of text
select generationfrom cohereai_generationwhere settings = '{"num_generations": 1}' and prompt = 'Check the smaple. Sample: "The impotance of effictive comunication. This is an exmaple artcile abot missplelled wrds."';
Schema for cohereai_generation
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
generation | text | Generation for a given text prompt. | |
likelihood | double precision | The likelihood of the generated text. | |
prompt | text | = | The prompt to get generations for, encoded as a string. |
settings | jsonb | = | Settings is a JSONB object that accepts any of the generate API request parameters. |
token_likelihoods | jsonb | The likelihood of the generated tokens/prompt. |