Skip to content

yuedaqing/yucongming-java-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

鱼聪明 Java SDK

只需一行代码,使用强大的 AI 能力!

鱼聪明 AI:https://yucongming.com

官方服务号:鱼聪明AI

快速开始

0、引入 sdk

<dependency>
    <groupId>com.yucongming</groupId>
    <artifactId>yucongming-java-sdk</artifactId>
    <version>0.0.1</version>
</dependency>

1、初始化 YuCongMingClient 对象

String accessKey = "你的 accessKey";
String secretKey = "你的 secretKey";
YuCongMingClient client = new YuCongMingClient(accessKey, secretKey);

2、构造请求参数

DevChatRequest devChatRequest = new DevChatRequest();
devChatRequest.setModelId(1651468516836098050L);
devChatRequest.setMessage("鱼皮");

3、获取响应结果

BaseResponse<DevChatResponse> response = client.doChat(devChatRequest);
System.out.println(response);

API 文档

AI 对话

方法名:doChat

请求参数:

  • modelId:使用的会话模型 id
  • message:要发送的消息,不超过 1024 字

响应结果:

  • code:响应状态码
  • data:
    • content:对话结果内容
  • message:响应信息

示例代码:

// 构造请求
DevChatRequest devChatRequest = new DevChatRequest();
devChatRequest.setModelId(1651468516836098050L);
devChatRequest.setMessage("鱼皮");

// 获取响应
BaseResponse<DevChatResponse> response = client.doChat(devChatRequest);
System.out.println(response);

About

智能BI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%