最新版本获取:https://central.sonatype.com/artifact/com.yby6.coze/coze-sdk-java
<dependency>
<groupId>com.yby6.coze</groupId>
<artifactId>coze-sdk-java</artifactId>
<version>${last}</version>
</dependency>
implementation group: 'com.yby6.coze', name: 'coze-sdk-java', version: '${last}'
@Before
public void test_session_Factory() {
// 1. 配置文件
CoZeConfiguration cozeConfiguration = new CoZeConfiguration();
cozeConfiguration.setApiHost("https://api.coze.cn/open_api/");
cozeConfiguration.setApiKey("Bearer 你的APIKEY");
cozeConfiguration.setLevel(HttpLoggingInterceptor.Level.HEADERS);
// 2. 会话工厂
DefaultCoZeSessionFactory factory = new DefaultCoZeSessionFactory(cozeConfiguration);
// 3. 开启会话
this.coZeSession = factory.openSession();
log.info("openAiSession:{}", coZeSession);
}