Álvaro Valenzuela Valdes commited on
Commit ·
7dc353b
1
Parent(s): f7cc442
🚀 Fix: Chat connectivity using absolute backend URL
Browse files
frontend/components/AgentChat.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
import { useState, useRef, useEffect } from "react";
|
| 4 |
import type { Tender, CompanyProfile } from "../lib/types";
|
| 5 |
-
import { uploadDocument } from "../lib/api";
|
| 6 |
|
| 7 |
type Message = {
|
| 8 |
role: "user" | "assistant";
|
|
@@ -113,7 +113,7 @@ export default function AgentChat({ tender, companyProfile }: Props) {
|
|
| 113 |
setIsLoading(true);
|
| 114 |
|
| 115 |
try {
|
| 116 |
-
const response = await fetch(
|
| 117 |
method: "POST",
|
| 118 |
headers: { "Content-Type": "application/json" },
|
| 119 |
body: JSON.stringify({
|
|
|
|
| 2 |
|
| 3 |
import { useState, useRef, useEffect } from "react";
|
| 4 |
import type { Tender, CompanyProfile } from "../lib/types";
|
| 5 |
+
import { uploadDocument, getAPIBase } from "../lib/api";
|
| 6 |
|
| 7 |
type Message = {
|
| 8 |
role: "user" | "assistant";
|
|
|
|
| 113 |
setIsLoading(true);
|
| 114 |
|
| 115 |
try {
|
| 116 |
+
const response = await fetch(`${getAPIBase()}/api/chat`, {
|
| 117 |
method: "POST",
|
| 118 |
headers: { "Content-Type": "application/json" },
|
| 119 |
body: JSON.stringify({
|