langchain-b12 0.1.0__tar.gz → 0.1.1__tar.gz
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.
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/PKG-INFO +1 -3
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/README.md +0 -2
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/pyproject.toml +1 -1
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/src/langchain_b12/genai/genai.py +8 -7
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/.gitignore +0 -0
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/.python-version +0 -0
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/.vscode/extensions.json +0 -0
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/Makefile +0 -0
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/src/langchain_b12/__init__.py +0 -0
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/src/langchain_b12/genai/embeddings.py +0 -0
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/src/langchain_b12/genai/genai_utils.py +0 -0
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/src/langchain_b12/py.typed +0 -0
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/tests/test_genai.py +0 -0
- {langchain_b12-0.1.0 → langchain_b12-0.1.1}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langchain-b12
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: A reusable collection of tools and implementations for Langchain
|
|
5
5
|
Author-email: Vincent Min <vincent.min@b12-consulting.com>
|
|
6
6
|
Requires-Python: >=3.11
|
|
@@ -11,8 +11,6 @@ Description-Content-Type: text/markdown
|
|
|
11
11
|
|
|
12
12
|
This repo hosts a collection of custom LangChain components.
|
|
13
13
|
|
|
14
|
-
- ChatGenAI converts a sequence of LangChain messages to Google GenAI Content objects and vice versa.
|
|
15
|
-
|
|
16
14
|
## Installation
|
|
17
15
|
|
|
18
16
|
To install this package, run
|
|
@@ -145,13 +145,14 @@ class ChatGenAI(BaseChatModel):
|
|
|
145
145
|
self, messages: list[BaseMessage]
|
|
146
146
|
) -> tuple[str | None, types.ContentListUnion]:
|
|
147
147
|
contents = convert_messages_to_contents(messages)
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
system_instruction
|
|
148
|
+
system_message: SystemMessage | None = next(
|
|
149
|
+
(message for message in messages if isinstance(message, SystemMessage)),
|
|
150
|
+
None,
|
|
151
|
+
)
|
|
152
|
+
system_instruction = system_message.content if system_message else None
|
|
153
|
+
assert system_instruction is None or isinstance(
|
|
154
|
+
system_instruction, str
|
|
155
|
+
), "System message content must be a string or None"
|
|
155
156
|
return system_instruction, cast(types.ContentListUnion, contents)
|
|
156
157
|
|
|
157
158
|
def get_num_tokens(self, text: str) -> int:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|