-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from griptape-ai:dev
* Added `max_tokens` to most configuration and prompt_driver nodes. This gives you the ability to control how many tokens come back from the LLM. _Note: It's a known issue that AmazonBedrock doesn't work with max_tokens at the moment._ * Added `Griptape Tool: Extraction` node that lets you extract either json or csv text with either a json schema or column header definitions. This works well with TaskMemory. * Added `Griptape Tool: Prompt Summary` node that will summarize text. This works well with TaskMemory.
- Loading branch information
Showing
30 changed files
with
423 additions
and
117 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 |
---|---|---|
|
@@ -161,3 +161,5 @@ cython_debug/ | |
poetry.lock | ||
pyproject.toml | ||
griptape_config.json | ||
pyproject_old.toml | ||
pyproject_pub.toml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { ComfyWidgets } from "../../../scripts/widgets.js"; | ||
import { fitHeight } from "./utils.js"; | ||
import { formatAndDisplayJSON } from "./gtUIUtils.js"; | ||
import { hideWidget, showWidget } from "./utils.js"; | ||
import { app } from "../../../scripts/app.js"; | ||
export function setupExtractionNodes(nodeType, nodeData, app) { | ||
if (nodeData.name === "Griptape Tool: Extraction") { | ||
setupExtractionTypeAttrr(nodeType, nodeData, app); | ||
} | ||
} | ||
|
||
function setupExtractionTypeAttrr(nodeType, nodeData, app) { | ||
const onNodeCreated = nodeType.prototype.onNodeCreated | ||
nodeType.prototype.onNodeCreated = function() { | ||
const me = onNodeCreated?.apply(this); | ||
const widget_extraction_type = this.widgets.find(w => w.name === 'extraction_type'); | ||
const widget_column_names = this.widgets.find(w=> w.name === 'column_names'); | ||
const widget_template_schema = this.widgets.find(w=> w.name === 'template_schema'); | ||
|
||
// Hide both widgets | ||
widget_extraction_type.callback = async() => { | ||
hideWidget(this, widget_column_names); | ||
hideWidget(this, widget_template_schema); | ||
|
||
switch (widget_extraction_type.value) { | ||
case "csv": | ||
showWidget(widget_column_names); | ||
// fitHeight(this, true); | ||
break; | ||
case "json": | ||
showWidget(widget_template_schema); | ||
// fitHeight(this, true); | ||
break; | ||
default: | ||
// fitHeight(this, true); | ||
break; | ||
} | ||
} | ||
|
||
setTimeout(() => { widget_extraction_type.callback() }, 5); | ||
return me; | ||
// setupMessageStyle(this.message); | ||
}; | ||
|
||
} | ||
|
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
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
Oops, something went wrong.