-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to connect a Chatbot that has its own data but has also access to internet for search? #8625
Comments
Answer generated by a 🤖 AnswerHi, From your code, it seems like you're trying to combine the results from your local documents and the internet search into one list and then pass it to the The Here's an example of how you might do this: def custom_search(query):
max_results = 3
internet_results = search.run(query)[:max_results]
# Convert the search results into Document objects
internet_documents = [Document(page_content=result) for result in internet_results]
return internet_documents
# ...
while True:
query = input("Hola, soy Chatbot. ¿Qué te gustaría saber? ")
internet_documents = custom_search(query)
combined_results = loaded_content + internet_documents
response = chain(
{"question": query, "chat_history": history, "documents": combined_results})
print(response["answer"])
history.append(("system", query))
history.append(("assistant", response["answer"])) In this code, the Please note that this is just a suggestion and the actual solution might differ based on the exact format of your search results and the specific requirements of your application. I hope this helps! Let me know if you have any other questions. Sources
This response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. |
I get "Dcoument" is not defined. Added this: But it still seems it hasn't access to internet. Any other suggestion? |
Answer generated by a 🤖 AnswerHello, From your code, it seems like you're trying to use the
Regarding the issue of the Chatbot not accessing the internet, it's hard to pinpoint the exact issue without more information. However, I can suggest a few things:
If you're still encountering issues, could you please provide more information about the error messages you're seeing, and any other relevant details about your setup? This will help me better understand the problem and provide a more accurate solution. Best, Sources
This response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. |
Document correctly imported, upgrade on Langchain done, GoogleSearchAPIWrapper on a simple script working,... Everything seems fine but when running this code it still doesn't get access to the internet: `
` What can I do to make it work? Appreciate. |
Answer generated by a 🤖 AnswerHello, Thank you for providing a detailed description of your issue. From the code you've shared, it seems like you've done a thorough job setting up your environment and implementing the necessary functions. However, to better assist you, I need a bit more information:
Your answers to these questions will help me provide a more accurate solution to your problem. Looking forward to your response. This response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. |
In conclussion it is something wrong on my code that doesn't allow the chatbot to look at the custom data and also on the internet. Please need someone that has knowledge to accomplish a solution. Here again the code I've so far: `
` NOTE: There has to be a problem with how Appreciate any help! |
I've updated the code but very strange it doesn't find a good response. When I `
` Can anyone help me to make it work? Appreicate! |
Hi, @venturaEffect! I'm Dosu, and I'm helping the LangChain team manage our backlog. I wanted to let you know that we are marking this issue as stale. Based on my understanding, you were seeking help to connect a chatbot with its own data to the internet for search. In the comments, there were suggestions and code examples provided by me to convert search results into Before we close this issue, we wanted to check if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days. Thank you for your understanding and contribution to the LangChain project! |
how to connect a chatbot to internet for real time access or to give up to date information. using gemini model not gpt-4 ??? Please help me with resources |
Issue you'd like to raise.
Hi!
How to make a Chatbot that uses its own data access to the internet to get more info (like new updated)? I've tried and searched everywhere but can't make it work.
Here the code:
`
from langchain.chains import ConversationalRetrievalChain
from langchain.memory import ConversationBufferMemory
from langchain.vectorstores import DocArrayInMemorySearch
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.document_loaders import (
UnstructuredWordDocumentLoader,
TextLoader,
UnstructuredPowerPointLoader,
)
from langchain.tools import Tool
from langchain.utilities import GoogleSearchAPIWrapper
from langchain.chat_models import ChatOpenAI
import os
import openai
import sys
from dotenv import load_dotenv, find_dotenv
`
This is the error message I get: "The document does not provide information on... ". So it seems it doesn't access to the internet or something else (?)
Really appreciate your suggestion or your help!
Suggestion:
No response
The text was updated successfully, but these errors were encountered: