-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathclient_internal.go
More file actions
45 lines (36 loc) · 1.2 KB
/
client_internal.go
File metadata and controls
45 lines (36 loc) · 1.2 KB
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
package langfuse
import (
"time"
"github.com/google/uuid"
"github.com/bdpiprava/GoLangfuse/types"
)
// This file contains all types required to frame a request but does not require it to be exposed
// event an ingestion event to add trace, span, generation or score to langfuse
type event struct {
ID string `json:"id"` // ID an event id
Type string `json:"type"`
Timestamp time.Time `json:"timestamp"`
Metadata map[string]any `json:"metadata,omitempty"`
Body types.LangfuseEvent `json:"body"`
}
// ingestionRequest langfuse ingestion request, only for client internal use
type ingestionRequest struct {
Batch []event `json:"batch"`
}
// success langfuse response for the success cases
type success struct {
ID uuid.UUID `json:"id"`
Status int `json:"status"`
}
// eventError an error specific to event
type eventError struct {
ID uuid.UUID `json:"id"`
Status int `json:"status"`
Message string `json:"message"`
Error string `json:"error"`
}
// ingestionResponse api call response from langfuse
type ingestionResponse struct {
Successes []success `json:"successes"`
Errors []eventError `json:"errors"`
}