langchain-google-genai 3.0.0a1__py3-none-any.whl → 3.0.0rc1__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-google-genai might be problematic. Click here for more details.
- langchain_google_genai/_compat.py +43 -5
- {langchain_google_genai-3.0.0a1.dist-info → langchain_google_genai-3.0.0rc1.dist-info}/METADATA +4 -4
- {langchain_google_genai-3.0.0a1.dist-info → langchain_google_genai-3.0.0rc1.dist-info}/RECORD +6 -6
- {langchain_google_genai-3.0.0a1.dist-info → langchain_google_genai-3.0.0rc1.dist-info}/WHEEL +0 -0
- {langchain_google_genai-3.0.0a1.dist-info → langchain_google_genai-3.0.0rc1.dist-info}/entry_points.txt +0 -0
- {langchain_google_genai-3.0.0a1.dist-info → langchain_google_genai-3.0.0rc1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Go from v1 content blocks to generativelanguage_v1beta format."""
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
|
-
from typing import Any, Optional
|
|
4
|
+
from typing import Any, Optional, cast
|
|
5
5
|
|
|
6
6
|
from langchain_core.messages import content as types
|
|
7
7
|
|
|
@@ -150,8 +150,6 @@ def _convert_from_v1_to_generativelanguage_v1beta(
|
|
|
150
150
|
elif block_dict["type"] == "reasoning" and model_provider == "google_genai":
|
|
151
151
|
# Google requires passing back the thought_signature when available.
|
|
152
152
|
# Signatures are only provided when function calling is enabled.
|
|
153
|
-
# If no signature is available, we skip the reasoning block as it cannot
|
|
154
|
-
# be properly serialized back to the API.
|
|
155
153
|
if "extras" in block_dict and isinstance(block_dict["extras"], dict):
|
|
156
154
|
extras = block_dict["extras"]
|
|
157
155
|
if "signature" in extras:
|
|
@@ -242,7 +240,47 @@ def _convert_from_v1_to_generativelanguage_v1beta(
|
|
|
242
240
|
}
|
|
243
241
|
new_content.append(function_call)
|
|
244
242
|
|
|
245
|
-
|
|
246
|
-
|
|
243
|
+
elif block_dict["type"] == "server_tool_call":
|
|
244
|
+
if block_dict.get("name") == "code_interpreter":
|
|
245
|
+
# LangChain v0 format
|
|
246
|
+
args = cast(dict, block_dict.get("args", {}))
|
|
247
|
+
executable_code = {
|
|
248
|
+
"type": "executable_code",
|
|
249
|
+
"executable_code": args.get("code", ""),
|
|
250
|
+
"language": args.get("language", ""),
|
|
251
|
+
"id": block_dict.get("id", ""),
|
|
252
|
+
}
|
|
253
|
+
# Google generativelanguage format
|
|
254
|
+
new_content.append(
|
|
255
|
+
{
|
|
256
|
+
"executable_code": {
|
|
257
|
+
"language": executable_code["language"],
|
|
258
|
+
"code": executable_code["executable_code"],
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
elif block_dict["type"] == "server_tool_result":
|
|
264
|
+
extras = cast(dict, block_dict.get("extras", {}))
|
|
265
|
+
if extras.get("block_type") == "code_execution_result":
|
|
266
|
+
# LangChain v0 format
|
|
267
|
+
code_execution_result = {
|
|
268
|
+
"type": "code_execution_result",
|
|
269
|
+
"code_execution_result": block_dict.get("output", ""),
|
|
270
|
+
"outcome": extras.get("outcome", ""),
|
|
271
|
+
"tool_call_id": block_dict.get("tool_call_id", ""),
|
|
272
|
+
}
|
|
273
|
+
# Google generativelanguage format
|
|
274
|
+
new_content.append(
|
|
275
|
+
{
|
|
276
|
+
"code_execution_result": {
|
|
277
|
+
"outcome": code_execution_result["outcome"],
|
|
278
|
+
"output": code_execution_result["code_execution_result"],
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
elif block_dict["type"] == "non_standard":
|
|
284
|
+
new_content.append(block_dict["value"])
|
|
247
285
|
|
|
248
286
|
return new_content
|
{langchain_google_genai-3.0.0a1.dist-info → langchain_google_genai-3.0.0rc1.dist-info}/METADATA
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: langchain-google-genai
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.0rc1
|
|
4
4
|
Summary: An integration package connecting Google's genai package and LangChain
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Source Code, https://github.com/langchain-ai/langchain-google/tree/main/libs/genai
|
|
7
7
|
Project-URL: Release Notes, https://github.com/langchain-ai/langchain-google/releases
|
|
8
8
|
Project-URL: repository, https://github.com/langchain-ai/langchain-google
|
|
9
9
|
Requires-Python: <4.0.0,>=3.10.0
|
|
10
|
-
Requires-Dist: langchain-core<2.0.0,>=1.0.
|
|
10
|
+
Requires-Dist: langchain-core<2.0.0,>=1.0.0rc2
|
|
11
11
|
Requires-Dist: google-ai-generativelanguage<1.0.0,>=0.7.0
|
|
12
12
|
Requires-Dist: pydantic<3.0.0,>=2.0.0
|
|
13
13
|
Requires-Dist: filetype<2.0.0,>=1.2.0
|
|
@@ -76,7 +76,7 @@ Then use the `ChatGoogleGenerativeAI` interface:
|
|
|
76
76
|
```python
|
|
77
77
|
from langchain_google_genai import ChatGoogleGenerativeAI
|
|
78
78
|
|
|
79
|
-
llm = ChatGoogleGenerativeAI(model="gemini-
|
|
79
|
+
llm = ChatGoogleGenerativeAI(model="gemini-flash-latest")
|
|
80
80
|
response = llm.invoke("Sing a ballad of LangChain.")
|
|
81
81
|
print(response.content)
|
|
82
82
|
```
|
|
@@ -97,7 +97,7 @@ Most Gemini models support image inputs.
|
|
|
97
97
|
from langchain_core.messages import HumanMessage
|
|
98
98
|
from langchain_google_genai import ChatGoogleGenerativeAI
|
|
99
99
|
|
|
100
|
-
llm = ChatGoogleGenerativeAI(model="gemini-
|
|
100
|
+
llm = ChatGoogleGenerativeAI(model="gemini-flash-latest")
|
|
101
101
|
|
|
102
102
|
message = HumanMessage(
|
|
103
103
|
content=[
|
{langchain_google_genai-3.0.0a1.dist-info → langchain_google_genai-3.0.0rc1.dist-info}/RECORD
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
langchain_google_genai-3.0.
|
|
2
|
-
langchain_google_genai-3.0.
|
|
3
|
-
langchain_google_genai-3.0.
|
|
4
|
-
langchain_google_genai-3.0.
|
|
1
|
+
langchain_google_genai-3.0.0rc1.dist-info/METADATA,sha256=6JdNfUOyd0HYZ-nULDv_tXw0opP9bYVv31J4PwAO1Hc,7098
|
|
2
|
+
langchain_google_genai-3.0.0rc1.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
|
|
3
|
+
langchain_google_genai-3.0.0rc1.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
|
4
|
+
langchain_google_genai-3.0.0rc1.dist-info/licenses/LICENSE,sha256=DppmdYJVSc1jd0aio6ptnMUn5tIHrdAhQ12SclEBfBg,1072
|
|
5
5
|
langchain_google_genai/__init__.py,sha256=yVc4wCHzajs8mvDVQLGmkxxivzApvdu7jTytrLr_i7g,2891
|
|
6
6
|
langchain_google_genai/_common.py,sha256=qV7EqGEsi1_BCnUDJf1ZDgOhHOIGKbgw8-D1g7Afo3g,6307
|
|
7
|
-
langchain_google_genai/_compat.py,sha256=
|
|
7
|
+
langchain_google_genai/_compat.py,sha256=QGQhorN0DHpbXMVJyKlzYdNz62L8EU6XM9EK-kfg-rQ,10979
|
|
8
8
|
langchain_google_genai/_enums.py,sha256=Zj3BXXLlkm_UybegCi6fLsfFhriJCt_LAJvgatgPWQ0,252
|
|
9
9
|
langchain_google_genai/_function_utils.py,sha256=zlH0YhFZolP6mhppBPr-7d1t6psvZcpSmkuS1oER0S0,23647
|
|
10
10
|
langchain_google_genai/_genai_extension.py,sha256=3W8N_vMxrwtzZvmPgmyIr6T8q6UkyS3y-IYMcr_67Ac,22597
|
|
@@ -15,4 +15,4 @@ langchain_google_genai/genai_aqa.py,sha256=NVW8wOWxU7T6VVshFrFlFHa5HzEPAedrgh1fO
|
|
|
15
15
|
langchain_google_genai/google_vector_store.py,sha256=x4OcXkcYWTubu-AESNzNDJG_dbge16GeNCAOCsBoc4g,16537
|
|
16
16
|
langchain_google_genai/llms.py,sha256=P_e_ImBWexhKqc7LZPo6tQbwLH2-ljr6oqpE5M27TRc,5755
|
|
17
17
|
langchain_google_genai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
langchain_google_genai-3.0.
|
|
18
|
+
langchain_google_genai-3.0.0rc1.dist-info/RECORD,,
|
{langchain_google_genai-3.0.0a1.dist-info → langchain_google_genai-3.0.0rc1.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|