TimePlugin plugin = new TimePlugin(TimePlugin.class);
plugin.setName("当前时间");
plugin.setFunction("getCurrentTime");
plugin.setDescription("询问当前时间,方法将会获取当前时间。");
PluginAbstract.Arg arg = new PluginAbstract.Arg();
plugin.setArgs(Collections.singletonList(arg));
openaiClient.chatCompletionWithPlugin(chatCompletion, plugin)
报错内容:
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "code" (class com.unfbx.chatgpt.entity.chat.ChatCompletionResponse), not marked as ignorable (6 known properties: "usage", "choices", "created", "model", "id", "object"])
原因是openai返回:
{
"error": {
"message": "None is not of type 'object' - 'functions.0.parameters'",
"type": "invalid_request_error",
"param": null,
"code": null
}
}
版本:1.1.1-beta0 调用地址:官方地址 调用方式:
报错内容:
原因是openai返回: