-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed 'Nonetype' is not subscriptable error * Fixed not getting secure next-auth cookies * Updated search to comply with document set selection * Updated run.py to exit after CREATE_VECTOR_STORE * Updated token limit for memory * Bugfix in checking for wrong value types * Better error handling
- Loading branch information
Showing
14 changed files
with
84 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,39 @@ | ||
export async function GET(request: Request) { | ||
import { NextRequest, NextResponse } from "next/server"; | ||
|
||
export async function GET(request: NextRequest) { | ||
const healthcheck_api = process.env.NEXT_PUBLIC_HEALTHCHECK_API as string; | ||
|
||
// Retrieve the session token from the request headers | ||
let session = request.headers.get('Authorization'); | ||
|
||
console.log('Status API - headers:', request.headers); | ||
// console.log('Status API - headers:', request.headers); | ||
|
||
// Public API key | ||
let api_key = null; | ||
|
||
// If no session, use the public API key | ||
if (!session) { | ||
if (session === null || session === undefined || session.includes('undefined')) { | ||
console.log('No session token found, using public API key'); | ||
api_key = process.env.BACKEND_API_KEY as string; | ||
session = null; // Clear the session token | ||
} | ||
|
||
const res = await fetch(healthcheck_api, { | ||
signal: AbortSignal.timeout(5000), // Abort the request if it takes longer than 5 seconds | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'Authorization': session, | ||
'X-API-Key': api_key, | ||
} as any, | ||
}) | ||
const data = await res.json() | ||
|
||
return Response.json({ data }) | ||
try { | ||
const res = await fetch(healthcheck_api, { | ||
signal: AbortSignal.timeout(5000), // Abort the request if it takes longer than 5 seconds | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'Authorization': session, | ||
'X-API-Key': api_key, | ||
} as any, | ||
}) | ||
const data = await res.json() | ||
if (!res.ok) { | ||
throw new Error(data.detail || 'Unknown Error'); | ||
} | ||
return NextResponse.json({ data }) | ||
} catch (error : any) { | ||
console.error(`${error}`); | ||
return NextResponse.json({ error: error.message }, { status: 500 }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters