Closed liuyunfeng2017 closed 2 weeks ago
@liuyunfeng2017 ERNIE-Speed-8K使用api调用的话模型名字应该传ernie_speed
,具体可以参考这里:https://cloud.baidu.com/doc/WENXINWORKSHOP/s/klqx7b1xf
api使用的模型名字如红框所示:
上面的说法不太正确 目前langchain4j里的千帆是先根据模型名找到endpoint,再使用endpoint拼成url去请求AI,但是由于QianfanChatModelNameEnum这个类没有包含ERNIE-Speed-8K这个模型名称,所以如果输入ERNIE-Speed-8K的话,是找不到对应的endpoint的,导致会报【Qianfan is no such model name】这种错误。
所以只能由代码显式指定endpoint~~
这个问题过两天我发个版本修复,你也可以直接在QianFanLLMService里的buildChatLLM方法里增加一行.endpoint(aiModel.getName())
,最终方法变成这样:
return QianfanChatModel.builder()
.modelName(aiModel.getName())
.endpoint(aiModel.getName()) //新增
.temperature(0.7)
.topP(1.0)
.maxRetries(1)
.apiKey(modelPlatformSetting.getApiKey())
.secretKey(modelPlatformSetting.getSecretKey())
.build();
接着aideepin里的模型名称填 ernie_speed
就可以了
这个问题发了新版本修复了吗
这个问题发了新版本修复了吗
是的,可以拉下2.8.0这个版本,adi_ai_model这张表新增了[setting]字段,千帆的配置补充好这个字段的值就可以了
参考这条sql:
INSERT INTO adi_ai_model (name, type, platform, is_enable, setting) VALUES ('ERNIE-Speed-8K', 'text', 'qianfan', false, '{"endpoint":"ernie_speed"}');
我今天下午拉的main分支,我配置好了千帆的api_key和secret_key,调用LLM模型的时候报Qianfan is no such model name. You can see model name here: https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu 我这里选择的是ERNIE-Speed-8K,请问一下这个模型名称是配置在模型管理模块中的名称吗?
![image](https://github.com/moyangzhan/langchain4j-aideepin/assets/18526469/4109521b-a24c-48b8-b8f7-3096ac27bb52)