MCPcopy
hub / github.com/srcbookdev/srcbook / generateCells

Function generateCells

packages/web/src/lib/server.ts:120–136  ·  view source on GitHub ↗
(
  sessionId: string,
  request: GenerateCellsRequestType,
)

Source from the content-addressed store, hash-verified

118 | { error: true; result: string }
119 | { error: false; result: Array<CodeCellType | MarkdownCellType> };
120export async function generateCells(
121 sessionId: string,
122 request: GenerateCellsRequestType,
123): Promise<GenerateCellsResponseType> {
124 const response = await fetch(API_BASE_URL + '/sessions/' + sessionId + '/generate_cells', {
125 method: 'POST',
126 headers: { 'content-type': 'application/json' },
127 body: JSON.stringify(request),
128 });
129
130 if (!response.ok) {
131 console.error(response);
132 throw new Error('Request failed');
133 }
134
135 return response.json();
136}
137
138interface CreateSessionRequestType {
139 path: string;

Callers 1

generateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected