meta#

  • __all__ = ['ActionSubtaskMetaEntry', 'BaseMetaEntry', 'MetaMemory'] module-attribute

Bases: BaseMetaEntry “)

Attributes#

Name

Type

Description

<a href="./#griptape.memory.meta.ActionSubtaskMetaEntry.thought" title="thought = field(default=None, kw_only=True, metadata={'serializable': True}) class-attribute instance-attribute (griptape.memory.meta.ActionSubtaskMetaEntry.thought)"><code class="language-python">thought</code></a>

Optional[str]

CoT thought string from the LLM.<br/>

<a href="./#griptape.memory.meta.ActionSubtaskMetaEntry.actions" title="actions = field(kw_only=True, metadata={'serializable': True}) class-attribute instance-attribute (griptape.memory.meta.ActionSubtaskMetaEntry.actions)"><code class="language-python">actions</code></a>

str

ReAct actions JSON string from the LLM.<br/>

<a href="./#griptape.memory.meta.ActionSubtaskMetaEntry.answer" title="answer = field(kw_only=True, metadata={'serializable': True}) class-attribute instance-attribute (griptape.memory.meta.ActionSubtaskMetaEntry.answer)"><code class="language-python">answer</code></a>

str

tool-generated and memory-processed response from Gen AI Builder.<br/>

Source Code in griptape/memory/meta/action_subtask_meta_entry.py

@define
class ActionSubtaskMetaEntry(BaseMetaEntry):
    """Used to store ActionSubtask data to preserve TaskMemory pointers and context in the form of thought and action.

    Attributes:
        thought: CoT thought string from the LLM.
        actions: ReAct actions JSON string from the LLM.
        answer: tool-generated and memory-processed response from Gen AI Builder.
    """

    type: str = field(default=BaseMetaEntry.__name__, kw_only=True, metadata={"serializable": False})
    thought: Optional[str] = field(default=None, kw_only=True, metadata={"serializable": True})
    actions: str = field(kw_only=True, metadata={"serializable": True})
    answer: str = field(kw_only=True, metadata={"serializable": True})
  • actions = field(kw_only=True, metadata={'serializable': True}) class-attribute instance-attribute

  • answer = field(kw_only=True, metadata={'serializable': True}) class-attribute instance-attribute

  • thought = field(default=None, kw_only=True, metadata={'serializable': True}) class-attribute instance-attribute

  • type = field(default=BaseMetaEntry.__name__, kw_only=True, metadata={'serializable': False}) class-attribute instance-attribute

BaseMetaEntry#

Bases: SerializableMixin “) , ABC

Source Code in griptape/memory/meta/base_meta_entry.py

@define
class BaseMetaEntry(SerializableMixin, ABC): ...

MetaMemory#

Used to store meta entries that can be shared between tasks.

Attributes#

Name

Type

Description

<a href="./#griptape.memory.meta.MetaMemory.entries" title="entries = field(factory=list, kw_only=True) class-attribute instance-attribute (griptape.memory.meta.MetaMemory.entries)"><code class="language-python">entries</code></a>

<a href="../../../data/artifacts.mdx#list" title="List (list)"><code class="language-python">list[BaseMetaEntry]</code></a>

a list of meta entries for downstream tasks and subtasks to load.<br/>

Source Code in griptape/memory/meta/meta_memory.py

@define
class MetaMemory:
    """Used to store meta entries that can be shared between tasks.

    Attributes:
        entries: a list of meta entries for downstream tasks and subtasks to load.
    """

    entries: list[BaseMetaEntry] = field(factory=list, kw_only=True)

    def add_entry(self, entry: BaseMetaEntry) -> None:
        self.entries.append(entry)
  • entries = field(factory=list, kw_only=True) class-attribute instance-attribute

add_entry(entry)#

Source Code in griptape/memory/meta/meta_memory.py

def add_entry(self, entry: BaseMetaEntry) -> None:
    self.entries.append(entry)