Skip to content

Commit 541838a

Browse files
committed
resolve comments
1 parent b9d3020 commit 541838a

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

libs/core/langchain_core/messages/content_blocks.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,7 @@ def create_tool_call(
13091309

13101310

13111311
def create_reasoning_block(
1312-
reasoning: str,
1313-
*,
1312+
reasoning: Optional[str] = None,
13141313
id: Optional[str] = None,
13151314
index: Optional[int] = None,
13161315
) -> ReasoningContentBlock:
@@ -1331,7 +1330,7 @@ def create_reasoning_block(
13311330
"""
13321331
block = ReasoningContentBlock(
13331332
type="reasoning",
1334-
reasoning=reasoning,
1333+
reasoning=reasoning or "",
13351334
id=_ensure_id(id),
13361335
)
13371336

libs/core/langchain_core/messages/v1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from typing import Any, Literal, Optional, Union, cast, get_args
1111

1212
from pydantic import BaseModel
13-
from typing_extensions import NotRequired, TypedDict
13+
from typing_extensions import TypedDict
1414

1515
import langchain_core.messages.content_blocks as types
1616
from langchain_core.messages.ai import (
@@ -54,10 +54,10 @@ class ResponseMetadata(TypedDict, total=False):
5454
definition.
5555
"""
5656

57-
model_provider: NotRequired[str]
57+
model_provider: str
5858
"""Name and version of the provider that created the message (e.g., openai)."""
5959

60-
model_name: NotRequired[str]
60+
model_name: str
6161
"""Name of the model that generated the message."""
6262

6363

libs/core/tests/unit_tests/test_messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def test_chat_message_chunks() -> None:
360360
):
361361
ChatMessageChunk(role="User", content="I am") + ChatMessageChunk(
362362
role="Assistant", content=" indeed."
363-
) # type: ignore[reportUnusedExpression, unused-ignore]
363+
) # type: ignore[reportUnusedExpression]
364364

365365
assert ChatMessageChunk(role="User", content="I am") + AIMessageChunk(
366366
content=" indeed."

0 commit comments

Comments
 (0)