Commit Graph

1921 Commits (textloader_autodetect_encodings)
 

Author SHA1 Message Date
Nuno Campos f3ec6d2449
Replace remaining usage of basellm with baselangmodel (#3981) 1 year ago
mbchang f291fd7eed
docs: remove stdout from pip install (for gymnasium) (#3993) 1 year ago
Harrison Chase b67be55ab8
bump ver (#4018) 1 year ago
Harrison Chase a5dd73c1a6
Revert "[agent][property type] Change allowed_tools to Set as Duplicate doesn’t make sense" (#4014)
Reverts hwchase17/langchain#3840
1 year ago
Davis Chase df3bc707fc
Dev2049/callback example fix (#4010)
Closes #3997

---------

Co-authored-by: Akshaj Jain <akshaj.jain@gmail.com>
1 year ago
Davis Chase f08a76250f
Better custom model handling OpenAICallbackHandler (#4009)
Thanks @maykcaldas for flagging! think this should resolve #3988. Let me
know if you still see issues after next release.
1 year ago
Zander Chase aa38355999
Vwp/docs improved document loaders (#4006)
Huge thanks to @leo-gan for improving the document loaders notebooks

---------

Co-authored-by: Leonid Ganeline <leo.gan.57@gmail.com>
1 year ago
Zander Chase 1c68cbdb28
Fix typing of attribute (#3999) 1 year ago
MichaelMDowling 36ee60c96c
Update \docs\modules\models\text_embedding\examples\openai.ipynb (#3976)
Single edit to: models/text_embedding/examples/openai.ipynb - Line 88:
changed from: "embeddings = OpenAIEmbeddings(model_name=\"ada\")" to
"embeddings = OpenAIEmbeddings()" as model_name is no longer part of the
OpenAIEmbeddings class.
1 year ago
Harrison Chase e23391965b
fix import (#4003) 1 year ago
Jinto Jose 013208cce6
Fix Documentation - Nomic - Atlas Jupyter Notebook (#3987)
Correction to Numic-Atlas Jupyter Notebook Docs
1 year ago
Ankush Gola 18f9d7b4f6
don't deepcopy handlers (#3995)
Co-authored-by: Sami Liedes <sami.liedes@iki.fi>
Co-authored-by: Sami Liedes <sami.liedes@rocket-science.ch>
1 year ago
Mike Wang c26cf04110
[check] add import check and warning for pandas (#3944)
- as titled, add an `import` catch for pandas with a user suggestion
message.
1 year ago
Chop Tr 71a337dac6
Update output_fixing_parser.ipynb (#3978) 1 year ago
Ankush Gola 3bd5a99b83
v2 tracer with single runs endpoint (#3951) 1 year ago
Harrison Chase 8fcb56e74a
bump version to 155 (#3943) 1 year ago
Harrison Chase ca08a34a98
retry to parsing (#3696) 1 year ago
mbchang 3993166b5e
docs: remove stdout from pip install (#3945) 1 year ago
Harrison Chase 2366e71bed
Harrison/azure openai (#3942)
Co-authored-by: Saverio Proto <zioproto@gmail.com>
1 year ago
Harrison Chase 48ea27ba60
Harrison/blockwise sitemap (#3940)
Co-authored-by: Martin Holzhauer <martin@holzhauer.eu>
1 year ago
Harrison Chase 483fe257d9
bump timeout (#3939) 1 year ago
Jan Philipp Harries fc3c2c4406
Async Support for LLMChainExtractor (new) (#3780)
@vowelparrot @hwchase17 Here a new implementation of
`acompress_documents` for `LLMChainExtractor ` without changes to the
sync-version, as you suggested in #3587 / [Async Support for
LLMChainExtractor](https://github.com/hwchase17/langchain/pull/3587) .

I created a new PR to avoid cluttering history with reverted commits,
hope that is the right way.
Happy for any improvements/suggestions.

(PS:
I also tried an alternative implementation with a nested helper function
like

``` python
  async def acompress_documents_old(
      self, documents: Sequence[Document], query: str
  ) -> Sequence[Document]:
      """Compress page content of raw documents."""
      async def _compress_concurrently(doc):
          _input = self.get_input(query, doc)
          output = await self.llm_chain.apredict_and_parse(**_input)
          return Document(page_content=output, metadata=doc.metadata)
      outputs=await asyncio.gather(*[_compress_concurrently(doc) for doc in documents])
      compressed_docs=list(filter(lambda x: len(x.page_content)>0,outputs))
      return compressed_docs
```

But in the end I found the commited version to be better readable and
more "canonical" - hope you agree.
1 year ago
Harrison Chase 2cecc572f9
Harrison/chroma get (#3938)
Co-authored-by: sdan <git@sdan.io>
1 year ago
liviuasnash1 6396a4ad8d
Fix documentation typos (#3870)
Co-authored-by: Liviu Asnash <liviua@maximallearning.com>
1 year ago
Hristo Stoychev 109927cdb2
Make project compatible with SQLAlchemy 1.3.* (#3862)
Related to [this
issue.](https://github.com/hwchase17/langchain/issues/3655#issuecomment-1529415363)

The `Mapped` SQLAlchemy class is introduced in SQLAlchemy 1.4 but the
migration from 1.3 to 1.4 is quite challenging so, IMO, it's better to
keep backwards compatibility and not change the SQLAlchemy requirements
just because of type annotations.
1 year ago
sqr 8bbdde8f9e
make ARG POETRY_HOME available in multistage (#3882) 1 year ago
玄猫 188a7bd653
fix: pgvector hang risk if table not exist #3883 (#3884) 1 year ago
tomer555 9acf80fd69
fix: invalid escape sequence error in regex pattern (#3902)
This PR fixes the "SyntaxError: invalid escape sequence" error in the
pydantic.py file. The issue was caused by the backslashes in the regular
expression pattern being treated as escape characters. By using a raw
string literal for the regex pattern (e.g., r"\{.*\}"), this fix ensures
that backslashes are treated as literal characters, thus preventing the
error.

Co-authored-by: Tomer Levy <tomer.levy@tipalti.com>
1 year ago
Samuel Dion-Girardeau c5c33786a7
Fix bad spellings for 'convenience' (#3936)
Found in the docs for chat prompt templates:

https://python.langchain.com/en/latest/getting_started/getting_started.html#chat-prompt-templates

and fixed similar issues in neighboring notebooks.
1 year ago
Harrison Chase f04faf8496
Harrison/spreedly (#3937)
Co-authored-by: Esmit Pérez <esmitperez@users.noreply.github.com>
1 year ago
Harrison Chase cd3f8582cb
Harrison/combined memory (#3935)
Co-authored-by: engkheng <60956360+outday29@users.noreply.github.com>
1 year ago
Zander Chase c4cb55a0c5
[Breaking] Migrate GPT4All to use PyGPT4All (#3934)
Seems the pyllamacpp package is no longer the supported bindings from
gpt4all. Tested that this works locally.

Given that the older models weren't very performant, I think it's better
to migrate now without trying to include a lot of try / except blocks

---------

Co-authored-by: Nissan Pow <npow@users.noreply.github.com>
Co-authored-by: Nissan Pow <pownissa@amazon.com>
1 year ago
leo-gan f0a4bbb8e2
updated `YouTube` links (#3916)
Added several links to fresh videos

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
1 year ago
Mike Wang 68a18cc621
[simple] add ddg-search to __init__ for easier loading (#3933)
the same as other tools
1 year ago
Matt Robinson c51dec5101
feat: add Unstructured API loaders (#3906)
### Summary

Adds `UnstructuredAPIFileLoaders` and `UnstructuredAPIFIleIOLoaders`
that partition documents through the Unstructured API. Defaults to the
URL for hosted Unstructured API, but can switch to a self hosted or
locally running API using the `url` kwarg. Currently, the Unstructured
API is open and does not require an API, but it will soon. A note was
added about that to the Unstructured ecosystem page.

### Testing


```python
from langchain.document_loaders import UnstructuredAPIFileIOLoader

filename = "fake-email.eml"

with open(filename, "rb") as f:
    loader = UnstructuredAPIFileIOLoader(file=f, file_filename=filename)
    docs = loader.load()

docs[0]
```

```python
from langchain.document_loaders import UnstructuredAPIFileLoader

filename = "fake-email.eml"
loader = UnstructuredAPIFileLoader(file_path=filename, mode="elements")
docs = loader.load()

docs[0]
```
1 year ago
Harrison Chase 13269fb583
Harrison/relevancy score (#3907)
Co-authored-by: Ryan Grippeling <R.Grippeling@hotmail.com>
Co-authored-by: Ryan <ryan@webgrip.nl>
Co-authored-by: Zander Chase <130414180+vowelparrot@users.noreply.github.com>
1 year ago
Zander Chase c582f2e9e3
Add Structure Chat Agent (#3912)
Create a new chat agent that is compatible with the Multi-input tools
1 year ago
Mike Wang ec21b7126c
[agent][property type] Change allowed_tools to Set as Duplicate doesn’t make sense (#3840)
- ActionAgent has a property called, `allowed_tools`, which is declared
as `List`. It stores all provided tools which is available to use during
agent action.
- This collection shouldn’t allow duplicates. The original datatype List
doesn’t make sense. Each tool should be unique. Even when there are
variants (assuming in the future), it would be named differently in
load_tools.


Test:
- confirm the functionality in an example by initializing an agent with
a list of 2 tools and confirm everything works.
```python3
def test_agent_chain_chat_bot():
	from langchain.agents import load_tools
	from langchain.agents import initialize_agent
	from langchain.agents import AgentType
	from langchain.chat_models import ChatOpenAI
	from langchain.llms import OpenAI
	from langchain.utilities.duckduckgo_search import DuckDuckGoSearchAPIWrapper

	chat = ChatOpenAI(temperature=0)
	llm = OpenAI(temperature=0)
	tools = load_tools(["ddg-search", "llm-math"], llm=llm)

	agent = initialize_agent(tools, chat, agent=AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
	agent.run("Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 power?")
test_agent_chain_chat_bot()
```
Result:
<img width="863" alt="Screenshot 2023-05-01 at 7 58 11 PM"
src="https://user-images.githubusercontent.com/62768671/235572157-0937594c-ddfb-4760-acb2-aea4cacacd89.png">
1 year ago
Harrison Chase c5cc09d4e3
Harrison/agent exec kwargs (#3917)
Co-authored-by: Zach Schillaci <40636930+zachschillaci27@users.noreply.github.com>
1 year ago
Harrison Chase 05170b6764
Harrison/from documents (#3919)
Co-authored-by: Gabriel Altay <gabriel.altay@gmail.com>
1 year ago
Davis Chase e7e29f9937
Dev2049/add modern treasury (#3924)
Modified Modern Treasury and Strip slightly so credentials don't have to
be passed in explicitly. Thanks @mattgmarcus for adding Modern Treasury!

---------

Co-authored-by: Matt Marcus <matt.g.marcus@gmail.com>
1 year ago
Davis Chase 5db6b796cf
Dev2049/hf emb encode kwargs (#3925)
Thanks @amogkam for the addition! Refactored slightly

---------

Co-authored-by: Amog Kamsetty <amogkam@users.noreply.github.com>
1 year ago
mbchang ffc87233a1
refactor GymnasiumAgent (#3927)
refactor GymnasiumAgent (for single-agent environments) to be extensible
to PettingZooAgent (multi-agent environments)
1 year ago
mbchang 81601d886c
new example: multi-agent simulations with environment (#3928) 1 year ago
Harrison Chase f7a828685d
Harrison/constitutional chain (#3931)
Co-authored-by: Sam Ching <samuel@duolingo.com>
1 year ago
Eduard van Valkenburg 43a0cb4b92
small change to allow powerbi tools to all have single inputs (#3864)
Small change in the tool input so that the single_input_tool function
works against all powerbi tools
1 year ago
Eduard van Valkenburg c38cafd6c2
Add connection string auth to cosmos (#3867)
Adds a connection string option for the cosmos memory, in case AAD auth
is not enabled on the cosmos instance.
1 year ago
Venelin Valkov bc7e4d5cd4
Add links to YouTube videos by Venelin Valkov (#3820)
Hi,
I've added links to my YouTube videos on LangChain. Thank you for
making/maintaining LangChain!
Venelin
1 year ago
Rafal Wojdyla a5a4999fb7
New line should be remove only for the 1st gen embedding models (#3853)
Only 1st generation OpenAI embeddings models are negatively impacted by
new lines.

Context:
https://github.com/openai/openai-python/issues/418#issuecomment-1525939500
1 year ago
Johan Stenberg (MSFT) 6bd367916c
Update adding_memory_chain_multiple_inputs.ipynb (#3895)
Fix misleading docs in memory chain example (used the term "outputs"
instead of "inputs")
1 year ago