-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlangsmith.go
More file actions
47 lines (38 loc) · 760 Bytes
/
Copy pathlangsmith.go
File metadata and controls
47 lines (38 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package mylangchaingo
import (
"sync/atomic"
)
var runID, parentID, rootID atomic.Value
// SetRunId sets the run id
func SetRunId(runId string) {
runID.Store(runId)
}
// GetRunId gets the run id
func GetRunId() string {
if runID.Load() == nil {
return ""
}
return runID.Load().(string)
}
// SetParentId sets the parent id
func SetParentId(parentId string) {
parentID.Store(parentId)
}
// GetParentId gets the parent id
func GetParentId() string {
if parentID.Load() == nil {
return ""
}
return parentID.Load().(string)
}
// SetRootId sets the root id
func SetRootId(rootId string) {
rootID.Store(rootId)
}
// GetRootId gets the root id
func GetRootId() string {
if rootID.Load() == nil {
return ""
}
return rootID.Load().(string)
}