Skip to content

Commit

Permalink
Add Google Vertex AI integration (#101)
Browse files Browse the repository at this point in the history
* Add Google Vertex AI integration

* Add Gemini

* Add label
  • Loading branch information
silvanocerza authored Dec 14, 2023
1 parent d45eca2 commit 824f57c
Show file tree
Hide file tree
Showing 21 changed files with 1,354 additions and 24 deletions.
54 changes: 32 additions & 22 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,53 @@
# Integrations
integration:chroma:
- changed-files:
- any-glob-to-any-file: 'integrations/chroma/**/*'
- changed-files:
- any-glob-to-any-file: "integrations/chroma/**/*"

integration:cohere:
- changed-files:
- any-glob-to-any-file: 'integrations/cohere/**/*'
- changed-files:
- any-glob-to-any-file: "integrations/cohere/**/*"

integration:elasticsearch:
- changed-files:
- any-glob-to-any-file: 'integrations/elasticsearch/**/*'
- changed-files:
- any-glob-to-any-file: "integrations/elasticsearch/**/*"

integration:google-vertex:
- changed-files:
- any-glob-to-any-file: "integrations/google-vertex/**/*"

integration:gradient:
- changed-files:
- any-glob-to-any-file: 'integrations/gradient/**/*'
- changed-files:
- any-glob-to-any-file: "integrations/gradient/**/*"

integration:instructor-embedders:
- changed-files:
- any-glob-to-any-file: 'integrations/instructor-embedders/**/*'
- changed-files:
- any-glob-to-any-file: "integrations/instructor-embedders/**/*"

integration:jina:
- changed-files:
- any-glob-to-any-file: 'integrations/jina/**/*'
- changed-files:
- any-glob-to-any-file: "integrations/jina/**/*"

integration:opensearch:
- changed-files:
- any-glob-to-any-file: 'integrations/opensearch/**/*'
- changed-files:
- any-glob-to-any-file: "integrations/opensearch/**/*"

integration:unstructured-fileconverter:
- changed-files:
- any-glob-to-any-file: 'integrations/unstructured/fileconverter/**/*'
- changed-files:
- any-glob-to-any-file: "integrations/unstructured/fileconverter/**/*"

# Topics
topic:CI:
- changed-files:
- any-glob-to-any-file: ['.github/*', '.github/**/*']
- changed-files:
- any-glob-to-any-file: [".github/*", ".github/**/*"]
topic:DX:
- changed-files:
- any-glob-to-any-file: ['CONTRIBUTING.md', '.pre-commit-config.yaml', '.gitignore', 'requirements.txt']
- changed-files:
- any-glob-to-any-file:
[
"CONTRIBUTING.md",
".pre-commit-config.yaml",
".gitignore",
"requirements.txt",
]
topic:security:
- changed-files:
- any-glob-to-any-file: ['SECURITY.md']
- changed-files:
- any-glob-to-any-file: ["SECURITY.md"]
56 changes: 56 additions & 0 deletions .github/workflows/google_vertex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This workflow comes from https://github.com/ofek/hatch-mypyc
# https://github.com/ofek/hatch-mypyc/blob/5a198c0ba8660494d02716cfc9d79ce4adfb1442/.github/workflows/test.yml
name: Test / google-vertex

on:
schedule:
- cron: "0 0 * * *"
pull_request:
paths:
- "integrations/google-vertex/**"
- ".github/workflows/google-vertex.yml"

defaults:
run:
working-directory: integrations/google-vertex

concurrency:
group: google-vertex-${{ github.head_ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
run:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10"]

steps:
- name: Support longpaths
if: matrix.os == 'windows-latest'
working-directory: .
run: git config --system core.longpaths true

- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Hatch
run: pip install --upgrade hatch

- name: Lint
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run lint:all

- name: Run tests
run: hatch run cov
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ You will need `hatch` to work on or create new integrations. Run `pip install ha

All the integrations are self contained, so the first step before working on one is to `cd` into the proper folder.
For example, to work on the Chroma Document Store, from the root of the repo:

```sh
$ cd integrations/chroma
```

From there, you can run the tests with `hatch`, that will take care of setting up an isolated Python environment:

```sh
hatch run test
```

Similarly, to run the linters:

```sh
hatch run lint:all
```
Expand All @@ -31,11 +34,13 @@ hatch run lint:all
> you're integrating Haystack with. For example, a deepset integration would be named as `deepset-haystack`.
To create a new integration, from the root of the repo change directory into `integrations`:

```sh
cd integrations
```

From there, use `hatch` to create the scaffold of the new integration:

```sh
$ hatch --config hatch.toml new -i
Project name: deepset-haystack
Expand All @@ -58,10 +63,11 @@ deepset-haystack
| Package | Type | PyPi Package | Status |
| ------------------------------------------------------------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [chroma-haystack](integrations/chroma/) | Document Store | [![PyPI - Version](https://img.shields.io/pypi/v/chroma-haystack.svg)](https://pypi.org/project/chroma-haystack) | [![Test / chroma](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/chroma.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/chroma.yml) |
| [cohere-haystack](integrations/cohere/) | Embedder, Generator | [![PyPI - Version](https://img.shields.io/pypi/v/cohere-haystack.svg)](https://pypi.org/project/cohere-haystack) | [![Test / cohere](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/cohere.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/cohere.yml) |
| [cohere-haystack](integrations/cohere/) | Embedder, Generator | [![PyPI - Version](https://img.shields.io/pypi/v/cohere-haystack.svg)](https://pypi.org/project/cohere-haystack) | [![Test / cohere](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/cohere.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/cohere.yml) |
| [elasticsearch-haystack](integrations/elasticsearch/) | Document Store | [![PyPI - Version](https://img.shields.io/pypi/v/elasticsearch-haystack.svg)](https://pypi.org/project/elasticsearch-haystack) | [![Test / elasticsearch](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/elasticsearch.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/elasticsearch.yml) |
| [google-vertex-haystack](integrations/google-vertex/) | Generator | [![PyPI - Version](https://img.shields.io/pypi/v/google-vertex-haystack.svg)](https://pypi.org/project/google-vertex-haystack) | [![Test / google-vertex](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/google-vertex.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/google-vertex.yml) |
| [gradient-haystack](integrations/gradient/) | Embedder, Generator | [![PyPI - Version](https://img.shields.io/pypi/v/gradient-haystack.svg)](https://pypi.org/project/gradient-haystack) | [![Test / gradient](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/gradient.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/gradient.yml) |
| [instructor-embedders-haystack](integrations/instructor-embedders/) | Embedder | [![PyPI - Version](https://img.shields.io/pypi/v/instructor-embedders-haystack.svg)](https://pypi.org/project/instructor-embedders-haystack) | [![Test / instructor-embedders](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/instructor_embedders.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/instructor_embedders.yml) |
| [opensearch-haystack](integrations/opensearch/) | Document Store | [![PyPI - Version](https://img.shields.io/pypi/v/opensearch-haystack.svg)](https://pypi.org/project/opensearch-haystack) | [![Test / opensearch](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/opensearch.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/opensearch.yml) |
| [unstructured-fileconverter-haystack](integrations/unstructured/fileconverter/) | File converter | [![PyPI - Version](https://img.shields.io/pypi/v/unstructured-fileconverter-haystack.svg)](https://pypi.org/project/unstructured-fileconverter-haystack) | [![Test / unstructured / fileconverter](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/unstructured_fileconverter.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/unstructured_fileconverter.yml) |
| [jina-haystack](integrations/jina/) | Embedder | [![PyPI - Version](https://img.shields.io/pypi/v/jina-haystack.svg)](https://pypi.org/project/jina-haystack) | [![Test / cohere](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/jina.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/jina.yml) |
| [jina-haystack](integrations/jina/) | Embedder | [![PyPI - Version](https://img.shields.io/pypi/v/jina-haystack.svg)](https://pypi.org/project/jina-haystack) | [![Test / cohere](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/jina.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/jina.yml) |
Loading

0 comments on commit 824f57c

Please sign in to comment.