mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-17 23:41:46 +00:00
langchain-nomic[patch]: Add ruff bandit rules to linter (#31805)
- Add ruff bandit rules - Some formatting
This commit is contained in:
@@ -10,6 +10,7 @@ class NomicEmbeddings(Embeddings):
|
||||
"""NomicEmbeddings embedding model.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from langchain_nomic import NomicEmbeddings
|
||||
@@ -66,16 +67,16 @@ class NomicEmbeddings(Embeddings):
|
||||
|
||||
Args:
|
||||
model: model name
|
||||
nomic_api_key: optionally, set the Nomic API key. Uses the NOMIC_API_KEY
|
||||
nomic_api_key: optionally, set the Nomic API key. Uses the ``NOMIC_API_KEY``
|
||||
environment variable by default.
|
||||
dimensionality: The embedding dimension, for use with Matryoshka-capable
|
||||
models. Defaults to full-size.
|
||||
inference_mode: How to generate embeddings. One of `remote`, `local`
|
||||
(Embed4All), or `dynamic` (automatic). Defaults to `remote`.
|
||||
inference_mode: How to generate embeddings. One of ``'remote'``, ``'local'``
|
||||
(Embed4All), or ``'dynamic'`` (automatic). Defaults to ``'remote'``.
|
||||
device: The device to use for local embeddings. Choices include
|
||||
`cpu`, `gpu`, `nvidia`, `amd`, or a specific device name. See
|
||||
the docstring for `GPT4All.__init__` for more info. Typically
|
||||
defaults to CPU. Do not use on macOS.
|
||||
``'cpu'``, ``'gpu'``, ``'nvidia'``, ``'amd'``, or a specific device
|
||||
name. See the docstring for ``GPT4All.__init__`` for more info.
|
||||
Typically defaults to ``'cpu'``. Do not use on macOS.
|
||||
"""
|
||||
_api_key = nomic_api_key or os.environ.get("NOMIC_API_KEY")
|
||||
if _api_key:
|
||||
@@ -91,8 +92,8 @@ class NomicEmbeddings(Embeddings):
|
||||
|
||||
Args:
|
||||
texts: list of texts to embed
|
||||
task_type: the task type to use when embedding. One of `search_query`,
|
||||
`search_document`, `classification`, `clustering`
|
||||
task_type: the task type to use when embedding. One of ``'search_query'``,
|
||||
``'search_document'``, ``'classification'``, ``'clustering'``
|
||||
"""
|
||||
|
||||
output = embed.text(
|
||||
|
Reference in New Issue
Block a user