提交 33d5ebdc 编写于 作者: 小傅哥's avatar 小傅哥

docs:maxTokens = 1024; 官网最大值调整

上级 58438b86
# url 支持base64和图片地址;https://bugstack.cn/images/article/project/chatgpt/chatgpt-extra-231011-01.png
curl -X POST \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsInNpZ25fdHlwZSI6IlNJR04ifQ.eyJhcGlfa2V5IjoiNjJkZGVjMzhiMWQwYjlhN2IwZmRkYWYyNzFlNmVkOTAiLCJleHAiOjE3MDU4MDgxNDEwNDUsInRpbWVzdGFtcCI6MTcwNTgwNjM0MTA0NX0.o7kogP0ZIFWVEEhplGaW1zBz16B1UbG2NIEqb7ZVflU" \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsInNpZ25fdHlwZSI6IlNJR04ifQ.eyJhcGlfa2V5IjoiMzk1ODBlMzRlMTc1MDE5YzIzMGZkZDUxOTgxN2IzODEiLCJleHAiOjE3MTczNzE2MzE4MDgsInRpbWVzdGFtcCI6MTcxNzM2OTgzMTgwOH0.2lk57oALzFxx2eAo-dKojKnVpn_MvJ8VJ4NQWTMYPHQ" \
-H "Content-Type: application/json" \
-H "User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)" \
-d '{
......
......@@ -70,7 +70,7 @@ public class ChatCompletionRequest {
* 24年1月发布的 GLM_3_5_TURBO、GLM_4 模型时新增
*/
@JsonProperty("max_tokens")
private Integer maxTokens = 2048;
private Integer maxTokens = 1024;
/**
* 模型在遇到stop所制定的字符时将停止生成,目前仅支持单个停止词,格式为["stop_word1"]
* 24年1月发布的 GLM_3_5_TURBO、GLM_4 模型时新增
......
......@@ -40,7 +40,7 @@ public class ApiTest {
// 1. 配置文件
Configuration configuration = new Configuration();
configuration.setApiHost("https://open.bigmodel.cn/");
configuration.setApiSecretKey("74e0b7fff9a578e2137300bcd58ae062.q0ABClJJS50rHQnn");
configuration.setApiSecretKey("39580e34e175019c230fdd519817b381.*****");
configuration.setLevel(HttpLoggingInterceptor.Level.BODY);
// 2. 会话工厂
OpenAiSessionFactory factory = new DefaultOpenAiSessionFactory(configuration);
......@@ -125,7 +125,7 @@ public class ApiTest {
// 入参;模型、请求信息
ChatCompletionRequest request = new ChatCompletionRequest();
request.setModel(Model.GLM_4); // GLM_3_5_TURBO、GLM_4
request.setModel(Model.GLM_4V); // GLM_3_5_TURBO、GLM_4
request.setIsCompatible(false);
// 24年1月发布的 glm-3-turbo、glm-4 支持函数、知识库、联网功能
request.setTools(new ArrayList<ChatCompletionRequest.Tool>() {
......@@ -196,10 +196,10 @@ public class ApiTest {
{
// content 字符串格式
add(ChatCompletionRequest.Prompt.builder()
.role(Role.user.getCode())
.content("这个图片写了什么")
.build());
// add(ChatCompletionRequest.Prompt.builder()
// .role(Role.user.getCode())
// .content("这个图片写了什么")
// .build());
// content 对象格式
add(ChatCompletionRequest.Prompt.builder()
......@@ -348,7 +348,7 @@ public class ApiTest {
// 1. 配置文件
Configuration configuration = new Configuration();
configuration.setApiHost("https://open.bigmodel.cn/");
configuration.setApiSecretKey("62ddec38b1d0b9a7b0fddaf271e6ed90.HpD0SUBUlvqd05ey");
configuration.setApiSecretKey("39580e34e175019c230fdd519817b381.*****");
// 2. 获取Token
String token = BearerTokenUtils.getToken(configuration.getApiKey(), configuration.getApiSecret());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册