Commit Graph

8713 Commits

Author SHA1 Message Date
ccurme
ce68a4e6f4 docs: add Cohere to ChatModelTabs (#20386) 2024-04-25 17:39:38 -07:00
Eugene Yurtsev
04069996cf langchain[patch]: Add deprecation warning to extraction chains (#20224)
Add deprecation warnings to extraction chains
2024-04-25 17:39:38 -07:00
Eugene Yurtsev
5adce0caa1 langchain[patch]: Add another unit test for indexing code (#20387)
Add another unit test for indexing
2024-04-25 17:39:38 -07:00
Erick Friis
038970bc7f core: bind_tools interface on basechatmodel (#20360) 2024-04-25 17:39:38 -07:00
Erick Friis
a49e7cae1d multiple: standard chat model tests (#20359) 2024-04-25 17:39:38 -07:00
Bagatur
846c6fcaf4 docs: show tool msg in tool call docs (#20358) 2024-04-25 17:39:38 -07:00
Isak Nyberg
2ceb2a3ce4 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
2024-04-25 17:39:38 -07:00
Ikko Eltociear Ashimine
1ead1f667e 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!
2024-04-25 17:39:38 -07:00
Jack Wotherspoon
9c1537bcdf 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>
2024-04-25 17:39:38 -07:00
Leonid Ganeline
c10aa62f12 community[patch]: docstrings update (#20301)
Added missed docstrings. Format docstings to the consistent form.
2024-04-25 17:39:38 -07:00
Eugene Yurtsev
4fd13632ce 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
2024-04-25 17:39:38 -07:00
Bagatur
585abbc8d7 docs: tool call nits (#20356) 2024-04-25 17:39:38 -07:00
Bagatur
4d7ae633b6 docs: tool agent nit (#20353) 2024-04-25 17:39:38 -07:00
Erick Friis
8f62446485 chroma: release 0.1.0 (#20355) 2024-04-25 17:39:38 -07:00
Bagatur
349dde1549 docs: use vertexai in chat model tabs (#20352) 2024-04-25 17:39:38 -07:00
Bagatur
46f9304f21 docs: update anthropic tool call (#20344) 2024-04-25 17:39:38 -07:00
Erick Friis
162daa3c62 chroma: remove relevance score int test (#20346)
deprecating feature in #20302
2024-04-25 17:39:38 -07:00
Eugene Yurtsev
a9f6fd16c8 docs: Update chat model providers include package information (#20336)
Include package information
2024-04-25 17:39:38 -07:00
Bagatur
b4d40b3622 docs: update tool-calling table (#20338) 2024-04-25 17:39:38 -07:00
Bagatur
83958c7d2b docs: tool agent nit (#20337) 2024-04-25 17:39:38 -07:00
Bagatur
8b8e35cd51 docs: update chat openai (#20331) 2024-04-25 17:39:38 -07:00
Bagatur
d68af26443 docs: add tool-calling agent (#20328) 2024-04-25 17:39:38 -07:00
ccurme
a7732aa55e 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).
2024-04-25 17:39:38 -07:00
Bagatur
463436a0e8 langchain[patch]: Release 0.1.16 (#20335) 2024-04-25 17:39:38 -07:00
Eugene Yurtsev
463ea8d7f6 docs: Update list of chat models tool calling providers (#20330)
Will follow up with a few missing providers
2024-04-25 17:39:37 -07:00
Eugene Yurtsev
4b575d8e78 docs: Update documentation for custom LLMs (#19972)
Update documentation for customizing LLMs
2024-04-25 17:39:37 -07:00
Bagatur
418df2bb6c release anthropic, fireworks, openai, groq, mistral (#20333) 2024-04-25 17:39:37 -07:00
Bagatur
6b3b4fdd9c core[patch]: Release 0.1.42 (#20332) 2024-04-25 17:39:37 -07:00
ccurme
e6ea42d7f0 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>
2024-04-25 17:39:37 -07:00
Eugene Yurtsev
269be353d6 community[patch]: Add deprecation warnings to postgres implementation (#20222)
Add deprecation warnings to postgres implementation that are in langchain-postgres.
2024-04-25 17:39:37 -07:00
Eugene Yurtsev
ad58b3fc19 core[patch]: For now remove user warning (#20321)
Remove warning since it creates a lot of noise.
2024-04-25 17:39:37 -07:00
Mayank Solanki
f84ad4c2fd docs: added backtick on RunnablePassthrough (#20310)
added backtick on RunnablePassthrough
Isuue: #20094
2024-04-25 17:39:37 -07:00
Bagatur
a7bae5767e openai[patch]: use tool_calls in request (#20272) 2024-04-25 17:39:37 -07:00
Bagatur
a4aefd124d langchain[patch]: agents check prompt partial vars (#20303) 2024-04-25 17:39:37 -07:00
Bagatur
689dc75d94 core[patch]: fix ChatGeneration.text with content blocks (#20294) 2024-04-25 17:39:37 -07:00
Bagatur
e8197740b2 core[patch]: include tool_calls in ai msg chunk serialization (#20291) 2024-04-25 17:39:37 -07:00
Erick Friis
9b9d64c79a chroma: bump rc, keep optional (#20298) 2024-04-25 17:39:37 -07:00
Erick Friis
8f2cd107f0 chroma: add required fastapi dep to restrict to <1 (#20297) 2024-04-25 17:39:37 -07:00
Erick Friis
59d97ca085 chroma: add optional fastapi dep to restrict to <1 (#20295) 2024-04-25 17:39:37 -07:00
killind-dev
33afc46207 chroma: Add chroma partner package (#19292)
**Description:** Adds chroma to the partners package. Tests & code
mirror those in the community package.
**Dependencies:** None
**Twitter handle:** @akiradev0x

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
2024-04-25 17:39:37 -07:00
Yuki Watanabe
52b28c328c core[patch]: fix duplicated kwargs in _load_sql_databse_chain (#19908)
`kwargs` is specified twice in [this
line](3218463f6a/libs/langchain/langchain/chains/loading.py (L386)),
causing runtime error when passing any keyword arguments.
2024-04-25 17:39:37 -07:00
ccurme
42e1165a33 docs: update tool calling cookbook (#20290)
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-04-25 17:39:37 -07:00
Nuno Campos
71e771118e core: mustache prompt templates (#19980)
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-04-25 17:39:37 -07:00
Leonid Ganeline
5133b56cf7 community[patch]: import flattening fix (#20110)
This PR should make it easier for linters to do type checking and for IDEs to jump to definition of code.

See #20050 as a template for this PR.
- As a byproduct: Added 3 missed `test_imports`.
- Added missed `SolarChat` in to __init___.py Added it into test_import
ut.
- Added `# type: ignore` to fix linting. It is not clear, why linting
errors appear after ^ changes.

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2024-04-25 17:39:37 -07:00
Yuki Oshima
60c7e2651c openai[patch]: Fix langchain-openai unknown parameter error with gpt-4-turbo (#20271)
**Description:** 

I fixed langchain-openai unknown parameter error with gpt-4-turbo.

It seems that the behavior of the Chat Completions API implicitly
changed when using the latest gpt-4-turbo model, differing from previous
models. It now appears to reject parameters that are not listed in the
[API
Reference](https://platform.openai.com/docs/api-reference/chat/create).
So I found some errors and fixed them.

**Issue:** https://github.com/langchain-ai/langchain/issues/20264

**Dependencies:** none

**Twitter handle:** https://twitter.com/oshima_123
2024-04-25 17:39:37 -07:00
ccurme
056a9db19a update agents to use tool call messages (#20074)
```python
from langchain.agents import AgentExecutor, create_tool_calling_agent, tool
from langchain_anthropic import ChatAnthropic
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder

prompt = ChatPromptTemplate.from_messages(
    [
        ("system", "You are a helpful assistant"),
        MessagesPlaceholder("chat_history", optional=True),
        ("human", "{input}"),
        MessagesPlaceholder("agent_scratchpad"),
    ]
)
model = ChatAnthropic(model="claude-3-opus-20240229")

@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)?"})
```
```
> Entering new AgentExecutor chain...

Invoking: `magic_function` with `{'input': 3}`
responded: [{'text': '<thinking>\nThe user has asked for the value of magic_function applied to the input 3. Looking at the available tools, magic_function is the relevant one to use here, as it takes an integer input and returns an integer output.\n\nThe magic_function has one required parameter:\n- input (integer)\n\nThe user has directly provided the value 3 for the input parameter. Since the required parameter is present, we can proceed with calling the function.\n</thinking>', 'type': 'text'}, {'id': 'toolu_01HsTheJPA5mcipuFDBbJ1CW', 'input': {'input': 3}, 'name': 'magic_function', 'type': 'tool_use'}]

5
Therefore, the value of magic_function(3) is 5.

> Finished chain.
{'input': 'what is the value of magic_function(3)?',
 'output': 'Therefore, the value of magic_function(3) is 5.'}
```

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
2024-04-25 17:39:37 -07:00
Erick Friis
0970ab9704 infra, multiple: rc release versions (#20252) 2024-04-25 17:39:37 -07:00
Bagatur
45f1834b8e mistralai[patch]: Pre-release 0.1.2-rc.1 (#20251) 2024-04-25 17:39:37 -07:00
Bagatur
7c197ec48b anthropic[patch]: Pre-release 0.1.8-rc.1 (#20250) 2024-04-25 17:39:37 -07:00
Bagatur
016e7d00e2 openai[patch]: pre-release 0.1.3-rc.1 (#20249) 2024-04-25 17:39:37 -07:00