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

Function hasPythonResultProperty

src/providers/pythonCompletion.ts:45–54  ·  view source on GitHub ↗
(
  result: any,
  propertyName: 'output' | 'error' | 'embedding' | 'classification',
)

Source from the content-addressed store, hash-verified

43}
44
45function hasPythonResultProperty(
46 result: any,
47 propertyName: 'output' | 'error' | 'embedding' | 'classification',
48): boolean {
49 return (
50 Boolean(result) &&
51 typeof result === 'object' &&
52 Object.prototype.hasOwnProperty.call(result, propertyName)
53 );
54}
55
56function applyCachedCallApiMetadata(apiType: PythonApiType, parsedResult: any) {
57 if (apiType !== 'call_api' || typeof parsedResult !== 'object' || parsedResult === null) {

Callers 4

hasPythonResultErrorFunction · 0.85
validateCallApiResultFunction · 0.85
validateEmbeddingResultFunction · 0.85

Calls 1

callMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…