Skip to content

Commit

Permalink
chore: bump version to 0.0.8 & update model list
Browse files Browse the repository at this point in the history
  • Loading branch information
Azure99 committed Jun 27, 2024
1 parent 728fb75 commit 6a6d3e3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
13 changes: 13 additions & 0 deletions java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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());
```
2 changes: 1 addition & 1 deletion java/example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<dependency>
<groupId>com.baidubce</groupId>
<artifactId>qianfan</artifactId>
<version>0.0.6</version>
<version>0.0.7</version>
</dependency>
</dependencies>
</project>
27 changes: 27 additions & 0 deletions java/example/src/main/java/com/baidubce/PluginExample.java
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());
}
}

0 comments on commit 6a6d3e3

Please sign in to comment.