forked from langchain-ai/langchain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
google-genai: added logic for method get_num_tokens() (langchain-ai#1…
…6205) <!-- Thank you for contributing to LangChain! Please title your PR "partners: google-genai", Replace this entire comment with: - **Description:** : added logic for method get_num_tokens() for ChatGoogleGenerativeAI , GoogleGenerativeAI, - **Issue:** : langchain-ai#16204, - **Dependencies:** : None, - **Twitter handle:** @Aditya_Rane --------- Co-authored-by: adityarane@google.com <adityarane@google.com> Co-authored-by: Leonid Kuligin <lkuligin@yandex.ru>
- Loading branch information
1 parent
0785432
commit 9dd7cbb
Showing
6 changed files
with
90 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from langchain_google_genai.llms import GoogleModelFamily | ||
|
||
|
||
def test_model_family() -> None: | ||
model = GoogleModelFamily("gemini-pro") | ||
assert model == GoogleModelFamily.GEMINI | ||
model = GoogleModelFamily("gemini-ultra") | ||
assert model == GoogleModelFamily.GEMINI |