Evaluators - Get multiple
- TypeScript
- Python
Get evaluators for a given pipeline with getEvaluators()
.
Get evaluators for a given pipeline with get_evaluators()
.
Example
typescript
import { init, getEvaluators } from "@gentrace/core";async function main() {init({apiKey: process.env.GENTRACE_API_KEY ?? ""});// example pipeline slugconst pipelineSlug = "compose";const evaluatorsFromSlug = await getEvaluators(pipelineSlug);console.log(evaluatorsFromSlug);// example pipeline IDconst pipelineId = "2c97ffc2-4fd0-5188-8f77-88ab8e2de3b5";const evaluatorsFromId = await getEvaluators(pipelineId);console.log(evaluatorsFromId);// get evaluator templatesconst evaluatorsTemplates = await getEvaluators(null);console.log(evaluatorsTemplates);}main();
python
import gentraceimport osfrom dotenv import load_dotenvload_dotenv()def main():gentrace.init(api_key=os.getenv("GENTRACE_API_KEY"))# example pipeline slugpipeline_slug = "compose"evaluators_from_slug = gentrace.get_evaluators(pipeline_slug = pipeline_slug)print(evaluators_from_slug)# example pipeline IDpipeline_id = "2c97ffc2-4fd0-5188-8f77-88ab8e2de3b5"evaluators_from_id = gentrace.get_evaluators(pipeline_id = pipeline_id)print(evaluators_from_id)# get evaluator templatesevaluator_templates = gentrace.get_evaluators()print(evaluator_templates)main()
Arguments
Return value
Array of Evaluator
objects.
Learn about the typing of the return value on this API page.