此版本仍在开发中,尚未被视为稳定版本。最新的快照版本请使用 Spring AI 1.0.0-SNAPSHOT!spring-doc.cn

Anthropic 的 Claude 模型也可通过 Amazon Bedrock 获得。 Spring AI 还提供专用的 Amazon Bedrock Anthropic 客户端实施。
请参阅 Dependency Management 部分,将 Spring AI BOM 添加到您的构建文件中。
财产 描述 违约

spring.ai.retry.max 次尝试spring-doc.cn

最大重试尝试次数。spring-doc.cn

10spring-doc.cn

spring.ai.retry.backoff.initial-intervalspring-doc.cn

指数回退策略的初始休眠持续时间。spring-doc.cn

2 秒spring-doc.cn

spring.ai.retry.backoff.multiplierspring-doc.cn

Backoff interval 乘数。spring-doc.cn

5spring-doc.cn

spring.ai.retry.backoff.max 间隔spring-doc.cn

最大回退持续时间。spring-doc.cn

3 分钟spring-doc.cn

spring.ai.retry.on-client-errorsspring-doc.cn

如果为 false,则引发 NonTransientAiException,并且不要尝试重试客户端错误代码4xxspring-doc.cn

spring-doc.cn

spring.ai.retry.exclude-on-http-codesspring-doc.cn

不应触发重试的 HTTP 状态代码列表(例如,引发 NonTransientAiException)。spring-doc.cn

spring-doc.cn

spring.ai.retry.on-http-codesspring-doc.cn

应触发重试的 HTTP 状态代码列表(例如,引发 TransientAiException)。spring-doc.cn

spring-doc.cn

目前,重试策略不适用于流式处理 API。
财产 描述 违约

spring.ai.anthropic.base-url 的spring-doc.cn

要连接到的 URLspring-doc.cn

api.anthropic.comspring-doc.cn

spring.ai.anthropic.versionspring-doc.cn

Anthropic API 版本spring-doc.cn

2023-06-01spring-doc.cn

spring.ai.anthropic.api-keyspring-doc.cn

API 密钥spring-doc.cn

-spring-doc.cn

spring.ai.anthropic.beta 版本spring-doc.cn

启用新功能/实验性功能。如果设置为输出标记,则 limit 将从 to tokens 增加(仅适用于 claude-3-5-sonnet)。max-tokens-3-5-sonnet-2024-07-1540968192spring-doc.cn

tools-2024-04-04spring-doc.cn

财产 描述 违约

spring.ai.anthropic.chat.enabledspring-doc.cn

启用 Anthropic 聊天模型。spring-doc.cn

spring-doc.cn

spring.ai.anthropic.chat.options.modelspring-doc.cn

这是要使用的 Anthropic Chat 模型。支持: 、 、 和 legacy 、 和 models。claude-3-5-sonnet-20240620claude-3-opus-20240229claude-3-sonnet-20240229claude-3-haiku-20240307claude-2.1claude-2.0claude-instant-1.2spring-doc.cn

claude-3-opus-20240229spring-doc.cn

spring.ai.anthropic.chat.options.temperaturespring-doc.cn

要使用的采样温度,用于控制生成的完成项的明显创造性。较高的值将使输出更具随机性,而较低的值将使结果更加集中和确定。不建议为相同的 completions 请求修改 temperature 和 top_p,因为这两个设置的交互很难预测。spring-doc.cn

0.8spring-doc.cn

spring.ai.anthropic.chat.options.max 代币spring-doc.cn

在聊天完成中生成的最大令牌数。输入标记和生成的标记的总长度受模型的上下文长度限制。spring-doc.cn

500spring-doc.cn

spring.ai.anthropic.chat.options.stop-sequencespring-doc.cn

将导致模型停止生成的自定义文本序列。我们的模型通常会在自然完成轮到时停止,这将导致响应stop_reason “end_turn”。如果希望模型在遇到自定义文本字符串时停止生成,可以使用 stop_sequences 参数。如果模型遇到其中一个自定义序列,则响应stop_reason值将为“stop_sequence”,响应stop_sequence值将包含匹配的停止序列。spring-doc.cn

-spring-doc.cn

spring.ai.anthropic.chat.options.top-pspring-doc.cn

使用细胞核采样。在原子核采样中,我们以降概率顺序计算每个后续标记的所有选项的累积分布,并在达到 top_p 指定的特定概率时将其切断。您应该更改温度或top_p,但不能同时更改两者。仅建议用于高级使用案例。您通常只需要使用 temperature。spring-doc.cn

-spring-doc.cn

spring.ai.anthropic.chat.options.top-kspring-doc.cn

仅从每个后续代币的前 K 个选项中采样。用于删除 “long tail” 低概率响应。在此处了解更多技术详细信息。仅建议用于高级使用案例。您通常只需要使用 temperature。spring-doc.cn

-spring-doc.cn

spring.ai.mistralai.chat.options.functionsspring-doc.cn

函数列表,由其名称标识,用于在单个提示请求中启用函数调用。具有这些名称的函数必须存在于 functionCallbacks 注册表中。spring-doc.cn

-spring-doc.cn

spring.ai.mistralai.chat.options.function回调spring-doc.cn

MistralAI 工具函数回调,用于注册 ChatModel。spring-doc.cn

-spring-doc.cn

通过向调用添加特定于请求的运行时选项,可以在运行时覆盖所有前缀为 的属性。spring.ai.anthropic.chat.optionsPrompt
除了特定于模型的 AnthropicChatOptions 之外,您还可以使用通过 ChatOptionsBuilder#builder() 创建的可移植 ChatOptions 实例。
将 替换为您的 Anthropic 凭据。api-key
请参阅 Dependency Management 部分,将 Spring AI BOM 添加到您的构建文件中。