in 3-ai-native-e2e-sample/frontend/src/lib/api.ts [132:147]
chat: async (message: string) => {
const response = await fetch(`${API_URL}/api/agents/literature-chat`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-version': API_VERSION,
},
body: JSON.stringify({ message }),
});
if (!response.ok) {
throw new Error('Failed to chat with literature agent');
}
return response.body;
}