mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
chore: add chatbox demo
This commit is contained in:
parent
bed06b4100
commit
589a4f507a
@ -4,7 +4,7 @@
|
||||
"answer": "a side project"
|
||||
},
|
||||
{
|
||||
"question": "when was jina ai founded?",
|
||||
"question": "when was jina ai founded, month and year?",
|
||||
"answer": "feb 2020"
|
||||
},
|
||||
{
|
||||
@ -24,7 +24,7 @@
|
||||
"answer": "30"
|
||||
},
|
||||
{
|
||||
"question": "when was jina reader released?",
|
||||
"question": "when was jina reader api released?",
|
||||
"answer": "April 2024"
|
||||
},
|
||||
{
|
||||
@ -1,37 +0,0 @@
|
||||
import axios from 'axios'; // You'll need to npm install axios first
|
||||
|
||||
async function testRequest(): Promise<any> {
|
||||
console.log('Starting test request...');
|
||||
|
||||
try {
|
||||
const response = await axios.get('https://jsonplaceholder.typicode.com/posts/1', {
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
|
||||
}
|
||||
});
|
||||
|
||||
console.log('Response status:', response.status);
|
||||
console.log('Request completed');
|
||||
return response.data;
|
||||
|
||||
} catch (error) {
|
||||
if (axios.isAxiosError(error)) {
|
||||
console.error('Axios error:', {
|
||||
message: error.message,
|
||||
code: error.code,
|
||||
status: error.response?.status
|
||||
});
|
||||
} else {
|
||||
console.error('Unexpected error:', error);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// Test
|
||||
console.log('Before test request');
|
||||
testRequest()
|
||||
.then(result => console.log('Success:', result))
|
||||
.catch(error => console.error('Error:', error));
|
||||
console.log('After test request');
|
||||
Loading…
x
Reference in New Issue
Block a user