Skip to content

Commit

Permalink
Merge branch 'main' into feature/ollama_streaming_support
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinsachdeva authored Feb 9, 2024
2 parents c763f17 + e49d52d commit 3cb069b
Show file tree
Hide file tree
Showing 32 changed files with 1,277 additions and 225 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/CI_readme_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Core / Sync docs with Readme

on:
push:
branches:
- main

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v4
with:
# This will tell tj-actions/changed-files to compare the current pushed commit with the latest in main
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U haystack-pydoc-tools hatch
# We look into the changeset in order to understand
# which integrations were modified by the last commit.
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
with:
files: integrations/**
# Output unique changed directories instead of filenames
dir_names: true
# We only care about the name of the integration, i.e. integrations/FOO
dir_names_max_depth: 2

- name: Generate docs
if: steps.changed-files.outputs.all_changed_files != ''
env:
# This is necessary to fetch the documentation categories
# from Readme.io as we need them to associate the slug
# in config files with their id.
README_API_KEY: ${{ secrets.README_API_KEY }}
ALL_CHANGED_DIRS: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for d in $ALL_CHANGED_DIRS; do
cd $d
hatch run docs
cd -
done
mkdir tmp
find . -name "_readme_*.md" -exec cp "{}" tmp \;
ls tmp
- name: Sync preview docs with 2.0
if: steps.changed-files.outputs.all_changed_files != ''
uses: readmeio/[email protected]
env:
README_API_KEY: ${{ secrets.README_API_KEY }}
with:
rdme: docs ./tmp --key="$README_API_KEY" --version=2.0
4 changes: 4 additions & 0 deletions .github/workflows/amazon_bedrock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ jobs:
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run lint:all

- name: Generate docs
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Run tests
run: hatch run cov
4 changes: 4 additions & 0 deletions .github/workflows/gradient.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ jobs:
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run lint:all

- name: Generate docs
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Run tests
run: hatch run cov
32 changes: 18 additions & 14 deletions .github/workflows/instructor_embedders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
- cron: "0 0 * * *"
pull_request:
paths:
- 'integrations/instructor_embedders/**'
- '.github/workflows/instructor_embedders.yml'
- "integrations/instructor_embedders/**"
- ".github/workflows/instructor_embedders.yml"

defaults:
run:
Expand All @@ -16,19 +16,23 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

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

- name: Lint
run: hatch run lint:all
- name: Lint
run: hatch run lint:all

- name: Run tests
run: hatch run cov
- name: Generate docs
if: runner.os == 'Linux'
run: hatch run docs

- name: Run tests
run: hatch run cov
42 changes: 23 additions & 19 deletions .github/workflows/jina.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- cron: "0 0 * * *"
pull_request:
paths:
- 'integrations/jina/**'
- '.github/workflows/jina.yml'
- "integrations/jina/**"
- ".github/workflows/jina.yml"

defaults:
run:
Expand All @@ -30,27 +30,31 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10']
python-version: ["3.9", "3.10"]

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

- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- 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: Install Hatch
run: pip install --upgrade hatch

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

- name: Run tests
run: hatch run cov
- name: Generate docs
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Run tests
run: hatch run cov
4 changes: 4 additions & 0 deletions .github/workflows/llama_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ jobs:
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run lint:all

- name: Generate docs
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Run tests
run: hatch run cov
8 changes: 8 additions & 0 deletions .github/workflows/pinecone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
- "integrations/pinecone/**"
- ".github/workflows/pinecone.yml"

defaults:
run:
working-directory: integrations/pinecone

concurrency:
group: pinecone-${{ github.head_ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -46,6 +50,10 @@ jobs:
if: matrix.python-version == '3.9'
run: hatch run lint:all

- name: Generate docs
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Run tests
working-directory: integrations/pinecone
run: hatch run cov
42 changes: 23 additions & 19 deletions .github/workflows/qdrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- cron: "0 0 * * *"
pull_request:
paths:
- 'integrations/qdrant/**'
- '.github/workflows/qdrant.yml'
- "integrations/qdrant/**"
- ".github/workflows/qdrant.yml"

defaults:
run:
Expand All @@ -30,27 +30,31 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10']
python-version: ["3.9", "3.10"]

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

- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- 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: Install Hatch
run: pip install --upgrade hatch

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

- name: Run tests
run: hatch run cov
- name: Generate docs
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Run tests
run: hatch run cov
9 changes: 7 additions & 2 deletions .github/workflows/unstructured.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
paths:
- "integrations/unstructured/**"
- ".github/workflows/unstructured.yml"
- ".github/workflows/unstructured.yml"

concurrency:
group: unstructured-${{ github.head_ref }}
Expand Down Expand Up @@ -59,6 +59,11 @@ jobs:
if: matrix.python-version == '3.9'
run: hatch run lint:all

- name: Generate docs
working-directory: integrations/unstructured
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Run tests
working-directory: integrations/unstructured
working-directory: integrations/unstructured
run: hatch run cov
31 changes: 31 additions & 0 deletions integrations/amazon_bedrock/pydoc/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
loaders:
- type: haystack_pydoc_tools.loaders.CustomPythonLoader
search_path: [../src]
modules: [
"haystack_integrations.components.generators.amazon_bedrock.generator",
"haystack_integrations.components.generators.amazon_bedrock.adapters",
"haystack_integrations.components.generators.amazon_bedrock.errors",
"haystack_integrations.components.generators.amazon_bedrock.handlers",
]
ignore_when_discovered: ["__init__"]
processors:
- type: filter
expression:
documented_only: true
do_not_filter_modules: false
skip_empty_modules: true
- type: smart
- type: crossref
renderer:
type: haystack_pydoc_tools.renderers.ReadmePreviewRenderer
excerpt: Amazon Bedrock integration for Haystack
category_slug: haystack-integrations
title: Amazon Bedrock
slug: integrations-amazon-bedrock
order: 10
markdown:
descriptive_class_title: false
descriptive_module_title: true
add_method_class_prefix: true
add_member_class_prefix: false
filename: _readme_amazon_bedrock.md
5 changes: 4 additions & 1 deletion integrations/amazon_bedrock/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ git_describe_command = 'git describe --tags --match="integrations/amazon_bedrock
dependencies = [
"coverage[toml]>=6.5",
"pytest",
"haystack-pydoc-tools",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
Expand All @@ -62,7 +63,9 @@ cov = [
"test-cov",
"cov-report",
]

docs = [
"pydoc-markdown pydoc/config.yml"
]
[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: 2023-present deepset GmbH <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
from .chat.chat_generator import AmazonBedrockChatGenerator
from .generator import AmazonBedrockGenerator

__all__ = ["AmazonBedrockGenerator"]
__all__ = ["AmazonBedrockGenerator", "AmazonBedrockChatGenerator"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: 2023-present deepset GmbH <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
Loading

0 comments on commit 3cb069b

Please sign in to comment.