Skip to content

Commit

Permalink
Update default artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed Jun 14, 2024
1 parent f756096 commit 19337e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions griptape/structures/agent.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Optional, Callable
from attrs import define, field
from griptape.artifacts.text_artifact import TextArtifact
from griptape.tools import BaseTool
from griptape.memory.structure import Run
from griptape.structures import Structure
from griptape.tasks import PromptTask, ToolkitTask, BaseTextInputTask
from griptape.tasks import PromptTask, ToolkitTask
from griptape.artifacts import BaseArtifact

if TYPE_CHECKING:
Expand All @@ -14,7 +15,7 @@
@define
class Agent(Structure):
input: str | list | tuple | BaseArtifact | Callable[[BaseTask], BaseArtifact] = field(
default=BaseTextInputTask.DEFAULT_INPUT_TEMPLATE
default=lambda task: task.full_context["args"][0] if task.full_context["args"] else TextArtifact(value="")
)
tools: list[BaseTool] = field(factory=list, kw_only=True)
max_meta_memory_entries: Optional[int] = field(default=20, kw_only=True)
Expand Down
5 changes: 2 additions & 3 deletions griptape/tasks/base_text_input_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@

@define
class BaseTextInputTask(RuleMixin, BaseTask, ABC):
DEFAULT_INPUT_TEMPLATE = "{{ args[0] }}"

_input: str | list | tuple | BaseArtifact | Callable[[BaseTask], BaseArtifact] = field(
default=DEFAULT_INPUT_TEMPLATE, alias="input"
default=lambda task: task.full_context["args"][0] if task.full_context["args"] else TextArtifact(value=""),
alias="input",
)

@property
Expand Down

0 comments on commit 19337e1

Please sign in to comment.