chore: add chatbox demo

This commit is contained in:
Han Xiao 2025-02-09 20:08:36 +08:00
parent bed06b4100
commit 589a4f507a
2 changed files with 2 additions and 39 deletions

View File

@ -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"
},
{

View File

@ -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');