Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Langfuse integration #686

Merged
merged 30 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
640aa46
Add langfuse integration
masci Apr 4, 2024
b618549
Trace pipeline run
vblagoje Apr 24, 2024
ea13593
Integration admin additions
vblagoje Apr 24, 2024
0dfb3d9
Pydoc config
vblagoje Apr 24, 2024
17f3754
Capture trace url in tracer component
vblagoje Apr 24, 2024
1540227
Add integration test, update example
vblagoje Apr 24, 2024
31f7792
Linting
vblagoje Apr 24, 2024
9ed1d2c
Add haystack-pydoc-tools dep
vblagoje Apr 26, 2024
0755886
Add comprehensive README
vblagoje Apr 26, 2024
e27d120
Handle both ChatMessage and str payloads
vblagoje Apr 27, 2024
5d8b54d
Renaming
vblagoje Apr 30, 2024
72c08c2
Versioning scheme
vblagoje Apr 30, 2024
ff5b8e0
Pydocs, add public trace flag
vblagoje Apr 30, 2024
fccd6a9
Add hatch-vcs dep
vblagoje Apr 30, 2024
eaf27cf
Merge branch 'main' into langfuse_integration
vblagoje Apr 30, 2024
8640cdf
Use OPENAI_API_KEY secret
vblagoje Apr 30, 2024
53e4a51
update docstrings
dfokina Apr 30, 2024
946a91a
Update integrations/langfuse/README.md
vblagoje Apr 30, 2024
1f19f9a
Update integrations/langfuse/README.md
vblagoje Apr 30, 2024
825d39c
Update integrations/langfuse/README.md
vblagoje Apr 30, 2024
02288e4
Update integrations/langfuse/README.md
vblagoje Apr 30, 2024
18be5fc
Update integrations/langfuse/README.md
vblagoje Apr 30, 2024
0882766
Update integrations/langfuse/README.md
vblagoje Apr 30, 2024
e7730f7
lint fixups
vblagoje Apr 30, 2024
6171b15
Improve test, previous version always returned 200
vblagoje May 2, 2024
df87c4f
Update integrations/langfuse/README.md
vblagoje May 2, 2024
bb7c6f6
Update integrations/langfuse/README.md
vblagoje May 2, 2024
10cece5
Merge branch 'main' into langfuse_integration
vblagoje May 2, 2024
33628ed
Add details about Langfuse keys
vblagoje May 2, 2024
a305728
Pylint
vblagoje May 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ integration:jina:
- any-glob-to-any-file: "integrations/jina/**/*"
- any-glob-to-any-file: ".github/workflows/jina.yml"

integration:langfuse:
- changed-files:
- any-glob-to-any-file: "integrations/langfuse/**/*"
- any-glob-to-any-file: ".github/workflows/langfuse.yml"

integration:llama_cpp:
- changed-files:
- any-glob-to-any-file: "integrations/llama_cpp/**/*"
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/langfuse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# This workflow comes from https://github.com/ofek/hatch-mypyc
# https://github.com/ofek/hatch-mypyc/blob/5a198c0ba8660494d02716cfc9d79ce4adfb1442/.github/workflows/test.yml
name: Test / langfuse

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

defaults:
run:
working-directory: integrations/langfuse

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

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
LANGFUSE_SECRET_KEY: ${{ secrets.LANGFUSE_SECRET_KEY }}
LANGFUSE_PUBLIC_KEY: ${{ secrets.LANGFUSE_PUBLIC_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

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: Generate docs
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Run tests
id: tests
run: hatch run cov

- name: Nightly - run unit tests with Haystack main branch
if: github.event_name == 'schedule'
id: nightly-haystack-main
run: |
hatch run pip install git+https://github.com/deepset-ai/haystack.git
hatch run test -m "not integration"

- name: Send event to Datadog for nightly failures
if: failure() && github.event_name == 'schedule'
uses: ./.github/actions/send_failure
with:
title: |
core-integrations failure:
${{ (steps.tests.conclusion == 'nightly-haystack-main') && 'nightly-haystack-main' || 'tests' }}
- ${{ github.workflow }}
api-key: ${{ secrets.CORE_DATADOG_API_KEY }}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Please check out our [Contribution Guidelines](CONTRIBUTING.md) for all the deta
## Inventory

| Package | Type | PyPi Package | Status |
| -------------------------------------------------------------------------------------------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|----------------------------------------------------------------------------------------------------------------|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [amazon-bedrock-haystack](integrations/amazon-bedrock/) | Generator | [![PyPI - Version](https://img.shields.io/pypi/v/amazon-bedrock-haystack.svg)](https://pypi.org/project/amazon-bedrock-haystack) | [![Test / amazon_bedrock](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/amazon_bedrock.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/amazon_bedrock.yml) |
| [amazon-sagemaker-haystack](integrations/amazon_sagemaker/) | Generator | [![PyPI - Version](https://img.shields.io/pypi/v/amazon-sagemaker-haystack.svg)](https://pypi.org/project/amazon-sagemaker-haystack) | [![Test / amazon_sagemaker](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/amazon_sagemaker.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/amazon_sagemaker.yml) |
| [anthropic-haystack](integrations/anthropic/) | Generator | [![PyPI - Version](https://img.shields.io/pypi/v/anthropic-haystack.svg)](https://pypi.org/project/anthropic-haystack) | [![Test / anthropic](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/anthropic.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/anthropic.yml) |
Expand All @@ -38,6 +38,7 @@ Please check out our [Contribution Guidelines](CONTRIBUTING.md) for all the deta
| [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) |
| [jina-haystack](integrations/jina/) | Embedder, Ranker | [![PyPI - Version](https://img.shields.io/pypi/v/jina-haystack.svg)](https://pypi.org/project/jina-haystack) | [![Test / jina](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) |
| [langfuse-haystack](integrations/langfuse/) | Tracer | [![PyPI - Version](https://img.shields.io/pypi/v/langfuse-haystack.svg?color=orange)](https://pypi.org/project/langfuse-haystack) | [![Test / langfuse](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/langfuse.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/langfuse.yml) |
| [llama-cpp-haystack](integrations/llama_cpp/) | Generator | [![PyPI - Version](https://img.shields.io/pypi/v/llama-cpp-haystack.svg?color=orange)](https://pypi.org/project/llama-cpp-haystack) | [![Test / llama-cpp](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/llama_cpp.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/llama_cpp.yml) |
| [mistral-haystack](integrations/mistral/) | Embedder, Generator | [![PyPI - Version](https://img.shields.io/pypi/v/mistral-haystack.svg)](https://pypi.org/project/mistral-haystack) | [![Test / mistral](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/mistral.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/mistral.yml) |
| [mongodb-atlas-haystack](integrations/mongodb_atlas/) | Document Store | [![PyPI - Version](https://img.shields.io/pypi/v/mongodb-atlas-haystack.svg?color=orange)](https://pypi.org/project/mongodb-atlas-haystack) | [![Test / mongodb-atlas](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/mongodb_atlas.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/mongodb_atlas.yml) |
Expand Down
Loading
Loading