graphlit-client 1.0.20260107003 → 1.0.20260107004
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +8 -2
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -5,7 +5,6 @@ import { ApolloClient, InMemoryCache, createHttpLink, ApolloLink, ApolloError, }
|
|
|
5
5
|
import { RetryLink } from "@apollo/client/link/retry/index.js";
|
|
6
6
|
import * as Types from "./generated/graphql-types.js";
|
|
7
7
|
import * as Documents from "./generated/graphql-documents.js";
|
|
8
|
-
import * as dotenv from "dotenv";
|
|
9
8
|
import { getServiceType, getModelName, getModelEnum } from "./model-mapping.js";
|
|
10
9
|
import { UIEventAdapter } from "./streaming/ui-event-adapter.js";
|
|
11
10
|
import { formatMessagesForOpenAI, formatMessagesForAnthropic, formatMessagesForGoogle, formatMessagesForMistral, formatMessagesForBedrock, } from "./streaming/llm-formatters.js";
|
|
@@ -182,7 +181,14 @@ class Graphlit {
|
|
|
182
181
|
: undefined) ||
|
|
183
182
|
"https://data-scus.graphlit.io/api/v1/graphql";
|
|
184
183
|
if (typeof process !== "undefined") {
|
|
185
|
-
dotenv
|
|
184
|
+
// Attempt to load dotenv if available (optional dependency)
|
|
185
|
+
try {
|
|
186
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
187
|
+
require("dotenv").config();
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
// dotenv not installed, user must set env vars manually
|
|
191
|
+
}
|
|
186
192
|
this.organizationId =
|
|
187
193
|
options.organizationId || process.env.GRAPHLIT_ORGANIZATION_ID;
|
|
188
194
|
this.environmentId =
|