SpringBoot 整合 LangChain4j 与 Tavily 实现联网搜索
要实现联网搜索功能,获取 API Key 是关键的第一步。建议按以下步骤操作:访问 Tavily 官网注册账号,进入 API Playground 填写申请信息,返回 Overview 页面即可查看生成的 API 密钥。

获得 API 密钥后,即可在项目中完成相应配置。可以通过 max-results 参数来控制最多搜索结果数量。
langchain4j:
open-ai:
chat-model:
base-url: https://dashscope.aliyuncs.com/compatible-mode/v1
api-key: ${QWEN_API_KEY}
model-name: qwen-plus
log-responses: true
log-requests: true
strict-tools: true
streaming-chat-model:
base-url: https://dashscope.aliyuncs.com/compatible-mode/v1
api-key: ${QWEN_API_KEY}
model-name: qwen-plus
log-responses: true
log-requests: true
strict-tools: true
embedding-model:
base-url: https://dashscope.aliyuncs.com/compatible-mode/v1
api-key: ${EMBEDDING_API_KEY}
model-name: text-embedding-v4
log-requests:




