-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add globals, fix openai temp, remove parameters
- Loading branch information
Showing
43 changed files
with
258 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,3 +132,6 @@ dist | |
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
# docusaurus | ||
build |
21 changes: 18 additions & 3 deletions
21
packages/@pufflig/ps-chains/src/engines/dataflow/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/@pufflig/ps-chains/src/engines/dataflow/utils/sanitizeInput.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { sanitizeInput } from "./sanitizeInput"; | ||
|
||
test("sanitizeInput - remove variables", async () => { | ||
const variables = await sanitizeInput({ | ||
"param-1": "not_a_variable", | ||
"param-2": "${{ps:ref:variable-1}}", | ||
"param-3": "${{ps:ref:variable-2}", | ||
"param-4": "${{variable-4}}", | ||
}); | ||
|
||
expect(variables).toMatchInlineSnapshot(` | ||
{ | ||
"param-1": "not_a_variable", | ||
"param-2": "", | ||
"param-3": "\${{ps:ref:variable-2}", | ||
"param-4": "\${{variable-4}}", | ||
} | ||
`); | ||
}); |
14 changes: 14 additions & 0 deletions
14
packages/@pufflig/ps-chains/src/engines/dataflow/utils/sanitizeInput.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ParamValue } from "@pufflig/ps-types"; | ||
import { resolveVariables } from "./resolveVariables"; | ||
|
||
/** | ||
* Remove all variables from an input object | ||
* | ||
* @param input | ||
* @returns | ||
*/ | ||
export const sanitizeInput = (input: Record<string, ParamValue>) => { | ||
return resolveVariables(input, async () => { | ||
return ""; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export { runFlow } from "./engines/dataflow/runFlow"; | ||
export { updateNodeInput } from "./engines/dataflow/updateNodeInput"; | ||
export * from "./types"; | ||
export { resolveVariables } from "./engines/dataflow/utils/resolveVariables"; | ||
export { sanitizeInput } from "./engines/dataflow/utils/sanitizeInput"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.