UNPKG

@aj-archipelago/cortex

Version:

Cortex is a GraphQL API for AI. It provides a simple, extensible interface for using AI services from OpenAI, Azure and others.

12 lines (9 loc) 328 B
export function assertOAIStyleDeltaMessage(t, message) { const progress = message?.data?.requestProgress; t.truthy(progress); if (progress.data) { // Should be string of serialized JSON or plain text const text = JSON.parse(progress.data); t.true(typeof text === 'string' || typeof text === 'object'); } }