Comparing version 0.1.0 to 0.1.1
@@ -86,2 +86,9 @@ "use strict"; | ||
// src/post-process.ts | ||
function post_process(llm_output) { | ||
llm_output = llm_output.trim(); | ||
llm_output = llm_output.replace(/^```.*\n/m, "").replace(/```\n?$/m, ""); | ||
return llm_output; | ||
} | ||
// src/query/openai.ts | ||
@@ -215,3 +222,5 @@ var import_debug = __toESM(require("debug")); | ||
log2("output", output); | ||
const json = JSON.parse(output); | ||
const post = post_process(output); | ||
log2("post-processed", post); | ||
const json = JSON.parse(post); | ||
if (!(opt == null ? void 0 : opt.check)) { | ||
@@ -218,0 +227,0 @@ return { result: json, errors: [] }; |
{ | ||
"name": "@ai-d/aid", | ||
"description": "Aid provides a structured and type-safe way to interact with LLMs.", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"author": "JacobLinCool <jacoblincool@gmail.com> (https://jacoblin.cool)", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31400
616