Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions callbacks/langfuse/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.23.0

require (
github.com/bytedance/mockey v1.2.13
github.com/bytedance/sonic v1.14.1
github.com/cloudwego/eino v0.6.0
github.com/cloudwego/eino-ext/libs/acl/langfuse v0.0.0-20251124083837-ce2e7e196f9f
github.com/golang/mock v1.6.0
Expand All @@ -15,6 +14,7 @@ require (
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/bytedance/gopkg v0.1.3 // indirect
github.com/bytedance/sonic v1.14.1 // indirect
github.com/bytedance/sonic/loader v0.3.0 // indirect
Comment on lines +17 to 18
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.com/bytedance/sonic and github.com/bytedance/sonic/loader are still present in this module’s go.mod (even if indirect). If the intent is to eliminate Go 1.24 linker/runtime issues related to sonic/loader, this module will likely still pull it in via dependencies (e.g., github.com/cloudwego/eino-ext/libs/acl/langfuse in this repo currently imports sonic). Consider updating that dependency to stop using sonic and/or removing these indirect requirements once the dependency graph no longer needs them.

Suggested change
github.com/bytedance/sonic v1.14.1 // indirect
github.com/bytedance/sonic/loader v0.3.0 // indirect

Copilot uses AI. Check for mistakes.
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
Expand Down Expand Up @@ -42,8 +42,8 @@ require (
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/yargevad/filepathx v1.0.0 // indirect
golang.org/x/arch v0.12.0 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/term v0.32.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
2 changes: 0 additions & 2 deletions callbacks/langfuse/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI
github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=
github.com/cloudwego/eino v0.6.0 h1:pobGKMOfcQHVNhD9UT/HrvO0eYG6FC2ML/NKY2Eb9+Q=
github.com/cloudwego/eino v0.6.0/go.mod h1:JNapfU+QUrFFpboNDrNOFvmz0m9wjBFHHCr77RH6a50=
github.com/cloudwego/eino-ext/libs/acl/langfuse v0.0.0-20250409060521-ba8646352e4b h1:QGOp1e7tmQEUtznQ8fD8xUam2d/RECA8oJuPam2212s=
github.com/cloudwego/eino-ext/libs/acl/langfuse v0.0.0-20250409060521-ba8646352e4b/go.mod h1:3U4sve/4FGASns5zXHUfBX4ZTruQEhT1t9F1cNb5czM=
github.com/cloudwego/eino-ext/libs/acl/langfuse v0.0.0-20251124083837-ce2e7e196f9f h1:i8DgDklrNznB1/e/HUpM8i/mfOL/E+Hsug5166f/mec=
github.com/cloudwego/eino-ext/libs/acl/langfuse v0.0.0-20251124083837-ce2e7e196f9f/go.mod h1:P3zzJTRexY0QKaE9Vn2CmOnCorIMgNzNtler8mw9IQM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
14 changes: 9 additions & 5 deletions callbacks/langfuse/langfuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ package langfuse

import (
"context"
"encoding/json"
"io"
"log"
"runtime/debug"
"time"

"github.com/bytedance/sonic"
"github.com/cloudwego/eino-ext/libs/acl/langfuse"
"github.com/cloudwego/eino/callbacks"
"github.com/cloudwego/eino/components"
Expand Down Expand Up @@ -225,11 +225,12 @@ func (c *CallbackHandler) OnStart(ctx context.Context, info *callbacks.RunInfo,
})
}

in, err := sonic.MarshalString(input)
inBytes, err := json.Marshal(input)
if err != nil {
log.Printf("marshal input error: %v, runinfo: %+v", err, info)
return ctx
}
in := string(inBytes)
spanID, err := c.cli.CreateSpan(&langfuse.SpanEventBody{
BaseObservationEventBody: langfuse.BaseObservationEventBody{
BaseEventBody: langfuse.BaseEventBody{
Expand Down Expand Up @@ -290,11 +291,12 @@ func (c *CallbackHandler) OnEnd(ctx context.Context, info *callbacks.RunInfo, ou
return ctx
}

out, err := sonic.MarshalString(output)
outBytes, err := json.Marshal(output)
if err != nil {
log.Printf("marshal output error: %v, runinfo: %+v", err, info)
return ctx
}
out := string(outBytes)
err = c.cli.EndSpan(&langfuse.SpanEventBody{
BaseObservationEventBody: langfuse.BaseObservationEventBody{
BaseEventBody: langfuse.BaseEventBody{
Expand Down Expand Up @@ -468,11 +470,12 @@ func (c *CallbackHandler) OnStartWithStreamInput(ctx context.Context, info *call
ins = append(ins, chunk)
}

in, err_ := sonic.MarshalString(ins)
inBytes, err_ := json.Marshal(ins)
if err_ != nil {
log.Printf("marshal input error: %v, runinfo: %+v", err_, info)
return
}
in := string(inBytes)
err = c.cli.EndSpan(&langfuse.SpanEventBody{
BaseObservationEventBody: langfuse.BaseObservationEventBody{
BaseEventBody: langfuse.BaseEventBody{
Expand Down Expand Up @@ -573,10 +576,11 @@ func (c *CallbackHandler) OnEndWithStreamOutput(ctx context.Context, info *callb
outs = append(outs, chunk)
}

out, err := sonic.MarshalString(outs)
outBytes, err := json.Marshal(outs)
if err != nil {
log.Printf("marshal stream output error: %v, runinfo: %+v", err, info)
}
out := string(outBytes)
err = c.cli.EndSpan(&langfuse.SpanEventBody{
BaseObservationEventBody: langfuse.BaseObservationEventBody{
BaseEventBody: langfuse.BaseEventBody{
Expand Down
6 changes: 3 additions & 3 deletions callbacks/langsmith/flow_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ package langsmith

import (
"context"
"encoding/json"
"fmt"
"log"
"sync"
"time"

"github.com/bytedance/sonic"
"github.com/google/uuid"
)

Expand Down Expand Up @@ -116,7 +116,7 @@ func (ft *FlowTrace) SpanToString(ctx context.Context) (string, error) {
})
}
state.MarshalMetadata = tmpMetadata
val, err := sonic.Marshal(state)
val, err := json.Marshal(state)
if err != nil {
return "", err
}
Expand All @@ -129,7 +129,7 @@ func (ft *FlowTrace) StringToSpan(val string) (*LangsmithState, error) {
return nil, nil
}
state := &LangsmithState{}
err := sonic.Unmarshal([]byte(val), state)
err := json.Unmarshal([]byte(val), state)
if err != nil {
return nil, err
}
Expand Down
8 changes: 5 additions & 3 deletions callbacks/langsmith/langsmith.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ package langsmith

import (
"context"
"encoding/json"
"fmt"
"io"
"log"
"runtime/debug"
"sync"
"time"

"github.com/bytedance/sonic"
"github.com/cloudwego/eino/callbacks"
"github.com/cloudwego/eino/schema"
"github.com/google/uuid"
Expand Down Expand Up @@ -84,11 +84,12 @@ func (c *CallbackHandler) OnStart(ctx context.Context, info *callbacks.RunInfo,
if opts == nil {
opts = &traceOptions{}
}
in, err := sonic.MarshalString(input)
inBytes, err := json.Marshal(input)
if err != nil {
log.Printf("marshal input error: %v, runinfo: %+v", err, info)
return ctx
}
in := string(inBytes)
var metaData = SafeDeepCopySyncMapMetadata(opts.Metadata)
if input != nil {
modelConf, _, _, _ := extractModelInput(convModelCallbackInput([]callbacks.CallbackInput{input}))
Expand Down Expand Up @@ -158,11 +159,12 @@ func (c *CallbackHandler) OnEnd(ctx context.Context, info *callbacks.RunInfo, ou
log.Printf("[langsmith] no state in context on OnEnd, runinfo: %+v", info)
return ctx
}
out, err := sonic.MarshalString(output)
outBytes, err := json.Marshal(output)
if err != nil {
log.Printf("marshal output error: %v, runinfo: %+v", err, info)
return ctx
}
out := string(outBytes)

endTime := time.Now().UTC()
patch := &RunPatch{
Expand Down
Loading