embeddings: nomic embed vision (#22482)

Thank you for contributing to LangChain!

**Description:** Adds Langchain support for Nomic Embed Vision
**Twitter handle:** nomic_ai,zach_nussbaum


- [x] **Add tests and docs**: If you're adding a new integration, please
include
1. a test for the integration, preferably unit tests that do not rely on
network access,
2. an example notebook showing its use. It lives in
`docs/docs/integrations` directory.


- [ ] **Lint and test**: Run `make format`, `make lint` and `make test`
from the root of the package(s) you've modified. See contribution
guidelines for more: https://python.langchain.com/docs/contributing/

Additional guidelines:
- Make sure optional dependencies are imported within a function.
- Please do not add dependencies to pyproject.toml files (even optional
ones) unless they are required for unit tests.
- Most PRs should not touch more than one package.
- Changes should be backwards compatible.
- If you are adding something to community, do not re-import it in
langchain.

If no one reviews your PR within a few days, please @-mention one of
baskaryan, efriis, eyurtsev, ccurme, vbarda, hwchase17.

---------

Co-authored-by: Lance Martin <122662504+rlancemartin@users.noreply.github.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
Zach Nussbaum
2024-06-05 12:47:17 -04:00
committed by GitHub
parent 3280a5b49b
commit 14f3014cce
9 changed files with 543 additions and 29 deletions

View File

@@ -515,7 +515,8 @@ def log_results(arxiv_id2type2key2urls):
def generate_arxiv_references_page(file_name: Path, papers: list[ArxivPaper]) -> None:
with open(file_name, "w") as f:
# Write the table headers
f.write("""# arXiv
f.write(
"""# arXiv
LangChain implements the latest research in the field of Natural Language Processing.
This page contains `arXiv` papers referenced in the LangChain Documentation, API Reference,
@@ -525,7 +526,8 @@ This page contains `arXiv` papers referenced in the LangChain Documentation, API
| arXiv id / Title | Authors | Published date 🔻 | LangChain Documentation|
|------------------|---------|-------------------|------------------------|
""")
"""
)
for paper in papers:
refs = []
if paper.referencing_doc2url:
@@ -595,7 +597,8 @@ This page contains `arXiv` papers referenced in the LangChain Documentation, API
if el
]
)
f.write(f"""
f.write(
f"""
## {paper.title}
- **arXiv id:** {paper.arxiv_id}
@@ -608,7 +611,8 @@ This page contains `arXiv` papers referenced in the LangChain Documentation, API
{refs}
**Abstract:** {paper.abstract}
""")
"""
)
logger.warning(f"Created the {file_name} file with {len(papers)} arXiv references.")