add auth for copilot and agents

This commit is contained in:
ramnique 2025-01-29 08:33:06 +05:30
parent cdc96e7ce3
commit ad4ea23d79
14 changed files with 173 additions and 43 deletions

View file

@ -504,6 +504,7 @@ export async function getCopilotResponse(
body: JSON.stringify(request),
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.COPILOT_API_KEY}`,
},
});
if (!response.ok) {

View file

@ -162,11 +162,12 @@ export async function getAgenticApiResponse(
}> {
// call agentic api
console.log(`agentic request`, JSON.stringify(request, null, 2));
const response = await fetch(process.env.AGENTIC_API_URL + '/chat', {
const response = await fetch(process.env.AGENTS_API_URL + '/chat', {
method: 'POST',
body: JSON.stringify(request),
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.AGENTS_API_KEY}`,
},
});
if (!response.ok) {