Prompt Overview
An Isomeric prompt is the JSON schema passed in theschema
key of your request POST body. Each schema strictly follows the JSON Schema spec.
A valid Isomeric POST request body looks like this:
Prompt Design
Designing the right prompt is critical to extracting the right data. Our LLM processes your prompt from top to bottom, and each key/value is its own pass through the model, including any previously generated data. This means that generating atitle
before generating a price
will get you a better result because the price being generated will be inferred given the context of the title.
For example:
price
output the prompt sent to the model will actually be:
recipe
data, it’s best to make that your top-level object. Like this:
Descriptions
Thedescription
value is the most powerful value to consider when designing your prompt. This informs the LLM what data specifically you’re looking for. Use plain english when describing the data definition. For example:
Types
Every key in a prompt needs a valid type. This will not only constrain the model to generate that type, it will also instruct the model on how to generate responses based on the type.String
When you want a single-string response, usestring
. This is good for things like titles, descriptions, summaries, etc.
Number
Thenumber
type will constrain the model only to generate a number as a result. Valid number examples are: 2
, 22
, 22.01
, and 22.202
. The resulting JSON will be a number therefore not wrapped in quotes.
Boolean
boolean
types will return only true
or false
. This type is great for keys used to determine something like page type. For example:
Object
Isomeric objects are powerful prompt types that contain children types. These are important in both generating the output you desire as well as in designing prompts that will yield the best results. Everyobject
must have a properties
key describing each property of the object.
For example:
Array
Isomeric can produce lists of content. Everyarray
type must have an items
attribute describing each item of the array. Let’s use reviews as an example.
Max Items
You can addmax_items
to control how many items in the list you want generated. This can be specified like so:
Attributes
Stop
As mentioned, Isomeric is an LLM trained on billions of tokens of website data. For every key/value pair, the model runs a full pass from start to finish. Just like working with other LLMs, you need to tell it when to stop generating new tokens. For everytype
specified above, we have added a default stop sequence. You can override these by specifying your own via the stop
key like so:
Max Tokens
You can control how many tokens are generated per key with themax_tokens
attribute like so:
Pattern
Pattern
is a powerful tool to use regular expressions giving you fine-grained control of the output of the model. Remember that because this is being passed in as json
you need to escape your escape characters too.
This is an example that will constrain the model to produce prices according to a strict format:
Options
You can constrain the model to a list of options to choose from. For example, given the following prompt:red
, green
, or blue
.
Nullable
strings
, numbers
, and booleans
can be marked as nullable
. This is helpful to prevent the model from hallucinating if a value does not exist on a website. In which case, a nullable
type will return null
instead of producing a hallucinated value because no value exists.