griptape icon indicating copy to clipboard operation
griptape copied to clipboard

prompt_task.py prompt_stack should check weather self.structure is None

Open Chuan-Zh opened this issue 5 months ago • 2 comments

Describe the bug If use prompt_task without a structure, access to self.structure might raise None exception.

To Reproduce A minimal, reproducible code example.

text_artifact = TextArtifact(
    "Respond to the user's following question 'who are you' in the language '{{preferred_language}}' and tone '{{tone}}'."
)

prompt_task = PromptTask(
    text_artifact,
    context={"preferred_language": "ENGLISH", "tone": "PLAYFUL"},
)

print(prompt_task.prompt_stack.to_json())

Chuan-Zh avatar Sep 09 '24 01:09 Chuan-Zh