Commit Graph

9366 Commits

Author SHA1 Message Date
Erick Friis
88740b64dc docs: version dropdown (#21784) 2024-06-20 13:52:14 -07:00
Chad Juliano
c9e8d851dc docs: fix errors and table formatting in notebook (#21696)
There are 2 issues fixed here:

* In the notebook pandas dataframes are formatted as HTML in the cells.
On the documentation site the renderer that converts notebooks
incorrectly displays the raw HTML. I can't find any examples of where
this is working and so I am formatting the dataframes as text.

* Some incorrect table names were referenced resulting in errors.
2024-06-20 13:52:14 -07:00
Asaf Joseph Gardin
78ea3fc025 partners: Revert AI21 Labs docs scan feature (#21699)
Description: Reverted commit #21614

---------

Co-authored-by: Asaf Gardin <asafg@ai21.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-06-20 13:52:14 -07:00
github-user-en
7a829a2bb8 Made a grammatical correction in streaming.ipynb (#21707)
The only change is replacing the word "operators" with "operates," to
make the sentence grammatically correct.

Thank you for contributing to LangChain!

- [x] **PR title**: "docs: Made a grammatical correction in
streaming.ipynb to use the word "operates" instead of the word
"operators""


- [x] **PR message**: 
- **Description:** The use of the word "operators" was incorrect, given
the context and grammar of the sentence. This PR updates the
documentation to use the word "operates" instead of the word
"operators".
    - **Issue:** Makes the documentation more easily understandable.
    - **Dependencies:** -no dependencies-
    - **Twitter handle:** --


- [x] **Add tests and docs**: Since no new integration is being made, no
new tests/example notebooks are required.


- [x] **Lint and test**: Run `make format`, `make lint` and `make test`
from the root of the package(s) you've modified. See contribution
guidelines for more: https://python.langchain.com/docs/contributing/
    - **No formatting changes made to the documentation**

Additional guidelines:
- Make sure optional dependencies are imported within a function.
- Please do not add dependencies to pyproject.toml files (even optional
ones) unless they are required for unit tests.
- Most PRs should not touch more than one package.
- Changes should be backwards compatible.
- If you are adding something to community, do not re-import it in
langchain.

If no one reviews your PR within a few days, please @-mention one of
baskaryan, efriis, eyurtsev, hwchase17.
2024-06-20 13:52:14 -07:00
Brace Sproul
4a1f397f02 docs[minor]: Hide prev/next buttons on docs in how to / tutorials (#21789)
These buttons don't navigate to the proper prev/next page. Hide in those
pages
2024-06-20 13:52:14 -07:00
Eugene Yurtsev
13cf33287a langchain[patch],community[patch]: Move unit tests that depend on community to community (#21685) 2024-06-20 13:52:14 -07:00
Eugene Yurtsev
daec5e8564 How To: Custom tools (#21725)
- Remove double implementations of functions. The single input is just
taking up space.
- Added tool specific information for `async + showing invoke vs.
ainvoke.
- Added more general information about about `async` (this should live
in a different place eventually since it's not specific to tools).
- Changed ordering of custom tools (StructuredTool is simpler and should
appear before the inheritance)
- Improved the error handling section (not convinced it should be here
though)
2024-06-20 13:52:14 -07:00
Bagatur
2764e0aa90 docs: link runnable api (#21783) 2024-06-20 13:52:14 -07:00
Bagatur
cd5a1f8371 docs: intro nit (#21785) 2024-06-20 13:52:14 -07:00
Marco Lamina
8b2b48b4c4 community: Add token cost for GPT-4o model (#21771)
Adding [token cost for the new GPT-4o
model](https://openai.com/api/pricing/):
* Input cost US$5.00 / 1M tokens
* Output cost US$15.00 / 1M tokens
2024-06-20 13:52:14 -07:00
Bagatur
15e7ae00e2 docs: update chat feat table (#21778) 2024-06-20 13:52:14 -07:00
Massimiliano Pronesti
5b522ee1f6 feat(community): support semantic hybrid score threshold in Azure AI Search (#21527)
Support semantic hybrid search with a score threshold -- similar to what
we do for similarity search and for hybrid search (#20907).
2024-06-20 13:52:14 -07:00
Erick Friis
2a631826a5 docs: dont rewrite ipynb links that have double slash (#21775) 2024-06-20 13:52:14 -07:00
Eugene Yurtsev
728507ba76 docs: concepts -- add information about tool calling models, update tools section (#21760)
- Add information about naitve tool calling capabilities
- Add information about standard langchain interface for tool calling
- Update description for tools

---------

Co-authored-by: ccurme <chester.curme@gmail.com>
2024-06-20 13:52:14 -07:00
Bagatur
092340f61d anthropic[patch]: Release 0.1.13, tool_choice support (#21773) 2024-06-20 13:52:14 -07:00
Stefano Lottini
63108ebe25 community: init signature revision for Cassandra LLM cache classes + small maintenance (#17765)
This PR improves on the `CassandraCache` and `CassandraSemanticCache`
classes, mainly in the constructor signature, and also introduces
several minor improvements around these classes.

### Init signature

A (sigh) breaking change is tentatively introduced to the constructor.
To me, the advantages outweigh the possible discomfort: the new syntax
places the DB-connection objects `session` and `keyspace` later in the
param list, so that they can be given a default value. This is what
enables the pattern of _not_ specifying them, provided one has
previously initialized the Cassandra connection through the versatile
utility method `cassio.init(...)`.

In this way, a much less unwieldy instantiation can be done, such as
`CassandraCache()` and `CassandraSemanticCache(embedding=xyz)`,
everything else falling back to defaults.

A downside is that, compared to the earlier signature, this might turn
out to be breaking for those doing positional instantiation. As a way to
mitigate this problem, this PR typechecks its first argument trying to
detect the legacy usage.
(And to make this point less tricky in the future, most arguments are
left to be keyword-only).

If this is considered too harsh, I'd like guidance on how to further
smoothen this transition. **Our plan is to make the pattern of optional
session/keyspace a standard across all Cassandra classes**, so that a
repeatable strategy would be ideal. A possibility would be to keep
positional arguments for legacy reasons but issue a deprecation warning
if any of them is actually used, to later remove them with 0.2 - please
advise on this point.

### Other changes

- class docstrings: enriched, completely moved to class level, added
note on `cassio.init(...)` pattern, added tiny sample usage code.
- semantic cache: revised terminology to never mention "distance" (it is
in fact a similarity!). Kept the legacy constructor param with a
deprecation warning if used.
- `llm_caching` notebook: uniform flow with the Cassandra and Astra DB
separate cases; better and Cassandra-first description; all imports made
explicit and from community where appropriate.
- cache integration tests moved to community (incl. the imported tools),
env var bugfix for `CASSANDRA_CONTACT_POINTS`.

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
2024-06-20 13:52:14 -07:00
fzowl
ef7353a138 docs: new voyageai text_embeddings model: voyage-large-2-instruct (#21706) 2024-06-20 13:52:14 -07:00
Bagatur
f087bcd0be docs: datacamp course (#21767) 2024-06-20 13:52:13 -07:00
Kyle Cassidy
476981022c Standardized openai init params (#21739)
## Patch Summary
community:openai[patch]: standardize init args

## Details
I made changes to the OpenAI Chat API wrapper test in the Langchain
open-source repository

- **File**: `libs/community/tests/unit_tests/chat_models/test_openai.py`
- **Changes**:
  - Updated `max_retries` with Pydantic Field
  - Updated the corresponding unit test
- **Related Issues**: #20085
  - Updated max_retries with Pydantic Field, updated the unit test.

---------

Co-authored-by: JuHyung Son <sonju0427@gmail.com>
2024-06-20 13:52:13 -07:00
laishzh
c2bdbfbcc4 docs: Remove unnecessary comment marks from the Makefile help section (#21749)
**Previous screenshot:**
<img width="758" alt="image"
src="https://github.com/langchain-ai/langchain/assets/1683919/7b90626e-35ab-4486-b41d-b664e69eec0b">

**Current:**
<img width="744" alt="image"
src="https://github.com/langchain-ai/langchain/assets/1683919/cdb69512-dc6c-4b7f-a466-4be92d94c076">
2024-06-20 13:52:13 -07:00
Ethan Yang
23647b44e0 community: update openvino doc with streaming support (#21519)
Co-authored-by: Chester Curme <chester.curme@gmail.com>
2024-06-20 13:52:13 -07:00
Eugene Yurtsev
f01b9225b6 How to: Streaming (#21715)
Update the how to guide on streaming

---------

Co-authored-by: ccurme <chester.curme@gmail.com>
2024-06-20 13:52:13 -07:00
ccurme
56cff57fe4 community: fix CI (#21766) 2024-06-20 13:52:13 -07:00
Michael Ozery
e1cf4225de docs: sql_qa.ipynb tutorial update (#21756)
1. Updated deprecated method usage.
2. Added LangGraph required installation in tutorial.

X: MichaelOzery
2024-06-20 13:52:13 -07:00
Mish Ushakov
54a56b91a1 community: updated Browserbase loader (#21757)
Thank you for contributing to LangChain!

- [x] **PR title**: "community: updated Browserbase loader"

- [x] **PR message**:
    Updates the Browserbase loader with more options and improved docs.

- [x] **Lint and test**: Run `make format`, `make lint` and `make test`
from the root of the package(s) you've modified. See contribution
guidelines for more: https://python.langchain.com/docs/contributing/
2024-06-20 13:52:13 -07:00
Ikko Eltociear Ashimine
b229468836 docs: update sql_large_db.ipynb (#21765)
mispelling -> misspelling
2024-06-20 13:52:13 -07:00
Eugene Yurtsev
a26476f866 core[major]: only use function description (#21622)
Do not prefix function signature

---

* Reason for this is that information is already present with tool
calling models.
* This will save on tokens for those models, and makes it more obvious
what the description is!
* The @tool can get more parameters to allow a user to re-introduce the
the signature if we want
2024-06-20 13:52:13 -07:00
William FH
46c1b56b09 Finish agent migration doc (#21731) 2024-06-20 13:52:13 -07:00
Cheese
732a4bc329 community: Implement bind_tools for ChatTongyi (#20725)
## Description

Implement `bind_tools` in ChatTongyi. Usage example:

```py
from langchain_core.tools import tool
from langchain_community.chat_models.tongyi import ChatTongyi

@tool
def multiply(first_int: int, second_int: int) -> int:
    """Multiply two integers together."""
    return first_int * second_int

llm = ChatTongyi(model="qwen-turbo")

llm_with_tools = llm.bind_tools([multiply])

msg = llm_with_tools.invoke("What's 5 times forty two")

print(msg)
```

Streaming is also supported.

## Dependencies

No Dependency is required for this change.

---------

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
Co-authored-by: Chester Curme <chester.curme@gmail.com>
2024-06-20 13:52:13 -07:00
yoogle
2a43e4ba78 docs: fix monorepo typo (#21761)
### Description
fix monorepo typo. `monorep` -> `monorepo`
2024-06-20 13:52:13 -07:00
Bagatur
1d62cba406 docs: aca-ds nit (#21759) 2024-06-20 13:52:13 -07:00
Bagatur
658a87c50e docs: add aca-ds (#21746) 2024-06-20 13:52:13 -07:00
Bagatur
a7b9bc4b7c docs: aza-ds cookbook (#21747) 2024-06-20 13:52:13 -07:00
Erick Friis
2cd418f54a fireworks: add secret (#21744) 2024-06-20 13:52:13 -07:00
Erick Friis
119e11acd9 pinecone: bump min core version (#21742) 2024-06-20 13:52:13 -07:00
Erick Friis
d0f0db2256 fireworks: bump min core version (#21741) 2024-06-20 13:52:13 -07:00
Erick Friis
7c9cbee4b0 infra: release min version dont clobber current lib (#21740) 2024-06-20 13:52:13 -07:00
Erick Friis
592af9f33d airbyte[patch]: airbyte-cdk compatible pydantic versions (#21738) 2024-06-20 13:52:13 -07:00
Erick Friis
7169b25d8a ibm[patch]: release 0.1.7 (#21737) 2024-06-20 13:52:13 -07:00
Erick Friis
83dcb567dd openai[patch]: fix embedding float precision issue (#21736)
also clean up + comment some of the embedding batching code
2024-06-20 13:52:13 -07:00
JuHyung Son
9636c0f7e3 upstage: Support batch input in embedding request. (#21730)
**Description:** upstage embedding now supports batch input.
2024-06-20 13:52:13 -07:00
junefish
85dc31f169 docs: Update Pinecone example notebook with embedded widget (#21719)
---------

Co-authored-by: Erick Friis <erick@langchain.dev>
2024-06-20 13:52:13 -07:00
Erick Friis
a122dc462e docs: fix installation link (#21728) 2024-06-20 13:52:13 -07:00
Harrison Chase
16a07bc743 Harrison/move flashrank rerank (#21448)
third party integration, should be in community
2024-06-20 13:52:13 -07:00
Harrison Chase
b845f495cf move installation (#21711) 2024-06-20 13:52:13 -07:00
Erick Friis
b12c2fb0bf multiple: releases with relaxed core dep (#21724) 2024-06-20 13:52:13 -07:00
Bagatur
b317b90af5 openai[patch]: Release 0.1.7, bump tiktoken 0.7.0 (#21723) 2024-06-20 13:52:13 -07:00
Bagatur
a68ba28157 docs: add feedback link to 0.2 banner (#21600) 2024-06-20 13:52:13 -07:00
William FH
9cda8b7ee8 [Core] Check is async callable (#21714)
To permit proper coercion of objects like the following:


```python
class MyAsyncCallable:
    async def __call__(self, foo):
        return await ...

class MyAsyncGenerator:
    async def __call__(self, foo):
        await ...
        yield 
```
2024-06-20 13:52:13 -07:00
ccurme
d439174bad docs: add tutorial for vector stores and retrievers (#21683)
also update how-to guide for parent document retriever
2024-06-20 13:52:13 -07:00