Giter Club home page Giter Club logo

wtf-langchain's Introduction

WTF Langchain

最近在学习Langchain框架,顺手写一个开源教程。本教程默认以下前提:

  • 使用Python版本的Langchain
  • LLM使用OpenAI的模型
  • Langchain目前还处于快速发展阶段,版本迭代频繁,为避免示例代码失效,本教程使用最新版本 0.0.235

极简入门

01: Hello Langchain链接

02: 模型链接

03: 数据连接链接

04: 提示词链接

05: 输出解析器链接

06: 链链接

07: 记忆组件链接

08: 代理链接

09: 回调链接

10: 一个完整的例子链接

wtf-langchain's People

Contributors

sugarforever avatar shunwuyu avatar chengge2003 avatar

Stargazers

Kylin avatar  avatar 张嘉夫 avatar  avatar darkVinci avatar 派蒙不好吃 avatar Jarvis Chan avatar 倾城、 avatar  avatar 嘉伦_TechAI avatar  avatar  avatar leeHo avatar leezhao avatar Vint avatar Inchill avatar  avatar  avatar  avatar  avatar  avatar Minggao Feng avatar  avatar Jessie Chen avatar Robus avatar  avatar Eason Tse avatar EchoByte avatar March avatar G_will avatar  avatar 南瓜 avatar jiadi_wu avatar  avatar  avatar Ruoqi_CAI avatar  avatar  avatar  avatar  avatar Ruobin Chang avatar  avatar  avatar  avatar Jiangnan avatar  avatar  avatar MasterMonster avatar  avatar  avatar  avatar  avatar  avatar heheshang avatar  avatar  avatar betaqi avatar Mafia avatar svanrj avatar Mason Chen avatar  avatar zhangzq avatar  avatar zero avatar Robert Wang avatar  avatar  avatar Wanqiang Liang avatar  avatar Huifeng Kan avatar  avatar lannyyuan avatar Eric avatar zhenda avatar  avatar sisuer avatar 道具是只猫 avatar  avatar  avatar 袁运亮 avatar  avatar  avatar gotomypc avatar Chenxu Hu avatar Zhang Xuhui avatar  avatar wangxinyu avatar  avatar  avatar CherryKing avatar  avatar 龙泉月夕 avatar James Zhang avatar  avatar Cui Jiahua avatar  avatar Hipparchus_wang avatar Kefan You avatar flyfox666 avatar NetGuy avatar

Watchers

 avatar  avatar  avatar hanzhc avatar  avatar  avatar

wtf-langchain's Issues

建议指定 openai 版本

当默认安装 openai 时使用的时最新版本,但是最新版本与当前文档内容会有冲突:

module 'openai' has no attribute 'error'

建议指定 openai==0.28

在第五步时报错,我检查了库的安装,都是没问题的,前四步也能正常运行(我是在windows上跑的,第三步下载pdf我是手动下载),还有pdf的页数更新成114页了,不知道这是否是错误的原因


AttributeError Traceback (most recent call last)
Cell In[13], line 10
6 split_docs = text_splitter.split_documents(docs)
8 embeddings = OpenAIEmbeddings()
---> 10 vectorstore = Chroma.from_documents(split_docs, embeddings, collection_name="serverless_guide")

File d:\MINIconda\envs\lc\lib\site-packages\langchain\vectorstores\chroma.py:564, in Chroma.from_documents(cls, documents, embedding, ids, collection_name, persist_directory, client_settings, client, collection_metadata, **kwargs)
562 texts = [doc.page_content for doc in documents]
563 metadatas = [doc.metadata for doc in documents]
--> 564 return cls.from_texts(
565 texts=texts,
566 embedding=embedding,
567 metadatas=metadatas,
568 ids=ids,
569 collection_name=collection_name,
570 persist_directory=persist_directory,
571 client_settings=client_settings,
572 client=client,
573 collection_metadata=collection_metadata,
574 **kwargs,
575 )

File d:\MINIconda\envs\lc\lib\site-packages\langchain\vectorstores\chroma.py:528, in Chroma.from_texts(cls, texts, embedding, metadatas, ids, collection_name, persist_directory, client_settings, client, collection_metadata, **kwargs)
500 """Create a Chroma vectorstore from a raw documents.
...
52 ),
53 before_sleep=before_sleep_log(logger, logging.WARNING),
54 )

AttributeError: module 'openai' has no attribute 'error'
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.