-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: bump version to 0.0.8 & update model list (#621)
- Loading branch information
Showing
6 changed files
with
64 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -181,3 +181,16 @@ response.getResults().forEach(data -> { | |
System.out.println(data.getRelevanceScore()); | ||
}); | ||
``` | ||
|
||
### 插件编排 | ||
|
||
千帆 SDK 支持调用插件编排后的服务,用于大模型 + 插件能力的组合。 | ||
|
||
```java | ||
PluginResponse response = new Qianfan().plugin() | ||
.endpoint("plugin-service-endpoint") | ||
.fileurl("https://www.baidu.com/img/flexible/logo/pc/[email protected]") | ||
.query("这个图片是什么") | ||
.execute(); | ||
System.out.println(response.getResult()); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
java/example/src/main/java/com/baidubce/PluginExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.baidubce; | ||
|
||
import com.baidubce.qianfan.Qianfan; | ||
import com.baidubce.qianfan.model.plugin.PluginResponse; | ||
|
||
/** | ||
* 本示例实现了Plugin调用流程 | ||
*/ | ||
public class PluginExample { | ||
public static void main(String[] args) { | ||
chatOcr(); | ||
} | ||
|
||
private static void chatOcr() { | ||
Qianfan qianfan = new Qianfan(); | ||
PluginResponse response = qianfan.plugin() | ||
// 请前往千帆大模型平台控制台->插件编排->配置插件应用服务 | ||
// 配置完成后进行上线,并进入详情页获取服务endpoint | ||
// 示例: https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/plugin/endpoint/ | ||
.endpoint("endpoint") | ||
// 智慧图问场景通过fileurl传入图片 | ||
.fileurl("https://www.baidu.com/img/flexible/logo/pc/[email protected]") | ||
.query("这个图片是什么") | ||
.execute(); | ||
System.out.println(response.getResult()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters