8000 Updated Docs for Render Template by vaibhavK1199 · Pull Request #73 · dimagi/open-chat-studio-docs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Updated Docs for Render Template #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Alread 8000 y on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vaibhavK1199
Copy link

Added Changelog for Updated Render Template Context - dimagi/open-chat-studio#1295

@vaibhavK1199 vaibhavK1199 requested a review from snopoke March 24, 2025 11:52
@@ -273,3 +273,12 @@ hide:
* Currently we have to create it manually through the admin dashboard, but a near future release will include a dedicated page to view/edit participant data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase 'but a near future release' should be revised for clarity.

Suggested change
* Currently we have to create it manually through the admin dashboard, but a near future release will include a dedicated page to view/edit participant data.
but a near-future release

@@ -273,3 +273,12 @@ hide:
* Currently we have to create it manually through the admin dashboard, but a near future release will include a dedicated page to view/edit participant data.
* Please note that participant data is experiment specific, meaning that data we have for a participant in one
experiment may not be the same for the next experiment.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase 'meaning that data we have for a participant in one experiment may not be the same for the next experiment' can be made more concise.

Suggested change
experiment may not be the same for the next experiment.
meaning that participant data may vary between experiments.


## Mar 11, 2025

* **NEW** Updated Render Template node context
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The term 'RenderTemplate' should be consistently formatted, either as 'Render Template' or 'RenderTemplate'.

Suggested change
* **NEW** Updated Render Template node context
Render Template

## Mar 11, 2025

* **NEW** Updated Render Template node context
* The RenderTemplate node supports flexible input context handling by processing the messages field in the state.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase 'by processing the messages field in the state' could be clearer.

Suggested change
* The RenderTemplate node supports flexible input context handling by processing the messages field in the state.
by processing the 'messages' field within the state.

* This enhancement allows the node to dynamically update the context with data from dictionaries or strings.
* If the input message is a dictionary, its key-value pairs are added to the context.
* If the input message is a string, it updates the input field in the context.
* This functionality ensures that the template node can access and render content dynamically based on participant details, pipeline temp state, and other input data without needing an additional Code Node for configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase 'without needing an additional Code Node for configuration' could be simplified.

Suggested change
* This functionality ensures that the template node can access and render content dynamically based on participant details, pipeline temp state, and other input data without needing an additional Code Node for configuration.
without requiring an additional Code Node for configuration.

@@ -127,6 +127,29 @@ content = attachment.read_text()
## Template
Renders a [Jinja](https://jinja.palletsprojects.com/en/stable/templates/) template.

The RenderTemplate node ensures that the template node can access and render content dynamically based on
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase 'pipeline temp state' is unclear and could be more descriptive.

Suggested change
The RenderTemplate node ensures that the template node can access and render content dynamically based on
The RenderTemplate node ensures that the template node can access and render content dynamically based on participant details, pipeline temporary state, and other input data without needing an additional Code Node for configuration.

"This is a custom welcome message."
]
}
}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON format in 'Sample State' section is missing a closing brace.

Suggested change
}`
Add a closing brace to the JSON: }

### Sample Output
`Hello Alice,
Welcome to Wonderland!
Message: This is a custom welcome message.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'Sample Output' section should have a closing backtick for consistency.

Suggested change
Message: This is a custom welcome message.
Add a closing backtick: `

Copy link
Contributor
@SmittieC SmittieC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vaibhavK1199 from here it looks like there are specific variables that users can use. Might be good to mention the list of available variables and what data they have.

@vaibhavK1199
Copy link
Author

@vaibhavK1199 from here it looks like there are specific variables that users can use. Might be good to mention the list of available variables and what data they have.

Yep now i have added them.

- `input`: The node’s input (string).
- `temp_state`: Pipeline temporary state (dict).
- `participant_details`: Participant details with `identifier` and `platform` keys (dict).
- `participant_data`: Participant data for the session, sourced from `ParticipantDataProxy` (dict).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Participant data for the session - To avoid confusing this with the session_state, maybe just say something like

The participant's data

| `input` | The input to the node | String |
| `temp_state` | Pipeline temporary state | Dict |
| `participant_details` | Participant details (`identifier`, `platform`) | Dict |
| `participant_data` | Participant data for this session | Dict |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Remove the for this session part

}
`json
{
"experiment_session": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this example an example of what a real context might look like?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is just a simplified example for real Pipeline State object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0