MCPcopy Index your code
hub / github.com/simstudioai/sim / formatKnowledgeBase

Function formatKnowledgeBase

apps/sim/app/api/v1/knowledge/utils.ts:46–60  ·  view source on GitHub ↗
(kb: KnowledgeBaseWithCounts)

Source from the content-addressed store, hash-verified

44 * Formats a KnowledgeBaseWithCounts into the API response shape.
45 */
46export function formatKnowledgeBase(kb: KnowledgeBaseWithCounts) {
47 return {
48 id: kb.id,
49 name: kb.name,
50 description: kb.description,
51 tokenCount: kb.tokenCount,
52 embeddingModel: kb.embeddingModel,
53 embeddingDimension: kb.embeddingDimension,
54 chunkingConfig: kb.chunkingConfig,
55 docCount: kb.docCount,
56 connectorTypes: kb.connectorTypes,
57 createdAt: serializeDate(kb.createdAt),
58 updatedAt: serializeDate(kb.updatedAt),
59 }
60}
61
62/**
63 * Handles unexpected errors with consistent logging and response.

Callers 2

route.tsFile · 0.90
route.tsFile · 0.90

Calls 1

serializeDateFunction · 0.85

Tested by

no test coverage detected