Skip to content

Commit

Permalink
rewrite threads for chainlit
Browse files Browse the repository at this point in the history
  • Loading branch information
stikkireddy committed Apr 24, 2024
1 parent 3346995 commit d503557
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dbtunnel/vendor/asgiproxy/frameworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ def _modify_js_content_root_rewrite(content):
return content

def _modify_js_bundle(content, root_path):

# fix for chainlit threads lookup and redirects
content = content.replace(b'`/thread/${d.id}`', f'`{root_path}thread/${{d.id}}`'.encode("utf-8"), 1)
content = content.replace(b'"/thread/:id?"', f'"{root_path}thread/:id?"'.encode("utf-8"), 1)
content = content.replace(b'"/element/:id"', f'"{root_path}element/:id"'.encode("utf-8"), 1)

list_of_uris = [
b"/feedback",
b"/project",
Expand Down

0 comments on commit d503557

Please sign in to comment.