Commit Graph

8721 Commits (38faa74c238e3fc20ff98c5c219a765eb3c0a0ee)
 

Author SHA1 Message Date
ccurme 38faa74c23
community[patch]: update use of deprecated llm methods (#20393)
.predict and .predict_messages for BaseLanguageModel and BaseChatModel
3 months ago
Corey Zumar 3a068b26f3
community[patch]: Databricks - fix scope of dangerous deserialization error in Databricks LLM connector (#20368)
fix scope of dangerous deserialization error in Databricks LLM connector

---------

Signed-off-by: dbczumar <corey.zumar@databricks.com>
3 months ago
Bagatur f1248f8d9a
core[patch]: configurable init params (#20070)
Proposed fix for #20061. need to test

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
3 months ago
Eugene Yurtsev 4808441d29
Docs: Add guide for implementing custom retriever (#20350)
Add longer guide for implementing custom retriever.

---------

Co-authored-by: ccurme <chester.curme@gmail.com>
3 months ago
aditya thomas 4f75b230ed
partner[ai21]: masking of the api key for ai21 models (#20257)
**Description:** Masking of the API key for AI21 models
**Issue:** Fixes #12165 for AI21
**Dependencies:** None

Note: This fix came in originally through #12418 but was possibly missed
in the refactor to the AI21 partner package


---------

Co-authored-by: Erick Friis <erick@langchain.dev>
3 months ago
Leonid Ganeline e512d3c6a6
langchain: `callbacks` imports fix (#20348)
Replaced all `from langchain.callbacks` into `from
langchain_core.callbacks` .
Changes in the `langchain` and `langchain_experimental`

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
3 months ago
Erick Friis d83b720c40
templates: readme langsmith not private beta (#20173) 3 months ago
michael 525226fb0b
docs: fix extraction/quickstart.ipynb example code (#20397)
- **Description**: The pydantic schema fields are supposed to be
optional but the use of `...` makes them required. This causes a
`ValidationError` when running the example code. I replaced `...` with
`default=None` to make the fields optional as intended. I also
standardized the format for all fields.
- **Issue**: n/a
- **Dependencies**: none
- **Twitter handle**: https://twitter.com/m_atoms

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
3 months ago
balloonio e7b1a44c5b
community[patch]: Invoke callback prior to yielding token fix for Llamafile (#20365)
- [x] **PR title**: community[patch]: Invoke callback prior to yielding
token fix for Llamafile


- [x] **PR message**: 
- **Description:** Invoke callback prior to yielding token in stream
method in community llamafile.py
    - **Issue:** https://github.com/langchain-ai/langchain/issues/16913
    - **Dependencies:** None
    - **Twitter handle:** @bolun_zhang

If no one reviews your PR within a few days, please @-mention one of
baskaryan, efriis, eyurtsev, hwchase17.
3 months ago
milind 1b272fa2f4
Update index.mdx (#20395)
spelling error fixed

Thank you for contributing to LangChain!

- [ ] **PR title**: "package: description"
- Where "package" is whichever of langchain, community, core,
experimental, etc. is being modified. Use "docs: ..." for purely docs
changes, "templates: ..." for template changes, "infra: ..." for CI
changes.
  - Example: "community: add foobar LLM"


- [ ] **PR message**: ***Delete this entire checklist*** and replace
with
    - **Description:** a description of the change
    - **Issue:** the issue # it fixes, if applicable
    - **Dependencies:** any dependencies required for this change
- **Twitter handle:** if your PR gets announced, and you'd like a
mention, we'll gladly shout you out!


- [ ] **Add tests and docs**: If you're adding a new integration, please
include
1. a test for the integration, preferably unit tests that do not rely on
network access,
2. an example notebook showing its use. It lives in
`docs/docs/integrations` directory.


- [ ] **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/

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.
3 months ago
balloonio 93caa568f9
community[patch]: Invoke callback prior to yielding token fix for HuggingFaceEndpoint (#20366)
- [x] **PR title**: community[patch]: Invoke callback prior to yielding
token fix for HuggingFaceEndpoint


- [x] **PR message**: 
- **Description:** Invoke callback prior to yielding token in stream
method in community HuggingFaceEndpoint
    - **Issue:** https://github.com/langchain-ai/langchain/issues/16913
    - **Dependencies:** None
    - **Twitter handle:** @bolun_zhang

If no one reviews your PR within a few days, please @-mention one of
baskaryan, efriis, eyurtsev, hwchase17.

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
3 months ago
Nicolas ad04585e30
community[minor]: Firecrawl.dev integration (#20364)
Added the [FireCrawl](https://firecrawl.dev) document loader. Firecrawl
crawls and convert any website into LLM-ready data. It crawls all
accessible subpages and give you clean markdown for each.

    - **Description:** Adds FireCrawl data loader
    - **Dependencies:** firecrawl-py
    - **Twitter handle:** @mendableai 

ccing contributors: (@ericciarla @nickscamara)

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
3 months ago
Tomaz Bratanic a1b105ac00
experimental[patch]: Skip pydantic validation for llm graph transformer and fix JSON response where possible (#19915)
LLMs might sometimes return invalid response for LLM graph transformer.
Instead of failing due to pydantic validation, we skip it and manually
check and optionally fix error where we can, so that more information
gets extracted
3 months ago
Erick Friis 20f5cd7c95
docs: langchain-chroma package (#20394) 3 months ago
Haris Ali 6786fa9186
docs: Adding api documentation link at the end of each output parser class description page. (#20391)
- **Description:** Added cross-links for easy access of api
documentation of each output parser class from it's description page.
  - **Issue:** related to issue #19969

Co-authored-by: Haris Ali <haris.ali@formulatrix.com>
3 months ago
P. Taylor Goetz 9317df7f16
community[patch]: Add "model" attribute to the payload sent to Ollama in `ChatOllama` (#20354)
Example Ollama API calls:

Request without "model":
```
curl --location 'http://localhost:11434/api/chat' \
--header 'Content-Type: application/json' \
--data '{
  "messages": [
    {
      "role": "user",
      "content": "What is the capitol of PA?"
    }
  ],
  "stream": false
}'
```
Response:
```
{"error":"model is required"}
```

Request with "model":
```
curl --location 'http://localhost:11434/api/chat' \
--header 'Content-Type: application/json' \
--data '{
  "model": "openchat",
  "messages": [
    {
      "role": "user",
      "content": "What is the capitol of PA?"
    }
  ],
  "stream": false
}'
```

Response:
```
{
  "eval_duration" : 733248000,
  "created_at" : "2024-04-11T23:04:08.735766843Z",
  "model" : "openchat",
  "message" : {
    "content" : " The capital city of Pennsylvania is Harrisburg.",
    "role" : "assistant"
  },
  "total_duration" : 3138731168,
  "prompt_eval_count" : 25,
  "load_duration" : 466562959,
  "done" : true,
  "prompt_eval_duration" : 1938495000,
  "eval_count" : 10
}
```
3 months ago
Bagatur 57bb940c17
docs: vertexai tool call update (#20362) 3 months ago
Alex Sherstinsky fad0962643
community: for Predibase -- enable both Predibase-hosted and HuggingFace-hosted fine-tuned adapter repositories (#20370) 3 months ago
ccurme 5395c409cb
docs: add Cohere to ChatModelTabs (#20386) 3 months ago
Eugene Yurtsev 6470b30173
langchain[patch]: Add deprecation warning to extraction chains (#20224)
Add deprecation warnings to extraction chains
3 months ago
Eugene Yurtsev b65a1d4cfd
langchain[patch]: Add another unit test for indexing code (#20387)
Add another unit test for indexing
3 months ago
Erick Friis 29282371db
core: bind_tools interface on basechatmodel (#20360) 3 months ago
Erick Friis e6806a08d4
multiple: standard chat model tests (#20359) 3 months ago
Bagatur f78564d75c
docs: show tool msg in tool call docs (#20358) 3 months ago
Isak Nyberg bac9fb9a7c
community: add gpt-4 pricing in callback (#20292)
Added the pricing for `gpt-4-turbo` and `gpt-4-turbo-2024-04-09` in the
callback method.
related to issue #17173 

https://openai.com/pricing#language-models
3 months ago
Ikko Eltociear Ashimine cb29b42285
docs: Update ibm_watsonx.ipynb (#20329)
avaliable -> available


    - **Description:** fixed typo
    - **Issue:** the issue # it fixes, if applicable
    - **Dependencies:** any dependencies required for this change
- **Twitter handle:** if your PR gets announced, and you'd like a
mention, we'll gladly shout you out!
3 months ago
Jack Wotherspoon 204a16addc
docs: add Cloud SQL for MySQL vector store integration docs (#20278)
Adding docs page for `Google Cloud SQL for MySQL` vector store
integration. This was recently released as part of the Cloud SQL for
MySQL LangChain package
([release](https://github.com/googleapis/langchain-google-cloud-sql-mysql-python/releases/tag/v0.2.0))

Co-authored-by: Erick Friis <erick@langchain.dev>
3 months ago
Leonid Ganeline 7cf2d2759d
community[patch]: docstrings update (#20301)
Added missed docstrings. Format docstings to the consistent form.
3 months ago
Eugene Yurtsev 2900720cd3
core[patch]: Update documentation for base retriever (#20345)
Updating in code documentation for base retriever to direct folks toward
the .invoke and .ainvoke methods + explain how to implement
3 months ago
Bagatur d2f4153fe6
docs: tool call nits (#20356) 3 months ago
Bagatur eafd8c580b
docs: tool agent nit (#20353) 3 months ago
Erick Friis ec0273fc92
chroma: release 0.1.0 (#20355) 3 months ago
Bagatur a889cd14f3
docs: use vertexai in chat model tabs (#20352) 3 months ago
Bagatur 9d302c1b57
docs: update anthropic tool call (#20344) 3 months ago
Erick Friis da707d0755
chroma: remove relevance score int test (#20346)
deprecating feature in #20302
3 months ago
Eugene Yurtsev de938a4451
docs: Update chat model providers include package information (#20336)
Include package information
3 months ago
Bagatur 56fe4ab382
docs: update tool-calling table (#20338) 3 months ago
Bagatur 43a98592c1
docs: tool agent nit (#20337) 3 months ago
Bagatur 562b546bcc
docs: update chat openai (#20331) 3 months ago
Bagatur 2c4741b5ed
docs: add tool-calling agent (#20328) 3 months ago
ccurme f02e55aaf7
docs: add component page for tool calls (#20282)
Note: includes links to API reference pages for ToolCall and other
objects that currently don't exist (e.g.,
https://api.python.langchain.com/en/latest/messages/langchain_core.messages.tool.ToolCall.html#langchain_core.messages.tool.ToolCall).
3 months ago
Bagatur 6608089030
langchain[patch]: Release 0.1.16 (#20335) 3 months ago
Eugene Yurtsev 0e74fb4ec1
docs: Update list of chat models tool calling providers (#20330)
Will follow up with a few missing providers
3 months ago
Eugene Yurtsev 653489a1a9
docs: Update documentation for custom LLMs (#19972)
Update documentation for customizing LLMs
3 months ago
Bagatur 799714c629
release anthropic, fireworks, openai, groq, mistral (#20333) 3 months ago
Bagatur e72330aacc
core[patch]: Release 0.1.42 (#20332) 3 months ago
ccurme 795c728f71
mistral[patch]: add IDs to tool calls (#20299)
Mistral gives us one ID per response, no individual IDs for tool calls.

```python
from langchain.agents import AgentExecutor, create_tool_calling_agent, tool
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_mistralai import ChatMistralAI


prompt = ChatPromptTemplate.from_messages(
    [
        ("system", "You are a helpful assistant"),
        ("human", "{input}"),
        MessagesPlaceholder("agent_scratchpad"),
    ]
)
model = ChatMistralAI(model="mistral-large-latest", temperature=0)

@tool
def magic_function(input: int) -> int:
    """Applies a magic function to an input."""
    return input + 2

tools = [magic_function]

agent = create_tool_calling_agent(model, tools, prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

agent_executor.invoke({"input": "what is the value of magic_function(3)?"})
```

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
3 months ago
Eugene Yurtsev 22fd844e8a
community[patch]: Add deprecation warnings to postgres implementation (#20222)
Add deprecation warnings to postgres implementation that are in langchain-postgres.
3 months ago
Eugene Yurtsev f02f708f52
core[patch]: For now remove user warning (#20321)
Remove warning since it creates a lot of noise.
3 months ago
Mayank Solanki f709ab4cdf
docs: added backtick on RunnablePassthrough (#20310)
added backtick on RunnablePassthrough
Isuue: #20094
3 months ago