Skip to content

Simple prompt

Simple prompt

An example of a simple prompt to jarvis looks like this:

curl --location 'https://api.paymentsos.com/hackathon-ai/prompt' \
--header 'private-key: replace-me' \
--header 'app-id: replace-me' \
--header 'Content-Type: application/json' \
--data '{
    "question": "Can you please tell me what is the most pouplar programing language, please provide short answer",
    "model": {
        "stop_sequences": [],
        "name": "anthropic.claude-v2",
        "max_tokens": 1000,
        "temperature": 1,
        "top_k": 250,
        "top_p": 0.999
    }
}'

and this is the answer you will get:

{
    "query": "Can you please tell me what is the most pouplar programing language, please provide short answer",
    "answer": " Python is currently one of the most popular programming languages."
}

Now lets go over all the params we had in this http request
question - This is the prompt that will be sent to the FM
stop_sequences - A set of chars that will stop the response from the FM like \n for new line * name - This is the model id from the - Bedrock supported models
max_tokens - The maximum tokens that will be in the answer - (1 token equal to 3/4 words)
temperature - Read here
top_k - Read here
top_p - Read here

Playing with the request body: different models and different params like temperature, top_k and top_p will give you different answers, play with them and find the right tool for the job.

As an example, lets ask FM from AI21 the same question

curl --location 'https://api.paymentsos.com/hackathon-ai/prompt' \
--header 'private-key: replace-me' \
--header 'app-id: replace-me' \
--header 'Content-Type: application/json' \
--data '{
"question": "Can you please tell me what is the most pouplar programing language, please provide short answer",
    "model": {
        "stop_sequences": [],
        "name": "ai21.j2-mid",
        "max_tokens": 1000,
        "temperature": 1,
        "top_k": 250,
        "top_p": 0.999
    }
}'

and this is the answer you will get:

{
    "query": "Can you please tell me what is the most pouplar programing language, please provide short answer",
    "answer": " According to recent surveys, JavaScript is currently the most popular programming language among developers."
}

As you can see different models trained and tuned on different sets of data can return various responses.