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 evaluationAssertion = await client.evaluationAssertions.get('1212121');
console.log(evaluationAssertion);
}
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"),
)
evaluation_assertion = client.evaluation_assertions.get(
"1212121",
)
print(evaluation_assertion)curl --request GET \
--url https://api.promptfoundry.ai/sdk/v1/evaluation-assertions/{id} \
--header 'X-API-KEY: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.promptfoundry.ai/sdk/v1/evaluation-assertions/{id}",
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/evaluation-assertions/{id}"
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/evaluation-assertions/{id}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptfoundry.ai/sdk/v1/evaluation-assertions/{id}")
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{
"type": "EXACT_MATCH",
"evaluationId": "<string>",
"targetValue": "<string>",
"id": "<string>",
"weight": 1,
"jsonPath": "$",
"ignoreCase": false,
"negate": false
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}API Reference
Get Evaluation Assertion
Retrieve the details of an evaluation assertion using its ID.
GET
/
sdk
/
v1
/
evaluation-assertions
/
{id}
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 evaluationAssertion = await client.evaluationAssertions.get('1212121');
console.log(evaluationAssertion);
}
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"),
)
evaluation_assertion = client.evaluation_assertions.get(
"1212121",
)
print(evaluation_assertion)curl --request GET \
--url https://api.promptfoundry.ai/sdk/v1/evaluation-assertions/{id} \
--header 'X-API-KEY: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.promptfoundry.ai/sdk/v1/evaluation-assertions/{id}",
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/evaluation-assertions/{id}"
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/evaluation-assertions/{id}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptfoundry.ai/sdk/v1/evaluation-assertions/{id}")
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{
"type": "EXACT_MATCH",
"evaluationId": "<string>",
"targetValue": "<string>",
"id": "<string>",
"weight": 1,
"jsonPath": "$",
"ignoreCase": false,
"negate": false
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Path Parameters
Example:
"1212121"
Response
Successfully retrieved the evaluation assertion
- EvaluationAssertionExactMatch
- EvaluationAssertionContainsAll
- EvaluationAssertionContainsAny
- EvaluationAssertionStartsWith
- EvaluationAssertionCost
- EvaluationAssertionLatency
- EvaluationAssertionToolCalled
- EvaluationAssertionToolCalledWith
Available options:
EXACT_MATCH The value to match.
How heavily to weigh the assertion within the evaluation.
Required range:
0 <= x <= 1A JSON path to use when matching a JSON response.
Whether to ignore case when comparing strings.
Whether to negate the assertion. "true" means the assertion must NOT be true.
Was this page helpful?