Skip to content

Commit 6397205

Browse files
authored
Update replicateHelper.js
1 parent 0e11fd3 commit 6397205

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

webchat/src/replicateHelper.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ function getErrorMessage(status, attempt, maxAttempts) {
6262
// ===== MAIN API FUNCTION =====
6363
export async function generateContent(messages) {
6464

65-
const url = 'http://localhost:8080/api/replicate';
65+
const url = window.location.hostname === 'localhost'
66+
? '/api/replicate'
67+
: `${window.location.origin}/api/replicate`;
6668
const maxAttempts = 5;
6769

6870
const systemMessages = messages.filter(msg => msg.role === 'system');

0 commit comments

Comments
 (0)