Skip to content

fix: correct callback API in ch06 documentation#228

Open
123456wda wants to merge 1 commit into
cloudwego:mainfrom
123456wda:fix/ch06-callback-api-docs
Open

fix: correct callback API in ch06 documentation#228
123456wda wants to merge 1 commit into
cloudwego:mainfrom
123456wda:fix/ch06-callback-api-docs

Conversation

@123456wda
Copy link
Copy Markdown

Summary

  • Fix incorrect callback API in ch06_callback.md documentation
  • The code example used callbacks.NewHandlerHelper() with .OnStart()/.OnEnd()/.OnError()/.Handler(), which does not match the actual API
  • Corrected to callbacks.NewHandlerBuilder() with .OnStartFn()/.OnEndFn()/.OnErrorFn()/.Build()
  • Bump eino and eino-ext dependency versions

Background

The quickstart chapter 6 callback example code was inconsistent with the actual github.com/cloudwego/eino/callbacks package API. The correct API for building a generic callback handler is:

handler := callbacks.NewHandlerBuilder().
    OnStartFn(...).
    OnEndFn(...).
    OnErrorFn(...).
    Build()

Note: NewHandlerHelper() lives in github.com/cloudwego/eino/utils/callbacks and is for component-specific typed callbacks (e.g., .ChatModel(), .Tool()), not for generic callbacks.

Test plan

  • Review the corrected code examples in ch06_callback.md
  • Verify the API matches github.com/cloudwego/eino/callbacks v0.8.13

🤖 Generated with Claude Code

The ch06_callback.md used incorrect API names:
- `callbacks.NewHandlerHelper()` → `callbacks.NewHandlerBuilder()`
- `.OnStart()` → `.OnStartFn()`
- `.OnEnd()` → `.OnEndFn()`
- `.OnError()` → `.OnErrorFn()`
- `.Handler()` → `.Build()`

Also bump eino and eino-ext dependency versions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants