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

refactor: chat model tool choice #37

Merged
merged 1 commit into from
Jan 20, 2025
Merged

refactor: chat model tool choice #37

merged 1 commit into from
Jan 20, 2025

Conversation

N3kox
Copy link
Contributor

@N3kox N3kox commented Jan 15, 2025

What type of PR is this?

refactor: remove tool_choice in model callback input

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.

chat model tool choice 重构

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

en:

  1. remove tool choice (type any) from callback input
  2. add tool choice string type def and enums
  3. add model common call option with tool choice

zh(optional):

  1. 移除 callback input 中 any 类型的 tool choice
  2. 新增 string 类型 tool choice 定义,给出枚举值
  3. model call option 支持请求级别配置 tool choice

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

(optional) The PR that updates user documentation:

Copy link

github-actions bot commented Jan 15, 2025

⚠️ Breaking API Changes Detected

This pull request contains breaking API changes that may affect compatibility:

uncompatible api changes found: 
github.com/cloudwego/eino/schema
  Compatible changes:
  - ToolChoice: added
  - ToolChoiceAllowed: added
  - ToolChoiceForbidden: added
  - ToolChoiceForced: added

github.com/cloudwego/eino/components/model
  Incompatible changes:
  - CallbackInput.ToolChoice: removed
  Compatible changes:
  - Options.ToolChoice: added
  - WithToolChoice: added

Required Actions:

  1. Please review these changes carefully
  2. Update the user documentation to reflect these API changes
  3. Add a note in the changelog about these breaking changes

Copy link

github-actions bot commented Jan 15, 2025

📊 Coverage Report:

File coverage threshold (20%) satisfied:	PASS
Package coverage threshold (30%) satisfied:	PASS
Total coverage threshold (75%) satisfied:	PASS
Total test coverage: 84.1% (3287/3909)

@N3kox N3kox force-pushed the feat/tool_choice branch 4 times, most recently from 81a6676 to b2e65a9 Compare January 20, 2025 06:42
@N3kox N3kox changed the title refactor: remove tool choice in model callback input refactor: chat model tool choice Jan 20, 2025
schema/tool_choice.go Outdated Show resolved Hide resolved
Copy link
Contributor

@BytePender BytePender left a comment

Choose a reason for hiding this comment

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

LGTM

@N3kox N3kox merged commit dfb8cad into main Jan 20, 2025
10 checks passed
@N3kox N3kox deleted the feat/tool_choice branch January 20, 2025 14:23
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