AIGenerateDocument
The AIGenerateDocument tool uses AI to generate structured documents based on your prompts. It combines the power of large language models with document validation to create properly formatted, type-safe documents automatically.
Documents generated with AIGenerateDocument are validated against your document schema and displayed as interactive forms in Loopstack Studio.
Basic Usage
Simple Document Generation
transitions:
- id: generate_summary
from: start
to: summary_created
call:
- tool: AIGenerateDocument
args:
prompt: |
Create meeting notes for a team standup on January 15th
{{ rawNotes }}
responseDocument: MeetingNotesDocumentUse separate messages
transitions:
- id: generate_with_context
from: processing
to: complete
call:
- tool: AIGenerateDocument
args:
messages:
- role: system
content: "You are a professional meeting notes assistant"
- role: user
content: "Summarize the key decisions from today's meeting"
- role: user
content: "Notes: {{ rawNotes }}"
responseDocument: MeetingNotesDocumentUse Workflow Message History
transitions:
- id: generate_with_context
from: processing
to: complete
call:
- tool: CreateChatMessage
args:
role: user
content: |
Create meeting notes for a team standup on January 15th
{{ rawNotes }}
- tool: AIGenerateDocument
args:
responseDocument: MeetingNotesDocument
messagesSearchTag: message # search for all messages in the workflow's document historyConfiguration Options
LLM Settings
transitions:
- id: generate_with_model
from: start
to: generated
call:
- tool: AIGenerateDocument
args:
llm:
provider: openai
model: gpt-4
prompt: "Generate a project task list"
responseDocument: TaskDocumentParameters
prompt: A string prompt for the AI (use this for simple requests)messages: An array of messages for more complex conversationsmessagesSearchTag: Reference previously tagged messages in the workflowresponseDocument: The document class to generate (required)llm: Optional LLM configurationmodel: The AI model to useprovider: The AI provider (e.g., βopenaiβ, βanthropicβ)
Last updated on