milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
28.16k stars 2.71k forks source link

[Bug]: The sample code for integrating langchain in the 2.4.x Docs has the problem of referencing the wrong package. #33455

Open xxh18819431660 opened 1 month ago

xxh18819431660 commented 1 month ago

Is there an existing issue for this?

Environment

- Milvus version: 2.4.x
- Deployment mode(standalone or cluster): standalone 
- MQ type(rocksmq, pulsar or kafka): None   
- SDK version(e.g. pymilvus v2.0.0rc2): None
- OS(Ubuntu or CentOS): None
- CPU/Memory: None
- GPU: None
- Others: None

Current Behavior

When I refer to the docs of version 2.4.x and run the sample code of Question Answering over Documents with Milvus and LangChain, I find that the code runs with this error: NameError: name 'PromptTemplate' is not defined The specific error location is in run of the Ask your question code. The specific code israg_prompt = PromptTemplate.from_template(template). https://milvus.io/docs/integrate_with_langchain.md#Ask-your-question

Expected Behavior

I sincerely hope that the committers can change this code in https://milvus.io/docs/integrate_with_langchain.md#Prepare-data: from langchain_core.prompts import ChatPromptTemplate to from langchain_core.prompts import PromptTemplate In this way, no error will be reported when the package method is called later.

Steps To Reproduce

No response

Milvus Log

No response

Anything else?

No response

xxh18819431660 commented 1 month ago

Modified the issue description to locate the problem and the code that needs to be modified more quickly.

yanliang567 commented 1 month ago

/assign @jaelgu I think you are working on the updates. /unassign

jaelgu commented 3 weeks ago

@xxh18819431660 The tutorial has been updated recently. Please check again: https://milvus.io/docs/integrate_with_langchain.md