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

[BUG] ZhipuAiChatModel does not support tools without parameters #950

Open
langchain4j opened this issue Apr 17, 2024 · 5 comments · May be fixed by #999
Open

[BUG] ZhipuAiChatModel does not support tools without parameters #950

langchain4j opened this issue Apr 17, 2024 · 5 comments · May be fixed by #999
Labels
bug Something isn't working P3 Medium priority

Comments

@langchain4j
Copy link
Owner

Describe the bug
When using a tool without input parameters, a NPE is happening.

Log and Stack trace
Cannot invoke "dev.langchain4j.agent.tool.ToolParameters.properties()" because "toolParameters" is null

To Reproduce

ToolSpecification currentTime = ToolSpecification.builder()
    .name("currentTime")
    .description("currentTime")
    .build();

Expected behavior
Should work without NPE.

Please complete the following information:

  • LangChain4j version: 0.30.0
  • LLM(s) used: ZhipuAiChatModel
  • Java version: any
@langchain4j langchain4j added bug Something isn't working P3 Medium priority labels Apr 17, 2024
@langchain4j
Copy link
Owner Author

@1402564807 fyi

@yongxingMa
Copy link

Once again, I went to test and found the zhipu API requires that tools must carry parameters ,So does this bug still need to be fix?

@yongxingMa
Copy link

Or we can add a judgement that throws the specified exception

@langchain4j
Copy link
Owner Author

@yongxingMa what do you mean? This bug should still be fixed

@1402564807
Copy link
Contributor

@langchain4j Sorry I just saw this question, I will deal with it now

1402564807 added a commit to 1402564807/langchain4j that referenced this issue Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3 Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants