Skip to main content
GET
/
sdk
/
v1
/
evaluations
JavaScript
import PromptFoundry from '@prompt-foundry/typescript-sdk';

const client = new PromptFoundry({
  apiKey: process.env['PROMPT_FOUNDRY_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const evaluations = await client.evaluations.list();

  console.log(evaluations);
}

main();
import os
from prompt_foundry_python_sdk import PromptFoundry

client = PromptFoundry(
# This is the default and can be omitted
api_key=os.environ.get("PROMPT_FOUNDRY_API_KEY"),
)
evaluations = client.evaluations.list()
print(evaluations)
curl --request GET \
--url https://api.promptfoundry.ai/sdk/v1/evaluations \
--header 'X-API-KEY: <api-key>'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.promptfoundry.ai/sdk/v1/evaluations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.promptfoundry.ai/sdk/v1/evaluations"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-API-KEY", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.promptfoundry.ai/sdk/v1/evaluations")
.header("X-API-KEY", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.promptfoundry.ai/sdk/v1/evaluations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'

response = http.request(request)
puts response.read_body
[
  {
    "id": "<string>",
    "promptId": "<string>",
    "appendedMessages": [
      {
        "content": [
          {
            "type": "TEXT",
            "text": "<string>"
          }
        ]
      }
    ],
    "variables": {},
    "weight": 1,
    "threshold": 1
  }
]
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}

Authorizations

X-API-KEY
string
header
required

Response

Successful operation

id
string
required
promptId
string
required
appendedMessages
object[]
required

The messages to append to the completion messages when running the evaluation.

variables
object
required

The template variables added to the prompt when executing the prompt.

weight
number
default:1

How heavily to weigh the evaluation within the prompt.

Required range: 0 <= x <= 1
threshold
number
default:1

What percentage of assertions must pass for the evaluation to pass.

Required range: 0 <= x <= 1