langchain 0.3.16__py3-none-any.whl → 0.3.18__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.
@@ -28,7 +28,7 @@ from typing_extensions import Self
28
28
 
29
29
  if TYPE_CHECKING:
30
30
  import openai
31
- from openai.types.beta.threads import ThreadMessage
31
+ from openai.types.beta.threads import ThreadMessage # type: ignore[attr-defined]
32
32
  from openai.types.beta.threads.required_action_function_tool_call import (
33
33
  RequiredActionFunctionToolCall,
34
34
  )
@@ -590,7 +590,8 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]):
590
590
  isinstance(content, openai.types.beta.threads.TextContentBlock)
591
591
  if version_gte_1_14
592
592
  else isinstance(
593
- content, openai.types.beta.threads.MessageContentText
593
+ content,
594
+ openai.types.beta.threads.MessageContentText, # type: ignore[attr-defined]
594
595
  )
595
596
  )
596
597
  for content in answer
@@ -743,7 +744,8 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]):
743
744
  isinstance(content, openai.types.beta.threads.TextContentBlock)
744
745
  if version_gte_1_14
745
746
  else isinstance(
746
- content, openai.types.beta.threads.MessageContentText
747
+ content,
748
+ openai.types.beta.threads.MessageContentText, # type: ignore[attr-defined]
747
749
  )
748
750
  )
749
751
  for content in answer
@@ -236,7 +236,9 @@ class FlareChain(Chain):
236
236
  "Please install langchain-openai."
237
237
  "pip install langchain-openai"
238
238
  )
239
- llm = ChatOpenAI(max_tokens=max_generation_len, logprobs=True, temperature=0)
239
+ llm = ChatOpenAI(
240
+ max_completion_tokens=max_generation_len, logprobs=True, temperature=0
241
+ )
240
242
  response_chain = PROMPT | llm
241
243
  question_gen_chain = QUESTION_GENERATOR_PROMPT | llm | StrOutputParser()
242
244
  return cls(
@@ -65,7 +65,7 @@ class OpenAIModerationChain(Chain):
65
65
  except ValueError:
66
66
  values["openai_pre_1_0"] = True
67
67
  if values["openai_pre_1_0"]:
68
- values["client"] = openai.Moderation
68
+ values["client"] = openai.Moderation # type: ignore[attr-defined]
69
69
  else:
70
70
  values["client"] = openai.OpenAI(api_key=openai_api_key)
71
71
  values["async_client"] = openai.AsyncOpenAI(api_key=openai_api_key)
@@ -52,7 +52,7 @@ def create_retrieval_chain(
52
52
  )
53
53
  retrieval_chain = create_retrieval_chain(retriever, combine_docs_chain)
54
54
 
55
- chain.invoke({"input": "..."})
55
+ retrieval_chain.invoke({"input": "..."})
56
56
 
57
57
  """
58
58
  if not isinstance(retriever, BaseRetriever):
@@ -417,7 +417,7 @@ def _init_chat_model_helper(
417
417
 
418
418
  return ChatAnthropicVertex(model=model, **kwargs)
419
419
  elif model_provider == "deepseek":
420
- _check_pkg("langchain_deepseek", pkg_kebab="langchain-deepseek-official")
420
+ _check_pkg("langchain_deepseek", pkg_kebab="langchain-deepseek")
421
421
  from langchain_deepseek import ChatDeepSeek
422
422
 
423
423
  return ChatDeepSeek(model=model, **kwargs)
@@ -30,7 +30,9 @@ def _embedding_factory() -> Embeddings:
30
30
  from langchain_openai import OpenAIEmbeddings
31
31
  except ImportError:
32
32
  try:
33
- from langchain_community.embeddings.openai import OpenAIEmbeddings
33
+ from langchain_community.embeddings.openai import ( # type: ignore[no-redef]
34
+ OpenAIEmbeddings,
35
+ )
34
36
  except ImportError:
35
37
  raise ImportError(
36
38
  "Could not import OpenAIEmbeddings. Please install the "
@@ -89,7 +91,9 @@ class _EmbeddingDistanceChainMixin(Chain):
89
91
  pass
90
92
 
91
93
  try:
92
- from langchain_community.embeddings.openai import OpenAIEmbeddings
94
+ from langchain_community.embeddings.openai import ( # type: ignore[no-redef]
95
+ OpenAIEmbeddings,
96
+ )
93
97
 
94
98
  types_.append(OpenAIEmbeddings)
95
99
  except ImportError:
@@ -135,7 +135,9 @@ def load_evaluator(
135
135
  from langchain_openai import ChatOpenAI
136
136
  except ImportError:
137
137
  try:
138
- from langchain_community.chat_models.openai import ChatOpenAI
138
+ from langchain_community.chat_models.openai import ( # type: ignore[no-redef]
139
+ ChatOpenAI,
140
+ )
139
141
  except ImportError:
140
142
  raise ImportError(
141
143
  "Could not import langchain_openai or fallback onto "
@@ -1,32 +1,52 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langchain
3
- Version: 0.3.16
3
+ Version: 0.3.18
4
4
  Summary: Building applications with LLMs through composability
5
- Home-page: https://github.com/langchain-ai/langchain
6
5
  License: MIT
7
- Requires-Python: >=3.9,<4.0
8
- Classifier: License :: OSI Approved :: MIT License
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: Programming Language :: Python :: 3.9
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Classifier: Programming Language :: Python :: 3.13
15
- Requires-Dist: PyYAML (>=5.3)
16
- Requires-Dist: SQLAlchemy (>=1.4,<3)
17
- Requires-Dist: aiohttp (>=3.8.3,<4.0.0)
18
- Requires-Dist: async-timeout (>=4.0.0,<5.0.0) ; python_version < "3.11"
19
- Requires-Dist: langchain-core (>=0.3.32,<0.4.0)
20
- Requires-Dist: langchain-text-splitters (>=0.3.3,<0.4.0)
21
- Requires-Dist: langsmith (>=0.1.17,<0.4)
22
- Requires-Dist: numpy (>=1.22.4,<2) ; python_version < "3.12"
23
- Requires-Dist: numpy (>=1.26.2,<3) ; python_version >= "3.12"
24
- Requires-Dist: pydantic (>=2.7.4,<3.0.0)
25
- Requires-Dist: requests (>=2,<3)
26
- Requires-Dist: tenacity (>=8.1.0,!=8.4.0,<10)
27
- Project-URL: Repository, https://github.com/langchain-ai/langchain
28
- Project-URL: Release Notes, https://github.com/langchain-ai/langchain/releases?q=tag%3A%22langchain%3D%3D0%22&expanded=true
29
6
  Project-URL: Source Code, https://github.com/langchain-ai/langchain/tree/master/libs/langchain
7
+ Project-URL: Release Notes, https://github.com/langchain-ai/langchain/releases?q=tag%3A%22langchain%3D%3D0%22&expanded=true
8
+ Project-URL: repository, https://github.com/langchain-ai/langchain
9
+ Requires-Python: <4.0,>=3.9
10
+ Requires-Dist: langchain-core<1.0.0,>=0.3.34
11
+ Requires-Dist: langchain-text-splitters<1.0.0,>=0.3.6
12
+ Requires-Dist: langsmith<0.4,>=0.1.17
13
+ Requires-Dist: pydantic<3.0.0,>=2.7.4
14
+ Requires-Dist: SQLAlchemy<3,>=1.4
15
+ Requires-Dist: requests<3,>=2
16
+ Requires-Dist: PyYAML>=5.3
17
+ Requires-Dist: aiohttp<4.0.0,>=3.8.3
18
+ Requires-Dist: tenacity!=8.4.0,<10,>=8.1.0
19
+ Requires-Dist: numpy<2,>=1.26.4; python_version < "3.12"
20
+ Requires-Dist: numpy<3,>=1.26.2; python_version >= "3.12"
21
+ Requires-Dist: async-timeout<5.0.0,>=4.0.0; python_version < "3.11"
22
+ Provides-Extra: community
23
+ Requires-Dist: langchain-community; extra == "community"
24
+ Provides-Extra: anthropic
25
+ Requires-Dist: langchain-anthropic; extra == "anthropic"
26
+ Provides-Extra: openai
27
+ Requires-Dist: langchain-openai; extra == "openai"
28
+ Provides-Extra: cohere
29
+ Requires-Dist: langchain-cohere; extra == "cohere"
30
+ Provides-Extra: google-vertexai
31
+ Requires-Dist: langchain-google-vertexai; extra == "google-vertexai"
32
+ Provides-Extra: google-genai
33
+ Requires-Dist: langchain-google-genai; extra == "google-genai"
34
+ Provides-Extra: fireworks
35
+ Requires-Dist: langchain-fireworks; extra == "fireworks"
36
+ Provides-Extra: ollama
37
+ Requires-Dist: langchain-ollama; extra == "ollama"
38
+ Provides-Extra: together
39
+ Requires-Dist: langchain-together; extra == "together"
40
+ Provides-Extra: mistralai
41
+ Requires-Dist: langchain-mistralai; extra == "mistralai"
42
+ Provides-Extra: huggingface
43
+ Requires-Dist: langchain-huggingface; extra == "huggingface"
44
+ Provides-Extra: groq
45
+ Requires-Dist: langchain-groq; extra == "groq"
46
+ Provides-Extra: aws
47
+ Requires-Dist: langchain-aws; extra == "aws"
48
+ Provides-Extra: deepseek
49
+ Requires-Dist: langchain-deepseek; extra == "deepseek"
30
50
  Description-Content-Type: text/markdown
31
51
 
32
52
  # 🦜️🔗 LangChain
@@ -120,4 +140,3 @@ For more information on these concepts, please see our [full documentation](http
120
140
  As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
121
141
 
122
142
  For detailed information on how to contribute, see the [Contributing Guide](https://python.langchain.com/docs/contributing/).
123
-
@@ -1,3 +1,7 @@
1
+ langchain-0.3.18.dist-info/METADATA,sha256=nel2wYLEeAURDBRZaoNDt1WVrFe-psHnT28MtpvWC_M,7810
2
+ langchain-0.3.18.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ langchain-0.3.18.dist-info/entry_points.txt,sha256=hLMwTN6pPNCY0cYtYmCYgY-piFzDb17o6ZrDC6IpdQU,75
4
+ langchain-0.3.18.dist-info/licenses/LICENSE,sha256=TsZ-TKbmch26hJssqCJhWXyGph7iFLvyFBYAa3stBHg,1067
1
5
  langchain/__init__.py,sha256=4cqV-N_QJnfjk52DqtR2e72vsmJC1R6PkflvRdLjZQI,13709
2
6
  langchain/_api/__init__.py,sha256=0FuHuMNUBMrst1Y1nm5yZzQr2xbLmb7rxMsimqKBXhs,733
3
7
  langchain/_api/deprecation.py,sha256=K9VCkmMs_ebfd_wCJppKq4Ahw-mlXkukbsQ69iQVxT0,1246
@@ -111,7 +115,7 @@ langchain/agents/mrkl/base.py,sha256=yonYGfgMkTixmrknWROMjwjddiUCgmWEkfIaWVlJdAU
111
115
  langchain/agents/mrkl/output_parser.py,sha256=YQGSjQq5pR4kFUg1HrOS3laV6xgtHgtIOQ_TtJY0UFI,3720
112
116
  langchain/agents/mrkl/prompt.py,sha256=2dTMP2lAWiLvCtuEijgQRjbKDlbPEnmx77duMwdJ7e4,641
113
117
  langchain/agents/openai_assistant/__init__.py,sha256=Xssaqoxrix3hn1gKSOLmDRQzTxAoJk0ProGXmXQe8Mw,114
114
- langchain/agents/openai_assistant/base.py,sha256=KtRFxOEICdFVG8fOrcb6Z0o1HpsDWjOx0p2u0CLFhmc,30029
118
+ langchain/agents/openai_assistant/base.py,sha256=pq-ttrSp6HWZA9qtw_yOCAvAhQWG90ZA_gt77omNKeM,30169
115
119
  langchain/agents/openai_functions_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
116
120
  langchain/agents/openai_functions_agent/agent_token_buffer_memory.py,sha256=G5vrWDbv3oWojxafiW2qSae7Z7WUdZugI-ywjTP0zZ4,3790
117
121
  langchain/agents/openai_functions_agent/base.py,sha256=katIW0vE87B7ezm9WU_fEMfeHSQPHZptM0zppQfnY-4,13474
@@ -241,7 +245,7 @@ langchain/chains/ernie_functions/__init__.py,sha256=X_gOa8GIjyV6tAS32A1BLv6q08uf
241
245
  langchain/chains/ernie_functions/base.py,sha256=SGs_-yi0qa7cxgkiu2EsoYQF4_fKQUZkxncrp1KiMbU,1730
242
246
  langchain/chains/example_generator.py,sha256=QDY7l9hO-RkTZGMMhVUfbZRf__eacdMGOPQXP3Yshrg,757
243
247
  langchain/chains/flare/__init__.py,sha256=ufb8LMpEVUzTDflcNiJJyKCG9e4EVGAvz5e7h7f0Z1c,51
244
- langchain/chains/flare/base.py,sha256=JQTtSybaMAoMdtF_uQqqh8GPZjvI28D3ZdP5vMu5U-w,8498
248
+ langchain/chains/flare/base.py,sha256=TeOb9K7NrZS4F7ScrTpxc9-5E2vJ1vOAQA9odFwaQB8,8531
245
249
  langchain/chains/flare/prompts.py,sha256=6ypb3UrOwd4YFy1W8LjBwNVgZLYb-W1U1hme5IdPpDE,1471
246
250
  langchain/chains/graph_qa/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
247
251
  langchain/chains/graph_qa/arangodb.py,sha256=FdkfnDwKnmWinqYObKK-ZPDO_AFZr3PAiRKDEGJxK_A,669
@@ -280,7 +284,7 @@ langchain/chains/llm_summarization_checker/prompts/revise_summary.txt,sha256=nSS
280
284
  langchain/chains/llm_symbolic_math/__init__.py,sha256=KQ6bFiFMsqs8PNtU-oo6l-czNBBwQUn2rEirz3gt-w8,470
281
285
  langchain/chains/loading.py,sha256=57shFurz0r_FDoUSTcD5Hv7cZl4Rr2G2A_gT-p7XHCE,28829
282
286
  langchain/chains/mapreduce.py,sha256=1Sjrnu21VaRtfAGQB-Mf-ssbsv3vk5-mXThwIq1IHTA,4117
283
- langchain/chains/moderation.py,sha256=E50JkOxi_KYwHXqVFB8bDuHBTZ7cHUZ1EekVj7WeqB8,4472
287
+ langchain/chains/moderation.py,sha256=NhtAkS1rTJTJuqzv4M_jHA0qoDMj2YHyyIgqJO1tuog,4502
284
288
  langchain/chains/natbot/__init__.py,sha256=ACF2TYNK_CTfvmdLlG5Ry0_j9D6ZfjgfQxmeKe1BAIg,96
285
289
  langchain/chains/natbot/base.py,sha256=pS4NHgEHDjqiHRcyxzNgrFrUG56tW8nQ7BOmxjvoe6c,5433
286
290
  langchain/chains/natbot/crawler.py,sha256=E1mQUEsg8Jj6Eth-LBUcMU-Zc88JEA3a79kMhHkKO08,16050
@@ -319,7 +323,7 @@ langchain/chains/question_answering/map_reduce_prompt.py,sha256=CrerC8PqW1-V8SsQ
319
323
  langchain/chains/question_answering/map_rerank_prompt.py,sha256=l2Ha1Xqr5Q6Y-Xh9af8JTni9gLAyhKJhmSErRFGw9s4,1622
320
324
  langchain/chains/question_answering/refine_prompts.py,sha256=eYz3MTGVdXlikjMEOE8LWxYE0A-R3jWLJQ6LtEqFibc,2432
321
325
  langchain/chains/question_answering/stuff_prompt.py,sha256=tXecxj10u9x0taPz4I1Kn-J0SOYcjIfr_8RINw9P7ys,1146
322
- langchain/chains/retrieval.py,sha256=-ZHLdDQUkIQLjF9DMvpH_YgZKxShTm0GaSIhw1ab_EM,2742
326
+ langchain/chains/retrieval.py,sha256=ESuxMb2bMYzBdCAh3vwxM2lGmI1lU7K1UdGolILU0Hk,2752
323
327
  langchain/chains/retrieval_qa/__init__.py,sha256=MGGNuZ-HVZDyk551hUjGexK3U9q-2Yi_VJkpi7MV2DE,62
324
328
  langchain/chains/retrieval_qa/base.py,sha256=R8zVrsg9OPPXDKLhQi6ouj9zvvlzqSNr1sNavR_Bji0,12013
325
329
  langchain/chains/retrieval_qa/prompt.py,sha256=c5_tFGFbltYvM9P6K_Zk3dOeYYbiSFN-MkJK6HBoNuA,399
@@ -360,7 +364,7 @@ langchain/chat_models/azure_openai.py,sha256=aRNol2PNC49PmvdZnwjhQeMFRDOOelPNAXz
360
364
  langchain/chat_models/azureml_endpoint.py,sha256=6mxXm8UFXataLp0NYRGA88V3DpiNKPo095u_JGj7XGE,863
361
365
  langchain/chat_models/baichuan.py,sha256=3-GveFoF5ZNyLdRNK6V4i3EDDjdseOTFWbCMhDbtO9w,643
362
366
  langchain/chat_models/baidu_qianfan_endpoint.py,sha256=CZrX2SMpbE9H7wBXNC6rGvw-YqQl9zjuJrClYQxEzuI,715
363
- langchain/chat_models/base.py,sha256=js7jRvA-3DxoctDf3zshWI7m7rrI5ugXzSo45O1VJms,33333
367
+ langchain/chat_models/base.py,sha256=ZpW2fAC0KigZMmEzxWQ_EREB4jTqXioE4unjDYlj2kw,33324
364
368
  langchain/chat_models/bedrock.py,sha256=HRV3T_0mEnZ8LvJJqAA_UVpt-_03G715oIgomRJw55M,757
365
369
  langchain/chat_models/cohere.py,sha256=EYOECHX-nKRhZVfCfmFGZ2lr51PzaB5OvOEqmBCu1fI,633
366
370
  langchain/chat_models/databricks.py,sha256=5_QkC5lG4OldaHC2FS0XylirJouyZx1YT95SKwc12M0,653
@@ -635,10 +639,10 @@ langchain/evaluation/criteria/__init__.py,sha256=FE5qrrz5JwWXJWXCzdyNRevEPfmmfBf
635
639
  langchain/evaluation/criteria/eval_chain.py,sha256=JkBEsgNPymOT3OqTSveRAsIr2Sk1O1oWjJZ664t0BuM,21279
636
640
  langchain/evaluation/criteria/prompt.py,sha256=6OgXmdvlYVzRMeAxa1fYGIxqeNAz1NkFCZ6ezLgUnZM,1756
637
641
  langchain/evaluation/embedding_distance/__init__.py,sha256=YLtGUI4ZMxjsn2Q0dGZ-R9YMFgZsarfJv9qzNEnrLQs,324
638
- langchain/evaluation/embedding_distance/base.py,sha256=h1loaVznNh0KMTjppKcMj8yhkcp2DuRKeJIYai8jRQY,17212
642
+ langchain/evaluation/embedding_distance/base.py,sha256=ra149EghJgnQi4k3n2yqA4zijnR7a712MUzVRObuoGg,17330
639
643
  langchain/evaluation/exact_match/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
640
644
  langchain/evaluation/exact_match/base.py,sha256=BykyjgKQ94391eDODzn3m1RXao9ZSXtc9wiww_fysXI,2751
641
- langchain/evaluation/loading.py,sha256=1zUtEao_F9292O0fNHl8i93bw1V94RDsFwXZTWe4-pA,7296
645
+ langchain/evaluation/loading.py,sha256=vKg-AbszUMqsC9ptLr5C2SUgHbb3fSIvsI-mwxoUoxE,7371
642
646
  langchain/evaluation/parsing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
643
647
  langchain/evaluation/parsing/base.py,sha256=oshaVFsY9ggIgOZX_3Xe-x7LPSRaQejmqLRT-nUvSVI,5242
644
648
  langchain/evaluation/parsing/json_distance.py,sha256=00h1wUNQyvjQiXi2OWlKb50Hcn_X55w4kndM1L38cAM,3662
@@ -1335,8 +1339,4 @@ langchain/vectorstores/xata.py,sha256=HW_Oi5Hz8rH2JaUhRNWQ-3hLYmNzD8eAz6K5YqPArm
1335
1339
  langchain/vectorstores/yellowbrick.py,sha256=-lnjGcRE8Q1nEPOTdbKYTw5noS2cy2ce1ePOU804-_o,624
1336
1340
  langchain/vectorstores/zep.py,sha256=RJ2auxoA6uHHLEZknw3_jeFmYJYVt-PWKMBcNMGV6TM,798
1337
1341
  langchain/vectorstores/zilliz.py,sha256=XhPPIUfKPFJw0_svCoBgCnNkkBLoRVVcyuMfOnE5IxU,609
1338
- langchain-0.3.16.dist-info/LICENSE,sha256=TsZ-TKbmch26hJssqCJhWXyGph7iFLvyFBYAa3stBHg,1067
1339
- langchain-0.3.16.dist-info/METADATA,sha256=PbAglzKagFXWtp3-u92vKMBd5yKI2ZKvzqcPrWxe58I,7127
1340
- langchain-0.3.16.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
1341
- langchain-0.3.16.dist-info/entry_points.txt,sha256=IgKjoXnkkVC8Nm7ggiFMCNAk01ua6RVTb9cmZTVNm5w,58
1342
- langchain-0.3.16.dist-info/RECORD,,
1342
+ langchain-0.3.18.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: pdm-backend (2.4.3)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -0,0 +1,5 @@
1
+ [console_scripts]
2
+ langchain-server = langchain.server:main
3
+
4
+ [gui_scripts]
5
+
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- langchain-server=langchain.server:main
3
-