乘风的人

欲穷千里目,更上一层楼


  • 首页

  • 搜索

Custom Tools - main.py

发表于 2026-03-10   |   分类于 技术 , Python   |   暂无评论
""" LangChain 1.0 - 自定义工具 (@tool 装饰器) ========================================= 本模块重点讲解: 1. 使用 @tool 装饰器创建工具(LangChain 1.0 推荐方式) 2. 工具的参数和文档字符串(docstring)的重要性 3. 测试...

阅读全文...

Custom_Tools.py

发表于 2026-03-10   |   分类于 技术 , Python   |   暂无评论
# 04 - Custom Tools (自定义工具) # 核心概念 # 工具 (Tool) = 给 AI 的函数 # 使用 @tool 装饰器,让 AI 能调用你的 Python 函数。 # @tool 基本用法 import json from turtle import st from langchain.tools import tool ...

阅读全文...

04 - Custom Tools (自定义工具)

发表于 2026-03-09   |   分类于 技术 , Python   |   暂无评论
04 - Custom Tools (自定义工具)核心概念工具 (Tool) = 给 AI 的函数使用 @tool 装饰器,让 AI 能调用你的 Python 函数。@tool 基本用法from langchain_core.tools import tool @tool def get_weather(city: str) -> str: ...

阅读全文...

messages.py

发表于 2026-03-09   |   分类于 技术 , Python   |   暂无评论
# 03 - Messages: 消息类型与对话管理 # 核心要点(只讲难点) # 初始化模型 from init_model import get_chat_model chat_model = get_chat_model() # 角色 字典格式 对象格式 用途 # System {"role": &quo...

阅读全文...

03 - Messages: 消息类型与对话管理

发表于 2026-03-09   |   分类于 技术 , Python   |   暂无评论
03 - Messages: 消息类型与对话管理核心要点(只讲难点)1. 三种消息类型角色字典格式对象格式用途System{"role": "system", ...}SystemMessage(...)系统提示User{"role": "user", ...}HumanMess...

阅读全文...

123456789101112...41

知易行难,知行合一

204 文章
14 分类
27 标签
GitHub
友情链接
© 2026 乘风的人
Typecho
主题 - NexT.Pisces