langchain-google-genai 0.0.10rc0__tar.gz → 1.0.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.

Potentially problematic release.


This version of langchain-google-genai might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langchain-google-genai
3
- Version: 0.0.10rc0
3
+ Version: 1.0.1
4
4
  Summary: An integration package connecting Google's genai package and LangChain
5
5
  Home-page: https://github.com/langchain-ai/langchain-google
6
6
  License: MIT
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
14
  Provides-Extra: images
15
- Requires-Dist: google-generativeai (>=0.3.1,<0.4.0)
15
+ Requires-Dist: google-generativeai (>=0.4.1,<0.5.0)
16
16
  Requires-Dist: langchain-core (>=0.1,<0.2)
17
17
  Requires-Dist: pillow (>=10.1.0,<11.0.0) ; extra == "images"
18
18
  Project-URL: Repository, https://github.com/langchain-ai/langchain-google
@@ -97,3 +97,33 @@ from langchain_google_genai import GoogleGenerativeAIEmbeddings
97
97
  embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
98
98
  embeddings.embed_query("hello, world!")
99
99
  ```
100
+
101
+ ## Semantic Retrieval
102
+
103
+ Enables retrieval augmented generation (RAG) in your application.
104
+
105
+ ```
106
+ # Create a new store for housing your documents.
107
+ corpus_store = GoogleVectorStore.create_corpus(display_name="My Corpus")
108
+
109
+ # Create a new document under the above corpus.
110
+ document_store = GoogleVectorStore.create_document(
111
+ corpus_id=corpus_store.corpus_id, display_name="My Document"
112
+ )
113
+
114
+ # Upload some texts to the document.
115
+ text_splitter = CharacterTextSplitter(chunk_size=500, chunk_overlap=0)
116
+ for file in DirectoryLoader(path="data/").load():
117
+ documents = text_splitter.split_documents([file])
118
+ document_store.add_documents(documents)
119
+
120
+ # Talk to your entire corpus with possibly many documents.
121
+ aqa = corpus_store.as_aqa()
122
+ answer = aqa.invoke("What is the meaning of life?")
123
+
124
+ # Read the response along with the attributed passages and answerability.
125
+ print(response.answer)
126
+ print(response.attributed_passages)
127
+ print(response.answerable_probability)
128
+ ```
129
+
@@ -75,4 +75,33 @@ from langchain_google_genai import GoogleGenerativeAIEmbeddings
75
75
 
76
76
  embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
77
77
  embeddings.embed_query("hello, world!")
78
- ```
78
+ ```
79
+
80
+ ## Semantic Retrieval
81
+
82
+ Enables retrieval augmented generation (RAG) in your application.
83
+
84
+ ```
85
+ # Create a new store for housing your documents.
86
+ corpus_store = GoogleVectorStore.create_corpus(display_name="My Corpus")
87
+
88
+ # Create a new document under the above corpus.
89
+ document_store = GoogleVectorStore.create_document(
90
+ corpus_id=corpus_store.corpus_id, display_name="My Document"
91
+ )
92
+
93
+ # Upload some texts to the document.
94
+ text_splitter = CharacterTextSplitter(chunk_size=500, chunk_overlap=0)
95
+ for file in DirectoryLoader(path="data/").load():
96
+ documents = text_splitter.split_documents([file])
97
+ document_store.add_documents(documents)
98
+
99
+ # Talk to your entire corpus with possibly many documents.
100
+ aqa = corpus_store.as_aqa()
101
+ answer = aqa.invoke("What is the meaning of life?")
102
+
103
+ # Read the response along with the attributed passages and answerability.
104
+ print(response.answer)
105
+ print(response.attributed_passages)
106
+ print(response.answerable_probability)
107
+ ```
@@ -58,12 +58,27 @@ embeddings.embed_query("hello, world!")
58
58
  from langchain_google_genai._enums import HarmBlockThreshold, HarmCategory
59
59
  from langchain_google_genai.chat_models import ChatGoogleGenerativeAI
60
60
  from langchain_google_genai.embeddings import GoogleGenerativeAIEmbeddings
61
+ from langchain_google_genai.genai_aqa import (
62
+ AqaInput,
63
+ AqaOutput,
64
+ GenAIAqa,
65
+ )
66
+ from langchain_google_genai.google_vector_store import (
67
+ DoesNotExistsException,
68
+ GoogleVectorStore,
69
+ )
61
70
  from langchain_google_genai.llms import GoogleGenerativeAI
62
71
 
63
72
  __all__ = [
73
+ "AqaInput",
74
+ "AqaOutput",
64
75
  "ChatGoogleGenerativeAI",
76
+ "DoesNotExistsException",
77
+ "GenAIAqa",
65
78
  "GoogleGenerativeAIEmbeddings",
66
79
  "GoogleGenerativeAI",
80
+ "GoogleVectorStore",
67
81
  "HarmBlockThreshold",
68
82
  "HarmCategory",
83
+ "DoesNotExistsException",
69
84
  ]