MCPcopy Index your code
hub / github.com/promptfoo/promptfoo / validatePythonScriptResult

Function validatePythonScriptResult

src/providers/pythonCompletion.ts:156–174  ·  view source on GitHub ↗
(
  apiType: PythonApiType,
  functionName: string,
  result: any,
)

Source from the content-addressed store, hash-verified

154}
155
156function validatePythonScriptResult(
157 apiType: PythonApiType,
158 functionName: string,
159 result: any,
160): void {
161 switch (apiType) {
162 case 'call_api':
163 validateCallApiResult(functionName, result);
164 return;
165 case 'call_embedding_api':
166 validateEmbeddingResult(functionName, result);
167 return;
168 case 'call_classification_api':
169 validateClassificationResult(functionName, result);
170 return;
171 default:
172 throw new Error(`Unsupported apiType: ${apiType}`);
173 }
174}
175
176export class PythonProvider implements ApiProvider {
177 config: PythonProviderConfig;

Callers 1

executePythonScriptMethod · 0.85

Calls 3

validateCallApiResultFunction · 0.85
validateEmbeddingResultFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…