Skip to content

Commit

Permalink
fix(langchain_tools_demo): use relative paths for resources (#192)
Browse files Browse the repository at this point in the history
Adjusts the LangChain Tools Demo to use relative paths so that it still
works for TLs that run overly complicated IDE setups that need a proxy
to access everything.
  • Loading branch information
kurtisvg authored Jan 28, 2024
1 parent 8467dda commit 6f8ae0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions langchain_tools_demo/static/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function submitMessage() {

// Send request to backend
async function askQuestion(prompt) {
const response = await fetch('/chat', {
const response = await fetch('chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand All @@ -68,7 +68,7 @@ async function askQuestion(prompt) {
}

async function reset() {
await fetch('/reset', {
await fetch('reset', {
method: 'POST',
}).then(()=>{
window.location.reload()
Expand Down
4 changes: 2 additions & 2 deletions langchain_tools_demo/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<link href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined" rel="stylesheet">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<link rel="stylesheet" href="/static/index.css">
<link rel="stylesheet" href="static/index.css">
<script src="https://accounts.google.com/gsi/client" async defer></script>
</head>

Expand Down Expand Up @@ -80,7 +80,7 @@ <h1>SFO Airport Assistant</h1>
src="https://code.jquery.com/jquery-3.7.1.slim.min.js"
integrity="sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8="
crossorigin="anonymous"></script>
<script src="/static/index.js"></script>
<script src="static/index.js"></script>
<script>
document.getElementById('g_id_onload').setAttribute('data-client_id', '{{ client_id }}');
var currentUrl = window.location.href;
Expand Down

0 comments on commit 6f8ae0d

Please sign in to comment.