Releases: griptape-ai/griptape
Releases · griptape-ai/griptape
v0.34.3
v0.34.2
Fixed
- Restore human-friendly default
ImageArtifact
andAudioArtifact
names with file type extension.
Full Changelog: 0.34.1...0.34.2
v0.34.1
v0.34.0
Added
griptape.configs.logging.JsonFormatter
for formatting logs as JSON.- Request/response debug logging to all Prompt Drivers.
griptape.schemas.UnionField
for serializing union fields.BaseEventListener.flush_events()
to flush events from an Event Listener.- Exponential backoff to
BaseEventListenerDriver
for retrying failed event publishing. BaseTask.task_outputs
to get a dictionary of all task outputs. This has been added toWorkflow.context
andPipeline.context
.Chat.input_fn
for customizing the input to the Chat utility.GriptapeCloudFileManagerDriver
for managing files on Griptape Cloud.BaseFileManagerDriver.load_artifact()
&BaseFileManagerDriver.save_artifact()
for loading & saving artifacts as files.- Events
BaseChunkEvent
,TextChunkEvent
,ActionChunkEvent
. wrapt
dependency for more robust decorators.BasePromptDriver.extra_params
for passing extra parameters not explicitly declared by the Driver.RunnableMixin
which addson_before_run
andon_after_run
hooks.griptape.utils.with_contextvars
utility for running functions with the currentcontextvars
context.
Changed
- BREAKING: Removed
BaseEventListenerDriver.publish_event
flush
argument. UseBaseEventListenerDriver.flush_events()
instead. - BREAKING: Renamed parameter
driver
onEventListener
toevent_listener_driver
. - BREAKING: Updated
EventListener.handler
return value behavior.- If
EventListener.handler
returnsNone
, the event will not be published to theevent_listener_driver
. - If
EventListener.handler
is None, the event will be published to theevent_listener_driver
as-is.
- If
- BREAKING: Removed
CompletionChunkEvent
. - BREAKING: Moved
griptape.common.observable.observable
togriptape.common.decorators.observable
. - BREAKING:
AnthropicDriversConfig
no longer bundlesVoyageAiEmbeddingDriver
. - BREAKING: Removed
HuggingFaceHubPromptDriver.params
, useHuggingFaceHubPromptDriver.extra_params
instead. - BREAKING: Removed
HuggingFacePipelinePromptDriver.params
, useHuggingFacePipelinePromptDriver.extra_params
instead. - BREAKING: Renamed
BaseTask.run
toBaseTask.try_run
. - BREAKING: Renamed
BaseTask.execute
toBaseTask.run
. - BREAKING: Renamed
BaseTask.can_execute
toBaseTool.can_run
. - BREAKING: Renamed
BaseTool.run
toBaseTool.try_run
. - BREAKING: Renamed
BaseTool.execute
toBaseTool.run
. - BREAKING: Renamed callables throughout the framework for consistency:
- Renamed
LocalStructureRunDriver.structure_factory_fn
toLocalStructureRunDriver.create_structure
. - Renamed
SnowflakeSqlDriver.connection_func
toSnowflakeSqlDriver.get_connection
. - Renamed
CsvLoader.formatter_fn
toCsvLoader.format_row
. - Renamed
SqlLoader.formatter_fn
toSqlLoader.format_row
. - Renamed
CsvExtractionEngine.system_template_generator
toCsvExtractionEngine.generate_system_template
. - Renamed
CsvExtractionEngine.user_template_generator
toCsvExtractionEngine.generate_user_template
. - Renamed
JsonExtractionEngine.system_template_generator
toJsonExtractionEngine.generate_system_template
. - Renamed
JsonExtractionEngine.user_template_generator
toJsonExtractionEngine.generate_user_template
. - Renamed
PromptResponseRagModule.generate_system_template
toPromptResponseRagModule.generate_system_template
. - Renamed
PromptTask.generate_system_template
toPromptTask.generate_system_template
. - Renamed
ToolkitTask.generate_assistant_subtask_template
toToolkitTask.generate_assistant_subtask_template
. - Renamed
JsonSchemaRule.template_generator
toJsonSchemaRule.generate_template
. - Renamed
ToolkitTask.generate_user_subtask_template
toToolkitTask.generate_user_subtask_template
. - Renamed
TextLoaderRetrievalRagModule.process_query_output_fn
toTextLoaderRetrievalRagModule.process_query_output
. - Renamed
FuturesExecutorMixin.futures_executor_fn
toFuturesExecutorMixin.create_futures_executor
. - Renamed
VectorStoreTool.process_query_output_fn
toVectorStoreTool.process_query_output
. - Renamed
CodeExecutionTask.run_fn
toCodeExecutionTask.on_run
. - Renamed
Chat.input_fn
toChat.handle_input
. - Renamed
Chat.output_fn
toChat.handle_output
. - Renamed
EventListener.handler
toEventListener.on_event
.
- Renamed
- Updated
EventListener.handler
return type toOptional[BaseEvent | dict]
. BaseTask.parent_outputs
type has changed fromdict[str, str | None]
todict[str, BaseArtifact]
.Workflow.context["parent_outputs"]
type has changed fromdict[str, str | None]
todict[str, BaseArtifact]
.Pipeline.context["parent_output"]
has changed type fromstr | None
toBaseArtifact | None
._DefaultsConfig.logging_config
andDefaults.drivers_config
are now lazily instantiated.griptape.schemas.BaseSchema
now usesgriptape.schemas.UnionField
forUnion
fields.BaseTask.add_parent
/BaseTask.add_child
now only add the parent/child task to the structure if it is not already present.BaseEventListener.flush_events()
to flush events from an Event Listener.BaseEventListener
no longer requires a thread lock for batching events.- Updated
ToolkitTask
system prompt to retry/fix actions when using native tool calling. Chat
input now uses a slightly customized version ofRich.prompt.Prompt
by default.Chat
output now usesRich.print
by default.Chat.output_fn
's now takes an optional kwarg parameter,stream
.- Implemented
SerializableMixin
inStructure
,BaseTask
,BaseTool
, andTaskMemory
@activity
decorated functions can now accept kwargs that are defined in the activity schema.- Updated
ToolkitTask
system prompt to no longer mentionmemory_name
andartifact_namespace
. - Models in
ToolkitTask
with native tool calling no longer need to provide their final answer asAnswer:
. EventListener.event_types
will now listen on child types of any provided type.- Only install Tool dependencies if the Tool provides a
requirements.txt
and the dependencies are not already met. - Implemented
RunnableMixin
inStructure
,BaseTask
, andBaseTool
. EventBus
's Event Listeners are now thread/coroutine-local. Event Listeners from the spawning thread will be automatically copied when using concurrent griptape features like Workflows.
Fixed
- Structures not flushing events when not listening for
FinishStructureRunEvent
. EventListener.event_types
and the argument toBaseEventListenerDriver.handler
being out of sync.- Models occasionally hallucinating
memory_name
andartifact_namespace
into Tool schemas when usingToolkitTask
. - Models occasionally providing overly succinct final answers when using
ToolkitTask
. - Exception getting raised in
FuturesExecutorMixin.__del__
. - Issues when using
EventListener
as a context manager in a multi-threaded environment.
0.33.1
Fixed
- Pinned
cohere
at~5.11.0
to resolve slow dependency resolution. - Missing
exa-py
fromall
extra.
0.33.0
Added
Workflow.input_tasks
andWorkflow.output_tasks
to access the input and output tasks of a Workflow.- Ability to pass nested list of
Tasks
toStructure.tasks
allowing for more complex declarative Structure definitions. TavilyWebSearchDriver
to integrate Tavily's web search capabilities.ExaWebSearchDriver
to integrate Exa's web search capabilities.Workflow.outputs
to access the outputs of a Workflow.BaseFileLoader
for Loaders that load from a path.BaseLoader.fetch()
method for fetching data from a source.BaseLoader.parse()
method for parsing fetched data.BaseFileManager.encoding
to specify the encoding when loading and saving files.BaseWebScraperDriver.extract_page()
method for extracting data from an already scraped web page.TextLoaderRetrievalRagModule.chunker
for specifying the chunking strategy.file_utils.get_mime_type
utility for getting the MIME type of a file.BaseRulesetDriver
for loading aRuleset
from an external source.LocalRulesetDriver
for loading aRuleset
from a local.json
file.GriptapeCloudRulesetDriver
for loading aRuleset
resource from Griptape Cloud.
- Parameter
alias
onGriptapeCloudConversationMemoryDriver
for fetching a Thread by alias. - Basic support for OpenAi Structured Output via
OpenAiChatPromptDriver.response_format
parameter. - Ability to pass callable to
activity.schema
for dynamic schema generation.
Changed
- BREAKING: Renamed parameters on several classes to
client
:bedrock_client
onAmazonBedrockCohereEmbeddingDriver
.bedrock_client
onAmazonBedrockCohereEmbeddingDriver
.bedrock_client
onAmazonBedrockTitanEmbeddingDriver
.bedrock_client
onAmazonBedrockImageGenerationDriver
.bedrock_client
onAmazonBedrockImageQueryDriver
.bedrock_client
onAmazonBedrockPromptDriver
.sagemaker_client
onAmazonSageMakerJumpstartEmbeddingDriver
.sagemaker_client
onAmazonSageMakerJumpstartPromptDriver
.sqs_client
onAmazonSqsEventListenerDriver
.iotdata_client
onAwsIotCoreEventListenerDriver
.s3_client
onAmazonS3FileManagerDriver
.s3_client
onAwsS3Tool
.iam_client
onAwsIamTool
.pusher_client
onPusherEventListenerDriver
.mq
onMarqoVectorStoreDriver
.model_client
onGooglePromptDriver
.model_client
onGoogleTokenizer
.
- BREAKING: Renamed parameter
pipe
onHuggingFacePipelinePromptDriver
topipeline
. - BREAKING: Removed
BaseFileManager.default_loader
andBaseFileManager.loaders
. - BREAKING: Loaders no longer chunk data, use a Chunker to chunk the data.
- BREAKING: Removed
fileutils.load_file
andfileutils.load_files
. - BREAKING: Removed
loaders-dataframe
andloaders-audio
extras as they are no longer needed. - BREKING:
TextLoader
,PdfLoader
,ImageLoader
, andAudioLoader
now take astr | PathLike
instead ofbytes
. Passingbytes
is still supported but deprecated. - BREAKING: Removed
DataframeLoader
. - BREAKING: Update
pypdf
dependency to^5.0.1
. - BREAKING: Update
redis
dependency to^5.1.0
. - BREAKING: Remove
torch
extra fromtransformers
dependency. This must be installed separately. - BREAKING: Split
BaseExtractionEngine.extract
intoextract_text
andextract_artifacts
for consistency withBaseSummaryEngine
. - BREAKING:
BaseExtractionEngine
no longer catches exceptions and returnsErrorArtifact
s. - BREAKING:
JsonExtractionEngine.template_schema
is now required. - BREAKING:
CsvExtractionEngine.column_names
is now required. - BREAKING: Renamed
RuleMixin.all_rulesets
toRuleMixin.rulesets
. - BREAKING: Renamed
GriptapeCloudKnowledgeBaseVectorStoreDriver
toGriptapeCloudVectorStoreDriver
. - BREAKING:
OpenAiChatPromptDriver.response_format
is now adict
instead of astr
. MarkdownifyWebScraperDriver.DEFAULT_EXCLUDE_TAGS
now includes media/blob-like HTML tagsStructureRunTask
now inherits fromPromptTask
.- Several places where API clients are initialized are now lazy loaded.
BaseVectorStoreDriver.upsert_text_artifacts
now returns a list or dictionary of upserted vector ids.LocalFileManagerDriver.workdir
is now optional.filetype
is now a core dependency.FileManagerTool
now usesfiletype
for more accurate file type detection.BaseFileLoader.load_file()
will now either return aTextArtifact
or aBlobArtifact
depending on whetherBaseFileManager.encoding
is set.Structure.output
's type is nowBaseArtifact
and raises an exception if the output isNone
.JsonExtractionEngine.extract_artifacts
now returns aListArtifact[JsonArtifact]
.CsvExtractionEngine.extract_artifacts
now returns aListArtifact[CsvRowArtifact]
.- Remove
manifest.yml
requirements for custom tool creation.
Fixed
- Anthropic native Tool calling.
- Empty
ActionsSubtask.thought
being logged. RuleMixin
no longer prevents settingrulesets
andrules
at the same time.PromptTask
will merge in its Structure's Rulesets and Rules.PromptTask
not checking whether Structure was set before building Prompt Stack.BaseTask.full_context
context being empty when not connected to a Structure.
0.32.0
Added
BaseArtifact.to_bytes()
method to convert an Artifact's value to bytes.BlobArtifact.base64
property for converting aBlobArtifact
's value to a base64 string.CsvLoader
/SqlLoader
/DataframeLoader
formatter_fn
field for customizing how SQL results are formatted intoTextArtifact
s.AzureOpenAiTextToSpeechDriver
.JsonSchemaRule
for instructing the LLM to output a JSON object that conforms to a schema.- Ability to use Event Listeners as Context Managers for temporarily setting the Event Bus listeners.
- Ability to use Drivers Configs as Context Managers for temporarily setting the default Drivers.
- Generic type support to
ListArtifact
. - Iteration support to
ListArtifact
.
Changed
- BREAKING: Removed
CsvRowArtifact
. UseTextArtifact
instead. - BREAKING: Removed
MediaArtifact
, useImageArtifact
orAudioArtifact
instead. - BREAKING:
CsvLoader
,DataframeLoader
, andSqlLoader
now returnlist[TextArtifact]
. - BREAKING: Removed
ImageArtifact.media_type
. - BREAKING: Removed
AudioArtifact.media_type
. - BREAKING: Removed
BlobArtifact.dir_name
. - BREAKING: Moved
ImageArtifact.prompt
andImageArtifact.model
intoImageArtifact.meta
. - BREAKING:
ImageArtifact.format
is now required. - BREAKING: Removed the
__all__
declaration from thegriptape.mixins
module. - Updated
JsonArtifact
value converter to properly handle more types. AudioArtifact
now subclassesBlobArtifact
instead ofMediaArtifact
.ImageArtifact
now subclassesBlobArtifact
instead ofMediaArtifact
.- Removed
__add__
method fromBaseArtifact
, implemented it where necessary.
Fixed
- Crash when passing "empty" Artifacts or no Artifacts to
CohereRerankDriver
.
0.31.0
Added
- Parameter
meta: dict
onBaseEvent
.
Changed
- BREAKING: Drivers, Loaders, and Engines now raise exceptions rather than returning
ErrorArtifacts
. - BREAKING: Parameter
driver
onBaseConversationMemory
renamed toconversation_memory_driver
. - BREAKING:
BaseConversationMemory.add_to_prompt_stack
now takes aprompt_driver
parameter. - BREAKING:
BaseConversationMemoryDriver.load
now returnstuple[list[Run], dict]
. This represents the runs and metadata. - BREAKING:
BaseConversationMemoryDriver.store
now takesruns: list[Run]
andmetadata: dict
as input. - BREAKING: Parameter
file_path
onLocalConversationMemoryDriver
renamed topersist_file
and is now typeOptional[str]
. Defaults.drivers_config.conversation_memory_driver
now defaults toLocalConversationMemoryDriver
instead ofNone
.CsvRowArtifact.to_text()
now includes the header.
Fixed
- Parsing streaming response with some OpenAI compatible services.
- Issue in
PromptSummaryEngine
if there are no artifacts during recursive summarization. - Issue in
GooglePromptDriver
using Tools with no schema. - Missing
maxTokens
inference parameter inAmazonBedrockPromptDriver
. - Incorrect model in
OpenAiDriverConfig
'stext_to_speech_driver
. - Crash when using
CohereRerankDriver
withCsvRowArtifact
s.
0.30.2
Fixed
- Ensure thread safety when publishing events by adding a thread lock to batch operations in
BaseEventListenerDriver
. FileManagerTool
failing to save Artifacts created byExtractionTool
with aCsvExtractionEngine
.
0.30.1
Fixed
CsvExtractionEngine
not using providedRuleset
s.- Docs examples for Extraction Engines not properly passing in schemas.