Skip to content

action_call_delta_message_content

ActionCallDeltaMessageContent

Bases: BaseDeltaMessageContent

Source code in griptape/common/prompt_stack/contents/action_call_delta_message_content.py
@define
class ActionCallDeltaMessageContent(BaseDeltaMessageContent):
    tag: Optional[str] = field(default=None, metadata={"serializable": True})
    name: Optional[str] = field(default=None, metadata={"serializable": True})
    path: Optional[str] = field(default=None, metadata={"serializable": True})
    partial_input: Optional[str] = field(default=None, metadata={"serializable": True})

    def __str__(self) -> str:
        parts = []

        if self.name:
            parts.append(self.name)
            if self.path:
                parts.append(f".{self.path}")
                if self.tag:
                    parts.append(f" ({self.tag})")

        if self.partial_input:
            if parts:
                parts.append(f" {self.partial_input}")
            else:
                parts.append(self.partial_input)

        return "".join(parts)

name: Optional[str] = field(default=None, metadata={'serializable': True}) class-attribute instance-attribute

partial_input: Optional[str] = field(default=None, metadata={'serializable': True}) class-attribute instance-attribute

path: Optional[str] = field(default=None, metadata={'serializable': True}) class-attribute instance-attribute

tag: Optional[str] = field(default=None, metadata={'serializable': True}) class-attribute instance-attribute

__str__()

Source code in griptape/common/prompt_stack/contents/action_call_delta_message_content.py
def __str__(self) -> str:
    parts = []

    if self.name:
        parts.append(self.name)
        if self.path:
            parts.append(f".{self.path}")
            if self.tag:
                parts.append(f" ({self.tag})")

    if self.partial_input:
        if parts:
            parts.append(f" {self.partial_input}")
        else:
            parts.append(self.partial_input)

    return "".join(parts)