(input: PromptEncoded, ast: AST.AST)
| 1375 | const encodeMessages = ParseResult.encodeEither(Schema.Array(Message)) |
| 1376 | |
| 1377 | const decodePrompt = (input: PromptEncoded, ast: AST.AST) => |
| 1378 | ParseResult.mapBoth(decodeMessages(input.content), { |
| 1379 | onFailure: () => new ParseResult.Type(ast, input, `Unable to decode ${JSON.stringify(input)} into a Prompt`), |
| 1380 | onSuccess: makePrompt |
| 1381 | }) |
| 1382 | |
| 1383 | const encodePrompt = (input: Prompt, ast: AST.AST) => |
| 1384 | ParseResult.mapBoth(encodeMessages(input.content), { |
no test coverage detected