Spaces:
Sleeping
Sleeping
Commit
·
2e1020f
1
Parent(s):
4998fbf
change the localhost to prod space url
Browse files
src/backend/voice_assistant.py
CHANGED
@@ -39,7 +39,7 @@ app = FastAPI()
|
|
39 |
# Add CORS middleware
|
40 |
app.add_middleware(
|
41 |
CORSMiddleware,
|
42 |
-
allow_origins=["
|
43 |
allow_credentials=True,
|
44 |
allow_methods=["GET", "POST", "OPTIONS"],
|
45 |
allow_headers=["Content-Type", "Authorization", "Accept", "X-Requested-With"],
|
|
|
39 |
# Add CORS middleware
|
40 |
app.add_middleware(
|
41 |
CORSMiddleware,
|
42 |
+
allow_origins=["https://abdullah-khaled-ai-voice-secretary.hf.space"],
|
43 |
allow_credentials=True,
|
44 |
allow_methods=["GET", "POST", "OPTIONS"],
|
45 |
allow_headers=["Content-Type", "Authorization", "Accept", "X-Requested-With"],
|
src/components/VoiceAssistant.jsx
CHANGED
@@ -28,7 +28,7 @@ const VoiceAssistant = () => {
|
|
28 |
|
29 |
// Initialize WebSocket
|
30 |
useEffect(() => {
|
31 |
-
websocketRef.current = new WebSocket('ws://
|
32 |
|
33 |
websocketRef.current.onopen = () => {
|
34 |
console.log('WebSocket connected');
|
@@ -317,7 +317,7 @@ const VoiceAssistant = () => {
|
|
317 |
try {
|
318 |
console.log('Sending POST request to /text_query with query:', textInput);
|
319 |
requestStartTimeRef.current = performance.now(); // Start latency timer
|
320 |
-
const response = await fetch('
|
321 |
method: 'POST',
|
322 |
headers: {
|
323 |
'Content-Type': 'application/json',
|
|
|
28 |
|
29 |
// Initialize WebSocket
|
30 |
useEffect(() => {
|
31 |
+
websocketRef.current = new WebSocket('ws://abdullah-khaled-ai-voice-secretary.hf.space/ws');
|
32 |
|
33 |
websocketRef.current.onopen = () => {
|
34 |
console.log('WebSocket connected');
|
|
|
317 |
try {
|
318 |
console.log('Sending POST request to /text_query with query:', textInput);
|
319 |
requestStartTimeRef.current = performance.now(); // Start latency timer
|
320 |
+
const response = await fetch('https://abdullah-khaled-ai-voice-secretary.hf.space/text_query', {
|
321 |
method: 'POST',
|
322 |
headers: {
|
323 |
'Content-Type': 'application/json',
|