MCPcopy Create free account
hub / github.com/CopilotKit/aimock / validateWebSearches

Function validateWebSearches

src/fixture-loader.ts:239–277  ·  view source on GitHub ↗
(
  response: { webSearches?: unknown },
  fixtureIndex: number,
  results: ValidationResult[],
)

Source from the content-addressed store, hash-verified

237}
238
239function validateWebSearches(
240 response: { webSearches?: unknown },
241 fixtureIndex: number,
242 results: ValidationResult[],
243): void {
244 if (response.webSearches !== undefined) {
245 if (!Array.isArray(response.webSearches)) {
246 results.push({
247 severity: "error",
248 fixtureIndex,
249 message: "webSearches must be an array of strings",
250 });
251 } else if (response.webSearches.length === 0) {
252 results.push({
253 severity: "warning",
254 fixtureIndex,
255 message: "webSearches is empty array — no web search events will be emitted",
256 });
257 } else {
258 for (let j = 0; j < response.webSearches.length; j++) {
259 if (typeof response.webSearches[j] !== "string") {
260 results.push({
261 severity: "error",
262 fixtureIndex,
263 message: `webSearches[${j}] is not a string`,
264 });
265 break;
266 }
267 if (response.webSearches[j] === "") {
268 results.push({
269 severity: "warning",
270 fixtureIndex,
271 message: `webSearches[${j}] is empty string`,
272 });
273 }
274 }
275 }
276 }
277}
278
279function validateBlocks(
280 response: { blocks?: unknown; content?: unknown; toolCalls?: unknown },

Callers 1

validateFixturesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…