Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
72 changes: 52 additions & 20 deletions .github/workflows/python-CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ on:

defaults:
run:
working-directory: ./python
working-directory: python

jobs:
ci:
name: CI Python
runs-on: oss-4-core-runner
changes:
name: Filter Changes
runs-on: ubuntu-latest
outputs:
diff_files: ${{ steps.filter.outputs.diff_files }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: python
- uses: dorny/paths-filter@v3
id: filter
with:
Expand All @@ -26,8 +30,17 @@ jobs:
diff:
- "python/**/*.py"
- "python/**/*.toml"

find-tox-testenv:
name: Find Tox Testenv
needs: changes
if: ${{ needs.changes.outputs.diff_files != '' }}
runs-on: ubuntu-latest
outputs:
list: ${{ steps.testenv.outputs.list }}
steps:
- run: >-
echo "packages=$(echo '${{ steps.filter.outputs.diff_files }}'
echo "list=$(echo '${{ needs.changes.outputs.diff_files }}'
| jq -r '.[]'
| sed -n
-e 's/^python\/instrumentation\/openinference-instrumentation-\([^/]*\)\/.*/\1/p'
Expand All @@ -37,20 +50,39 @@ jobs:
| sed -e 's/semantic-conventions/semconv/' -e 's/-/_/' -e 's/^/\\b/'
| paste -sd "|" -)"
>> "$GITHUB_OUTPUT"
if: ${{ steps.filter.outputs.diff == 'true' }}
id: changes
id: packages
- uses: actions/checkout@v4
with:
sparse-checkout: python
- uses: actions/setup-python@v5
if: ${{ (steps.filter.outputs.diff == 'true') && (steps.changes.outputs.packages != '') }}
with:
python-version: |
3.8
3.9
3.10
3.11
3.12
- run: pip install tox-uv==1.11.2
if: ${{ (steps.filter.outputs.diff == 'true') && (steps.changes.outputs.packages != '') }}
with:
python-version: 3.8
- uses: astral-sh/setup-uv@v5
with:
version: 0.5.27
- run: >-
tox run-parallel --parallel-no-spinner
-e $(tox -l | egrep -e '${{ steps.changes.outputs.packages }}' | paste -sd, -)
if: ${{ (steps.filter.outputs.diff == 'true') && (steps.changes.outputs.packages != '') }}
echo "list=$(uvx --with tox-uv tox -l
| egrep -e '${{ steps.packages.outputs.list }}'
| jq -R -s 'split("\n")[:-1]')"
>> $GITHUB_OUTPUT
id: testenv

run-tox-testenv:
name: Run Tox Testenv
needs: find-tox-testenv
if: ${{ needs.find-tox-testenv.outputs.list != '' }}
runs-on: ubuntu-latest
strategy:
matrix:
testenv: ${{ fromJSON(needs.find-tox-testenv.outputs.list) }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: python
- uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: astral-sh/setup-uv@v5
with:
version: 0.5.27
- run: uvx --with tox-uv tox run -e ${{ matrix.testenv }} -- -ra -x
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"python/instrumentation/openinference-instrumentation-bedrock": "0.1.13",
"python/instrumentation/openinference-instrumentation-mistralai": "1.1.0",
"python/openinference-instrumentation": "0.1.21",
"python/instrumentation/openinference-instrumentation-guardrails": "0.1.3",
"python/instrumentation/openinference-instrumentation-guardrails": "0.1.4",
"python/instrumentation/openinference-instrumentation-vertexai": "0.1.4",
"python/instrumentation/openinference-instrumentation-crewai": "0.1.4",
"python/instrumentation/openinference-instrumentation-haystack": "0.1.14",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class _WithSpan:
def __init__(
self,
span: trace_api.Span,

context_attributes: Attributes = None,
extra_attributes: Attributes = None,
) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## [0.1.4](https://github.com/RogerHYang/openinference/compare/python-openinference-instrumentation-guardrails-v0.1.3...python-openinference-instrumentation-guardrails-v0.1.4) (2025-02-04)


### Features

* Enable config propagation ([#741](https://github.com/RogerHYang/openinference/issues/741)) ([16cdc6b](https://github.com/RogerHYang/openinference/commit/16cdc6b71fb14728a3eca7db27a55b68187cb4aa))
* **guardrailsai:** add instrumentation support ([#553](https://github.com/RogerHYang/openinference/issues/553)) ([fb07e84](https://github.com/RogerHYang/openinference/commit/fb07e84b2027f06ad1c0659b5eabee87b23a0de0))
* **guardrails:** limit support to versions <0.5.2 ([#941](https://github.com/RogerHYang/openinference/issues/941)) ([3729e09](https://github.com/RogerHYang/openinference/commit/3729e09ea568b404a331a7f183067052010408ea))


### Bug Fixes

* defer version detection until run time for guardrails-ai ([#1099](https://github.com/RogerHYang/openinference/issues/1099)) ([156b6c1](https://github.com/RogerHYang/openinference/commit/156b6c11b0cbade2b99e37af49a77f4e1af79f84))
* increase version lower bound for openinference-instrumentation ([#1012](https://github.com/RogerHYang/openinference/issues/1012)) ([3236d27](https://github.com/RogerHYang/openinference/commit/3236d2733a46b84d693ddb7092209800cde8cc34))


### Documentation

* TraceConfig and context attributes ([#793](https://github.com/RogerHYang/openinference/issues/793)) ([d3808c4](https://github.com/RogerHYang/openinference/commit/d3808c4bea3f6a4c72d3a7ea09b54e78072be6fd))
* Update README.md ([#605](https://github.com/RogerHYang/openinference/issues/605)) ([ebbbd1a](https://github.com/RogerHYang/openinference/commit/ebbbd1a7ef91aa0a05cbd7c2f5c1a74c60de5c5c))

## [0.1.3](https://github.com/Arize-ai/openinference/compare/python-openinference-instrumentation-guardrails-v0.1.2...python-openinference-instrumentation-guardrails-v0.1.3) (2024-11-01)


Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.3"
__version__ = "0.1.4"
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
)

logger = logging.getLogger(__name__)

logger.addHandler(logging.NullHandler())


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class TraceConfig:
"default_value": DEFAULT_HIDE_LLM_INVOCATION_PARAMETERS,
},
)

hide_inputs: Optional[bool] = field(
default=None,
metadata={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class SpanAttributes:
"""

EMBEDDING_EMBEDDINGS = "embedding.embeddings"

"""
A list of objects containing embedding data, including the vector and represented piece of text.
"""
Expand Down