摘要: 把chain当成工具使用 from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts.chat import ChatPromptTemplate # LCEL定制 prompt = Ch 阅读全文
posted @ 2026-07-21 18:32 leah-xx 阅读(3) 评论(0) 推荐(0)
摘要: 工具篇,三步走: 确定该大模型有调用工具的能力(deepseek-v3可以,qwen-plus可以) - @tool - StructedTool @tool 绑定工具 import datetime from langchain.tools import tool # 定义工具 注意要添加注释 @ 阅读全文
posted @ 2026-07-21 16:49 leah-xx 阅读(1) 评论(0) 推荐(0)
摘要: 怎么结合消息存储方法与LCEL (因为RedischatMessageHistory组件本身是没有实现Runnable类的,也没有invoke等相关方法的,所以无法直接书写成链式语法,需要借助 RunnableWithMessageHistory 类) from langchain_core.run 阅读全文
posted @ 2026-07-21 13:32 leah-xx 阅读(3) 评论(0) 推荐(0)
摘要: 消息存储,使用redis(用docker运行redis)保存聊天记录 安装redis相关依赖包 pip install -q langchain-redis redis 构建问答 from langchain redis import RedischatMessageHistory #这也是Base 阅读全文
posted @ 2026-07-20 18:03 leah-xx 阅读(2) 评论(0) 推荐(0)
摘要: langchain expression language(LCEL) 串行简单链条 from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ChatPromptTemp 阅读全文
posted @ 2026-07-20 17:25 leah-xx 阅读(1) 评论(0) 推荐(0)
摘要: invoke 直接执行输出 from langchain_core prompts import ChatPromptTemplate prompt_template =ChatPromptTemplate.from_messages([ ("system","Translat the follow 阅读全文
posted @ 2026-07-18 22:59 leah-xx 阅读(4) 评论(0) 推荐(0)
摘要: 这两天在搞AI model,发现还是在linux环境跑最好,还是安装了虚拟机,一些踩雷问题记录下里。安装虚拟机的教程大家可以看其他的,网上有很多,这里我已经安装好了,就不赘述了。 Ubuntu 24.03 Desktop 网络连接问题 首先可以看到,ubuntu界面右上角的网络连接有个问号❓的故障提 阅读全文
posted @ 2025-12-03 11:42 leah-xx 阅读(61) 评论(0) 推荐(0)
摘要: 本人最近在跑模型,用到了一个tensorflow==1.4.0的包 我承认,这个包确实有些太“古老”了,但是人家作者用的就是这个包呀,我的目的只是跑通模型,看看结果,没有修改的想法。所以就老老实实照用,结果就是这个包,折腾了我半天时间,这里仅提供一个不算解决办法的办法:放弃windows,用linu 阅读全文
posted @ 2025-11-26 16:28 leah-xx 阅读(20) 评论(0) 推荐(0)
摘要: 在python项目引入faiss模块,运行项目的时候报错: File "C:\Users\xxxxx\AppData\Local\anaconda3\envs\xxxx\lib\site-packages\faiss\swigfaiss.py",line 13, in <module> from . 阅读全文
posted @ 2025-11-07 11:23 leah-xx 阅读(92) 评论(0) 推荐(0)
摘要: 针对场景:Qoder连接local mcp server的mcp.json文件配置,即stdio方式启动。 { "mcpServers": { "your-mcp-identifier": { "command": "uv", "args": [ "--directory", "D:/usr/use 阅读全文
posted @ 2025-10-27 00:23 leah-xx 阅读(1012) 评论(0) 推荐(0)