fix: Get proper langgraph api url from PORT env var in agent (#217)

This commit is contained in:
Brace Sproul 2025-06-18 11:23:35 -07:00 • committed by GitHub
parent ff8a0f7167
commit ac9f6a3986
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,8 +4,8 @@ export function createLangGraphClient(options?: {
defaultHeaders?: Record<string, string>;
includeApiKey?: boolean;
}) {
if (!process.env.LANGGRAPH_API_URL) {
throw new Error("LANGGRAPH_API_URL not found");
if (!process.env.PORT) {
throw new Error("PORT environment variable not found");
}
if (options?.includeApiKey && !process.env.LANGGRAPH_API_KEY) {
throw new Error("LANGGRAPH_API_KEY not found");
@ -14,7 +14,7 @@ export function createLangGraphClient(options?: {
...(options?.includeApiKey && {
apiKey: process.env.LANGGRAPH_API_KEY,
}),
apiUrl: process.env.LANGGRAPH_API_URL,
apiUrl: `http://localhost:${process.env.PORT}`,
defaultHeaders: options?.defaultHeaders,
});
}