@langchain/langgraph-sdk
Version:
Client library for interacting with the LangGraph API
84 lines (83 loc) • 2.43 kB
JavaScript
import "./base.js";
import { AssistantsClient } from "./assistants/index.js";
import "./stream/subscription.js";
import "./stream/handles/tools.js";
import "./stream/messages.js";
import "./stream/media.js";
import "./stream/handles/subgraphs.js";
import "./stream/handles/subagents.js";
import "./stream/error.js";
import "./stream/index.js";
import "./stream/transport/http.js";
import "./stream/transport/websocket.js";
import { ThreadsClient } from "./threads/index.js";
import { RunsClient } from "./runs/index.js";
import { CronsClient } from "./crons/index.js";
import { StoreClient } from "./store/index.js";
import { UiClient } from "./ui-internal/index.js";
import "./stream/transport/agent-server.js";
import "./stream/transport/index.js";
import "./stream/resolve-client-api-url.js";
//#region src/client/index.ts
var Client = class {
/**
* The client for interacting with assistants.
*/
assistants;
/**
* The client for interacting with threads.
*/
threads;
/**
* The client for interacting with runs.
*/
runs;
/**
* The client for interacting with cron runs.
*/
crons;
/**
* The client for interacting with the KV store.
*/
store;
/**
* The client for interacting with the UI.
* @internal Used by LoadExternalComponent and the API might change in the future.
*/
"~ui";
/**
* @internal Used to obtain a stable key representing the client.
*/
"~configHash";
constructor(config) {
this["~configHash"] = JSON.stringify({
apiUrl: config?.apiUrl,
apiKey: config?.apiKey,
timeoutMs: config?.timeoutMs,
defaultHeaders: config?.defaultHeaders,
streamProtocol: config?.streamProtocol,
maxConcurrency: config?.callerOptions?.maxConcurrency,
maxRetries: config?.callerOptions?.maxRetries,
callbacks: {
onFailedResponseHook: config?.callerOptions?.onFailedResponseHook != null,
onRequest: config?.onRequest != null,
fetch: config?.callerOptions?.fetch != null
}
});
this.assistants = new AssistantsClient(config);
this.threads = new ThreadsClient(config);
this.runs = new RunsClient(config);
this.crons = new CronsClient(config);
this.store = new StoreClient(config);
this["~ui"] = new UiClient(config);
}
};
/**
* @internal Used to obtain a stable key representing the client.
*/
function getClientConfigHash(client) {
return client["~configHash"];
}
//#endregion
export { Client, getClientConfigHash };
//# sourceMappingURL=index.js.map