langroid 0.1.25__py3-none-any.whl → 0.1.26__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.
@@ -48,16 +48,18 @@ class QdrantDB(VectorStore):
48
48
  self.host = config.host
49
49
  self.port = config.port
50
50
  load_dotenv()
51
+ key = os.getenv("QDRANT_API_KEY")
52
+ url = os.getenv("QDRANT_API_URL")
53
+ if config.cloud and None in [key, url]:
54
+ logger.warning(
55
+ f"""QDRANT_API_KEY, QDRANT_API_URL env variable must be set to use
56
+ QdrantDB in cloud mode. Please set these values
57
+ in your .env file.
58
+ Switching to local storage at {config.storage_path}
59
+ """
60
+ )
61
+ config.cloud = False
51
62
  if config.cloud:
52
- key = os.getenv("QDRANT_API_KEY")
53
- url = os.getenv("QDRANT_API_URL")
54
- if key is None or key == "" or url is None or url == "":
55
- raise ValueError(
56
- """QDRANT_API_KEY, QDRANT_API_URL env variable must be set to use
57
- QdrantDB in cloud mode. Please set these values
58
- in your .env file.
59
- """
60
- )
61
63
  self.client = QdrantClient(
62
64
  url=url,
63
65
  api_key=key,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langroid
3
- Version: 0.1.25
3
+ Version: 0.1.26
4
4
  Summary: Harness LLMs with Multi-Agent Programming
5
5
  License: MIT
6
6
  Author: Prasad Chalasani
@@ -172,25 +172,37 @@ Note that this will install `torch` and `sentence-transformers` libraries.
172
172
 
173
173
  ### Set up environment variables (API keys, etc)
174
174
 
175
- Copy the `.env-template` file to a new file `.env` and
176
- insert these secrets:
177
- - **OpenAI API** key (required): If you don't have one, see [this OpenAI Page](https://help.openai.com/en/collections/3675940-getting-started-with-openai-api).
178
- - **Qdrant** Vector Store API Key, URL (required for apps that need retrieval from
179
- documents): Sign up for a free 1GB account at [Qdrant cloud](https://cloud.qdrant.io).
175
+ In the root of the repo, copy the `.env-template` file to a new file `.env`:
176
+ ```bash
177
+ cp .env-template .env
178
+ ```
179
+ Then insert your OpenAI API Key. If you don't have one, see [this OpenAI Page](https://help.openai.com/en/collections/3675940-getting-started-with-openai-api).
180
+ Your `.env` file should look like this:
181
+
182
+ ```bash
183
+ OPENAI_API_KEY=your-key-here-without-quotes
184
+ ````
185
+
186
+ Currently only OpenAI models are supported. Others will be added later
187
+ (Pull Requests welcome!).
188
+
189
+ All of the below are optional and not strictly needed to run any of the examples.
190
+
191
+ - **Qdrant** Vector Store API Key, URL. This is only required if you want to use Qdrant cloud.
192
+ You can sign up for a free 1GB account at [Qdrant cloud](https://cloud.qdrant.io).
193
+ If you skip setting up these, Langroid will use Qdrant in local-storage mode.
180
194
  Alternatively [Chroma](https://docs.trychroma.com/) is also currently supported.
181
195
  We use the local-storage version of Chroma, so there is no need for an API key.
196
+ - **Redis** Password, host, port: This is optional, and only needed to cache LLM API responses
197
+ using Redis Cloud. Redis [offers](https://redis.com/try-free/) a free 30MB Redis account
198
+ which is more than sufficient to try out Langroid and even beyond.
199
+ If you don't set up these, Langroid will use a pure-python
200
+ Redis in-memory cache via the [Fakeredis](https://fakeredis.readthedocs.io/en/latest/) library.
182
201
  - **GitHub** Personal Access Token (required for apps that need to analyze git
183
202
  repos; token-based API calls are less rate-limited). See this
184
203
  [GitHub page](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).
185
- - **Redis** Password, host, port (optional, only needed to cache LLM API responses):
186
- Redis [offers](https://redis.com/try-free/) a free 30MB Redis account
187
- which is more than sufficient to try out Langroid and even beyond.
188
-
189
- ```bash
190
- cp .env-template .env
191
- # now edit the .env file, insert your secrets as above
192
- ```
193
- Your `.env` file should look like this:
204
+
205
+ If you add all of these optional variables, your `.env` file should look like this:
194
206
  ```bash
195
207
  OPENAI_API_KEY=your-key-here-without-quotes
196
208
  GITHUB_ACCESS_TOKEN=your-personal-access-token-no-quotes
@@ -201,8 +213,6 @@ QDRANT_API_KEY=your-key
201
213
  QDRANT_API_URL=https://your.url.here:6333 # note port number must be included
202
214
  ```
203
215
 
204
- Currently only OpenAI models are supported. Others will be added later
205
- (Pull Requests welcome!).
206
216
 
207
217
  ---
208
218
 
@@ -216,9 +226,12 @@ and they are **not** complete runnable examples! For that we encourage you to
216
226
  consult the [`langroid-examples`](https://github.com/langroid/langroid-examples)
217
227
  repository.
218
228
 
219
- :information_source: The examples below will only work with OpenAI GPT4 model,
220
- which is the default in Langroid. Switching to GPT3.5-Turbo is easy via a config
221
- flag (i.e., `cfg = OpenAIGPTConfig(chat_model=OpenAIChatModel.GPT4)`), but results may be inferior.
229
+ :information_source: The various LLM prompts and instructions in Langroid
230
+ have been tested to work well with GPT4.
231
+ Switching to GPT3.5-Turbo is easy via a config flag
232
+ (e.g., `cfg = OpenAIGPTConfig(chat_model=OpenAIChatModel.GPT3_5_TURBO)`),
233
+ and may suffice for some applications, but in general you may see inferior results.
234
+
222
235
 
223
236
  :book: Also see the
224
237
  [`Getting Started Guide`](https://langroid.github.io/langroid/quick-start/)
@@ -60,8 +60,8 @@ langroid/vector_store/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
60
60
  langroid/vector_store/base.py,sha256=QZx3NUNwf2I0r3A7iuoUHIRGbqt_pFGD0hq1R-Yg8iM,3740
61
61
  langroid/vector_store/chromadb.py,sha256=GPaXNPgPGIVUwYx2eO_-kreQoJ_33IFo13oigH5BP1c,5200
62
62
  langroid/vector_store/qdrant_cloud.py,sha256=3im4Mip0QXLkR6wiqVsjV1QvhSElfxdFSuDKddBDQ-4,188
63
- langroid/vector_store/qdrantdb.py,sha256=dPpTzKZWAPJ_0NynkM31eyHbiyl2IcaE9t17bqHpYOY,8499
64
- langroid-0.1.25.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
65
- langroid-0.1.25.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
66
- langroid-0.1.25.dist-info/METADATA,sha256=DTIFcx2gN8xyFKFDdUB1-c7I-ZNif54fdDeR3TqGImM,20528
67
- langroid-0.1.25.dist-info/RECORD,,
63
+ langroid/vector_store/qdrantdb.py,sha256=cnxCrp4yIdbJ7-pz7yRoepJhd29mOzwacV2C6O7G_AQ,8548
64
+ langroid-0.1.26.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
65
+ langroid-0.1.26.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
66
+ langroid-0.1.26.dist-info/METADATA,sha256=ozd74VngEPA1ZcQrREhERhw2Byb3h0wCuzAlaNJOsWo,21039
67
+ langroid-0.1.26.dist-info/RECORD,,