https://github.com/langchain-ai/web-explorer
  
  
     
    https://github.com/langchain-ai/web-explorer
  
        Last synced: 7 months ago 
        JSON representation
    
- Host: GitHub
 - URL: https://github.com/langchain-ai/web-explorer
 - Owner: langchain-ai
 - Created: 2023-07-24T19:14:26.000Z (over 2 years ago)
 - Default Branch: main
 - Last Pushed: 2023-08-09T23:06:57.000Z (about 2 years ago)
 - Last Synced: 2025-03-29T14:06:46.075Z (7 months ago)
 - Language: Python
 - Size: 643 KB
 - Stars: 385
 - Watchers: 12
 - Forks: 87
 - Open Issues: 7
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
- jimsghstars - langchain-ai/web-explorer - (Python)
 
README
          # Web Explorer
This is a lightweight app using the [Web Research Retriever](https://github.com/langchain-ai/langchain/pull/8102).
## Setup
You only need to supply a few things.
In `settings()` function, supply:
* Search: Select the search tool you want to use (e.g., GoogleSearchAPIWrapper). 
* Vectorstore: Select the vectorstore and embeddings you want to use (e.g., Chroma, OpenAIEmbeddings).
* Select the LLM you want to use (e.g., ChatOpenAI).
To use `st.secrets` set enviorment variables in `.streamlit/secrets.toml` file.
 
Or, simply add environemnt variables and remove `st.secrets`: 
```
import os
os.environ["GOOGLE_API_KEY"] = "YOUR_API_KEY"
os.environ["GOOGLE_CSE_ID"] = "YOUR_CSE_ID" 
os.environ["OPENAI_API_BASE"] = "https://api.openai.com/v1"
os.environ["OPENAI_API_KEY"] = "YOUR_API_KEY"
```
For `GOOGLE_API_KEY` , you could get it from [this link](https://console.cloud.google.com/apis/api/customsearch.googleapis.com/credentials).
For `GOOGLE_CSE_ID` , you could get it from [this link](https://programmablesearchengine.google.com/)
## Run
```
streamlit run web_explorer.py
```
Example output:
