Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add InitTrace to Langfuse #146

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

meguminnnnnnnnn
Copy link
Contributor

@meguminnnnnnnnn meguminnnnnnnnn commented Mar 6, 2025

What type of PR is this?

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
zh(optional):

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

@meguminnnnnnnnn meguminnnnnnnnn force-pushed the feat/wdz/langfuse_init_trace branch from 235824c to 70aa57d Compare March 6, 2025 12:44
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

license-eye has totally checked 268 files.

Valid Invalid Ignored Fixed
267 1 0 0
Click to see the invalid file list
  • callbacks/langfuse/trace.go

Copy link

github-actions bot commented Mar 6, 2025

go-test-coverage report:

Package coverage threshold (70%) satisfied:	PASS
Total coverage threshold (66%) satisfied:	PASS
Total test coverage: 70.1% (4318/6161)

@meguminnnnnnnnn meguminnnnnnnnn force-pushed the feat/wdz/langfuse_init_trace branch from 70aa57d to cd096db Compare March 6, 2025 12:47
@meguminnnnnnnnn meguminnnnnnnnn self-assigned this Mar 6, 2025
@meguminnnnnnnnn meguminnnnnnnnn force-pushed the feat/wdz/langfuse_init_trace branch from cd096db to c0721da Compare March 6, 2025 13:07
@meguminnnnnnnnn
Copy link
Contributor Author

#128 (comment)

@meguminnnnnnnnn meguminnnnnnnnn force-pushed the feat/wdz/langfuse_init_trace branch 4 times, most recently from 00ef155 to 96d9c4f Compare March 6, 2025 13:34
"github.com/cloudwego/eino-ext/libs/acl/langfuse"
)

func (c *CallbackHandler) InitTrace(ctx context.Context, opts ...TraceOption) (context.Context, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. 这个用起来不太方便,所有需要请求粒度注入 TraceOption 的地方,都需要能拿到 CallbackHandler 实例。
  2. 感觉数据的传递也不是很纯粹,即使用了 context, 也是使用了 state 实例

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@meguminnnnnnnnn meguminnnnnnnnn force-pushed the feat/wdz/langfuse_init_trace branch from 96d9c4f to 11f9d50 Compare March 10, 2025 14:15
return &model.CallbackInput{Config: &model.Config{}}
}
if in.Config == nil {
in.Config = &model.Config{}
Copy link
Contributor

Choose a reason for hiding this comment

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

这里 set 可能有并发问题,如果必须非空的话开个新的 *model.CallbackInput 吧。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done,不改了

@meguminnnnnnnnn meguminnnnnnnnn force-pushed the feat/wdz/langfuse_init_trace branch from 11f9d50 to 47943fd Compare March 11, 2025 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants