langchain 0.3.18rc2__py3-none-any.whl → 0.3.21__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 might be problematic. Click here for more details.
- langchain/agents/openai_assistant/base.py +6 -3
- langchain/agents/output_parsers/json.py +4 -3
- langchain/chains/elasticsearch_database/prompts.py +1 -1
- langchain/chains/flare/base.py +21 -2
- langchain/chains/hyde/base.py +19 -2
- langchain/chains/sql_database/prompt.py +1 -1
- langchain/chat_models/base.py +57 -18
- langchain/evaluation/embedding_distance/base.py +84 -26
- langchain/retrievers/document_compressors/embeddings_filter.py +14 -1
- {langchain-0.3.18rc2.dist-info → langchain-0.3.21.dist-info}/METADATA +9 -9
- {langchain-0.3.18rc2.dist-info → langchain-0.3.21.dist-info}/RECORD +14 -14
- {langchain-0.3.18rc2.dist-info → langchain-0.3.21.dist-info}/WHEEL +0 -0
- {langchain-0.3.18rc2.dist-info → langchain-0.3.21.dist-info}/entry_points.txt +0 -0
- {langchain-0.3.18rc2.dist-info → langchain-0.3.21.dist-info}/licenses/LICENSE +0 -0
|
@@ -114,7 +114,7 @@ def _is_assistants_builtin_tool(
|
|
|
114
114
|
tool: Union[Dict[str, Any], Type[BaseModel], Callable, BaseTool],
|
|
115
115
|
) -> bool:
|
|
116
116
|
"""Determine if tool corresponds to OpenAI Assistants built-in."""
|
|
117
|
-
assistants_builtin_tools = ("code_interpreter", "
|
|
117
|
+
assistants_builtin_tools = ("code_interpreter", "file_search")
|
|
118
118
|
return (
|
|
119
119
|
isinstance(tool, dict)
|
|
120
120
|
and ("type" in tool)
|
|
@@ -128,7 +128,7 @@ def _get_assistants_tool(
|
|
|
128
128
|
"""Convert a raw function/class to an OpenAI tool.
|
|
129
129
|
|
|
130
130
|
Note that OpenAI assistants supports several built-in tools,
|
|
131
|
-
such as "code_interpreter" and "
|
|
131
|
+
such as "code_interpreter" and "file_search".
|
|
132
132
|
"""
|
|
133
133
|
if _is_assistants_builtin_tool(tool):
|
|
134
134
|
return tool # type: ignore
|
|
@@ -300,6 +300,8 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]):
|
|
|
300
300
|
max_completion_tokens: Allow setting max_completion_tokens for this run.
|
|
301
301
|
max_prompt_tokens: Allow setting max_prompt_tokens for this run.
|
|
302
302
|
run_metadata: Metadata to associate with new run.
|
|
303
|
+
attachments: A list of files attached to the message, and the
|
|
304
|
+
tools they should be added to.
|
|
303
305
|
config: Runnable config. Defaults to None.
|
|
304
306
|
|
|
305
307
|
Return:
|
|
@@ -333,6 +335,7 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]):
|
|
|
333
335
|
"role": "user",
|
|
334
336
|
"content": input["content"],
|
|
335
337
|
"metadata": input.get("message_metadata"),
|
|
338
|
+
"attachments": input.get("attachments"),
|
|
336
339
|
}
|
|
337
340
|
],
|
|
338
341
|
"metadata": input.get("thread_metadata"),
|
|
@@ -652,7 +655,7 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]):
|
|
|
652
655
|
self, intermediate_steps: List[Tuple[OpenAIAssistantAction, str]]
|
|
653
656
|
) -> dict:
|
|
654
657
|
last_action, last_output = intermediate_steps[-1]
|
|
655
|
-
run =
|
|
658
|
+
run = self._wait_for_run(last_action.run_id, last_action.thread_id)
|
|
656
659
|
required_tool_call_ids = set()
|
|
657
660
|
if run.required_action:
|
|
658
661
|
required_tool_call_ids = {
|
|
@@ -50,9 +50,10 @@ class JSONAgentOutputParser(AgentOutputParser):
|
|
|
50
50
|
if response["action"] == "Final Answer":
|
|
51
51
|
return AgentFinish({"output": response["action_input"]}, text)
|
|
52
52
|
else:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
action_input = response.get("action_input", {})
|
|
54
|
+
if action_input is None:
|
|
55
|
+
action_input = {}
|
|
56
|
+
return AgentAction(response["action"], action_input, text)
|
|
56
57
|
except Exception as e:
|
|
57
58
|
raise OutputParserException(f"Could not parse LLM output: {text}") from e
|
|
58
59
|
|
|
@@ -9,7 +9,7 @@ ESQuery:"""
|
|
|
9
9
|
|
|
10
10
|
DEFAULT_DSL_TEMPLATE = """Given an input question, create a syntactically correct Elasticsearch query to run. Unless the user specifies in their question a specific number of examples they wish to obtain, always limit your query to at most {top_k} results. You can order the results by a relevant column to return the most interesting examples in the database.
|
|
11
11
|
|
|
12
|
-
Unless told to do not query for all the columns from a specific index, only ask for a
|
|
12
|
+
Unless told to do not query for all the columns from a specific index, only ask for a few relevant columns given the question.
|
|
13
13
|
|
|
14
14
|
Pay attention to use only the column names that you can see in the mapping description. Be careful to not query for columns that do not exist. Also, pay attention to which column is in which index. Return the query as valid json.
|
|
15
15
|
|
langchain/chains/flare/base.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import logging
|
|
3
4
|
import re
|
|
4
5
|
from typing import Any, Dict, List, Optional, Sequence, Tuple
|
|
5
6
|
|
|
6
|
-
import numpy as np
|
|
7
7
|
from langchain_core.callbacks import (
|
|
8
8
|
CallbackManagerForChainRun,
|
|
9
9
|
)
|
|
@@ -23,6 +23,8 @@ from langchain.chains.flare.prompts import (
|
|
|
23
23
|
)
|
|
24
24
|
from langchain.chains.llm import LLMChain
|
|
25
25
|
|
|
26
|
+
logger = logging.getLogger(__name__)
|
|
27
|
+
|
|
26
28
|
|
|
27
29
|
def _extract_tokens_and_log_probs(response: AIMessage) -> Tuple[List[str], List[float]]:
|
|
28
30
|
"""Extract tokens and log probabilities from chat model response."""
|
|
@@ -57,7 +59,24 @@ def _low_confidence_spans(
|
|
|
57
59
|
min_token_gap: int,
|
|
58
60
|
num_pad_tokens: int,
|
|
59
61
|
) -> List[str]:
|
|
60
|
-
|
|
62
|
+
try:
|
|
63
|
+
import numpy as np
|
|
64
|
+
|
|
65
|
+
_low_idx = np.where(np.exp(log_probs) < min_prob)[0]
|
|
66
|
+
except ImportError:
|
|
67
|
+
logger.warning(
|
|
68
|
+
"NumPy not found in the current Python environment. FlareChain will use a "
|
|
69
|
+
"pure Python implementation for internal calculations, which may "
|
|
70
|
+
"significantly impact performance, especially for large datasets. For "
|
|
71
|
+
"optimal speed and efficiency, consider installing NumPy: pip install numpy"
|
|
72
|
+
)
|
|
73
|
+
import math
|
|
74
|
+
|
|
75
|
+
_low_idx = [ # type: ignore[assignment]
|
|
76
|
+
idx
|
|
77
|
+
for idx, log_prob in enumerate(log_probs)
|
|
78
|
+
if math.exp(log_prob) < min_prob
|
|
79
|
+
]
|
|
61
80
|
low_idx = [i for i in _low_idx if re.search(r"\w", tokens[i])]
|
|
62
81
|
if len(low_idx) == 0:
|
|
63
82
|
return []
|
langchain/chains/hyde/base.py
CHANGED
|
@@ -5,9 +5,9 @@ https://arxiv.org/abs/2212.10496
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
+
import logging
|
|
8
9
|
from typing import Any, Dict, List, Optional
|
|
9
10
|
|
|
10
|
-
import numpy as np
|
|
11
11
|
from langchain_core.callbacks import CallbackManagerForChainRun
|
|
12
12
|
from langchain_core.embeddings import Embeddings
|
|
13
13
|
from langchain_core.language_models import BaseLanguageModel
|
|
@@ -20,6 +20,8 @@ from langchain.chains.base import Chain
|
|
|
20
20
|
from langchain.chains.hyde.prompts import PROMPT_MAP
|
|
21
21
|
from langchain.chains.llm import LLMChain
|
|
22
22
|
|
|
23
|
+
logger = logging.getLogger(__name__)
|
|
24
|
+
|
|
23
25
|
|
|
24
26
|
class HypotheticalDocumentEmbedder(Chain, Embeddings):
|
|
25
27
|
"""Generate hypothetical document for query, and then embed that.
|
|
@@ -54,7 +56,22 @@ class HypotheticalDocumentEmbedder(Chain, Embeddings):
|
|
|
54
56
|
|
|
55
57
|
def combine_embeddings(self, embeddings: List[List[float]]) -> List[float]:
|
|
56
58
|
"""Combine embeddings into final embeddings."""
|
|
57
|
-
|
|
59
|
+
try:
|
|
60
|
+
import numpy as np
|
|
61
|
+
|
|
62
|
+
return list(np.array(embeddings).mean(axis=0))
|
|
63
|
+
except ImportError:
|
|
64
|
+
logger.warning(
|
|
65
|
+
"NumPy not found in the current Python environment. "
|
|
66
|
+
"HypotheticalDocumentEmbedder will use a pure Python implementation "
|
|
67
|
+
"for internal calculations, which may significantly impact "
|
|
68
|
+
"performance, especially for large datasets. For optimal speed and "
|
|
69
|
+
"efficiency, consider installing NumPy: pip install numpy"
|
|
70
|
+
)
|
|
71
|
+
if not embeddings:
|
|
72
|
+
return []
|
|
73
|
+
num_vectors = len(embeddings)
|
|
74
|
+
return [sum(dim_values) / num_vectors for dim_values in zip(*embeddings)]
|
|
58
75
|
|
|
59
76
|
def embed_query(self, text: str) -> List[float]:
|
|
60
77
|
"""Generate a hypothetical document and embedded it."""
|
|
@@ -10,7 +10,7 @@ Question: {input}"""
|
|
|
10
10
|
|
|
11
11
|
_DEFAULT_TEMPLATE = """Given an input question, first create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer. Unless the user specifies in his question a specific number of examples he wishes to obtain, always limit your query to at most {top_k} results. You can order the results by a relevant column to return the most interesting examples in the database.
|
|
12
12
|
|
|
13
|
-
Never query for all the columns from a specific table, only ask for a
|
|
13
|
+
Never query for all the columns from a specific table, only ask for a few relevant columns given the question.
|
|
14
14
|
|
|
15
15
|
Pay attention to use only the column names that you can see in the schema description. Be careful to not query for columns that do not exist. Also, pay attention to which column is in which table.
|
|
16
16
|
|
langchain/chat_models/base.py
CHANGED
|
@@ -98,13 +98,17 @@ def init_chat_model(
|
|
|
98
98
|
installed.
|
|
99
99
|
|
|
100
100
|
Args:
|
|
101
|
-
model: The name of the model, e.g. "
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
model: The name of the model, e.g. "o3-mini", "claude-3-5-sonnet-latest". You can
|
|
102
|
+
also specify model and model provider in a single argument using
|
|
103
|
+
'{model_provider}:{model}' format, e.g. "openai:o1".
|
|
104
|
+
model_provider: The model provider if not specified as part of model arg (see
|
|
105
|
+
above). Supported model_provider values and the corresponding integration
|
|
106
|
+
package are:
|
|
104
107
|
|
|
105
108
|
- 'openai' -> langchain-openai
|
|
106
109
|
- 'anthropic' -> langchain-anthropic
|
|
107
110
|
- 'azure_openai' -> langchain-openai
|
|
111
|
+
- 'azure_ai -> langchain-ai
|
|
108
112
|
- 'google_vertexai' -> langchain-google-vertexai
|
|
109
113
|
- 'google_genai' -> langchain-google-genai
|
|
110
114
|
- 'bedrock' -> langchain-aws
|
|
@@ -117,6 +121,10 @@ def init_chat_model(
|
|
|
117
121
|
- 'groq' -> langchain-groq
|
|
118
122
|
- 'ollama' -> langchain-ollama
|
|
119
123
|
- 'google_anthropic_vertex' -> langchain-google-vertexai
|
|
124
|
+
- 'deepseek' -> langchain-deepseek
|
|
125
|
+
- 'ibm' -> langchain-ibm
|
|
126
|
+
- 'nvidia' -> langchain-nvidia-ai-endpoints
|
|
127
|
+
- 'xai' -> langchain-xai
|
|
120
128
|
|
|
121
129
|
Will attempt to infer model_provider from model if not specified. The
|
|
122
130
|
following providers will be inferred based on these model prefixes:
|
|
@@ -128,6 +136,8 @@ def init_chat_model(
|
|
|
128
136
|
- 'command...' -> 'cohere'
|
|
129
137
|
- 'accounts/fireworks...' -> 'fireworks'
|
|
130
138
|
- 'mistral...' -> 'mistralai'
|
|
139
|
+
- 'deepseek...' -> 'deepseek'
|
|
140
|
+
- 'grok...' -> 'xai'
|
|
131
141
|
configurable_fields: Which model parameters are
|
|
132
142
|
configurable:
|
|
133
143
|
|
|
@@ -179,13 +189,13 @@ def init_chat_model(
|
|
|
179
189
|
# pip install langchain langchain-openai langchain-anthropic langchain-google-vertexai
|
|
180
190
|
from langchain.chat_models import init_chat_model
|
|
181
191
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
192
|
+
o3_mini = init_chat_model("openai:o3-mini", temperature=0)
|
|
193
|
+
claude_sonnet = init_chat_model("anthropic:claude-3-5-sonnet-latest", temperature=0)
|
|
194
|
+
gemini_2_flash = init_chat_model("google_vertexai:gemini-2.0-flash", temperature=0)
|
|
185
195
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
196
|
+
o3_mini.invoke("what's your name")
|
|
197
|
+
claude_sonnet.invoke("what's your name")
|
|
198
|
+
gemini_2_flash.invoke("what's your name")
|
|
189
199
|
|
|
190
200
|
|
|
191
201
|
.. dropdown:: Partially configurable model with no default
|
|
@@ -206,7 +216,7 @@ def init_chat_model(
|
|
|
206
216
|
|
|
207
217
|
configurable_model.invoke(
|
|
208
218
|
"what's your name",
|
|
209
|
-
config={"configurable": {"model": "claude-3-5-sonnet-
|
|
219
|
+
config={"configurable": {"model": "claude-3-5-sonnet-latest"}}
|
|
210
220
|
)
|
|
211
221
|
# claude-3.5 sonnet response
|
|
212
222
|
|
|
@@ -218,8 +228,7 @@ def init_chat_model(
|
|
|
218
228
|
from langchain.chat_models import init_chat_model
|
|
219
229
|
|
|
220
230
|
configurable_model_with_default = init_chat_model(
|
|
221
|
-
"gpt-4o",
|
|
222
|
-
model_provider="openai",
|
|
231
|
+
"openai:gpt-4o",
|
|
223
232
|
configurable_fields="any", # this allows us to configure other params like temperature, max_tokens, etc at runtime.
|
|
224
233
|
config_prefix="foo",
|
|
225
234
|
temperature=0
|
|
@@ -232,8 +241,7 @@ def init_chat_model(
|
|
|
232
241
|
"what's your name",
|
|
233
242
|
config={
|
|
234
243
|
"configurable": {
|
|
235
|
-
"foo_model": "claude-3-5-sonnet-20240620",
|
|
236
|
-
"foo_model_provider": "anthropic",
|
|
244
|
+
"foo_model": "anthropic:claude-3-5-sonnet-20240620",
|
|
237
245
|
"foo_temperature": 0.6
|
|
238
246
|
}
|
|
239
247
|
}
|
|
@@ -287,18 +295,22 @@ def init_chat_model(
|
|
|
287
295
|
|
|
288
296
|
.. versionchanged:: 0.2.12
|
|
289
297
|
|
|
290
|
-
Support for
|
|
298
|
+
Support for Ollama via langchain-ollama package added
|
|
291
299
|
(langchain_ollama.ChatOllama). Previously,
|
|
292
300
|
the now-deprecated langchain-community version of Ollama was imported
|
|
293
301
|
(langchain_community.chat_models.ChatOllama).
|
|
294
302
|
|
|
295
|
-
Support for
|
|
303
|
+
Support for AWS Bedrock models via the Converse API added
|
|
296
304
|
(model_provider="bedrock_converse").
|
|
297
305
|
|
|
298
306
|
.. versionchanged:: 0.3.5
|
|
299
307
|
|
|
300
308
|
Out of beta.
|
|
301
309
|
|
|
310
|
+
.. versionchanged:: 0.3.19
|
|
311
|
+
|
|
312
|
+
Support for Deepseek, IBM, Nvidia, and xAI models added.
|
|
313
|
+
|
|
302
314
|
""" # noqa: E501
|
|
303
315
|
if not model and not configurable_fields:
|
|
304
316
|
configurable_fields = ("model", "model_provider")
|
|
@@ -345,6 +357,11 @@ def _init_chat_model_helper(
|
|
|
345
357
|
from langchain_openai import AzureChatOpenAI
|
|
346
358
|
|
|
347
359
|
return AzureChatOpenAI(model=model, **kwargs)
|
|
360
|
+
elif model_provider == "azure_ai":
|
|
361
|
+
_check_pkg("langchain_azure_ai")
|
|
362
|
+
from langchain_azure_ai import AzureAIChatCompletionsModel
|
|
363
|
+
|
|
364
|
+
return AzureAIChatCompletionsModel(model=model, **kwargs)
|
|
348
365
|
elif model_provider == "cohere":
|
|
349
366
|
_check_pkg("langchain_cohere")
|
|
350
367
|
from langchain_cohere import ChatCohere
|
|
@@ -421,6 +438,21 @@ def _init_chat_model_helper(
|
|
|
421
438
|
from langchain_deepseek import ChatDeepSeek
|
|
422
439
|
|
|
423
440
|
return ChatDeepSeek(model=model, **kwargs)
|
|
441
|
+
elif model_provider == "nvidia":
|
|
442
|
+
_check_pkg("langchain_nvidia_ai_endpoints")
|
|
443
|
+
from langchain_nvidia_ai_endpoints import ChatNVIDIA
|
|
444
|
+
|
|
445
|
+
return ChatNVIDIA(model=model, **kwargs)
|
|
446
|
+
elif model_provider == "ibm":
|
|
447
|
+
_check_pkg("langchain_ibm")
|
|
448
|
+
from langchain_ibm import ChatWatsonx
|
|
449
|
+
|
|
450
|
+
return ChatWatsonx(model_id=model, **kwargs)
|
|
451
|
+
elif model_provider == "xai":
|
|
452
|
+
_check_pkg("langchain_xai")
|
|
453
|
+
from langchain_xai import ChatXAI
|
|
454
|
+
|
|
455
|
+
return ChatXAI(model=model, **kwargs)
|
|
424
456
|
else:
|
|
425
457
|
supported = ", ".join(_SUPPORTED_PROVIDERS)
|
|
426
458
|
raise ValueError(
|
|
@@ -433,6 +465,7 @@ _SUPPORTED_PROVIDERS = {
|
|
|
433
465
|
"openai",
|
|
434
466
|
"anthropic",
|
|
435
467
|
"azure_openai",
|
|
468
|
+
"azure_ai",
|
|
436
469
|
"cohere",
|
|
437
470
|
"google_vertexai",
|
|
438
471
|
"google_genai",
|
|
@@ -446,11 +479,13 @@ _SUPPORTED_PROVIDERS = {
|
|
|
446
479
|
"bedrock_converse",
|
|
447
480
|
"google_anthropic_vertex",
|
|
448
481
|
"deepseek",
|
|
482
|
+
"ibm",
|
|
483
|
+
"xai",
|
|
449
484
|
}
|
|
450
485
|
|
|
451
486
|
|
|
452
487
|
def _attempt_infer_model_provider(model_name: str) -> Optional[str]:
|
|
453
|
-
if any(model_name.startswith(pre) for pre in ("gpt-3", "gpt-4", "o1")):
|
|
488
|
+
if any(model_name.startswith(pre) for pre in ("gpt-3", "gpt-4", "o1", "o3")):
|
|
454
489
|
return "openai"
|
|
455
490
|
elif model_name.startswith("claude"):
|
|
456
491
|
return "anthropic"
|
|
@@ -464,6 +499,10 @@ def _attempt_infer_model_provider(model_name: str) -> Optional[str]:
|
|
|
464
499
|
return "bedrock"
|
|
465
500
|
elif model_name.startswith("mistral"):
|
|
466
501
|
return "mistralai"
|
|
502
|
+
elif model_name.startswith("deepseek"):
|
|
503
|
+
return "deepseek"
|
|
504
|
+
elif model_name.startswith("grok"):
|
|
505
|
+
return "xai"
|
|
467
506
|
else:
|
|
468
507
|
return None
|
|
469
508
|
|
|
@@ -843,7 +882,7 @@ class _ConfigurableModel(Runnable[LanguageModelInput, Any]):
|
|
|
843
882
|
input: Any,
|
|
844
883
|
config: Optional[RunnableConfig] = None,
|
|
845
884
|
*,
|
|
846
|
-
version: Literal["v1", "v2"],
|
|
885
|
+
version: Literal["v1", "v2"] = "v2",
|
|
847
886
|
include_names: Optional[Sequence[str]] = None,
|
|
848
887
|
include_types: Optional[Sequence[str]] = None,
|
|
849
888
|
include_tags: Optional[Sequence[str]] = None,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"""A chain for comparing the output of two models using embeddings."""
|
|
2
2
|
|
|
3
|
+
import functools
|
|
4
|
+
import logging
|
|
3
5
|
from enum import Enum
|
|
6
|
+
from importlib import util
|
|
4
7
|
from typing import Any, Dict, List, Optional
|
|
5
8
|
|
|
6
|
-
import numpy as np
|
|
7
9
|
from langchain_core.callbacks.manager import (
|
|
8
10
|
AsyncCallbackManagerForChainRun,
|
|
9
11
|
CallbackManagerForChainRun,
|
|
@@ -18,6 +20,34 @@ from langchain.evaluation.schema import PairwiseStringEvaluator, StringEvaluator
|
|
|
18
20
|
from langchain.schema import RUN_KEY
|
|
19
21
|
|
|
20
22
|
|
|
23
|
+
def _import_numpy() -> Any:
|
|
24
|
+
try:
|
|
25
|
+
import numpy as np
|
|
26
|
+
|
|
27
|
+
return np
|
|
28
|
+
except ImportError as e:
|
|
29
|
+
raise ImportError(
|
|
30
|
+
"Could not import numpy, please install with `pip install numpy`."
|
|
31
|
+
) from e
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
logger = logging.getLogger(__name__)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@functools.lru_cache(maxsize=1)
|
|
38
|
+
def _check_numpy() -> bool:
|
|
39
|
+
if bool(util.find_spec("numpy")):
|
|
40
|
+
return True
|
|
41
|
+
logger.warning(
|
|
42
|
+
"NumPy not found in the current Python environment. "
|
|
43
|
+
"langchain will use a pure Python implementation for embedding distance "
|
|
44
|
+
"operations, which may significantly impact performance, especially for large "
|
|
45
|
+
"datasets. For optimal speed and efficiency, consider installing NumPy: "
|
|
46
|
+
"pip install numpy"
|
|
47
|
+
)
|
|
48
|
+
return False
|
|
49
|
+
|
|
50
|
+
|
|
21
51
|
def _embedding_factory() -> Embeddings:
|
|
22
52
|
"""Create an Embeddings object.
|
|
23
53
|
Returns:
|
|
@@ -158,7 +188,7 @@ class _EmbeddingDistanceChainMixin(Chain):
|
|
|
158
188
|
raise ValueError(f"Invalid metric: {metric}")
|
|
159
189
|
|
|
160
190
|
@staticmethod
|
|
161
|
-
def _cosine_distance(a:
|
|
191
|
+
def _cosine_distance(a: Any, b: Any) -> Any:
|
|
162
192
|
"""Compute the cosine distance between two vectors.
|
|
163
193
|
|
|
164
194
|
Args:
|
|
@@ -179,7 +209,7 @@ class _EmbeddingDistanceChainMixin(Chain):
|
|
|
179
209
|
return 1.0 - cosine_similarity(a, b)
|
|
180
210
|
|
|
181
211
|
@staticmethod
|
|
182
|
-
def _euclidean_distance(a:
|
|
212
|
+
def _euclidean_distance(a: Any, b: Any) -> Any:
|
|
183
213
|
"""Compute the Euclidean distance between two vectors.
|
|
184
214
|
|
|
185
215
|
Args:
|
|
@@ -189,10 +219,15 @@ class _EmbeddingDistanceChainMixin(Chain):
|
|
|
189
219
|
Returns:
|
|
190
220
|
np.floating: The Euclidean distance.
|
|
191
221
|
"""
|
|
192
|
-
|
|
222
|
+
if _check_numpy():
|
|
223
|
+
import numpy as np
|
|
224
|
+
|
|
225
|
+
return np.linalg.norm(a - b)
|
|
226
|
+
|
|
227
|
+
return sum((x - y) * (x - y) for x, y in zip(a, b)) ** 0.5
|
|
193
228
|
|
|
194
229
|
@staticmethod
|
|
195
|
-
def _manhattan_distance(a:
|
|
230
|
+
def _manhattan_distance(a: Any, b: Any) -> Any:
|
|
196
231
|
"""Compute the Manhattan distance between two vectors.
|
|
197
232
|
|
|
198
233
|
Args:
|
|
@@ -202,10 +237,14 @@ class _EmbeddingDistanceChainMixin(Chain):
|
|
|
202
237
|
Returns:
|
|
203
238
|
np.floating: The Manhattan distance.
|
|
204
239
|
"""
|
|
205
|
-
|
|
240
|
+
if _check_numpy():
|
|
241
|
+
np = _import_numpy()
|
|
242
|
+
return np.sum(np.abs(a - b))
|
|
243
|
+
|
|
244
|
+
return sum(abs(x - y) for x, y in zip(a, b))
|
|
206
245
|
|
|
207
246
|
@staticmethod
|
|
208
|
-
def _chebyshev_distance(a:
|
|
247
|
+
def _chebyshev_distance(a: Any, b: Any) -> Any:
|
|
209
248
|
"""Compute the Chebyshev distance between two vectors.
|
|
210
249
|
|
|
211
250
|
Args:
|
|
@@ -215,10 +254,14 @@ class _EmbeddingDistanceChainMixin(Chain):
|
|
|
215
254
|
Returns:
|
|
216
255
|
np.floating: The Chebyshev distance.
|
|
217
256
|
"""
|
|
218
|
-
|
|
257
|
+
if _check_numpy():
|
|
258
|
+
np = _import_numpy()
|
|
259
|
+
return np.max(np.abs(a - b))
|
|
260
|
+
|
|
261
|
+
return max(abs(x - y) for x, y in zip(a, b))
|
|
219
262
|
|
|
220
263
|
@staticmethod
|
|
221
|
-
def _hamming_distance(a:
|
|
264
|
+
def _hamming_distance(a: Any, b: Any) -> Any:
|
|
222
265
|
"""Compute the Hamming distance between two vectors.
|
|
223
266
|
|
|
224
267
|
Args:
|
|
@@ -228,9 +271,13 @@ class _EmbeddingDistanceChainMixin(Chain):
|
|
|
228
271
|
Returns:
|
|
229
272
|
np.floating: The Hamming distance.
|
|
230
273
|
"""
|
|
231
|
-
|
|
274
|
+
if _check_numpy():
|
|
275
|
+
np = _import_numpy()
|
|
276
|
+
return np.mean(a != b)
|
|
232
277
|
|
|
233
|
-
|
|
278
|
+
return sum(1 for x, y in zip(a, b) if x != y) / len(a)
|
|
279
|
+
|
|
280
|
+
def _compute_score(self, vectors: Any) -> float:
|
|
234
281
|
"""Compute the score based on the distance metric.
|
|
235
282
|
|
|
236
283
|
Args:
|
|
@@ -240,8 +287,11 @@ class _EmbeddingDistanceChainMixin(Chain):
|
|
|
240
287
|
float: The computed score.
|
|
241
288
|
"""
|
|
242
289
|
metric = self._get_metric(self.distance_metric)
|
|
243
|
-
|
|
244
|
-
|
|
290
|
+
if _check_numpy() and isinstance(vectors, _import_numpy().ndarray):
|
|
291
|
+
score = metric(vectors[0].reshape(1, -1), vectors[1].reshape(1, -1)).item()
|
|
292
|
+
else:
|
|
293
|
+
score = metric(vectors[0], vectors[1])
|
|
294
|
+
return float(score)
|
|
245
295
|
|
|
246
296
|
|
|
247
297
|
class EmbeddingDistanceEvalChain(_EmbeddingDistanceChainMixin, StringEvaluator):
|
|
@@ -292,9 +342,12 @@ class EmbeddingDistanceEvalChain(_EmbeddingDistanceChainMixin, StringEvaluator):
|
|
|
292
342
|
Returns:
|
|
293
343
|
Dict[str, Any]: The computed score.
|
|
294
344
|
"""
|
|
295
|
-
vectors =
|
|
296
|
-
|
|
345
|
+
vectors = self.embeddings.embed_documents(
|
|
346
|
+
[inputs["prediction"], inputs["reference"]]
|
|
297
347
|
)
|
|
348
|
+
if _check_numpy():
|
|
349
|
+
np = _import_numpy()
|
|
350
|
+
vectors = np.array(vectors)
|
|
298
351
|
score = self._compute_score(vectors)
|
|
299
352
|
return {"score": score}
|
|
300
353
|
|
|
@@ -313,13 +366,15 @@ class EmbeddingDistanceEvalChain(_EmbeddingDistanceChainMixin, StringEvaluator):
|
|
|
313
366
|
Returns:
|
|
314
367
|
Dict[str, Any]: The computed score.
|
|
315
368
|
"""
|
|
316
|
-
|
|
369
|
+
vectors = await self.embeddings.aembed_documents(
|
|
317
370
|
[
|
|
318
371
|
inputs["prediction"],
|
|
319
372
|
inputs["reference"],
|
|
320
373
|
]
|
|
321
374
|
)
|
|
322
|
-
|
|
375
|
+
if _check_numpy():
|
|
376
|
+
np = _import_numpy()
|
|
377
|
+
vectors = np.array(vectors)
|
|
323
378
|
score = self._compute_score(vectors)
|
|
324
379
|
return {"score": score}
|
|
325
380
|
|
|
@@ -432,14 +487,15 @@ class PairwiseEmbeddingDistanceEvalChain(
|
|
|
432
487
|
Returns:
|
|
433
488
|
Dict[str, Any]: The computed score.
|
|
434
489
|
"""
|
|
435
|
-
vectors =
|
|
436
|
-
|
|
437
|
-
[
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
]
|
|
441
|
-
)
|
|
490
|
+
vectors = self.embeddings.embed_documents(
|
|
491
|
+
[
|
|
492
|
+
inputs["prediction"],
|
|
493
|
+
inputs["prediction_b"],
|
|
494
|
+
]
|
|
442
495
|
)
|
|
496
|
+
if _check_numpy():
|
|
497
|
+
np = _import_numpy()
|
|
498
|
+
vectors = np.array(vectors)
|
|
443
499
|
score = self._compute_score(vectors)
|
|
444
500
|
return {"score": score}
|
|
445
501
|
|
|
@@ -458,13 +514,15 @@ class PairwiseEmbeddingDistanceEvalChain(
|
|
|
458
514
|
Returns:
|
|
459
515
|
Dict[str, Any]: The computed score.
|
|
460
516
|
"""
|
|
461
|
-
|
|
517
|
+
vectors = await self.embeddings.aembed_documents(
|
|
462
518
|
[
|
|
463
519
|
inputs["prediction"],
|
|
464
520
|
inputs["prediction_b"],
|
|
465
521
|
]
|
|
466
522
|
)
|
|
467
|
-
|
|
523
|
+
if _check_numpy():
|
|
524
|
+
np = _import_numpy()
|
|
525
|
+
vectors = np.array(vectors)
|
|
468
526
|
score = self._compute_score(vectors)
|
|
469
527
|
return {"score": score}
|
|
470
528
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from typing import Callable, Dict, Optional, Sequence
|
|
2
2
|
|
|
3
|
-
import numpy as np
|
|
4
3
|
from langchain_core.callbacks.manager import Callbacks
|
|
5
4
|
from langchain_core.documents import Document
|
|
6
5
|
from langchain_core.embeddings import Embeddings
|
|
@@ -69,6 +68,13 @@ class EmbeddingsFilter(BaseDocumentCompressor):
|
|
|
69
68
|
"To use please install langchain-community "
|
|
70
69
|
"with `pip install langchain-community`."
|
|
71
70
|
)
|
|
71
|
+
|
|
72
|
+
try:
|
|
73
|
+
import numpy as np
|
|
74
|
+
except ImportError as e:
|
|
75
|
+
raise ImportError(
|
|
76
|
+
"Could not import numpy, please install with `pip install numpy`."
|
|
77
|
+
) from e
|
|
72
78
|
stateful_documents = get_stateful_documents(documents)
|
|
73
79
|
embedded_documents = _get_embeddings_from_stateful_docs(
|
|
74
80
|
self.embeddings, stateful_documents
|
|
@@ -104,6 +110,13 @@ class EmbeddingsFilter(BaseDocumentCompressor):
|
|
|
104
110
|
"To use please install langchain-community "
|
|
105
111
|
"with `pip install langchain-community`."
|
|
106
112
|
)
|
|
113
|
+
|
|
114
|
+
try:
|
|
115
|
+
import numpy as np
|
|
116
|
+
except ImportError as e:
|
|
117
|
+
raise ImportError(
|
|
118
|
+
"Could not import numpy, please install with `pip install numpy`."
|
|
119
|
+
) from e
|
|
107
120
|
stateful_documents = get_stateful_documents(documents)
|
|
108
121
|
embedded_documents = await _aget_embeddings_from_stateful_docs(
|
|
109
122
|
self.embeddings, stateful_documents
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: langchain
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.21
|
|
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/langchain
|
|
7
7
|
Project-URL: Release Notes, https://github.com/langchain-ai/langchain/releases?q=tag%3A%22langchain%3D%3D0%22&expanded=true
|
|
8
8
|
Project-URL: repository, https://github.com/langchain-ai/langchain
|
|
9
9
|
Requires-Python: <4.0,>=3.9
|
|
10
|
-
Requires-Dist: langchain-core<1.0.0,>=0.3.
|
|
11
|
-
Requires-Dist: langchain-text-splitters<1.0.0,>=0.3.
|
|
10
|
+
Requires-Dist: langchain-core<1.0.0,>=0.3.45
|
|
11
|
+
Requires-Dist: langchain-text-splitters<1.0.0,>=0.3.7
|
|
12
12
|
Requires-Dist: langsmith<0.4,>=0.1.17
|
|
13
13
|
Requires-Dist: pydantic<3.0.0,>=2.7.4
|
|
14
14
|
Requires-Dist: SQLAlchemy<3,>=1.4
|
|
15
15
|
Requires-Dist: requests<3,>=2
|
|
16
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
17
|
Requires-Dist: async-timeout<5.0.0,>=4.0.0; python_version < "3.11"
|
|
22
18
|
Provides-Extra: community
|
|
23
19
|
Requires-Dist: langchain-community; extra == "community"
|
|
24
20
|
Provides-Extra: anthropic
|
|
25
|
-
Requires-Dist: langchain-anthropic
|
|
21
|
+
Requires-Dist: langchain-anthropic; extra == "anthropic"
|
|
26
22
|
Provides-Extra: openai
|
|
27
|
-
Requires-Dist: langchain-openai
|
|
23
|
+
Requires-Dist: langchain-openai; extra == "openai"
|
|
24
|
+
Provides-Extra: azure-ai
|
|
25
|
+
Requires-Dist: langchain-azure-ai; extra == "azure-ai"
|
|
28
26
|
Provides-Extra: cohere
|
|
29
27
|
Requires-Dist: langchain-cohere; extra == "cohere"
|
|
30
28
|
Provides-Extra: google-vertexai
|
|
@@ -47,6 +45,8 @@ Provides-Extra: aws
|
|
|
47
45
|
Requires-Dist: langchain-aws; extra == "aws"
|
|
48
46
|
Provides-Extra: deepseek
|
|
49
47
|
Requires-Dist: langchain-deepseek; extra == "deepseek"
|
|
48
|
+
Provides-Extra: xai
|
|
49
|
+
Requires-Dist: langchain-xai; extra == "xai"
|
|
50
50
|
Description-Content-Type: text/markdown
|
|
51
51
|
|
|
52
52
|
# 🦜️🔗 LangChain
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
langchain-0.3.
|
|
2
|
-
langchain-0.3.
|
|
3
|
-
langchain-0.3.
|
|
4
|
-
langchain-0.3.
|
|
1
|
+
langchain-0.3.21.dist-info/METADATA,sha256=lvJQJ8u2VCTFRKuBHgCRMcg7qg0BCqNiVaSnR8T1DdQ,7760
|
|
2
|
+
langchain-0.3.21.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
|
3
|
+
langchain-0.3.21.dist-info/entry_points.txt,sha256=hLMwTN6pPNCY0cYtYmCYgY-piFzDb17o6ZrDC6IpdQU,75
|
|
4
|
+
langchain-0.3.21.dist-info/licenses/LICENSE,sha256=TsZ-TKbmch26hJssqCJhWXyGph7iFLvyFBYAa3stBHg,1067
|
|
5
5
|
langchain/__init__.py,sha256=4cqV-N_QJnfjk52DqtR2e72vsmJC1R6PkflvRdLjZQI,13709
|
|
6
6
|
langchain/_api/__init__.py,sha256=0FuHuMNUBMrst1Y1nm5yZzQr2xbLmb7rxMsimqKBXhs,733
|
|
7
7
|
langchain/_api/deprecation.py,sha256=K9VCkmMs_ebfd_wCJppKq4Ahw-mlXkukbsQ69iQVxT0,1246
|
|
@@ -115,7 +115,7 @@ langchain/agents/mrkl/base.py,sha256=yonYGfgMkTixmrknWROMjwjddiUCgmWEkfIaWVlJdAU
|
|
|
115
115
|
langchain/agents/mrkl/output_parser.py,sha256=YQGSjQq5pR4kFUg1HrOS3laV6xgtHgtIOQ_TtJY0UFI,3720
|
|
116
116
|
langchain/agents/mrkl/prompt.py,sha256=2dTMP2lAWiLvCtuEijgQRjbKDlbPEnmx77duMwdJ7e4,641
|
|
117
117
|
langchain/agents/openai_assistant/__init__.py,sha256=Xssaqoxrix3hn1gKSOLmDRQzTxAoJk0ProGXmXQe8Mw,114
|
|
118
|
-
langchain/agents/openai_assistant/base.py,sha256=
|
|
118
|
+
langchain/agents/openai_assistant/base.py,sha256=ElQWMn_Ld_bb26vEXuHmI8Zs7HsMVh5Z7jBFv33KEFI,30365
|
|
119
119
|
langchain/agents/openai_functions_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
120
120
|
langchain/agents/openai_functions_agent/agent_token_buffer_memory.py,sha256=G5vrWDbv3oWojxafiW2qSae7Z7WUdZugI-ywjTP0zZ4,3790
|
|
121
121
|
langchain/agents/openai_functions_agent/base.py,sha256=katIW0vE87B7ezm9WU_fEMfeHSQPHZptM0zppQfnY-4,13474
|
|
@@ -124,7 +124,7 @@ langchain/agents/openai_functions_multi_agent/base.py,sha256=dRVNujpitWkqgjleJaT
|
|
|
124
124
|
langchain/agents/openai_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
125
125
|
langchain/agents/openai_tools/base.py,sha256=8a5x0l2FFEv9juNTCRDpzgsLNg4W3sUzD4kT10JySNg,3596
|
|
126
126
|
langchain/agents/output_parsers/__init__.py,sha256=Zzsf8moY-juhKCrnBDUhwgKQtW12cNBkua5faqbAlQA,1374
|
|
127
|
-
langchain/agents/output_parsers/json.py,sha256=
|
|
127
|
+
langchain/agents/output_parsers/json.py,sha256=Q4G8FtZ2GG3JZ_ZCvntIVLL26LgW_O8jDlWnZK-k1gU,1931
|
|
128
128
|
langchain/agents/output_parsers/openai_functions.py,sha256=MjNEFVCxYgS6Efr3HX4rR1zoks2vJxoV8FCUa240jPQ,3467
|
|
129
129
|
langchain/agents/output_parsers/openai_tools.py,sha256=A_GpcYqy3xnkKrlBtrmHIUWwwLMyaKwWc8R-gEvRV3s,2317
|
|
130
130
|
langchain/agents/output_parsers/react_json_single_input.py,sha256=SUkOGmdGGzxB4e1CNJD1eo4dJneiMYsgfGVHpxZ5bfI,2473
|
|
@@ -240,12 +240,12 @@ langchain/chains/conversational_retrieval/base.py,sha256=exiaFjIDLk9VoAf15qhMuBe
|
|
|
240
240
|
langchain/chains/conversational_retrieval/prompts.py,sha256=kJITwauXq7dYKnSBoL2EcDTqAnJZlWF_GzJ9C55ZEv8,720
|
|
241
241
|
langchain/chains/elasticsearch_database/__init__.py,sha256=B3Zxy8mxTb4bfMGHC__26BFkvT_6bPisS4rPIFiFWdU,126
|
|
242
242
|
langchain/chains/elasticsearch_database/base.py,sha256=Rw6z9x---84WsVKP2L-YI-VehgP3VtI70kc0BfJv9Js,8248
|
|
243
|
-
langchain/chains/elasticsearch_database/prompts.py,sha256=
|
|
243
|
+
langchain/chains/elasticsearch_database/prompts.py,sha256=N6X__jKt0yoA4kFfW-lXxJyP7Wsmef9AVDaxScql1yU,1421
|
|
244
244
|
langchain/chains/ernie_functions/__init__.py,sha256=X_gOa8GIjyV6tAS32A1BLv6q08ufSms-tffwgtSyIDA,1514
|
|
245
245
|
langchain/chains/ernie_functions/base.py,sha256=SGs_-yi0qa7cxgkiu2EsoYQF4_fKQUZkxncrp1KiMbU,1730
|
|
246
246
|
langchain/chains/example_generator.py,sha256=QDY7l9hO-RkTZGMMhVUfbZRf__eacdMGOPQXP3Yshrg,757
|
|
247
247
|
langchain/chains/flare/__init__.py,sha256=ufb8LMpEVUzTDflcNiJJyKCG9e4EVGAvz5e7h7f0Z1c,51
|
|
248
|
-
langchain/chains/flare/base.py,sha256=
|
|
248
|
+
langchain/chains/flare/base.py,sha256=I-wyBjCe3j_mJs50DEWNaiCIFDrEhbIhyVwTPAyi8uU,9199
|
|
249
249
|
langchain/chains/flare/prompts.py,sha256=6ypb3UrOwd4YFy1W8LjBwNVgZLYb-W1U1hme5IdPpDE,1471
|
|
250
250
|
langchain/chains/graph_qa/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
251
251
|
langchain/chains/graph_qa/arangodb.py,sha256=FdkfnDwKnmWinqYObKK-ZPDO_AFZr3PAiRKDEGJxK_A,669
|
|
@@ -264,7 +264,7 @@ langchain/chains/graph_qa/prompts.py,sha256=dqfI2CSw5xDR3SvIsFSxq2jwOFp-CcGF3WDj
|
|
|
264
264
|
langchain/chains/graph_qa/sparql.py,sha256=wIAy-nymiftBnW3kExycpGOMyFveD1QBrETlfcnlyuE,665
|
|
265
265
|
langchain/chains/history_aware_retriever.py,sha256=a92vlxlq0PaOubc_b4jj_WwGivk4Tyi1xzSBKaTOx4g,2662
|
|
266
266
|
langchain/chains/hyde/__init__.py,sha256=mZ-cb7slBdlK5aG2R_NegBzNCXToHR-tdmfIIA6lKvQ,75
|
|
267
|
-
langchain/chains/hyde/base.py,sha256=
|
|
267
|
+
langchain/chains/hyde/base.py,sha256=tiriie9bJVaE4XgBoP-FYhDLtvK1SlZpKR0ykJkNSCg,4350
|
|
268
268
|
langchain/chains/hyde/prompts.py,sha256=U4LfozneOyHDIKd8rCbnGSQK84YvZqAtpf5EL435Ol8,1913
|
|
269
269
|
langchain/chains/llm.py,sha256=tzLw3OLgBDsHwDNAHV5IP3avRSy8EfZhPnR6tFNJmes,15515
|
|
270
270
|
langchain/chains/llm_bash/__init__.py,sha256=qvRpa5tj09akj4DLVZoKvWK8-oJrUxc5-7ooAP3mO18,453
|
|
@@ -337,7 +337,7 @@ langchain/chains/router/multi_retrieval_prompt.py,sha256=VUYGLWbwGiv03aSMW5sjdGN
|
|
|
337
337
|
langchain/chains/router/multi_retrieval_qa.py,sha256=tjIhHEbOwtF3CLq0qQ8Kd78ao5BXRKZLsm9UlmHrdtQ,4254
|
|
338
338
|
langchain/chains/sequential.py,sha256=a9i0IGsjji57oJg-1QHJqSVcbMpdyqasYPGaeG3OU5I,7499
|
|
339
339
|
langchain/chains/sql_database/__init__.py,sha256=jQotWN4EWMD98Jk-f7rqh5YtbXbP9XXA0ypLGq8NgrM,47
|
|
340
|
-
langchain/chains/sql_database/prompt.py,sha256=
|
|
340
|
+
langchain/chains/sql_database/prompt.py,sha256=q3C6BbmWtNYXWV-9qHnyux5trsM3fjlRLuYNPTlpdR4,15454
|
|
341
341
|
langchain/chains/sql_database/query.py,sha256=h-QP5ESatTFj8t7sGsHppXSchy3ZGL1U1afza-Lo8fc,5421
|
|
342
342
|
langchain/chains/structured_output/__init__.py,sha256=-6nFe-gznavFc3XCMv8XkEzuXoto2rI8Q-bcruVPOR8,204
|
|
343
343
|
langchain/chains/structured_output/base.py,sha256=jsrF_WQe55gVhZzRGSY7DCetdR91IXdkItK_O_IhovA,25461
|
|
@@ -364,7 +364,7 @@ langchain/chat_models/azure_openai.py,sha256=aRNol2PNC49PmvdZnwjhQeMFRDOOelPNAXz
|
|
|
364
364
|
langchain/chat_models/azureml_endpoint.py,sha256=6mxXm8UFXataLp0NYRGA88V3DpiNKPo095u_JGj7XGE,863
|
|
365
365
|
langchain/chat_models/baichuan.py,sha256=3-GveFoF5ZNyLdRNK6V4i3EDDjdseOTFWbCMhDbtO9w,643
|
|
366
366
|
langchain/chat_models/baidu_qianfan_endpoint.py,sha256=CZrX2SMpbE9H7wBXNC6rGvw-YqQl9zjuJrClYQxEzuI,715
|
|
367
|
-
langchain/chat_models/base.py,sha256=
|
|
367
|
+
langchain/chat_models/base.py,sha256=59N9cThpqZExemmLY25EAaDDrqX_F_EdRQCTusK28cE,34850
|
|
368
368
|
langchain/chat_models/bedrock.py,sha256=HRV3T_0mEnZ8LvJJqAA_UVpt-_03G715oIgomRJw55M,757
|
|
369
369
|
langchain/chat_models/cohere.py,sha256=EYOECHX-nKRhZVfCfmFGZ2lr51PzaB5OvOEqmBCu1fI,633
|
|
370
370
|
langchain/chat_models/databricks.py,sha256=5_QkC5lG4OldaHC2FS0XylirJouyZx1YT95SKwc12M0,653
|
|
@@ -639,7 +639,7 @@ langchain/evaluation/criteria/__init__.py,sha256=FE5qrrz5JwWXJWXCzdyNRevEPfmmfBf
|
|
|
639
639
|
langchain/evaluation/criteria/eval_chain.py,sha256=JkBEsgNPymOT3OqTSveRAsIr2Sk1O1oWjJZ664t0BuM,21279
|
|
640
640
|
langchain/evaluation/criteria/prompt.py,sha256=6OgXmdvlYVzRMeAxa1fYGIxqeNAz1NkFCZ6ezLgUnZM,1756
|
|
641
641
|
langchain/evaluation/embedding_distance/__init__.py,sha256=YLtGUI4ZMxjsn2Q0dGZ-R9YMFgZsarfJv9qzNEnrLQs,324
|
|
642
|
-
langchain/evaluation/embedding_distance/base.py,sha256=
|
|
642
|
+
langchain/evaluation/embedding_distance/base.py,sha256=cO5ZdmCL7hhDFk0AAoq--qUuwUduSW0mO9uFh8FSvkQ,18944
|
|
643
643
|
langchain/evaluation/exact_match/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
644
644
|
langchain/evaluation/exact_match/base.py,sha256=BykyjgKQ94391eDODzn3m1RXao9ZSXtc9wiww_fysXI,2751
|
|
645
645
|
langchain/evaluation/loading.py,sha256=vKg-AbszUMqsC9ptLr5C2SUgHbb3fSIvsI-mwxoUoxE,7371
|
|
@@ -879,7 +879,7 @@ langchain/retrievers/document_compressors/chain_filter_prompt.py,sha256=FTQRPiEs
|
|
|
879
879
|
langchain/retrievers/document_compressors/cohere_rerank.py,sha256=7U35vqEdslr43q8H74CUzcDvbXuZqLnK8-MH8VrlKWo,4567
|
|
880
880
|
langchain/retrievers/document_compressors/cross_encoder.py,sha256=_Z7SoPSfOUSk-rNIHX2lQgYV0TgVMKf3F9AnTH7EFiM,393
|
|
881
881
|
langchain/retrievers/document_compressors/cross_encoder_rerank.py,sha256=ThgVrX8NeXFzE4eoftBoa1yz-sBJiDb-JISQa9Hep2k,1542
|
|
882
|
-
langchain/retrievers/document_compressors/embeddings_filter.py,sha256=
|
|
882
|
+
langchain/retrievers/document_compressors/embeddings_filter.py,sha256=B1l7vNptrNAtWQENP3ZMW6lXyNZ7bu-gsnY4mP16QXw,5624
|
|
883
883
|
langchain/retrievers/document_compressors/flashrank_rerank.py,sha256=Eo86fJ_T2IbEEeCkI_5rb3Ao4gsdenv-_Ukt33MuMko,709
|
|
884
884
|
langchain/retrievers/document_compressors/listwise_rerank.py,sha256=i3dCqXBF27_sHPGxWOlCkVjt4s85QM0ikHZtPp2LpDs,5127
|
|
885
885
|
langchain/retrievers/elastic_search_bm25.py,sha256=eRboOkRQj-_E53gUQIZzxQ1bX0-uEMv7LAQSD7K7Qf8,665
|
|
@@ -1339,4 +1339,4 @@ langchain/vectorstores/xata.py,sha256=HW_Oi5Hz8rH2JaUhRNWQ-3hLYmNzD8eAz6K5YqPArm
|
|
|
1339
1339
|
langchain/vectorstores/yellowbrick.py,sha256=-lnjGcRE8Q1nEPOTdbKYTw5noS2cy2ce1ePOU804-_o,624
|
|
1340
1340
|
langchain/vectorstores/zep.py,sha256=RJ2auxoA6uHHLEZknw3_jeFmYJYVt-PWKMBcNMGV6TM,798
|
|
1341
1341
|
langchain/vectorstores/zilliz.py,sha256=XhPPIUfKPFJw0_svCoBgCnNkkBLoRVVcyuMfOnE5IxU,609
|
|
1342
|
-
langchain-0.3.
|
|
1342
|
+
langchain-0.3.21.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|