MCPcopy Create free account
hub / github.com/simstudioai/sim / parseStrictStreamSnapshot

Function parseStrictStreamSnapshot

apps/sim/hooks/queries/mothership-chats.ts:141–152  ·  view source on GitHub ↗
(
  value: unknown,
  context: string
)

Source from the content-addressed store, hash-verified

139}
140
141function parseStrictStreamSnapshot(
142 value: unknown,
143 context: string
144): MothershipChatHistory['streamSnapshot'] {
145 if (value === undefined || value === null) {
146 return null
147 }
148
149 const snapshot = parseStreamSnapshot(value)
150 assertValid(snapshot !== null, `${context} is invalid`)
151 return snapshot
152}
153
154function parseChatHistory(value: unknown): MothershipChatHistory {
155 const responseContext = 'Invalid chat response'

Callers 1

parseChatHistoryFunction · 0.85

Calls 2

parseStreamSnapshotFunction · 0.85
assertValidFunction · 0.85

Tested by

no test coverage detected