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

Add support for parameter types 'object' and 'array' in tool-call #6845

Closed

Conversation

maybemaynot
Copy link
Contributor

@maybemaynot maybemaynot commented Jul 31, 2024

Checklist:

Important

Please review the checklist below before submitting your pull request.

  • Please open an issue before creating a PR or link to an existing issue
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. Close issue syntax: Fixes #<issue number>, see documentation for more details.

Fixes

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

Testing Instructions

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A Tested parse of openapi's json content
  • Test B Tested tool-call of model provider: moonshot, hunyuan-pro, Baichuan4

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. 🔨 feat:tools Tools for agent, function call related stuff. labels Jul 31, 2024
@crazywoola crazywoola requested review from Yeuoly and laipz8200 and removed request for Yeuoly July 31, 2024 11:21
@crazywoola crazywoola marked this pull request as draft August 1, 2024 02:34
@crazywoola
Copy link
Member

This PR touches some core logic of the model runtime, which may lead to breaking changes. @Yeuoly @laipz8200 @maybemaynot

@maybemaynot
Copy link
Contributor Author

maybemaynot commented Aug 1, 2024

This PR touches some core logic of the model runtime, which may lead to breaking changes. @Yeuoly @laipz8200 @maybemaynot

hi, @crazywoola
i think you need a full test for this PR
I have tested some cases, execute some tool-calls use model provider: moonshot, Baichuan4, hunyuan-pro.
all of these make correct value for parameters which type = 'object'

I don't think it lead to breaking changes, I think it compatible
the call without object/array type parameters, just execute same as before
the call with object type parameters, I have coded for model prompts and tested in some cases

object type parameters are saved & used as string type before my code
it cannot make correct value for object type parameters by the 3 model providers mentioned before
is it wrong?

@crazywoola
Copy link
Member

Can you rebase the origin/main to submit this PR again?

@crazywoola crazywoola closed this Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 feat:tools Tools for agent, function call related stuff. size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants