langsmith
Version:
Client library to connect to the LangSmith Observability and Evaluation Platform.
49 lines (48 loc) • 1.52 kB
TypeScript
export declare const DEFAULT_API_URL = "https://api.smith.langchain.com";
type LangSmithProfileOAuth = {
access_token?: string;
refresh_token?: string;
expires_at?: string;
};
type LangSmithProfile = {
api_key?: string;
api_url?: string;
workspace_id?: string;
oauth?: LangSmithProfileOAuth;
};
type LangSmithProfileConfigFile = {
current_profile?: string;
profiles?: Record<string, LangSmithProfile>;
};
type LangSmithProfileState = {
configPath: string;
config: LangSmithProfileConfigFile;
profileName: string;
profile: LangSmithProfile;
};
export type ProfileAuthHeader = {
name: "Authorization" | "x-api-key";
value: string;
};
export type ProfileClientConfig = {
apiUrl?: string;
apiKey?: string;
workspaceId?: string;
oauthAccessToken?: string;
oauthRefreshToken?: string;
profileAuth?: ProfileAuth;
};
export declare function hasValue(value?: string | null): boolean;
export declare function loadProfileClientConfig(): ProfileClientConfig;
export declare class ProfileAuth {
private state;
private refreshPromise?;
private managedAuthorizationValue?;
constructor(state: LangSmithProfileState);
currentAuthHeader(): ProfileAuthHeader | undefined;
getAuthHeader(fetchImplementation: typeof fetch, signal?: AbortSignal | null): Promise<ProfileAuthHeader | undefined>;
isProfileAuthorizationHeader(value: string): boolean;
private refreshOAuthToken;
private rememberProfileAuthHeader;
}
export {};