MCPcopy Create free account
hub / github.com/algolia/docsearch / looksLikeJsonObjectString

Function looksLikeJsonObjectString

packages/docsearch-react/src/utils/ai.ts:285–288  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

283const TOKEN_OUTPUT_LIMIT_FALLBACK = 'Could not complete response due to token output limits';
284
285function looksLikeJsonObjectString(s: string): boolean {
286 const t = s.trim();
287 return t.startsWith('{') && t.endsWith('}');
288}
289
290/**
291 * Message shown in the top blocking banner (parsed API text, never raw JSON when avoidable).

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected