Render Endpoint in Julep
Learn about the render endpoint for previewing chat inputs before sending them to the model
Overview
Julep provides a render endpoint that allows you to preview how chat inputs will be processed before actually sending them to the model. This is useful for debugging, testing templates, and understanding how the system processes your messages.
Purpose
Preview Processing
The render endpoint processes chat inputs exactly as the chat endpoint would, but stops short of sending them to the model.
Template Rendering
See how templates in your messages and system prompts will be rendered with the current environment variables.
Document Retrieval
Preview which documents will be retrieved from your knowledge base for a given input.
Tool Configuration
Examine how tools will be formatted and made available to the model.
Debugging
Useful for debugging complex prompts and understanding the exact input that would be sent to the model.
- The render endpoint uses the same input format as the chat endpoint but returns the processed messages without actually calling the model.
- To use the render endpoint, you need to create a session first. To learn more about the session object, check out the Session page.
Input Structure
The render endpoint accepts the same input structure as the chat endpoint:
- Messages: An array of input messages representing the conversation so far.
- Tools: (Advanced) Additional tools provided for this specific interaction.
- Tool Choice: Specifies which tool the agent should use.
- Memory Access: Controls how the session accesses history and memories (
recall
parameter). - Additional Parameters: Various parameters to control the behavior of the rendering.
Here’s an example of how a typical message object might be structured in a render request:
Additional Parameters
The render endpoint accepts the same parameters as the chat endpoint:
Parameter | Type | Description | Default |
---|---|---|---|
model | str | The model to use for validation (though no actual model call is made). | None |
agent | UUID | Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) | None |
recall | bool | Whether previous memories and docs should be recalled or not. | True |
response_format | str | Response format specification (used for validation only). | None |
temperature | float | Not used in rendering but validated for format. | None |
top_p | float | Not used in rendering but validated for format. | 1.0 |
max_tokens | int | Not used in rendering but validated for format. | None |
stop | list[str] | Not used in rendering but validated for format. | [] |
Response Structure
The render endpoint returns a RenderResponse
object with the following structure:
The render response includes:
messages
: The fully processed messages, including rendered templates and system messages.docs
: List of document references that would be used for this request, intended for citation purposes.tools
: The formatted tools that would be available to the model.
Usage
Here’s an example of how to use the render endpoint in Julep using the SDKs:
To use the render endpoint, you always have to create a session first.
Use Cases
Template Debugging
Test how your templates will be rendered with the current environment variables.
RAG Preview
Preview which documents will be retrieved for a given query.
Tool Configuration
Verify that tools are properly configured before sending to the model.
System Prompt Testing
Test how system prompts will be processed and combined with user messages.
Support
If you need help with further questions in Julep:
- Join our Discord community
- Check the GitHub repository
- Contact support at hey@julep.ai