langchain-core 0.3.77__py3-none-any.whl → 0.3.78__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of langchain-core might be problematic. Click here for more details.

@@ -1040,6 +1040,7 @@ def convert_to_openai_messages(
1040
1040
  messages: Union[MessageLikeRepresentation, Sequence[MessageLikeRepresentation]],
1041
1041
  *,
1042
1042
  text_format: Literal["string", "block"] = "string",
1043
+ include_id: bool = False,
1043
1044
  ) -> Union[dict, list[dict]]:
1044
1045
  """Convert LangChain messages into OpenAI message dicts.
1045
1046
 
@@ -1057,6 +1058,8 @@ def convert_to_openai_messages(
1057
1058
  If a message has a string content, this is turned into a list
1058
1059
  with a single content block of type ``'text'``. If a message has
1059
1060
  content blocks these are left as is.
1061
+ include_id: Whether to include message ids in the openai messages, if they
1062
+ are present in the source messages.
1060
1063
 
1061
1064
  Raises:
1062
1065
  ValueError: if an unrecognized ``text_format`` is specified, or if a message
@@ -1145,6 +1148,8 @@ def convert_to_openai_messages(
1145
1148
  oai_msg["refusal"] = message.additional_kwargs["refusal"]
1146
1149
  if isinstance(message, ToolMessage):
1147
1150
  oai_msg["tool_call_id"] = message.tool_call_id
1151
+ if include_id and message.id:
1152
+ oai_msg["id"] = message.id
1148
1153
 
1149
1154
  if not message.content:
1150
1155
  content = "" if text_format == "string" else []
langchain_core/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """langchain-core version information and utilities."""
2
2
 
3
- VERSION = "0.3.77"
3
+ VERSION = "0.3.78"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langchain-core
3
- Version: 0.3.77
3
+ Version: 0.3.78
4
4
  Summary: Building applications with LLMs through composability
5
5
  License: MIT
6
6
  Project-URL: Source Code, https://github.com/langchain-ai/langchain/tree/master/libs/core
@@ -1,6 +1,6 @@
1
- langchain_core-0.3.77.dist-info/METADATA,sha256=mi0rrNStwgWhpu0O2VZE-v0TAtS-9Zw8XVcjGpD_vQg,3155
2
- langchain_core-0.3.77.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
- langchain_core-0.3.77.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1
+ langchain_core-0.3.78.dist-info/METADATA,sha256=p2mFMUB3yNtnZkcOLujqkN0d3ZdiSvzbJDFawVy0fEQ,3155
2
+ langchain_core-0.3.78.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
+ langchain_core-0.3.78.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
4
  langchain_core/__init__.py,sha256=TgvhxbrjCRVJwr2HddiyHvtH8W94K-uLM6-6ifNIBXo,713
5
5
  langchain_core/_api/__init__.py,sha256=WDOMw4faVuscjDCL5ttnRQNienJP_M9vGMmJUXS6L5w,1976
6
6
  langchain_core/_api/beta_decorator.py,sha256=XK7dDgbsyBTiZMjUxVB_bUuuGR1X8T_zBgEBya55mQU,8813
@@ -68,7 +68,7 @@ langchain_core/messages/human.py,sha256=UZjG3KJLX8IF2VrYtj8EQ_O9tLjz-Xlp8gL60qDR
68
68
  langchain_core/messages/modifier.py,sha256=N0vSbZa1jpzMom8_Vr0hr-ZAJi9eh1I8NkMVB5TQ2RI,895
69
69
  langchain_core/messages/system.py,sha256=cMSNtauXX9AJ7NiJ8tYXa0rrVT46s-6t09Ec00la3PQ,1692
70
70
  langchain_core/messages/tool.py,sha256=DiJQUmrOnRDUz74q7jofvJwbh_ghnT50iveMeGfy2hY,12668
71
- langchain_core/messages/utils.py,sha256=ds872YzqNiOqEIrloCEjFCXAiWicswofFEYy1KG4HGM,70469
71
+ langchain_core/messages/utils.py,sha256=GCybSPKerfy7KYttj3EtPeK2BZ2V8N2fzL_m61s0xXk,70715
72
72
  langchain_core/output_parsers/__init__.py,sha256=R8L0GwY-vD9qvqze3EVELXF6i45IYUJ_FbSfno_IREg,2873
73
73
  langchain_core/output_parsers/base.py,sha256=53Yt9dOlR686ku0dP2LK9hHKGprxw_YEsAsY04dejmE,11225
74
74
  langchain_core/output_parsers/format_instructions.py,sha256=8oUbeysnVGvXWyNd5gqXlEL850D31gMTy74GflsuvRU,553
@@ -170,5 +170,5 @@ langchain_core/vectorstores/__init__.py,sha256=5P0eoeoH5LHab64JjmEeWa6SxX4eMy-et
170
170
  langchain_core/vectorstores/base.py,sha256=nWlfzbkVdOObfbPpvfdLKHw9J0PryACVohHC_Y6wWZM,41529
171
171
  langchain_core/vectorstores/in_memory.py,sha256=btq53JnPZHMRGCbejVx1H-6RSNRAgtacd-XAx6dt-Q8,18076
172
172
  langchain_core/vectorstores/utils.py,sha256=D6St53Xg1kO73dnw4MPd8vlkro4C3gmCpcghUzcepi0,4971
173
- langchain_core/version.py,sha256=BV6kJkydC-YxBFj9-ENNXDRLAAS3qhnj70qoZSwkSR0,76
174
- langchain_core-0.3.77.dist-info/RECORD,,
173
+ langchain_core/version.py,sha256=RvXW3LZZh5kETtasiibosMdNbMuRUYCC5xKy9MPZnU0,76
174
+ langchain_core-0.3.78.dist-info/RECORD,,