LLM Response Record â
Generated on:
ID:
Created at:
đ¤ Query â
đŦ Response â
đ§ Model Information â
Provider:
Model:
đ Raw Data â
Response JSON â
json
{{RESPONSE_JSON}}Template Usage Instructions â
To use this template, replace the placeholders with your actual data:
Placeholders to Replace: â
â Date in YYYY-MM-DD format (e.g.,2025-10-11)â Human-readable generation timestamp (e.g.,2025-10-11 12:19:56)â The record ID (e.g.,68dd1f52292b8087b556615a)â ISO timestamp (e.g.,2025-10-01T12:32:18.118141300Z)â The query or prompt sent to the LLMâ The LLM's response textâ The LLM provider (e.g.,Perplexity,OpenAI)â The specific model used (e.g.,sonar,gpt-4)â The raw JSON response from the API (formatted properly)
Python Helper Function â
If you want to automate this process, here's a Python function you can add to your script.py:
python
import json
from datetime import datetime
def format_llm_response_record(record_data):
"""
Format LLM response record into styled markdown
Args:
record_data (dict): Dictionary containing:
- id: Record ID
- created_at: ISO timestamp
- query: The query/prompt
- response: The LLM response text
- provider: LLM provider name
- model: Model name
- response_json: Raw JSON response (optional)
- generated_date: Human readable date (optional)
"""
# Format date
created_dt = datetime.fromisoformat(record_data['created_at'].replace('Z', '+00:00'))
date_str = created_dt.strftime('%Y-%m-%d')
generated_str = record_data.get('generated_date', created_dt.strftime('%Y-%m-%d %H:%M:%S'))
# Handle response_json
response_json = record_data.get('response_json', {})
if isinstance(response_json, str):
response_json = json.loads(response_json)
# Build template
template = f"""---
title: LLM Response Record
description: LLM response record with query, response, and model information
date: {date_str}
---
# LLM Response Record
**Generated on:** {generated_str}
**ID:** {record_data['id']}
**Created at:** {record_data['created_at']}
---
## đ¤ Query
{record_data['query']}
---
## đŦ Response
{record_data['response']}
---
## đ§ Model Information
**Provider:** {record_data['provider']}
**Model:** {record_data['model']}
---
## đ Raw Data
### Response JSON
```json
{json.dumps(response_json, indent=2)}
```"""
return templateThis template and helper function will ensure consistent formatting for all your LLM response records, making them much more readable and professional-looking. You can easily copy the template and fill in the placeholders manually, or use the Python function to automate the process.