TextToLLMConversation
Python template · sinapsis_chatbots_base.templates.text_to_llm_conversation
Overview
Convert TextPackets into LLMConversationPackets.
This template is useful when upstream templates generate TextPackets and downstream LLM templates expect LLMConversationPackets.
Depending on the configured mode, the template can either merge all text packets into a single conversation prompt or create one conversation packet per text packet.
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-chatbots-base==1.0.0uv pip install sinapsis-chatbots-base==1.0.0uv add sinapsis-chatbots-base==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
Conversion strategy. Use ``single`` to merge all text packets into one conversation prompt or ``per_text_packet`` to create one conversation per text packet.
Optional
Default: "single"
Optional
Default: ""
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
String used to join text packet contents when ``mode="single"``.
Optional
Default: "\n\n--- PAGE ---\n\n"
Optional
Default: null
Optional text prepended to the generated prompt.
Optional
Default: ""
Optional text appended to the generated prompt.
Optional
Default: ""
Optional
Default: null
Configuration example
Example from the Python docstring:
agent:
name: my_test_agent
templates
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: TextToLLMConversation
class_name: TextToLLMConversation
template_input: InputTemplate
attributes:
mode: single
prompt_prefix: 'text prepended to the generated prompt'
prompt_suffix: 'text appended to the generated prompt'Show schema-based configuration skeleton
templates:
- template_name: "TextToLLMConversation"
class_name: "TextToLLMConversation"
attributes:
mode: "single"
prompt: ""
run_id: null
user_id: null
agent_id: null
separator: "\n\n--- PAGE ---\n\n"
session_id: null
prompt_prefix: ""
prompt_suffix: ""
system_prompt: null
Inheritance
sinapsis_chatbots_base.templates.llm_conversation_input.LLMConversationInputEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.