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

using a function call to invoke the model reported 'Extra inputs are not permitted'. #11795

Closed
5 tasks done
lijiaqi0121 opened this issue Dec 18, 2024 · 1 comment
Closed
5 tasks done

Comments

@lijiaqi0121
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.13.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I added a locally deployed glm-4-9b-chat in an OpenAI API-compatible manner and set up function calls.
C4E32E93284E4AEF8933379714BE0A76
when I used this model to run an agent, I encountered a 400 error. Below is the detailed information about the error
61ED062B63B52C98A85D344A95AFD6E8

[openai_api_compatible] Error: API request failed with status code 400: {"object":"error","message":[{"type":'extra_forbidden', 'loc':('body', 'functions'), 'msg': 'Extra inputs are not permitted', 'input':[{'name': 'Analysis', 'description': '', 'parameters': {'type': 'object', 'properties': {'text': {'type': 'string', 'description': ''}, 'class_name': {'type': 'string', 'description': ''}}, 'required': ['text']}}]}],"type":"BadRequestError","param":null,"code":400}

How should I go about resolving this issue?

✔️ Expected Behavior

I hope to be able to use function calls within the agent

❌ Actual Behavior

Some errors have occurred.

@dosubot dosubot bot added the 🔨 feat:tools Tools for agent, function call related stuff. label Dec 18, 2024
Copy link

dosubot bot commented Dec 18, 2024

To resolve the "Extra inputs are not permitted" error when using function calls with a locally deployed glm-4-9b-chat model in an OpenAI API-compatible manner, ensure that the model you are using supports function calling. The error message indicates that the functions section in your request body is not being accepted, which suggests that the model might not support function calling or the request format is incorrect.

Here are some steps you can take to address this issue:

  1. Check Model Compatibility: Ensure that the model you are using supports function calling. According to the Dify platform, models like gpt-3.5 and gpt-4 series support function calling [1][2]. If glm-4-9b-chat does not support this feature, you may need to switch to a compatible model.

  2. Verify Request Format: Make sure that the functions section in your request body is formatted correctly. The functions list should include dictionaries with name, description, and parameters fields. Each function should be properly defined according to the expected input format [3].

  3. Review Configuration Settings: Double-check your configuration settings to ensure that the function_calling_type is set correctly. If you are using function calls, this should be set to "function_call" [3].

By ensuring compatibility and correct configuration, you should be able to resolve the error and use function calls within the agent.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@crazywoola crazywoola added ⚙️ feat:model-runtime and removed 🔨 feat:tools Tools for agent, function call related stuff. labels Dec 18, 2024
@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Jan 20, 2025
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 4, 2025
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants