public static class ChatModel.Builder
extends java.lang.Object
构造器和说明 |
---|
Builder(ChatConfig config) |
Builder(java.lang.String apiUrl) |
限定符和类型 | 方法和说明 |
---|---|
ChatModel.Builder |
apiKey(java.lang.String apiKey)
接口密钥
|
ChatModel |
build() |
ChatModel.Builder |
globalFunctionAdd(java.lang.Class<?> functionClz,
java.lang.Object functionObj)
函数添加
|
ChatModel.Builder |
globalFunctionAdd(java.lang.Object functionObj)
函数添加
|
ChatModel.Builder |
globalFunctionAdd(java.lang.String name,
java.util.function.Consumer<ChatFunctionDecl> functionBuilder)
函数添加
|
ChatModel.Builder |
headerSet(java.lang.String key,
java.lang.String value)
头信息添加
|
ChatModel.Builder |
model(java.lang.String model)
使用模型
|
ChatModel.Builder |
provider(java.lang.String provider)
服务提供者
|
ChatModel.Builder |
timeout(java.time.Duration timeout)
超时
|
public Builder(java.lang.String apiUrl)
apiUrl
- 接口地址public Builder(ChatConfig config)
config
- 配置public ChatModel.Builder apiKey(java.lang.String apiKey)
public ChatModel.Builder provider(java.lang.String provider)
public ChatModel.Builder model(java.lang.String model)
public ChatModel.Builder headerSet(java.lang.String key, java.lang.String value)
public ChatModel.Builder globalFunctionAdd(java.lang.Object functionObj)
functionObj
- 函数对象public ChatModel.Builder globalFunctionAdd(java.lang.Class<?> functionClz, java.lang.Object functionObj)
functionClz
- 函数类(如果函数对象为代理时,必须传入原始类)functionObj
- 函数对象public ChatModel.Builder globalFunctionAdd(java.lang.String name, java.util.function.Consumer<ChatFunctionDecl> functionBuilder)
name
- 函数名functionBuilder
- 函数构建器public ChatModel.Builder timeout(java.time.Duration timeout)
public ChatModel build()