Learn about the render endpoint for previewing chat inputs before sending them to the model
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.
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 accepts the same input structure as the chat endpoint:
recall
parameter).Here’s an example of how a typical message object might be structured in a render request:
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. | [] |
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.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.
Test how your templates will be rendered with the current environment variables.
Preview which documents will be retrieved for a given query.
Verify that tools are properly configured before sending to the model.
Test how system prompts will be processed and combined with user messages.
If you need help with further questions in Julep: