类的使用
io.agentscope.core.model.GenerateOptions
使用GenerateOptions的程序包
程序包
说明
-
io.agentscope.core中GenerateOptions的使用
修饰符和类型方法说明protected GenerateOptionsReActAgent.buildGenerateOptions()ReActAgent.getGenerateOptions()Gets the configured generation options for this agent.参数类型为GenerateOptions的io.agentscope.core中的方法修饰符和类型方法说明ReActAgent.Builder.generateOptions(GenerateOptions generateOptions) Sets the generation options for model API calls. -
io.agentscope.core.formatter中GenerateOptions的使用
修饰符和类型方法说明voidFormatter.applyOptions(TParams paramsBuilder, GenerateOptions options, GenerateOptions defaultOptions) Apply generation options to provider-specific request parameters.protected <T> TAbstractBaseFormatter.getOptionOrDefault(GenerateOptions options, GenerateOptions defaultOptions, Function<GenerateOptions, T> getter) Get an option value from options or fall back to defaultOptions.类型变量类型为GenerateOptions的io.agentscope.core.formatter中的方法参数修饰符和类型方法说明protected <T> TAbstractBaseFormatter.getOptionOrDefault(GenerateOptions options, GenerateOptions defaultOptions, Function<GenerateOptions, T> getter) Get an option value from options or fall back to defaultOptions. -
io.agentscope.core.formatter.anthropic中GenerateOptions的使用
修饰符和类型方法说明voidAnthropicBaseFormatter.applyOptions(com.anthropic.models.messages.MessageCreateParams.Builder paramsBuilder, GenerateOptions options, GenerateOptions defaultOptions) Apply generation options to Anthropic request parameters.static voidAnthropicToolsHelper.applyOptions(com.anthropic.models.messages.MessageCreateParams.Builder builder, GenerateOptions options, GenerateOptions defaultOptions) Apply generation options to the builder.static voidAnthropicToolsHelper.applyTools(com.anthropic.models.messages.MessageCreateParams.Builder builder, List<ToolSchema> tools, GenerateOptions options) Apply tools to the message create params builder. -
io.agentscope.core.formatter.dashscope中GenerateOptions的使用
修饰符和类型方法说明voidDashScopeChatFormatter.applyOptions(DashScopeRequest request, GenerateOptions options, GenerateOptions defaultOptions) voidDashScopeMultiAgentFormatter.applyOptions(DashScopeRequest request, GenerateOptions options, GenerateOptions defaultOptions) voidDashScopeToolsHelper.applyOptions(DashScopeParameters params, GenerateOptions options, GenerateOptions defaultOptions) Apply GenerateOptions to DashScopeParameters.DashScopeChatFormatter.buildRequest(String model, List<DashScopeMessage> messages, boolean stream, GenerateOptions options, GenerateOptions defaultOptions, List<ToolSchema> tools, ToolChoice toolChoice) Build a complete DashScopeRequest with full configuration.DashScopeToolsHelper.mergeAdditionalBodyParams(GenerateOptions options, GenerateOptions defaultOptions) Merge additional body parameters from options and default options.DashScopeToolsHelper.mergeAdditionalHeaders(GenerateOptions options, GenerateOptions defaultOptions) Merge additional headers from options and default options.DashScopeToolsHelper.mergeAdditionalQueryParams(GenerateOptions options, GenerateOptions defaultOptions) Merge additional query parameters from options and default options. -
io.agentscope.core.formatter.gemini中GenerateOptions的使用
修饰符和类型方法说明voidGeminiChatFormatter.applyOptions(com.google.genai.types.GenerateContentConfig.Builder configBuilder, GenerateOptions options, GenerateOptions defaultOptions) voidGeminiMultiAgentFormatter.applyOptions(com.google.genai.types.GenerateContentConfig.Builder configBuilder, GenerateOptions options, GenerateOptions defaultOptions) -
io.agentscope.core.formatter.ollama中GenerateOptions的使用
修饰符和类型方法说明voidOllamaChatFormatter.applyOptions(OllamaRequest request, GenerateOptions options, GenerateOptions defaultOptions) voidOllamaMultiAgentFormatter.applyOptions(OllamaRequest request, GenerateOptions options, GenerateOptions defaultOptions) voidOllamaToolsHelper.applyOptions(OllamaRequest request, GenerateOptions options, GenerateOptions defaultOptions) Apply GenerateOptions to OllamaRequest. -
io.agentscope.core.formatter.openai中GenerateOptions的使用
修饰符和类型方法说明protected voidOpenAIChatFormatter.applyAdditionalBodyParams(OpenAIRequest request, GenerateOptions opts) Apply additional body parameters from GenerateOptions to OpenAI request.protected voidOpenAIChatFormatter.applyMaxTokens(OpenAIRequest request, GenerateOptions options, GenerateOptions defaultOptions) abstract voidOpenAIBaseFormatter.applyOptions(OpenAIRequest request, GenerateOptions options, GenerateOptions defaultOptions) Apply generation options to the request.voidOpenAIChatFormatter.applyOptions(OpenAIRequest request, GenerateOptions options, GenerateOptions defaultOptions) OpenAIBaseFormatter.buildRequest(String model, List<OpenAIMessage> messages, boolean stream, GenerateOptions options, GenerateOptions defaultOptions, List<ToolSchema> tools, ToolChoice toolChoice) Build a complete OpenAIRequest with full configuration. -
io.agentscope.core.hook中GenerateOptions的使用
修饰符和类型方法说明PreReasoningEvent.getEffectiveGenerateOptions()已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the effective generation options.PreSummaryEvent.getEffectiveGenerateOptions()已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the effective generation options.final GenerateOptionsReasoningEvent.getGenerateOptions()已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the generation options.final GenerateOptionsSummaryEvent.getGenerateOptions()已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the generation options.参数类型为GenerateOptions的io.agentscope.core.hook中的方法修饰符和类型方法说明reactor.core.publisher.Mono<PostSummaryEvent> LegacyHookDispatcher.firePostSummary(Msg msg, GenerateOptions generateOptions, String modelName) 已过时, 待删除: 此 API 元素将从以后的版本中删除。reactor.core.publisher.Mono<PreSummaryEvent> LegacyHookDispatcher.firePreSummary(List<Msg> msgs, GenerateOptions generateOptions, String modelName, int maxIters, Msg systemMsg) 已过时, 待删除: 此 API 元素将从以后的版本中删除。reactor.core.publisher.Mono<Void> LegacyHookDispatcher.fireSummaryChunk(Msg chunkMsg, io.agentscope.core.agent.accumulator.ReasoningContext context, GenerateOptions generateOptions, String modelName) 已过时, 待删除: 此 API 元素将从以后的版本中删除。voidPreReasoningEvent.setGenerateOptions(GenerateOptions generateOptions) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Set custom generation options for this reasoning call.voidPreSummaryEvent.setGenerateOptions(GenerateOptions generateOptions) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Set custom generation options for this summary call.参数类型为GenerateOptions的io.agentscope.core.hook中的构造器限定符构造器说明PostReasoningEvent(Agent agent, String modelName, GenerateOptions generateOptions, Msg reasoningMessage) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for PostReasoningEvent.PostSummaryEvent(Agent agent, String modelName, GenerateOptions generateOptions, Msg summaryMessage) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for PostSummaryEvent.PreReasoningEvent(Agent agent, String modelName, GenerateOptions generateOptions, List<Msg> inputMessages) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for PreReasoningEvent.PreSummaryEvent(Agent agent, String modelName, GenerateOptions generateOptions, List<Msg> inputMessages, int maxIterations, int currentIteration) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for PreSummaryEvent.ReasoningChunkEvent(Agent agent, String modelName, GenerateOptions generateOptions, Msg incrementalChunk, Msg accumulated) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for ReasoningChunkEvent.protectedReasoningEvent(HookEventType type, Agent agent, String modelName, GenerateOptions generateOptions) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for ReasoningEvent.SummaryChunkEvent(Agent agent, String modelName, GenerateOptions generateOptions, Msg incrementalChunk, Msg accumulated) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for SummaryChunkEvent.protectedSummaryEvent(HookEventType type, Agent agent, String modelName, GenerateOptions generateOptions) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for SummaryEvent. -
io.agentscope.core.middleware中GenerateOptions的使用
修饰符和类型方法说明ModelCallInput.options()返回options记录组件的值。ReasoningInput.options()返回options记录组件的值。参数类型为GenerateOptions的io.agentscope.core.middleware中的构造器限定符构造器说明ModelCallInput(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options, Model model) 创建ModelCallInput记录类的实例。ReasoningInput(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) 创建ReasoningInput记录类的实例。 -
io.agentscope.core.model中GenerateOptions的使用
修饰符和类型方法说明GenerateOptions.Builder.build()Builds a new GenerateOptions instance with the set values.static GenerateOptionsModelUtils.ensureDefaultExecutionConfig(GenerateOptions options) Ensures GenerateOptions has MODEL_DEFAULTS for executionConfig applied.static GenerateOptionsGenerateOptions.mergeOptions(GenerateOptions primary, GenerateOptions fallback) Merges two GenerateOptions instances, with primary options taking precedence.参数类型为GenerateOptions的io.agentscope.core.model中的方法修饰符和类型方法说明static reactor.core.publisher.Flux<ChatResponse> ModelUtils.applyTimeoutAndRetry(reactor.core.publisher.Flux<ChatResponse> responseFlux, GenerateOptions options, GenerateOptions defaultOptions, String modelName, String provider) Applies timeout and retry configuration to a model response Flux.OpenAIClient.call(String apiKey, String baseUrl, OpenAIRequest request, GenerateOptions options) Make a synchronous API call with options.OpenAIClient.callApi(String apiKey, String baseUrl, String endpoint, Object requestBody, GenerateOptions options) Make a generic API call to any OpenAI endpoint with JSON request body and custom options.OllamaChatModel.chat(List<Msg> messages, GenerateOptions options) Chat with the model using default options.AnthropicChatModel.Builder.defaultOptions(GenerateOptions defaultOptions) Sets default generation options.DashScopeChatModel.Builder.defaultOptions(GenerateOptions options) Sets the default generation options.GeminiChatModel.Builder.defaultOptions(GenerateOptions defaultOptions) Sets the default generation options.protected reactor.core.publisher.Flux<ChatResponse> AnthropicChatModel.doStream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) Stream chat completion responses from Anthropic's API.protected abstract reactor.core.publisher.Flux<ChatResponse> ChatModelBase.doStream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) Internal implementation for streaming chat completion responses.protected reactor.core.publisher.Flux<ChatResponse> DashScopeChatModel.doStream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) Stream chat completion responses from DashScope's API.protected reactor.core.publisher.Flux<ChatResponse> GeminiChatModel.doStream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) Stream chat completion responses from Gemini's API.protected reactor.core.publisher.Flux<ChatResponse> OllamaChatModel.doStream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) protected reactor.core.publisher.Flux<ChatResponse> OpenAIChatModel.doStream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) protected reactor.core.publisher.Flux<ChatResponse> OpenAIChatModel.doStream0(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) static GenerateOptionsModelUtils.ensureDefaultExecutionConfig(GenerateOptions options) Ensures GenerateOptions has MODEL_DEFAULTS for executionConfig applied.OpenAIChatModel.Builder.generateOptions(GenerateOptions options) Sets the default generation options.static GenerateOptionsGenerateOptions.mergeOptions(GenerateOptions primary, GenerateOptions fallback) Merges two GenerateOptions instances, with primary options taking precedence.final reactor.core.publisher.Flux<ChatResponse> ChatModelBase.stream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) Stream chat completion responses.reactor.core.publisher.Flux<ChatResponse> Model.stream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) Stream chat completion responses.reactor.core.publisher.Flux<OpenAIResponse> OpenAIClient.stream(String apiKey, String baseUrl, OpenAIRequest request, GenerateOptions options) Make a streaming API call with options for headers and query params.参数类型为GenerateOptions的io.agentscope.core.model中的构造器限定符构造器说明AnthropicChatModel(String baseUrl, String apiKey, String modelName, boolean streamEnabled, GenerateOptions defaultOptions, AnthropicBaseFormatter formatter, ProxyConfig proxyConfig) Creates a new Anthropic chat model instance.DashScopeChatModel(String apiKey, String modelName, boolean stream, Boolean enableThinking, Boolean enableSearch, EndpointType endpointType, GenerateOptions defaultOptions, String baseUrl, Formatter<DashScopeMessage, DashScopeResponse, DashScopeRequest> formatter, HttpTransport httpTransport, String publicKeyId, String publicKey) Creates a new DashScope chat model instance with explicit API type.DashScopeChatModel(String apiKey, String modelName, boolean stream, Boolean enableThinking, Boolean enableSearch, GenerateOptions defaultOptions, String baseUrl, Formatter<DashScopeMessage, DashScopeResponse, DashScopeRequest> formatter, HttpTransport httpTransport, String publicKeyId, String publicKey) Creates a new DashScope chat model instance with automatic API type detection.GeminiChatModel(String apiKey, String modelName, boolean streamEnabled, String project, String location, Boolean vertexAI, com.google.genai.types.HttpOptions httpOptions, com.google.auth.oauth2.GoogleCredentials credentials, com.google.genai.types.ClientOptions clientOptions, GenerateOptions defaultOptions, Formatter<com.google.genai.types.Content, com.google.genai.types.GenerateContentResponse, com.google.genai.types.GenerateContentConfig.Builder> formatter) Creates a new Gemini chat model instance using the default endpoint configuration.GeminiChatModel(String apiKey, String baseUrl, String modelName, boolean streamEnabled, String project, String location, Boolean vertexAI, com.google.genai.types.HttpOptions httpOptions, com.google.auth.oauth2.GoogleCredentials credentials, com.google.genai.types.ClientOptions clientOptions, GenerateOptions defaultOptions, Formatter<com.google.genai.types.Content, com.google.genai.types.GenerateContentResponse, com.google.genai.types.GenerateContentConfig.Builder> formatter) Creates a new Gemini chat model instance. -
io.agentscope.core.model.ollama中GenerateOptions的使用
修饰符和类型方法说明OllamaOptions.toGenerateOptions()Converts thisOllamaOptionsto genericGenerateOptions.修饰符和类型方法说明static OllamaOptionsOllamaOptions.fromGenerateOptions(GenerateOptions genOptions) Converts genericGenerateOptionstoOllamaOptions.OllamaOptions.merge(GenerateOptions other) Merges the givenGenerateOptionsinto a new instance, with the given options taking precedence. -
io.agentscope.core.tracing中GenerateOptions的使用
修饰符和类型方法说明default reactor.core.publisher.Flux<ChatResponse> Tracer.callModel(ChatModelBase instance, List<Msg> inputMessages, List<ToolSchema> toolSchemas, GenerateOptions options, Supplier<reactor.core.publisher.Flux<ChatResponse>> modelCall) 已过时, 待删除: 此 API 元素将从以后的版本中删除。