mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-13 08:15:21 +02:00
feat: support {{variable}} substitution in HTTP tool endpoint URL
Apply the same render_template() logic used for node prompts and preset
parameters to the endpoint URL, so users can use {{initial_context.*}}
and {{gathered_context.*}} in the URL path. The URL is rendered at
execution time just before the HTTP request.
- Backend: render URL via render_template() in execute_http_tool
- Frontend: allow {{variable}} in URL path but reject in domain
- Frontend: add hint label below Endpoint URL field
- Tests: verify URL rendering with initial_context, gathered_context,
and static (unchanged) URLs
This commit is contained in:
parent
2326a2f65a
commit
49fcb770a4
4 changed files with 142 additions and 0 deletions
|
|
@ -231,6 +231,17 @@ async def execute_http_tool(
|
|||
method = config.get("method", "POST").upper()
|
||||
url = config.get("url", "")
|
||||
|
||||
# Build render context for template variable substitution (same as preset params)
|
||||
initial_context = dict(call_context_vars or {})
|
||||
render_context: Dict[str, Any] = {
|
||||
**initial_context,
|
||||
"initial_context": initial_context,
|
||||
"gathered_context": dict(gathered_context_vars or {}),
|
||||
}
|
||||
|
||||
# Apply template rendering to URL (supports {{variable}} in path)
|
||||
url = render_template(url, render_context)
|
||||
|
||||
# Get headers from config
|
||||
headers = dict(config.get("headers", {}) or {})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue