forked from langchain-ai/langchain
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fetch fork master #3
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Harrison Chase <[email protected]>
Co-authored-by: Stefan Keselj <[email protected]> Co-authored-by: Harrison Chase <[email protected]>
…ngchain-ai#1000) Co-authored-by: Francisco Ingham <>
simple typo fix: because --> between
…1011) Updates the Unstructured example notebook with a PDF example. Includes additional dependencies for PDF processing (and images, etc).
Chroma is a simple to use, open-source, zero-config, zero setup vectorstore. Simply `pip install chromadb`, and you're good to go. Out-of-the-box Chroma is suitable for most LangChain workloads, but is highly flexible. I tested to 1M embs on my M1 mac, with out issues and reasonably fast query times. Look out for future releases as we integrate more Chroma features with LangChain!
Co-authored-by: William FH <[email protected]>
Imho retries should be performed for ServiceUnavailableError (which tends to happen to me quite often).
Co-authored-by: blob42 <[email protected]> Co-authored-by: blob42 <spike@w530>
This PR adds persistence to the Chroma vector store. Users can supply a `persist_directory` with any of the `Chroma` creation methods. If supplied, the store will be automatically persisted at that directory. If a user creates a new `Chroma` instance with the same persistence directory, it will get loaded up automatically. If they use `from_texts` or `from_documents` in this way, the documents will be loaded into the existing store. There is the chance of some funky behavior if the user passes a different embedding function from the one used to create the collection - we will make this easier in future updates. For now, we log a warning.
Add GooseAI, CerebriumAI, Petals, ForefrontAI
Co-authored-by: Ibis Prevedello <[email protected]>
Currently the chain is getting the column names and types on the one side and the example rows on the other. It is easier for the llm to read the table information if the column name and examples are shown together so that it can easily understand to which columns do the examples refer to. For an instantiation of this, please refer to the changes in the `sqlite.ipynb` notebook. Also changed `eval` for `ast.literal_eval` when interpreting the results from the sample row query since it is a better practice. --------- Co-authored-by: Francisco Ingham <> --------- Co-authored-by: Francisco Ingham <[email protected]>
Co-authored-by: jped <[email protected]> Co-authored-by: Justin Torre <[email protected]> Co-authored-by: Ivan Vendrov <[email protected]>
* Support a callback `on_llm_new_token` that users can implement when `OpenAI.streaming` is set to `True`
### Summary Adds tracked metadata from `unstructured` elements to the document metadata when `UnstructuredFileLoader` is used in `"elements"` mode. Tracked metadata is available in `unstructured>=0.4.9`, but the code is written for backward compatibility with older `unstructured` versions. ### Testing Before running, make sure to upgrade to `unstructured==0.4.9`. In the code snippet below, you should see `page_number`, `filename`, and `category` in the metadata for each document. `doc[0]` should have `page_number: 1` and `doc[-1]` should have `page_number: 2`. The example document is `layout-parser-paper-fast.pdf` from the [`unstructured` sample docs](https://github.com/Unstructured-IO/unstructured/tree/main/example-docs). ```python from langchain.document_loaders import UnstructuredFileLoader loader = UnstructuredFileLoader(file_path=f"layout-parser-paper-fast.pdf", mode="elements") docs = loader.load() ```
…angchain-ai#1053) This PR updates the usage instructions for PromptLayerOpenAI in Langchain's documentation. The updated instructions provide more detail and conform better to the style of other LLM integration documentation pages. No code changes were made in this PR, only improvements to the documentation. This update will make it easier for users to understand how to use `PromptLayerOpenAI`
We introduced a breaking change but missed this call. This PR fixes `langchain` to work with upstream `chroma`.
Updating this base file as well as the .ipynb file of the example on the website: langchain-ai/langchain@master...akshayvkt:langchain:patch-1 https://langchain.readthedocs.io/en/latest/modules/document_loaders/examples/everynote.html
Co-authored-by: Andrew Huang <[email protected]>
langchain-ai#909) Adds Google Search integration with [Serper](https://serper.dev) a low-cost alternative to SerpAPI (10x cheaper + generous free tier). Includes documentation, tests and examples. Hopefully I am not missing anything. Developers can sign up for a free account at [serper.dev](https://serper.dev) and obtain an api key. ## Usage ```python from langchain.utilities import GoogleSerperAPIWrapper from langchain.llms.openai import OpenAI from langchain.agents import initialize_agent, Tool import os os.environ["SERPER_API_KEY"] = "" os.environ['OPENAI_API_KEY'] = "" llm = OpenAI(temperature=0) search = GoogleSerperAPIWrapper() tools = [ Tool( name="Intermediate Answer", func=search.run ) ] self_ask_with_search = initialize_agent(tools, llm, agent="self-ask-with-search", verbose=True) self_ask_with_search.run("What is the hometown of the reigning men's U.S. Open champion?") ``` ### Output ``` Entering new AgentExecutor chain... Yes. Follow up: Who is the reigning men's U.S. Open champion? Intermediate answer: Current champions Carlos Alcaraz, 2022 men's singles champion. Follow up: Where is Carlos Alcaraz from? Intermediate answer: El Palmar, Spain So the final answer is: El Palmar, Spain > Finished chain. 'El Palmar, Spain' ```
Co-authored-by: Akshay <[email protected]>
…ain-ai#1066) This PR updates `PromptLayerOpenAI` to now support requests using the [Async API](https://langchain.readthedocs.io/en/latest/modules/llms/async_llm.html) It also updates the documentation on Async API to let users know that PromptLayerOpenAI also supports this. `PromptLayerOpenAI` now redefines `_agenerate` a similar was to how it redefines `_generate`
Alternate implementation to PR langchain-ai#960 Again - only FAISS is implemented. If accepted can add this to other vectorstores or leave as NotImplemented? Suggestions welcome...
…ze calculation. (langchain-ai#991) I modified the logic of the batch calculation for embedding according to this cookbook https://github.com/openai/openai-cookbook/blob/main/examples/Embedding_long_inputs.ipynb
This is a work in progress PR to track my progres. ## TODO: - [x] Get results using the specifed searx host - [x] Prioritize returning an `answer` or results otherwise - [ ] expose the field `infobox` when available - [ ] expose `score` of result to help agent's decision - [ ] expose the `suggestions` field to agents so they could try new queries if no results are found with the orignial query ? - [ ] Dynamic tool description for agents ? - Searx offers many engines and a search syntax that agents can take advantage of. It would be nice to generate a dynamic Tool description so that it can be used many times as a tool but for different purposes. - [x] Limit number of results - [ ] Implement paging - [x] Miror the usage of the Google Search tool - [x] easy selection of search engines - [x] Documentation - [ ] update HowTo guide notebook on Search Tools - [ ] Handle async - [ ] Tests ### Add examples / documentation on possible uses with - [ ] getting factual answers with `!wiki` option and `infoboxes` - [ ] getting `suggestions` - [ ] getting `corrections` --------- Co-authored-by: blob42 <spike@w530> Co-authored-by: Harrison Chase <[email protected]>
Co-authored-by: Ivan Vendrov <[email protected]> Co-authored-by: Sasmitha Manathunga <[email protected]>
Co-authored-by: Chen Wu (吴尘) <[email protected]>
This addresses langchain-ai#948. I set the documentation max width to 2560px, but can be adjusted - see screenshot below. <img width="1741" alt="Screenshot 2023-02-14 at 13 05 57" src="https://user-images.githubusercontent.com/23406704/218749076-ea51e90a-a220-4558-b4fe-5a95b39ebf15.png">
Co-authored-by: Maxime Vidal <[email protected]>
Co-authored-by: Francisco Ingham <[email protected]>
Changed number of types of chains to make it consistent with the rest of the docs
…in-ai#1093) The langchain-ai#1088 introduced a bug in Qdrant integration. That PR reverts those changes and provides class attributes to ensure consistent payload keys. In addition to that, an exception will be thrown if any of texts is None (that could have been an issue reported in langchain-ai#1087)
Hase-U
pushed a commit
that referenced
this pull request
Apr 30, 2023
without --no-sandbox param, load documents from url by selenium in chrome occured error below: ```Traceback (most recent call last): File "/data//playgroud/try_langchain.py", line 343, in <module> langchain_doc_loader() File "/data//playgroud/try_langchain.py", line 67, in langchain_doc_loader documents = loader.load() File "/install/anaconda3-env/envs/python3.10/lib/python3.10/site-packages/langchain/document_loaders/url_selenium.py", line 102, in load driver = self._get_driver() File "/install/anaconda3-env/envs/python3.10/lib/python3.10/site-packages/langchain/document_loaders/url_selenium.py", line 76, in _get_driver return Chrome(options=chrome_options) File "/install/anaconda3-env/envs/python3.10/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 80, in __init__ super().__init__( File "/install/anaconda3-env/envs/python3.10/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 104, in __init__ super().__init__( File "/install/anaconda3-env/envs/python3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 286, in __init__ self.start_session(capabilities, browser_profile) File "/install/anaconda3-env/envs/python3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/install/anaconda3-env/envs/python3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute self.error_handler.check_response(response) File "/install/anaconda3-env/envs/python3.10/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Stacktrace: #0 0x55cf8da1bfe3 <unknown> #1 0x55cf8d75ad36 <unknown> #2 0x55cf8d783b20 <unknown> #3 0x55cf8d77fa9b <unknown> #4 0x55cf8d7c1af7 <unknown> #5 0x55cf8d7c111f <unknown> langchain-ai#6 0x55cf8d7b8693 <unknown> langchain-ai#7 0x55cf8d78b03a <unknown> langchain-ai#8 0x55cf8d78c17e <unknown> langchain-ai#9 0x55cf8d9dddbd <unknown> langchain-ai#10 0x55cf8d9e1c6c <unknown> langchain-ai#11 0x55cf8d9eb4b0 <unknown> langchain-ai#12 0x55cf8d9e2d63 <unknown> langchain-ai#13 0x55cf8d9b5c35 <unknown> langchain-ai#14 0x55cf8da06138 <unknown> langchain-ai#15 0x55cf8da062c7 <unknown> langchain-ai#16 0x55cf8da14093 <unknown> langchain-ai#17 0x7f3da31a72de start_thread ``` add option `chrome_options.add_argument("--no-sandbox")` for chrome.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.