Commit Graph

7534 Commits

Author SHA1 Message Date
Mason Daugherty
04bcccf2fe Merge branch 'cc/1.0/standard_content' of github.com:langchain-ai/langchain into mdrxy/call-version 2025-08-26 16:43:15 -04:00
Mason Daugherty
18d1cf236e . 2025-08-26 16:42:58 -04:00
ccurme
447db13473 feat(openai): (v1) support content_blocks on legacy v0 responses API format (#32700) 2025-08-26 16:33:59 -04:00
Mason Daugherty
fa5d49f7b6 Merge branch 'cc/1.0/standard_content' of github.com:langchain-ai/langchain into mdrxy/call-version 2025-08-26 16:04:21 -04:00
Mason Daugherty
395515762e Merge branch 'wip-v1.0' into cc/1.0/standard_content 2025-08-26 15:52:11 -04:00
Mason Daugherty
a2322f68ba Merge branch 'master' into wip-v1.0 2025-08-26 15:51:57 -04:00
Mason Daugherty
3d08b6bd11 chore: adress pytest-asyncio deprecation warnings + other nits (#32696)
amongst some linting imcompatible rules
2025-08-26 15:51:38 -04:00
Matthew Farrellee
f2dcdae467 fix(standard-tests): update function_args to match my_adder_tool param types (#32689)
**Description:**

https://api.llama.com implements strong type checking, which results in
a false negative.

with type mismatch (expected integer, received string) -

```
$ curl -X POST "https://api.llama.com/compat/v1/chat/completions" \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
 "model": "Llama-3.3-70B-Instruct",
 "messages": [
     {"role": "user", "content": "What is 1 + 2"},
     {"role": "assistant", "content": "", "tool_calls": [{"id": "abc123", "type": "function", "function": {"name": "my_adder_tool", "arguments": "{\"a\": \"1\", \"b\": \"2\"}"}}]},
     {"role": "tool", "tool_call_id": "abc123", "content": "{\"result\": 3}"}
 ],
 "tools": [{"type": "function", "function": {"name": "my_adder_tool", "description": "Sum two integers", "parameters": {"properties": {"a": {"type": "integer"}, "b": {"type": "integer"}}, "required": ["a", "b"], "type": "object"}}}]
}'

{"title":"Bad request","detail":"Unexpected param value `a`: \"1\"","status":400}
```

with correct type -

```
$ curl -X POST "https://api.llama.com/compat/v1/chat/completions" \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
 "model": "Llama-3.3-70B-Instruct",
 "messages": [
     {"role": "user", "content": "What is 1 + 2"},
     {"role": "assistant", "content": "", "tool_calls": [{"id": "abc123", "type": "function", "function": {"name": "my_adder_tool", "arguments": "{\"a\": 1, \"b\": 2}"}}]},
     {"role": "tool", "tool_call_id": "abc123", "content": "{\"result\": 3}"}
 ],
 "tools": [{"type": "function", "function": {"name": "my_adder_tool", "description": "Sum two integers", "parameters": {"properties": {"a": {"type": "integer"}, "b": {"type": "integer"}}, "required": ["a", "b"], "type": "object"}}}]
}'

{"id":"AhMwBbuaa5payFr_xsOHzxX","model":"Llama-3.3-70B-Instruct","choices":[{"finish_reason":"stop","index":0,"message":{"refusal":"","role":"assistant","content":"The result of 1 + 2 is 3.","id":"AhMwBbuaa5payFr_xsOHzxX"},"logprobs":null}],"created":1756167668,"object":"chat.completions","usage":{"prompt_tokens":248,"completion_tokens":17,"total_tokens":265}}
```
2025-08-26 15:50:47 -04:00
ccurme
2bbd034f85 fix(core): (v1) invoke callback prior to yielding final chunk (#32695) 2025-08-26 14:58:43 -04:00
Mason Daugherty
dc5ac6695c . 2025-08-26 14:43:31 -04:00
Mason Daugherty
620779f61b . 2025-08-26 14:38:09 -04:00
Mason Daugherty
720d08e932 . 2025-08-26 14:24:32 -04:00
Mason Daugherty
5222d51fb0 . 2025-08-26 14:22:11 -04:00
Mason Daugherty
72b2436b49 ss 2025-08-26 14:12:04 -04:00
Mason Daugherty
19d3a73646 . 2025-08-26 14:11:01 -04:00
Chester Curme
659d282d1d standard tests: update multimodal tests 2025-08-26 13:55:44 -04:00
Mason Daugherty
df3db473b8 Merge branch 'cc/1.0/standard_content' of github.com:langchain-ai/langchain into mdrxy/call-version 2025-08-26 13:55:01 -04:00
Mason Daugherty
706ea1b757 . 2025-08-26 13:54:22 -04:00
Mason Daugherty
f1b676c0ee . 2025-08-26 13:54:14 -04:00
Mason Daugherty
518f4dfccb . 2025-08-26 13:54:04 -04:00
ccurme
c63c3ea290 feat(core): (v1) add sentinel value to output_version (#32692) 2025-08-26 13:29:20 -04:00
ccurme
dbebe2ca97 release(core): 0.3.75 (#32693) 2025-08-26 11:12:03 -04:00
ccurme
008043977d release(openai): 0.3.32 (#32691) 2025-08-26 14:05:40 +00:00
Jacob Lee
1459d4f4ce fix(openai): Always add raw response object to OpenAI client errors for invoke (#32655) 2025-08-26 09:59:25 -04:00
ccurme
fe9599f118 feat(core): parse tool_call_chunks in content in aggregated stream (#32664) 2025-08-25 15:38:22 -04:00
ccurme
97bd2cf938 fix(core): (v1) fix PDF input translation for openai chat completions (#32673) 2025-08-25 15:15:03 -04:00
Mason Daugherty
5ef18e8f5b feat(core): add .text property, introduce TextAccessor for backward compatibility with text access methods (#32672) 2025-08-25 14:51:40 -04:00
ccurme
f33480c2cf feat(core): trace response body on error (#32653) 2025-08-25 14:28:19 -04:00
ccurme
7e9ae5df60 feat(openai): (v1) delete bind_functions and remove tool_calls from additional_kwargs (#32669) 2025-08-25 14:22:31 -04:00
Mason Daugherty
4e0fd330aa fix: update content_blocks property docstring 2025-08-25 14:10:21 -04:00
Mason Daugherty
1c55536ec1 chore(core): add note about backward compatibility for tool_calls in additional_kwargs in JsonOutputKeyToolsParser 2025-08-25 10:30:41 -04:00
Maitrey Talware
622337a297 docs(docs): fixed typos in documentations (#32661)
Minor typo fixes. (Not linked to current open issues)
2025-08-25 10:02:53 -04:00
Chester Curme
2d9fe703cb Merge branch 'wip-v1.0' into cc/1.0/standard_content 2025-08-25 09:56:39 -04:00
Chester Curme
7a108618ae Merge branch 'master' into wip-v1.0 2025-08-25 09:39:39 -04:00
ccurme
62d746e630 feat(core): (v1) restore separate type for AIMessage.tool_calls (#32668) 2025-08-25 09:37:41 -04:00
Mason Daugherty
2d0713c2fc fix(infra): ollama CI 2025-08-22 16:40:03 -04:00
Mason Daugherty
8060b371bb fix(infra): ollama CI 2025-08-22 16:37:05 -04:00
ccurme
26833f2ebc feat(anthropic): v1 support (#32623) 2025-08-22 16:06:53 -04:00
Mason Daugherty
7851f66503 release(ollama): 0.3.7 (#32651) 2025-08-22 15:18:40 -04:00
Mason Daugherty
af3b88f58d feat(ollama): update reasoning type to support string values for custom intensity levels (e.g. gpt-oss) (#32650) 2025-08-22 15:11:32 -04:00
itaismith
1eb45d17fb feat(chroma): Add support for collection forking (#32627) 2025-08-21 17:57:55 -04:00
ccurme
8545d4731e release(openai): 0.3.31 (#32646) 2025-08-21 16:50:27 -04:00
Alex Naidis
21f7a9a9e5 fix(openai): allow temperature parameter for gpt-5-chat models (#32624) 2025-08-21 16:40:10 -04:00
sa411022
61bc1bf9cc fix(openai): construct responses api input (#32557) 2025-08-21 15:56:29 -04:00
Shahrukh Shaik
4ba222148d fix(openai): Chat Message Annotations defaults to [ ] if not list or None (#32614) 2025-08-21 15:30:12 -04:00
Mason Daugherty
5bcf7d006f refactor(core): data block handling, normalize message formats, strip IDs from messages (#32572)
> [!WARNING]
> **BREAKING:** Simplifies message normalization to single consistent
path, requiring partner package updates

**Key Changes:**
- Consistent multimodal handling:
- OpenAI `image_url` blocks pass through unchanged (broad compatibility)
- OpenAI `input_audio` and `file` blocks convert to v1 standard
equivalents
  - Legacy v0 multimodal blocks convert to v1 standard
  - Everything else passes through unchanged
- Partner packages must update content block parsing logic

**Partner Updates**

`output_version` affects how messages are serialized into `.content`.
`_normalize_messages()` will now upgrade v0 content to v1, so, all
partners now receive v1 format input regardless of `output_version`.

Migration:
- Partner packages must update to handle v1 input content blocks
- `output_version` still controls serialization format of responses
(unchanged)

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
2025-08-21 14:48:23 -04:00
Chester Curme
3c8edbecb2 Merge branch 'wip-v1.0' into cc/1.0/standard_content
# Conflicts:
#	libs/core/langchain_core/messages/ai.py
2025-08-21 14:12:29 -04:00
ccurme
6f058e7b9b fix(core): (v1) update BaseChatModel return type to AIMessage (#32626) 2025-08-21 14:02:24 -04:00
Christophe Bornet
b825f85bf2 fix(standard-tests): fix BaseStoreAsyncTests.test_set_values_is_idempotent (#32638)
The async version of the test should use the `ayield_keys` method
instead of `yield_keys`.
Otherwise tools such as `blockbuster` may trigger on a blocking call.
2025-08-21 10:07:46 -04:00
Christophe Bornet
f896bcdb1d chore(langchain): add mypy pydantic plugin (#32610) 2025-08-19 16:59:59 -04:00