Class: BraintrustState
Constructors
constructor
• new BraintrustState(loginParams): BraintrustState
Parameters
| Name | Type |
|---|---|
loginParams | LoginOptions |
Returns
Methods
apiConn
▸ apiConn(): HTTPConnection
Returns
HTTPConnection
appConn
▸ appConn(): HTTPConnection
Returns
HTTPConnection
bgLogger
▸ bgLogger(): BackgroundLogger
Returns
BackgroundLogger
copyLoginInfo
▸ copyLoginInfo(other): void
Parameters
| Name | Type |
|---|---|
other | BraintrustState |
Returns
void
login
▸ login(loginParams): Promise<void>
Parameters
| Name | Type |
|---|---|
loginParams | LoginOptions & { forceLogin?: boolean } |
Returns
Promise<void>
loginReplaceApiConn
▸ loginReplaceApiConn(apiConn): void
Parameters
| Name | Type |
|---|---|
apiConn | HTTPConnection |
Returns
void
proxyConn
▸ proxyConn(): HTTPConnection
Returns
HTTPConnection
resetLoginInfo
▸ resetLoginInfo(): void
Returns
void
serialize
▸ serialize(): Object
Returns
Object
| Name | Type |
|---|---|
apiUrl | string |
appPublicUrl | string |
appUrl | string |
gitMetadataSettings? | null | { collect: "some" | "none" | "all" ; fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] } |
loginToken | string |
orgId? | null | string |
orgName | string |
proxyUrl | string |
setFetch
▸ setFetch(fetch): void
Parameters
| Name | Type |
|---|---|
fetch | (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>(input: string | URL | Request, init?: RequestInit) => Promise<Response> |
Returns
void
deserialize
▸ deserialize(serialized): BraintrustState
Parameters
| Name | Type |
|---|---|
serialized | unknown |
Returns
Properties
apiUrl
• apiUrl: null | string = null
appPublicUrl
• appPublicUrl: null | string = null
appUrl
• appUrl: null | string = null
currentExperiment
• currentExperiment: undefined | Experiment
currentLogger
• currentLogger: undefined | Logger<false>
currentSpan
• currentSpan: IsoAsyncLocalStorage<Span>
fetch
• fetch: (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>(input: string | URL | Request, init?: RequestInit) => Promise<Response> = globalThis.fetch
Type declaration
▸ (input, init?): Promise<Response>
Parameters
| Name | Type |
|---|---|
input | URL | RequestInfo |
init? | RequestInit |
Returns
Promise<Response>
▸ (input, init?): Promise<Response>
Parameters
| Name | Type |
|---|---|
input | string | URL | Request |
init? | RequestInit |
Returns
Promise<Response>
gitMetadataSettings
• Optional gitMetadataSettings: Object
Type declaration
| Name | Type |
|---|---|
collect | "some" | "none" | "all" |
fields? | ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] |
id
• id: string
loggedIn
• loggedIn: boolean = false
loginToken
• loginToken: null | string = null
orgId
• orgId: null | string = null
orgName
• orgName: null | string = null
proxyUrl
• proxyUrl: null | string = null