Skip to content

Fix TemplateResponse calls for Starlette 0.36+ API#38

Merged
teallarson merged 2 commits intomainfrom
teallarson/fix-template-response
Apr 9, 2026
Merged

Fix TemplateResponse calls for Starlette 0.36+ API#38
teallarson merged 2 commits intomainfrom
teallarson/fix-template-response

Conversation

@teallarson
Copy link
Copy Markdown
Collaborator

@teallarson teallarson commented Apr 9, 2026

Summary

  • Starlette 0.36+ changed TemplateResponse signature from (name, context) to (request, name, context)
  • The old call was passing the context dict as the template name, causing Jinja2's cache to fail with TypeError: unhashable type: 'dict'
  • Fixed both index and dashboard_page endpoints in templates/langchain/app/main.py

it works now!

Screenshot 2026-04-09 at 4 08 22 PM

Starlette 0.36+ changed the signature from (name, context) to
(request, name, context), causing a TypeError: unhashable type: 'dict'
when the context dict was passed as the template name to Jinja2's cache.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@teallarson teallarson requested a review from torresmateo April 9, 2026 20:08
@teallarson teallarson marked this pull request as ready for review April 9, 2026 20:09
@teallarson teallarson requested a review from sdserranog April 9, 2026 20:09
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@teallarson teallarson merged commit fc5c5e8 into main Apr 9, 2026
@teallarson teallarson deleted the teallarson/fix-template-response branch April 9, 2026 20:14
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