All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Datadog nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL DATADOG BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
opentelemetry-python-contrib-0.66b2/README.md 0000664 0000000 0000000 00000027630 15270700723 0021034 0 ustar 00root root 0000000 0000000 ---
Getting Started
•
API Documentation
•
Getting In Touch (GitHub Discussions)
Contributing
•
Instrumentations
---
# OpenTelemetry Python Contrib
The Python auto-instrumentation libraries for [OpenTelemetry](https://opentelemetry.io/) (per [OTEP 0001](https://github.com/open-telemetry/oteps/blob/main/text/0001-telemetry-without-manual-instrumentation.md))
## Index
* [Installation](#installation)
* [Releasing](#releasing)
* [Releasing a package as `1.0` stable](#releasing-a-package-as-10-stable)
* [Semantic Convention status of instrumentations](#semantic-convention-status-of-instrumentations)
* [Contributing](#contributing)
* [Thanks to all the people who already contributed](#thanks-to-all-the-people-who-already-contributed)
## Installation
This repository includes installable packages for each instrumented library. Libraries that produce telemetry data should only depend on `opentelemetry-api`,
and defer the choice of the SDK to the application developer. Applications may
depend on `opentelemetry-sdk` or another package that implements the API.
**Please note** that these libraries are currently in _beta_, and shouldn't
generally be used in production environments.
Unless explicitly stated otherwise, any instrumentation here for a particular library is not developed or maintained by the authors of such library.
The
[`instrumentation/`](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation)
directory includes OpenTelemetry instrumentation packages, which can be installed
separately as:
```sh
pip install opentelemetry-instrumentation-{integration}
```
To install the development versions of these packages instead, clone or fork
this repo and do an [editable
install](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs):
```sh
pip install -e ./instrumentation/opentelemetry-instrumentation-{integration}
```
## Releasing
Maintainers release new versions of the packages in `opentelemetry-python-contrib` on a monthly cadence. See [releases](https://github.com/open-telemetry/opentelemetry-python-contrib/releases) for all previous releases.
Contributions that enhance OTel for Python are welcome to be hosted upstream for the benefit of group collaboration. Maintainers will look for things like good documentation, good unit tests, and in general their own confidence when deciding to release a package with the stability guarantees that are implied with a `1.0` release.
To resolve this, members of the community are encouraged to commit to becoming a CODEOWNER for packages in `-contrib` that they feel experienced enough to maintain. CODEOWNERS can then follow the checklist below to release `-contrib` packages as 1.0 stable:
### Releasing a package as `1.0` stable
To release a package as `1.0` stable, the package:
- SHOULD have a CODEOWNER. To become one, submit an issue and explain why you meet the responsibilities found in [CODEOWNERS](.github/CODEOWNERS).
- MUST have unit tests that cover all supported versions of the instrumented library.
- e.g. Instrumentation packages might use different techniques to instrument different major versions of python packages
- MUST have clear documentation for non-obvious usages of the package
- e.g. If an instrumentation package uses flags, a token as context, or parameters that are not typical of the `BaseInstrumentor` class, these are documented
- After the release of `1.0`, a CODEOWNER may no longer feel like they have the bandwidth to meet the responsibilities of maintaining the package. That's not a problem at all, life happens! However, if that is the case, we ask that the CODEOWNER please raise an issue indicating that they would like to be removed as a CODEOWNER so that they don't get pinged on future PRs. Ultimately, we hope to use that issue to find a new CODEOWNER.
## Semantic Convention status of instrumentations
In our efforts to maintain optimal user experience and prevent breaking changes for transitioning into stable semantic conventions, OpenTelemetry Python is adopting the semantic convention migration plan for several instrumentations. Currently this plan is only being adopted for [HTTP-related instrumentations](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/non-normative/http-migration.md), but will eventually cover all types. Please refer to the `semconv status` column of the [instrumentation README](instrumentation/README.md) of the current status of instrumentations' semantic conventions. The possible values are `development`, `stable` and `migration` referring to [status](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.31.0/specification/document-status.md#lifecycle-status) of that particular semantic convention. `Migration` refers to an instrumentation that currently supports the migration plan.
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)
We meet weekly on Thursday at 9AM PT. The meeting is subject to change depending on contributors' availability. Check the [OpenTelemetry community calendar](https://calendar.google.com/calendar/embed?src=c_2bf73e3b6b530da4babd444e72b76a6ad893a5c3f43cf40467abc7a9a897f977%40group.calendar.google.com) for specific dates and for the Zoom link.
Meeting notes are available as a public [Google doc](https://docs.google.com/document/d/18w8zOBm_mbety0OqlPwxc7dvnfu641EgmrO4AdJef0U/edit?tab=t.0).
The meeting is open for all to join. We invite everyone to join our meeting, regardless of your experience level. Whether you're a seasoned OpenTelemetry developer, just starting your journey, or simply curious about the work we do, you're more than welcome to participate!
### Maintainers
- [Aaron Abbott](https://github.com/aabmass), Google
- [Emídio Neto](https://github.com/emdneto), Independent
- [Leighton Chen](https://github.com/lzchen), Microsoft
- [Lukas Hering](https://github.com/herin049), Oracle
- [Riccardo Magliocchetti](https://github.com/xrmx), Elastic
For more information about the maintainer role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer).
### Approvers
- [Diego Hurtado](https://github.com/ocelotl), Dash0
- [Dylan Russell](https://github.com/dylanrussell), Google
- [Héctor Hernández](https://github.com/hectorhdzg), Microsoft
- [Keith Decker](https://github.com/keith-decker), Cisco/Splunk
- [Liudmila Molkova](https://github.com/lmolkova), Google
- [Mike Goldsmith](https://github.com/MikeGoldsmith), Honeycomb
- [Pablo Collins](https://github.com/pmcollins), Splunk
- [Srikanth Chekuri](https://github.com/srikanthccv), signoz.io
- [Tammy Baylis](https://github.com/tammy-baylis-swi), SolarWinds
For more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver).
### Emeritus
- [Alex Boten](https://github.com/codeboten), Maintainer
- [Ashutosh Goel](https://github.com/ashu658), Approver
- [Jeremy Voss](https://github.com/jeremydvoss), Approver
- [Nathaniel Ruiz Nowell](https://github.com/NathanielRN), Approver
- [Nikolay Sokolik](https://github.com/nikosokolik), Approver
- [Nikolay Sokolik](https://github.com/oxeye-nikolay), Approver
- [Owais Lone](https://github.com/owais), Maintainer
- [Owais Lone](https://github.com/owais), Approver
- [Sanket Mehta](https://github.com/sanketmehta28), Approver
- [Shalev Roda](https://github.com/shalevr), Maintainer
- [Shalev Roda](https://github.com/shalevr), Approver
- [Yusuke Tsutsumi](https://github.com/toumorokoshi), Maintainer
For more information about the emeritus role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager).
### Thanks to all of our contributors!
opentelemetry-python-contrib-0.66b2/RELEASING.md 0000664 0000000 0000000 00000023433 15270700723 0021405 0 ustar 00root root 0000000 0000000 # Release instructions
## Preparing a new major or minor release
* Run the [Prepare release branch workflow](https://github.com/open-telemetry/opentelemetry-python-contrib/actions/workflows/prepare-release-branch.yml).
* Press the "Run workflow" button, and leave the default branch `main` selected.
* If making a pre-release of stable components (e.g. release candidate),
enter the pre-release version number, e.g. `1.9.0rc2`.
(otherwise the workflow will pick up the version from `main` and just remove the `.dev` suffix).
* Review the two pull requests that it creates.
(one is targeted to the release branch and one is targeted to `main`).
* The builds will fail for the release PR because of validation rules. Follow the [release workflow](https://github.com/open-telemetry/opentelemetry-python/blob/main/RELEASING.md) for the core repo up until this same point.
* Close and reopen the PR so that the workflow will take into account the label automation we have in place
* Merge the release PR.
* Merge the PR to main (this can be done separately from [making the release](#making-the-release))
### Preparing a major or minor release for individual package
> [!NOTE]
> Per-package major or minor release is supported for the following packages only:
> - opentelemetry-opamp-client
> - opentelemetry-propagator-aws-xray
> - opentelemetry-resource-detector-azure
> - opentelemetry-resourcedetector-gcp
> - opentelemetry-sdk-extension-aws
> - opentelemetry-instrumentation-valkey-py
> - opentelemetry-util-genai
>
> These libraries are also excluded from the general release.
>
> The deprecated GenAI instrumentations listed under [Releasing individual package](#releasing-individual-package)
> are intentionally absent here: they no longer get major or minor releases from this repository, only
> patch releases from their existing `package-release/` branches.
Package release preparation is handled by the [`[Package] Prepare release`](./.github/workflows/package-prepare-release.yml) workflow that allows
to pick a specific package to release. It follows the same versioning strategy and process as the general release.
Long-term package release branch follows `package-release/{package-name}/v{major}.{minor}.x` (or `package-release/{package-name}/v{major}.{minor}bx`) naming pattern.
The workflow will create two pull requests, one against the `main` and one against the `package-release/` branch; both should be merged in order to proceed with the release.
To keep the process lightweight, it's OK to approve the PRs you generate and merge without additional reviews.
## Preparing a new patch release
### Backporting
Creating manual backports of pull request(s) requires the `backport` label to be added in order to have a green CI.
To use the workflow to backport pull request(s) to the release branch:
* Run the [Backport workflow](https://github.com/open-telemetry/opentelemetry-python-contrib/actions/workflows/backport.yml).
* Press the "Run workflow" button, then select the release branch from the dropdown list,
e.g. `release/v1.9.x`, then enter the pull request number that you want to backport,
then click the "Run workflow" button below that.
* Add the label `backport` to the generated pull request.
* In case label automation doesn't work, just close and reopen the PR so that the workflow will take into account the label automation we have in place.
* Review and merge the backport pull request that it generates.
### Preparing a patch release
* Run the [Prepare patch release workflow](https://github.com/open-telemetry/opentelemetry-python-contrib/actions/workflows/prepare-patch-release.yml).
* Press the "Run workflow" button, then select the release branch from the dropdown list,
e.g. `release/v1.9.x`, and click the "Run workflow" button below that.
* Review and merge the pull request that it creates for updating the version.
* Note: If you are doing a patch release in `-contrib` repo, you should also do an equivalent patch release in `-core` repo (even if there's no fix to release), otherwise tests in CI will fail.
### Preparing a patch release for individual package
> [!NOTE]
> Per-package release is supported only for packages included in the corresponding workflow. Libraries that support per-package release are currently
> excluded from the general patch release.
Per-package patch release preparation is handled by the [`[Package] Prepare patch release`](./.github/workflows/package-prepare-patch-release.yml) workflow that allows
to pick a specific package to release.
The workflow can only be run against long-term release branch such as `package-release/{package-name}/v{major}.{minor}.x` or `package-release/{package-name}/v{major}.{minor}bx`.
The workflow will create a pull request that should be merged in order to proceed with the release.
## Making the release
* Run the [Release workflow](https://github.com/open-telemetry/opentelemetry-python-contrib/actions/workflows/release.yml).
* Press the "Run workflow" button, then select the release branch from the dropdown list,
e.g. `release/v1.9.x`, and click the "Run workflow" button below that.
* This workflow will publish the artifacts and publish a GitHub release with release notes based on the change log.
* Review and merge the pull request that it creates for updating the change log in main
(note that if this is not a patch release then the change log on main may already be up-to-date,
in which case no pull request will be created).
* Verify that a new [Github release](https://github.com/open-telemetry/opentelemetry-python-contrib/releases) has been created and that the CHANGELOGs look correct.
### Releasing individual package
> [!NOTE]
> Per-package patch release is supported for the following packages only:
> - opentelemetry-opamp-client
> - opentelemetry-propagator-aws-xray
> - opentelemetry-resource-detector-azure
> - opentelemetry-resourcedetector-gcp
> - opentelemetry-sdk-extension-aws
> - opentelemetry-instrumentation-openai-v2
> - opentelemetry-instrumentation-openai-agents-v2
> - opentelemetry-instrumentation-vertexai
> - opentelemetry-instrumentation-valkey-py
> - opentelemetry-util-genai
>
> These libraries are also excluded from the general patch release.
Per-package release is handled by the [`[Package] Release`](./.github/workflows/package-release.yml) workflow that allows
to pick a specific package to release.
The workflow can only be run against long-term release branch such as `package-release/{package-name}/v{major}.{minor}.x` or `package-release/{package-name}/v{major}.{minor}bx`.
## After the release
* Check PyPI
* This should be handled automatically on release by the [publish action](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/.github/workflows/release.yml).
* Check the [action logs](https://github.com/open-telemetry/opentelemetry-python-contrib/actions/workflows/release.yml) to make sure packages have been uploaded to PyPI
* Check the release history (e.g. https://pypi.org/project/opentelemetry-instrumentation/#history) on PyPI
* If for some reason the action failed, see [Publish failed](#publish-failed) below
## Notes about version numbering for stable components
* The version number for stable components in the `main` branch is always `X.Y.0.dev`,
where `X.Y.0` represents the next minor release.
* When the release branch is created, you can opt to make a "pre-release", e.g. `X.Y.0rc2`.
* If you ARE NOT making a "pre-release":
* A "long-term" release branch will be created, e.g. `release/v1.9.x-0.21bx` (notice the wildcard x's).
Later on, after the initial release, you can backport PRs to a "long-term" release branch and make patch releases
from it.
* The version number for stable components in the release branch will be bumped to remove the `.dev`,
e.g. `X.Y.0`.
* The version number for stable components in the `main` branch will be bumped to the next version,
e.g. `X.{Y+1}.0.dev`.
* If you ARE making a "pre-release":
* A "short-term" release branch will be created, e.g. `release/v1.9.0rc2-0.21b0` (notice the precise version with no
wildcard x's). "Short-term" release branches do not support backports or patch releases after the initial release.
* The version number for stable components in the `main` branch will not be bumped, e.g. it will remain `X.Y.0.dev`
since the next minor release will still be `X.Y.0`.
## Notes about version numbering for unstable components
* The version number for unstable components in the `main` branch is always `0.Yb0.dev`,
where `0.Yb0` represents the next minor release.
* _Question: Is "b" (beta) redundant on "0." releases, or is this a python thing? I'm wondering if we can change it to `0.Y.0` to match up with the practice in js and go repos._
* Unstable components do not need "pre-releases", and so whether or not you are making a "pre-release" of stable
components:
* The version number for unstable components in the release branch will be bumped to remove the `.dev`,
e.g. `0.Yb0`.
* The version number for unstable components in the `main` branch will be bumped to the next version,
e.g. `0.{Y+1}b0.dev`.
## Releasing dev version of new packages to claim namespace
When a contribution introduces a new package, in order to mitigate name-squatting incidents, release the current development version of the new package under the `opentelemetry` user to simply claim the namespace. This should be done shortly after the PR that introduced this package has been merged into `main`.
## Troubleshooting
### Publish failed
If for some reason the action failed, do it manually:
- Switch to the release branch (important so we don't publish packages with "dev" versions)
- Build distributions with `./scripts/build.sh`
- Delete distributions we don't want to push (e.g. `testutil`)
- Push to PyPI as `twine upload --skip-existing --verbose dist/*`
- Double check PyPI!
opentelemetry-python-contrib-0.66b2/_template/ 0000775 0000000 0000000 00000000000 15270700723 0021517 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/_template/README.rst 0000664 0000000 0000000 00000001220 15270700723 0023201 0 ustar 00root root 0000000 0000000 OpenTelemetry Instrumentation
==========================================
|pypi|
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-.svg
:target: https://pypi.org/project/opentelemetry-instrumentation-/
This library allows tracing requests made by the library.
Installation
------------
::
pip install opentelemetry-instrumentation-
References
----------
* `OpenTelemetry REPLACE ME/ Tracing `_
* `OpenTelemetry Project `_
opentelemetry-python-contrib-0.66b2/_template/autodoc_entry.rst 0000664 0000000 0000000 00000000355 15270700723 0025133 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-/README.rst
:end-before: References
.. automodule:: opentelemetry.instrumentation.
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/_template/pyproject.toml 0000664 0000000 0000000 00000003607 15270700723 0024441 0 ustar 00root root 0000000 0000000 [build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
# opentelemetry-instrumentation plus the name of the library being instrument e.g
# name = "opentelemetry-instrumentation-sqlalchemy"
name = ""
dynamic = ["version"]
# a description of the instrumentation e.g
# description = "SQLAlchemy tracing for OpenTelemetry"
description = ""
readme = "README.rst"
license = "Apache-2.0"
requires-python = ">=3.10"
authors = [
{ name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"opentelemetry-api ~= 1.12",
]
[project.entry-points.opentelemetry_instrumentor]
# REPLACE ME: the entrypoint for the instrumentor e.g
# sqlalchemy = "opentelemetry.instrumentation.sqlalchemy:SQLAlchemyInstrumentor"
REPLACE_ME = "opentelemetry.instrumentation."
[project.urls]
# url of the instrumentation e.g
# Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-sqlalchemy"
Homepage = ""
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"
[tool.hatch.version]
# REPLACE ME: the path to the version file e.g
# "src/opentelemetry/instrumentation/sqlalchemy/version.py"
path = "src/opentelemetry/instrumentation//version.py"
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
]
[tool.hatch.build.targets.wheel]
packages = ["src/opentelemetry"]
opentelemetry-python-contrib-0.66b2/_template/version.py 0000664 0000000 0000000 00000000144 15270700723 0023555 0 ustar 00root root 0000000 0000000 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
__version__ = "0.66b2"
opentelemetry-python-contrib-0.66b2/dev-requirements.txt 0000664 0000000 0000000 00000000516 15270700723 0023607 0 ustar 00root root 0000000 0000000 pylint==4.0.5
pyright==v1.1.404
sphinx==7.1.2
sphinx-rtd-theme==2.0.0rc4
sphinx-autodoc-typehints==1.25.2
pytest==7.4.4
pytest-cov==4.1.0
readme-renderer==42.0
bleach==4.1.0 # transient dependency for readme-renderer
markupsafe>=2.0.1
codespell==2.1.0
requests==2.33.1
ruamel.yaml==0.17.21
flaky==3.7.0
pre-commit==3.7.0
ruff==0.16.1
opentelemetry-python-contrib-0.66b2/docs-requirements.txt 0000664 0000000 0000000 00000002160 15270700723 0023756 0 ustar 00root root 0000000 0000000 sphinx==7.1.2
sphinx-rtd-theme==2.0.0rc4
sphinx-autodoc-typehints==1.25.2
# Required to avoid breakages for pyramid and cassandra packages
setuptools<82.0.0
# Required by opentelemetry-instrumentation
fastapi>=0.65.2
pymemcache~=1.3
# Required by conf
django>=2.2
# Require by opentelemetry-util-genai
fsspec>=2025.9.0
# Required by instrumentation and exporter packages
aio_pika~=7.2.0
aiohttp~=3.13
aiokafka~=0.11.0
aiopg>=0.13.0,<1.3.0
asyncpg>=0.12.0
asyncclick~=8.0
botocore~=1.0
boto3~=1.0
cassandra-driver~=3.25
celery>=4.0
confluent-kafka>= 1.8.2,< 3.0.0
flask~=2.0
falcon~=2.0
grpcio~=1.27
httpx>=0.18.0
httpx2~=2.12
kafka-python>=2.0,<3.0
mysql-connector-python~=8.0
mysqlclient~=2.1.1
openai >= 1.26.0
psutil>=5
psycopg~=3.1.17
pika>=0.12.0
pymongo~=4.6.3
PyMySQL~=1.1.1
pymssql~=2.3.2
pyramid>=1.7
redis>=2.6
remoulade[limits]>=5.0.0 ; python_version >= "3.12"
remoulade>=0.50.0 ; python_version < "3.12"
sqlalchemy>=1.0
starlette~=0.50
structlog>=21.1
tornado>=5.1.1
tortoise-orm>=0.17.0
wrapt~=2.1
# required by opamp
uuid_utils
protobuf>=5.0,< 7.0
# indirect dependency pins
markupsafe==2.0.1
itsdangerous==2.0.1
opentelemetry-python-contrib-0.66b2/docs/ 0000775 0000000 0000000 00000000000 15270700723 0020475 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/Makefile 0000664 0000000 0000000 00000001105 15270700723 0022132 0 ustar 00root root 0000000 0000000 # Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
opentelemetry-python-contrib-0.66b2/docs/conf.py 0000664 0000000 0000000 00000015524 15270700723 0022003 0 ustar 00root root 0000000 0000000 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys
from configparser import ConfigParser
from os import listdir
from os.path import isdir, join
# configure django to avoid the following exception:
# django.core.exceptions.ImproperlyConfigured: Requested settings, but settings
# are not configured. You must either define the environment variable
# DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
from django.conf import settings
settings.configure()
source_dirs = []
exp = "../exporter"
exp_dirs = [os.path.abspath("/".join([exp, f, "src"])) for f in listdir(exp) if isdir(join(exp, f))]
instr = "../instrumentation"
instr_dirs = [os.path.abspath("/".join([instr, f, "src"])) for f in listdir(instr) if isdir(join(instr, f))]
instr_genai = "../instrumentation-genai"
instr_genai_dirs = [
os.path.abspath("/".join([instr_genai, f, "src"])) for f in listdir(instr_genai) if isdir(join(instr_genai, f))
]
prop = "../propagator"
prop_dirs = [os.path.abspath("/".join([prop, f, "src"])) for f in listdir(prop) if isdir(join(prop, f))]
sdk_ext = "../sdk-extension"
sdk_ext_dirs = [os.path.abspath("/".join([sdk_ext, f, "src"])) for f in listdir(sdk_ext) if isdir(join(sdk_ext, f))]
resource = "../resource"
resource_dirs = [os.path.abspath("/".join([resource, f, "src"])) for f in listdir(resource) if isdir(join(resource, f))]
util = "../util"
util_dirs = [os.path.abspath("/".join([util, f, "src"])) for f in listdir(util) if isdir(join(util, f))]
opamp = "../opamp"
opamp_dirs = [os.path.abspath("/".join([opamp, f, "src"])) for f in listdir(opamp) if isdir(join(opamp, f))]
sys.path[:0] = (
exp_dirs + instr_dirs + instr_genai_dirs + sdk_ext_dirs + prop_dirs + resource_dirs + util_dirs + opamp_dirs
)
# -- Project information -----------------------------------------------------
project = "OpenTelemetry Python Contrib"
copyright = "OpenTelemetry Authors" # pylint: disable=redefined-builtin
author = "OpenTelemetry Authors"
# -- General configuration ---------------------------------------------------
# Easy automatic cross-references for `code in backticks`
default_role = "any"
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
# API doc generation
"sphinx.ext.autodoc",
# Support for google-style docstrings
"sphinx.ext.napoleon",
# Infer types from hints instead of docstrings
"sphinx_autodoc_typehints",
# Add links to source from generated docs
"sphinx.ext.viewcode",
# Link to other sphinx docs
"sphinx.ext.intersphinx",
# Add a .nojekyll file to the generated HTML docs
# https://help.github.com/en/articles/files-that-start-with-an-underscore-are-missing
"sphinx.ext.githubpages",
# Support external links to different versions in the Github repo
"sphinx.ext.extlinks",
]
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"psycopg": ("https://www.psycopg.org/psycopg3/docs/", None),
"psycopg2": ("https://www.psycopg.org/docs/", None),
"opentracing": (
"https://opentracing-python.readthedocs.io/en/latest/",
None,
),
"aiohttp": ("https://docs.aiohttp.org/en/stable/", None),
"wrapt": ("https://wrapt.readthedocs.io/en/latest/", None),
"pymongo": ("https://pymongo.readthedocs.io/en/stable/", None),
"opentelemetry": (
"https://opentelemetry-python.readthedocs.io/en/latest/",
None,
),
"redis": ("https://redis.readthedocs.io/en/latest/", None),
"fsspec": ("https://filesystem-spec.readthedocs.io/en/latest/", None),
}
# http://www.sphinx-doc.org/en/master/config.html#confval-nitpicky
# Sphinx will warn about all references where the target cannot be found.
nitpicky = True
# Sphinx does not recognize generic type TypeVars
# Container supposedly were fixed, but does not work
# https://github.com/sphinx-doc/sphinx/pull/3744
nitpick_ignore = [
(
"py:class",
"opamp_pb2.RemoteConfigStatus",
),
(
"py:class",
"opamp_pb2.EffectiveConfig",
),
(
"py:class",
"opamp_pb2.AgentRemoteConfig",
),
]
cfg = ConfigParser()
cfg.read("./nitpick-exceptions.ini")
mcfg = cfg["default"]
def getlistcfg(strval):
return [val.strip() for line in strval.split("\n") for val in line.split(",") if val.strip()]
ignore_categories = [
"py-class",
"py-func",
"py-exc",
"py-obj",
"py-data",
"any",
]
for category in ignore_categories:
if category in mcfg:
items = getlistcfg(mcfg[category])
for item in items:
nitpick_ignore.append((category.replace("-", ":"), item))
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
autodoc_default_options = {
"members": True,
"undoc-members": True,
"show-inheritance": True,
"member-order": "bysource",
}
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []
# Support external links to specific versions of the files in the Github repo
branch = os.environ.get("READTHEDOCS_VERSION")
if branch is None or branch == "latest":
branch = "main"
REPO = "open-telemetry/opentelemetry-python-contrib/"
scm_raw_web = "https://raw.githubusercontent.com/" + REPO + branch
scm_web = "https://github.com/" + REPO + "blob/" + branch
# Store variables in the epilogue so they are globally available.
rst_epilog = f"""
.. |SCM_WEB| replace:: {scm_web}
.. |SCM_RAW_WEB| replace:: {scm_raw_web}
.. |SCM_BRANCH| replace:: {branch}
"""
# used to have links to repo files
extlinks = {
"scm_raw_web": (scm_raw_web + "/%s", "scm_raw_web"),
"scm_web": (scm_web + "/%s", "scm_web"),
}
opentelemetry-python-contrib-0.66b2/docs/index.rst 0000664 0000000 0000000 00000006121 15270700723 0022336 0 ustar 00root root 0000000 0000000 OpenTelemetry-Python-Contrib
============================
Complimentary instrumentation and vendor-specific packages for use with the
Python `OpenTelemetry `_ client.
.. image:: https://img.shields.io/badge/slack-chat-green.svg
:target: https://cloud-native.slack.com/archives/C01PD4HUVBL
:alt: Slack Chat
**Please note** that this library is currently in _beta_, and shouldn't
generally be used in production environments.
Installation
------------
There are several complimentary packages available on PyPI which can be
installed separately via pip:
.. code-block:: sh
pip install opentelemetry-exporter-{exporter}
pip install opentelemetry-instrumentation-{instrumentation}
pip install opentelemetry-sdk-extension-{sdk-extension}
A complete list of packages can be found at the
`Contrib repo instrumentation `_
and `Contrib repo exporter `_ directories.
Extensions
----------
Visit `OpenTelemetry Registry `_ to
find a lot of related projects like exporters, instrumentation libraries, tracer
implementations, resource, etc.
Installing Cutting Edge Packages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
While the project is pre-1.0, there may be significant functionality that
has not yet been released to PyPI. In that situation, you may want to
install the packages directly from the repo. This can be done by cloning the
repository and doing an `editable
install `_:
.. code-block:: sh
git clone https://github.com/open-telemetry/opentelemetry-python-contrib.git
cd opentelemetry-python-contrib
pip install -e ./instrumentation/opentelemetry-instrumentation-flask
pip install -e ./instrumentation/opentelemetry-instrumentation-botocore
pip install -e ./sdk-extension/opentelemetry-sdk-extension-aws
pip install -e ./resource/opentelemetry-resource-detector-containerid
.. toctree::
:maxdepth: 2
:caption: OpenTelemetry Instrumentations
:name: Instrumentations
:glob:
instrumentation/**
.. toctree::
:maxdepth: 2
:caption: OpenTelemetry Generative AI Instrumentations
:name: Generative AI Instrumentations
:glob:
instrumentation-genai/**
.. toctree::
:maxdepth: 2
:caption: OpenTelemetry Propagators
:name: Propagators
:glob:
propagator/**
.. toctree::
:maxdepth: 2
:caption: OpenTelemetry Performance
:name: Performance
:glob:
performance/**
.. toctree::
:maxdepth: 2
:caption: OpenTelemetry SDK Extensions
:name: SDK Extensions
:glob:
sdk-extension/**
.. toctree::
:maxdepth: 2
:caption: OpenTelemetry Resource Detectors
:name: Resource Detectors
:glob:
resource/**
.. toctree::
:maxdepth: 2
:caption: OpAMP
:name: OpAMP
:glob:
opamp/**
Indices and tables
------------------
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
opentelemetry-python-contrib-0.66b2/docs/instrumentation-genai/ 0000775 0000000 0000000 00000000000 15270700723 0025021 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation-genai/openai.rst 0000664 0000000 0000000 00000000316 15270700723 0027026 0 ustar 00root root 0000000 0000000 OpenTelemetry Python - OpenAI Instrumentation
=============================================
.. automodule:: opentelemetry.instrumentation.openai_v2
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation-genai/util.rst 0000664 0000000 0000000 00000001274 15270700723 0026534 0 ustar 00root root 0000000 0000000 OpenTelemetry Python - GenAI Util
=================================
.. automodule:: opentelemetry.util.genai
:members:
:undoc-members:
:show-inheritance:
.. automodule:: opentelemetry.util.genai.utils
:members:
:undoc-members:
:show-inheritance:
.. automodule:: opentelemetry.util.genai.types
:members:
:undoc-members:
:show-inheritance:
.. automodule:: opentelemetry.util.genai.environment_variables
:members:
:undoc-members:
:show-inheritance:
.. automodule:: opentelemetry.util.genai.completion_hook
:members:
:undoc-members:
:show-inheritance:
.. automodule:: opentelemetry.util.genai._upload
:members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/ 0000775 0000000 0000000 00000000000 15270700723 0023740 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/aio_pika/ 0000775 0000000 0000000 00000000000 15270700723 0025514 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/aio_pika/aio_pika.rst 0000664 0000000 0000000 00000000305 15270700723 0030020 0 ustar 00root root 0000000 0000000 OpenTelemetry aio pika Instrumentation
============================================
.. automodule:: opentelemetry.instrumentation.aio_pika
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/aiohttp_client/ 0000775 0000000 0000000 00000000000 15270700723 0026746 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/aiohttp_client/aiohttp_client.rst 0000664 0000000 0000000 00000000321 15270700723 0032502 0 ustar 00root root 0000000 0000000 OpenTelemetry aiohttp client Instrumentation
============================================
.. automodule:: opentelemetry.instrumentation.aiohttp_client
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/aiohttp_server/ 0000775 0000000 0000000 00000000000 15270700723 0026776 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/aiohttp_server/aiohttp_server.rst 0000664 0000000 0000000 00000000361 15270700723 0032566 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-aiohttp-server/README.rst
:end-before: References
.. automodule:: opentelemetry.instrumentation.aiohttp_server
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/aiokafka/ 0000775 0000000 0000000 00000000000 15270700723 0025506 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/aiokafka/aiokafka.rst 0000664 0000000 0000000 00000000356 15270700723 0030012 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-aiokafka/README.rst
:end-before: References
API
---
.. automodule:: opentelemetry.instrumentation.aiokafka
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/aiopg/ 0000775 0000000 0000000 00000000000 15270700723 0025037 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/aiopg/aiopg.rst 0000664 0000000 0000000 00000000266 15270700723 0026674 0 ustar 00root root 0000000 0000000 OpenTelemetry aiopg Instrumentation
===================================
.. automodule:: opentelemetry.instrumentation.aiopg
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/asgi/ 0000775 0000000 0000000 00000000000 15270700723 0024663 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/asgi/asgi.rst 0000664 0000000 0000000 00000000312 15270700723 0026334 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-asgi/README.rst
API
---
.. automodule:: opentelemetry.instrumentation.asgi
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/asyncclick/ 0000775 0000000 0000000 00000000000 15270700723 0026063 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/asyncclick/asyncclick.rst 0000664 0000000 0000000 00000000351 15270700723 0030737 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-asyncclick/README.rst
:end-before: References
.. automodule:: opentelemetry.instrumentation.asyncclick
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/asyncio/ 0000775 0000000 0000000 00000000000 15270700723 0025405 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/asyncio/asyncio.rst 0000664 0000000 0000000 00000000513 15270700723 0027603 0 ustar 00root root 0000000 0000000 OpenTelemetry asyncio Instrumentation
==============================================
.. automodule:: opentelemetry.instrumentation.asyncio
:members:
:undoc-members:
:show-inheritance:
.. automodule:: opentelemetry.instrumentation.asyncio.environment_variables
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/asyncpg/ 0000775 0000000 0000000 00000000000 15270700723 0025404 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/asyncpg/asyncpg.rst 0000664 0000000 0000000 00000000335 15270700723 0027603 0 ustar 00root root 0000000 0000000 OpenTelemetry asyncpg Instrumentation
=====================================
Module contents
---------------
.. automodule:: opentelemetry.instrumentation.asyncpg
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/aws_lambda/ 0000775 0000000 0000000 00000000000 15270700723 0026032 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/aws_lambda/aws_lambda.rst 0000664 0000000 0000000 00000000305 15270700723 0030654 0 ustar 00root root 0000000 0000000 OpenTelemetry AWS lambda Instrumentation
==========================================
.. automodule:: opentelemetry.instrumentation.aws_lambda
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/base/ 0000775 0000000 0000000 00000000000 15270700723 0024652 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/base/instrumentation.rst 0000664 0000000 0000000 00000000424 15270700723 0030647 0 ustar 00root root 0000000 0000000 .. include:: ../../../opentelemetry-instrumentation/README.rst
:end-before: References
API
---
.. automodule:: opentelemetry.instrumentation
:members:
:undoc-members:
:show-inheritance:
Submodules
----------
.. toctree::
:maxdepth: 1
instrumentor
opentelemetry-python-contrib-0.66b2/docs/instrumentation/base/instrumentor.rst 0000664 0000000 0000000 00000000333 15270700723 0030154 0 ustar 00root root 0000000 0000000 opentelemetry.instrumentation.instrumentor package
==================================================
.. automodule:: opentelemetry.instrumentation.instrumentor
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/boto3sqs/ 0000775 0000000 0000000 00000000000 15270700723 0025515 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/boto3sqs/boto3sqs.rst 0000664 0000000 0000000 00000000311 15270700723 0030017 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-boto3sqs/README.rst
.. automodule:: opentelemetry.instrumentation.boto3sqs
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/botocore/ 0000775 0000000 0000000 00000000000 15270700723 0025554 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/botocore/botocore.rst 0000664 0000000 0000000 00000000277 15270700723 0030130 0 ustar 00root root 0000000 0000000 OpenTelemetry Botocore Instrumentation
======================================
.. automodule:: opentelemetry.instrumentation.botocore
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/cassandra/ 0000775 0000000 0000000 00000000000 15270700723 0025677 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/cassandra/cassandra.rst 0000664 0000000 0000000 00000000302 15270700723 0030363 0 ustar 00root root 0000000 0000000 OpenTelemetry Cassandra Instrumentation
=======================================
.. automodule:: opentelemetry.instrumentation.cassandra
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/celery/ 0000775 0000000 0000000 00000000000 15270700723 0025223 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/celery/celery.rst 0000664 0000000 0000000 00000000271 15270700723 0027240 0 ustar 00root root 0000000 0000000 OpenTelemetry Celery Instrumentation
====================================
.. automodule:: opentelemetry.instrumentation.celery
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/click/ 0000775 0000000 0000000 00000000000 15270700723 0025025 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/click/click.rst 0000664 0000000 0000000 00000000337 15270700723 0026647 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-click/README.rst
:end-before: References
.. automodule:: opentelemetry.instrumentation.click
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/confluent_kafka/ 0000775 0000000 0000000 00000000000 15270700723 0027072 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/confluent_kafka/confluent_kafka.rst 0000664 0000000 0000000 00000000345 15270700723 0032760 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-confluent-kafka/README.rst
.. automodule:: opentelemetry.instrumentation.confluent_kafka
:members:
:undoc-members:
:show-inheritance:
:noindex:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/dbapi/ 0000775 0000000 0000000 00000000000 15270700723 0025017 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/dbapi/dbapi.rst 0000664 0000000 0000000 00000000304 15270700723 0026625 0 ustar 00root root 0000000 0000000 OpenTelemetry Database API Instrumentation
==========================================
.. automodule:: opentelemetry.instrumentation.dbapi
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/django/ 0000775 0000000 0000000 00000000000 15270700723 0025202 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/django/django.rst 0000664 0000000 0000000 00000000271 15270700723 0027176 0 ustar 00root root 0000000 0000000 OpenTelemetry Django Instrumentation
====================================
.. automodule:: opentelemetry.instrumentation.django
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/exceptions/ 0000775 0000000 0000000 00000000000 15270700723 0026121 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/exceptions/exceptions.rst 0000664 0000000 0000000 00000000305 15270700723 0031032 0 ustar 00root root 0000000 0000000 OpenTelemetry Exceptions Instrumentation
========================================
.. automodule:: opentelemetry.instrumentation.exceptions
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/falcon/ 0000775 0000000 0000000 00000000000 15270700723 0025202 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/falcon/falcon.rst 0000664 0000000 0000000 00000000271 15270700723 0027176 0 ustar 00root root 0000000 0000000 OpenTelemetry Falcon Instrumentation
====================================
.. automodule:: opentelemetry.instrumentation.falcon
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/fastapi/ 0000775 0000000 0000000 00000000000 15270700723 0025367 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/fastapi/fastapi.rst 0000664 0000000 0000000 00000000317 15270700723 0027551 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-fastapi/README.rst
API
---
.. automodule:: opentelemetry.instrumentation.fastapi
:members:
:undoc-members:
:show-inheritance: opentelemetry-python-contrib-0.66b2/docs/instrumentation/flask/ 0000775 0000000 0000000 00000000000 15270700723 0025040 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/flask/flask.rst 0000664 0000000 0000000 00000000266 15270700723 0026676 0 ustar 00root root 0000000 0000000 OpenTelemetry Flask Instrumentation
===================================
.. automodule:: opentelemetry.instrumentation.flask
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/grpc/ 0000775 0000000 0000000 00000000000 15270700723 0024673 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/grpc/grpc.rst 0000664 0000000 0000000 00000000321 15270700723 0026354 0 ustar 00root root 0000000 0000000 OpenTelemetry gRPC Instrumentation
==================================
Module contents
---------------
.. automodule:: opentelemetry.instrumentation.grpc
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/httpx/ 0000775 0000000 0000000 00000000000 15270700723 0025107 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/httpx/httpx.rst 0000664 0000000 0000000 00000000400 15270700723 0027002 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-httpx/README.rst
:end-before: References
API
---
.. automodule:: opentelemetry.instrumentation.httpx
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/jinja2/ 0000775 0000000 0000000 00000000000 15270700723 0025115 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/jinja2/jinja2.rst 0000664 0000000 0000000 00000000271 15270700723 0027024 0 ustar 00root root 0000000 0000000 OpenTelemetry Jinja2 Instrumentation
====================================
.. automodule:: opentelemetry.instrumentation.jinja2
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/kafka_python/ 0000775 0000000 0000000 00000000000 15270700723 0026416 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/kafka_python/kafka_python.rst 0000664 0000000 0000000 00000000357 15270700723 0031633 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-kafka-python/README.rst
:end-before: References
API
---
.. automodule:: opentelemetry.instrumentation.kafka
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/logging/ 0000775 0000000 0000000 00000000000 15270700723 0025366 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/logging/logging.rst 0000664 0000000 0000000 00000000274 15270700723 0027551 0 ustar 00root root 0000000 0000000 OpenTelemetry Logging Instrumentation
=====================================
.. automodule:: opentelemetry.instrumentation.logging
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/mysql/ 0000775 0000000 0000000 00000000000 15270700723 0025105 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/mysql/mysql.rst 0000664 0000000 0000000 00000000266 15270700723 0027010 0 ustar 00root root 0000000 0000000 OpenTelemetry MySQL Instrumentation
===================================
.. automodule:: opentelemetry.instrumentation.mysql
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/mysqlclient/ 0000775 0000000 0000000 00000000000 15270700723 0026304 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/mysqlclient/mysqlclient.rst 0000664 0000000 0000000 00000000310 15270700723 0031374 0 ustar 00root root 0000000 0000000 OpenTelemetry mysqlclient Instrumentation
=========================================
.. automodule:: opentelemetry.instrumentation.mysqlclient
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/pika/ 0000775 0000000 0000000 00000000000 15270700723 0024664 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/pika/pika.rst 0000664 0000000 0000000 00000000266 15270700723 0026346 0 ustar 00root root 0000000 0000000 OpenTelemetry Pika Instrumentation
=====================================
.. automodule:: opentelemetry.instrumentation.pika
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/psycopg/ 0000775 0000000 0000000 00000000000 15270700723 0025424 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/psycopg/psycopg.rst 0000664 0000000 0000000 00000000274 15270700723 0027645 0 ustar 00root root 0000000 0000000 OpenTelemetry Psycopg Instrumentation
=====================================
.. automodule:: opentelemetry.instrumentation.psycopg
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/psycopg2/ 0000775 0000000 0000000 00000000000 15270700723 0025506 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/psycopg2/psycopg2.rst 0000664 0000000 0000000 00000000277 15270700723 0030014 0 ustar 00root root 0000000 0000000 OpenTelemetry Psycopg2 Instrumentation
======================================
.. automodule:: opentelemetry.instrumentation.psycopg2
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/pymemcache/ 0000775 0000000 0000000 00000000000 15270700723 0026053 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/pymemcache/pymemcache.rst 0000664 0000000 0000000 00000000305 15270700723 0030716 0 ustar 00root root 0000000 0000000 OpenTelemetry pymemcache Instrumentation
========================================
.. automodule:: opentelemetry.instrumentation.pymemcache
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/pymongo/ 0000775 0000000 0000000 00000000000 15270700723 0025430 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/pymongo/pymongo.rst 0000664 0000000 0000000 00000000274 15270700723 0027655 0 ustar 00root root 0000000 0000000 OpenTelemetry pymongo Instrumentation
=====================================
.. automodule:: opentelemetry.instrumentation.pymongo
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/pymssql/ 0000775 0000000 0000000 00000000000 15270700723 0025450 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/pymssql/pymssql.rst 0000664 0000000 0000000 00000000274 15270700723 0027715 0 ustar 00root root 0000000 0000000 OpenTelemetry pymssql Instrumentation
=====================================
.. automodule:: opentelemetry.instrumentation.pymssql
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/pymysql/ 0000775 0000000 0000000 00000000000 15270700723 0025456 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/pymysql/pymysql.rst 0000664 0000000 0000000 00000000274 15270700723 0027731 0 ustar 00root root 0000000 0000000 OpenTelemetry PyMySQL Instrumentation
=====================================
.. automodule:: opentelemetry.instrumentation.pymysql
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/pyramid/ 0000775 0000000 0000000 00000000000 15270700723 0025405 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/pyramid/pyramid.rst 0000664 0000000 0000000 00000000274 15270700723 0027607 0 ustar 00root root 0000000 0000000 OpenTelemetry Pyramid Instrumentation
=====================================
.. automodule:: opentelemetry.instrumentation.pyramid
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/redis/ 0000775 0000000 0000000 00000000000 15270700723 0025046 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/redis/redis.rst 0000664 0000000 0000000 00000000353 15270700723 0026707 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-redis/README.rst
:end-before: References
Usage
-----
.. automodule:: opentelemetry.instrumentation.redis
:members:
:undoc-members:
:show-inheritance: opentelemetry-python-contrib-0.66b2/docs/instrumentation/remoulade/ 0000775 0000000 0000000 00000000000 15270700723 0025715 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/remoulade/remoulade.rst 0000664 0000000 0000000 00000000314 15270700723 0030422 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-remoulade/README.rst
.. automodule:: opentelemetry.instrumentation.remoulade
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/requests/ 0000775 0000000 0000000 00000000000 15270700723 0025613 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/requests/requests.rst 0000664 0000000 0000000 00000000277 15270700723 0030226 0 ustar 00root root 0000000 0000000 OpenTelemetry requests Instrumentation
======================================
.. automodule:: opentelemetry.instrumentation.requests
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/sqlalchemy/ 0000775 0000000 0000000 00000000000 15270700723 0026102 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/sqlalchemy/sqlalchemy.rst 0000664 0000000 0000000 00000000305 15270700723 0030774 0 ustar 00root root 0000000 0000000 OpenTelemetry SQLAlchemy Instrumentation
========================================
.. automodule:: opentelemetry.instrumentation.sqlalchemy
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/sqlite3/ 0000775 0000000 0000000 00000000000 15270700723 0025324 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/sqlite3/sqlite3.rst 0000664 0000000 0000000 00000000274 15270700723 0027445 0 ustar 00root root 0000000 0000000 OpenTelemetry SQLite3 Instrumentation
=====================================
.. automodule:: opentelemetry.instrumentation.sqlite3
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/starlette/ 0000775 0000000 0000000 00000000000 15270700723 0025747 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/starlette/starlette.rst 0000664 0000000 0000000 00000000323 15270700723 0030506 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-starlette/README.rst
API
---
.. automodule:: opentelemetry.instrumentation.starlette
:members:
:undoc-members:
:show-inheritance: opentelemetry-python-contrib-0.66b2/docs/instrumentation/structlog/ 0000775 0000000 0000000 00000000000 15270700723 0025766 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/structlog/structlog.rst 0000664 0000000 0000000 00000000302 15270700723 0030541 0 ustar 00root root 0000000 0000000 OpenTelemetry Structlog Instrumentation
=======================================
.. automodule:: opentelemetry.instrumentation.structlog
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/system_metrics/ 0000775 0000000 0000000 00000000000 15270700723 0027012 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/system_metrics/system_metrics.rst 0000664 0000000 0000000 00000000536 15270700723 0032622 0 ustar 00root root 0000000 0000000 OpenTelemetry system metrics Instrumentation
============================================
.. automodule:: opentelemetry.instrumentation.system_metrics
:members:
:undoc-members:
:show-inheritance:
.. automodule:: opentelemetry.instrumentation.system_metrics.environment_variables
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/threading/ 0000775 0000000 0000000 00000000000 15270700723 0025705 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/threading/threading.rst 0000664 0000000 0000000 00000000302 15270700723 0030377 0 ustar 00root root 0000000 0000000 OpenTelemetry Threading Instrumentation
=======================================
.. automodule:: opentelemetry.instrumentation.threading
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/tornado/ 0000775 0000000 0000000 00000000000 15270700723 0025406 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/tornado/tornado.rst 0000664 0000000 0000000 00000000275 15270700723 0027612 0 ustar 00root root 0000000 0000000 OpenTelemetry Tornado Instrumentation
======================================
.. automodule:: opentelemetry.instrumentation.tornado
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/tortoiseorm/ 0000775 0000000 0000000 00000000000 15270700723 0026326 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/tortoiseorm/tortoiseorm.rst 0000664 0000000 0000000 00000000317 15270700723 0031447 0 ustar 00root root 0000000 0000000 .. include:: ../../../instrumentation/opentelemetry-instrumentation-tortoiseorm/README.rst
.. automodule:: opentelemetry.instrumentation.tortoiseorm
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/urllib/ 0000775 0000000 0000000 00000000000 15270700723 0025231 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/urllib/urllib3.rst 0000664 0000000 0000000 00000000301 15270700723 0027331 0 ustar 00root root 0000000 0000000 OpenTelemetry urllib Instrumentation
============================================
.. automodule:: opentelemetry.instrumentation.urllib
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/urllib3/ 0000775 0000000 0000000 00000000000 15270700723 0025314 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/urllib3/urllib3.rst 0000664 0000000 0000000 00000000303 15270700723 0027416 0 ustar 00root root 0000000 0000000 OpenTelemetry urllib3 Instrumentation
============================================
.. automodule:: opentelemetry.instrumentation.urllib3
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/instrumentation/wsgi/ 0000775 0000000 0000000 00000000000 15270700723 0024711 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/instrumentation/wsgi/wsgi.rst 0000664 0000000 0000000 00000000263 15270700723 0026415 0 ustar 00root root 0000000 0000000 OpenTelemetry WSGI Instrumentation
==================================
.. automodule:: opentelemetry.instrumentation.wsgi
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/make.bat 0000664 0000000 0000000 00000001423 15270700723 0022102 0 ustar 00root root 0000000 0000000 @ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd
opentelemetry-python-contrib-0.66b2/docs/nitpick-exceptions.ini 0000664 0000000 0000000 00000005010 15270700723 0025012 0 ustar 00root root 0000000 0000000 [default]
py-class=
; TODO: Understand why sphinx is not able to find this local class
opentelemetry.propagators.textmap.CarrierT
opentelemetry.propagators.textmap.Setter
opentelemetry.propagators.textmap.Getter
opentelemetry.propagators.textmap.TextMapPropagator
; - AwsXRayPropagator
opentelemetry.propagators.textmap.DefaultGetter
; API
opentelemetry.propagators.textmap.Getter
; - AWSXRayPropagator
opentelemetry.sdk.trace.id_generator.IdGenerator
opentelemetry.instrumentation.confluent_kafka.ProxiedProducer
opentelemetry.instrumentation.confluent_kafka.ProxiedConsumer
opentelemetry.instrumentation.instrumentor.BaseInstrumentor
; - AwsXRayIdGenerator
TextMapPropagator
CarrierT
Setter
Getter
; - AwsXRayPropagator.extract
; httpx changes __module__ causing Sphinx to error and no Sphinx site is available
httpx.Client
httpx.AsyncClient
httpx.BaseTransport
httpx2.BaseTransport
openai.BaseTransport
httpx.AsyncBaseTransport
httpx2.AsyncBaseTransport
httpx.SyncByteStream
httpx.AsyncByteStream
httpx.Response
httpx.URL
httpx.Headers
aiohttp.web_request.Request
celery.worker.request.Request
yarl.URL
cimpl.Producer
cimpl.Consumer
func
Message
TopicPartition
callable
Consumer
confluent_kafka.Message
psycopg.Connection
psycopg.AsyncConnection
ObjectProxy
wrapt.proxies.ObjectProxy
_wrappers.ObjectProxy
fastapi.applications.FastAPI
starlette.applications.Starlette
_contextvars.Token
opentelemetry.instrumentation.httpx._SyncOpenTelemetryTransportBase
opentelemetry.instrumentation.httpx._AsyncOpenTelemetryTransportBase
opentelemetry.instrumentation.httpx._BaseHTTPXClientInstrumentor
any=
; API
opentelemetry.propagators.textmap.TextMapPropagator.fields
; - AWSXRayPropagator
TraceId
; - AwsXRayIdGenerator
TraceIdRatioBased
; - AwsXRayIdGenerator
; SDK
SpanProcessor
TracerProvider
; - AwsXRayIdGenerator
; Instrumentation
BaseInstrumentor
; - instrumentation.*
Setter
httpx
instrument
__iter__
list.__iter__
__getitem__
list.__getitem__
SQS.ReceiveMessage
py-obj=
opentelemetry.propagators.textmap.CarrierT
opentelemetry.instrumentation.dbapi.ConnectionT
opentelemetry.instrumentation.dbapi.CursorT
py-data=
typing.Union
typing.Optional
py-func=
poll
flush
Message.error
py-exc=
KafkaException
KafkaError
opentelemetry-python-contrib-0.66b2/docs/opamp/ 0000775 0000000 0000000 00000000000 15270700723 0021611 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/opamp/client.rst 0000664 0000000 0000000 00000000247 15270700723 0023624 0 ustar 00root root 0000000 0000000 OpenTelemetry Python - OpAMP Client
===================================
.. automodule:: opentelemetry._opamp
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/performance/ 0000775 0000000 0000000 00000000000 15270700723 0022776 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/performance/benchmarks.rst 0000664 0000000 0000000 00000000657 15270700723 0025655 0 ustar 00root root 0000000 0000000 Performance Tests - Benchmarks
==============================
For instructions on running and writing benchmarks locally, see the
`Benchmarks section of CONTRIBUTING.md `_.
Live benchmark results are published at
`opentelemetry.io/docs/languages/python/benchmarks `_.
opentelemetry-python-contrib-0.66b2/docs/propagator/ 0000775 0000000 0000000 00000000000 15270700723 0022653 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/propagator/aws/ 0000775 0000000 0000000 00000000000 15270700723 0023445 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/propagator/aws/aws.rst 0000664 0000000 0000000 00000000277 15270700723 0024777 0 ustar 00root root 0000000 0000000 OpenTelemetry Python - AWS X-Ray Propagator
===========================================
.. automodule:: opentelemetry.propagators.aws
:members:
:undoc-members:
:show-inheritance: opentelemetry-python-contrib-0.66b2/docs/resource/ 0000775 0000000 0000000 00000000000 15270700723 0022324 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/resource/container/ 0000775 0000000 0000000 00000000000 15270700723 0024306 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/resource/container/container.rst 0000664 0000000 0000000 00000000346 15270700723 0027025 0 ustar 00root root 0000000 0000000 OpenTelemetry Python - Resource Detector for Containers
=======================================================
.. automodule:: opentelemetry.resource.detector.containerid
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/docs/sdk-extension/ 0000775 0000000 0000000 00000000000 15270700723 0023270 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/sdk-extension/aws/ 0000775 0000000 0000000 00000000000 15270700723 0024062 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/docs/sdk-extension/aws/aws.rst 0000664 0000000 0000000 00000000330 15270700723 0025402 0 ustar 00root root 0000000 0000000 OpenTelemetry Python - AWS SDK Extension
========================================
.. automodule:: opentelemetry.sdk.extension.aws.trace.aws_xray_id_generator
:members:
:undoc-members:
:show-inheritance:
opentelemetry-python-contrib-0.66b2/eachdist.ini 0000664 0000000 0000000 00000003641 15270700723 0022036 0 ustar 00root root 0000000 0000000 # These will be sorted first in that order.
# All packages that are depended upon by others should be listed here.
[DEFAULT]
ignore=
_template
sortfirst=
opentelemetry-instrumentation
util/opentelemetry-util-http
instrumentation/opentelemetry-instrumentation-wsgi
instrumentation/opentelemetry-instrumentation-dbapi
instrumentation/opentelemetry-instrumentation-asgi
instrumentation/opentelemetry-instrumentation-botocore
instrumentation/*
exporter/*
ext/*
[stable]
version=1.45.2
packages=
opentelemetry-sdk
opentelemetry-proto
opentelemetry-propagator-jaeger
opentelemetry-propagator-b3
opentelemetry-exporter-zipkin-proto-http
opentelemetry-exporter-zipkin-json
opentelemetry-exporter-zipkin
opentelemetry-exporter-otlp-proto-grpc
opentelemetry-exporter-otlp
opentelemetry-exporter-jaeger-thrift
opentelemetry-exporter-jaeger-proto-grpc
opentelemetry-exporter-jaeger
opentelemetry-api
opentelemetry-exporter-credential-provider-gcp
[prerelease]
version=0.66b2
packages=
all
opentelemetry-semantic-conventions
opentelemetry-test-utils
opentelemetry-instrumentation
opentelemetry-contrib-instrumentations
opentelemetry-distro
opentelemetry-resource-detector-containerid
[exclude_release]
packages=
opentelemetry-opamp-client
opentelemetry-instrumentation-valkey-py
opentelemetry-propagator-aws-xray
opentelemetry-resource-detector-azure
opentelemetry-resourcedetector-gcp
opentelemetry-sdk-extension-aws
opentelemetry-propagator-aws-xray
opentelemetry-instrumentation-vertexai
opentelemetry-instrumentation-openai-v2
opentelemetry-instrumentation-openai-agents-v2
opentelemetry-instrumentation-test
opentelemetry-util-genai
[lintroots]
extraroots=examples/*,scripts/
subglob=*.py,tests/,test/,src/*,examples/*
[testroots]
extraroots=examples/*,tests/
subglob=tests/,test/
opentelemetry-python-contrib-0.66b2/exporter/ 0000775 0000000 0000000 00000000000 15270700723 0021415 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-credential-provider-gcp/ 0000775 0000000 0000000 00000000000 15270700723 0032666 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-credential-provider-gcp/LICENSE 0000664 0000000 0000000 00000026135 15270700723 0033702 0 ustar 00root root 0000000 0000000 Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
README.rst 0000664 0000000 0000000 00000004354 15270700723 0034304 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-credential-provider-gcp OpenTelemetry GCP Credential Provider for OTLP Exporters
========================================================
.. image:: https://badge.fury.io/py/opentelemetry-exporter-credential-provider-gcp.svg
:target: https://badge.fury.io/py/opentelemetry-exporter-credential-provider-gcp
.. image:: https://readthedocs.org/projects/google-cloud-opentelemetry/badge/?version=latest
:target: https://google-cloud-opentelemetry.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
This library provides support for supplying your machine's Application Default Credentials (https://cloud.google.com/docs/authentication/application-default-credentials)
to the OTLP Exporters created automatically by OpenTelemetry Python's auto instrumentation.
These credentials authorize OTLP traces to be sent to `telemetry.googleapis.com`.
Currently `telemetry.googleapis.com` only supports OTLP traces, but eventually the endpoint will
support OTLP logs and metrics too.
To learn more about instrumentation and observability, including opinionated recommendations
for Google Cloud Observability, visit `Instrumentation and observability
`_.
For how to export trace data when you use manual instrumentation visit `Migrate from the Trace exporter to the OTLP endpoint
`_.
Installation
------------
.. code:: bash
pip install opentelemetry-exporter-credential-provider-gcp
Usage
-----
Your installed HTTP/GRPC OTLP Exporter must be at release `>=1.37` for this feature.
Set the following environment variables:
`export OTEL_RESOURCE_ATTRIBUTES="gcp.project_id="`
`export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://telemetry.googleapis.com:443/v1/traces"`
If you plan to have python auto instrumentation use the GRPC OTLP Exporter to send traces to Cloud Trace:
`export OTEL_PYTHON_EXPORTER_OTLP_GRPC_TRACES_CREDENTIAL_PROVIDER=gcp_grpc_credentials`
If you plan to have python auto instrumentation use the HTTP OTLP Exporter to send traces to Cloud Trace:
`export OTEL_PYTHON_EXPORTER_OTLP_HTTP_TRACES_CREDENTIAL_PROVIDER=gcp_http_credentials`
References
----------
* `OpenTelemetry Project `_
pyproject.toml 0000664 0000000 0000000 00000003171 15270700723 0035525 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-credential-provider-gcp [build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "opentelemetry-exporter-credential-provider-gcp"
dynamic = ["version"]
description = "GCP OTLP Exporter Credential Provider for OpenTelemetry"
readme = "README.rst"
license = "Apache-2.0"
requires-python = ">=3.10"
authors = [
{ name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"grpcio >= 1.67.0",
"google-auth >= 2.25",
"requests >= 2.7",
]
[project.entry-points.opentelemetry_otlp_credential_provider]
gcp_grpc_credentials = "opentelemetry.gcp_credential_provider:create_google_grpc_credentials"
gcp_http_credentials = "opentelemetry.gcp_credential_provider:create_google_authorized_session"
[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/exporter/opentelemetry-exporter-credential-provider-gcp"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"
[tool.hatch.version]
path = "src/opentelemetry/gcp_credential_provider/version.py"
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
]
[tool.hatch.build.targets.wheel]
packages = ["src/opentelemetry"]
opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-credential-provider-gcp/src/ 0000775 0000000 0000000 00000000000 15270700723 0033455 5 ustar 00root root 0000000 0000000 opentelemetry/ 0000775 0000000 0000000 00000000000 15270700723 0036272 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-credential-provider-gcp/src gcp_credential_provider/ 0000775 0000000 0000000 00000000000 15270700723 0043147 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-credential-provider-gcp/src/opentelemetry __init__.py 0000664 0000000 0000000 00000001444 15270700723 0045263 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-credential-provider-gcp/src/opentelemetry/gcp_credential_provider # Copyright 2025 Google LLC
# SPDX-License-Identifier: Apache-2.0
import google.auth
import grpc
import requests
from google.auth.transport.grpc import AuthMetadataPlugin
from google.auth.transport.requests import AuthorizedSession, Request
# pyright: reportUnknownMemberType=false, reportUnknownArgumentType=false, reportUnknownVariableType=false
def create_google_grpc_credentials() -> grpc.ChannelCredentials:
credentials, _ = google.auth.default()
return grpc.composite_channel_credentials(
grpc.ssl_channel_credentials(),
grpc.metadata_call_credentials(AuthMetadataPlugin(credentials=credentials, request=Request())),
)
def create_google_authorized_session() -> requests.Session:
credentials, _ = google.auth.default()
return AuthorizedSession(credentials)
version.py 0000664 0000000 0000000 00000000144 15270700723 0045205 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-credential-provider-gcp/src/opentelemetry/gcp_credential_provider # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
__version__ = "0.66b2"
test-requirements.txt 0000664 0000000 0000000 00000000203 15270700723 0037043 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-credential-provider-gcp pytest==7.4.4
opentelemetry-exporter-otlp-proto-http==1.37
opentelemetry-exporter-otlp-proto-common==1.37
opentelemetry-proto==1.37 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-credential-provider-gcp/tests/ 0000775 0000000 0000000 00000000000 15270700723 0034030 5 ustar 00root root 0000000 0000000 test_credential_provider.py 0000664 0000000 0000000 00000003060 15270700723 0041405 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-credential-provider-gcp/tests # Copyright 2023 Google LLC
# SPDX-License-Identifier: Apache-2.0
from os import environ
from unittest import TestCase
from unittest.mock import MagicMock, patch
from google.auth.transport.requests import AuthorizedSession
from opentelemetry.exporter.otlp.proto.http.trace_exporter import (
OTLPSpanExporter,
)
from opentelemetry.sdk.environment_variables import (
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_TRACES_CREDENTIAL_PROVIDER,
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_TRACES_CREDENTIAL_PROVIDER,
)
# pyright: reportUnknownMemberType=false, reportUnknownVariableType=false, reportMissingImports=false, reportUntypedFunctionDecorator=false
class TestOTLPTraceAutoInstrumentGcpCredential(TestCase):
@patch("google.auth.default")
@patch.dict(
environ,
{
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_TRACES_CREDENTIAL_PROVIDER: "gcp_http_credentials",
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_TRACES_CREDENTIAL_PROVIDER: "gcp_grpc_credentials",
},
)
def test_loads_otlp_exporters_with_google_creds(self, mock_default: MagicMock): # pylint: disable=no-self-use
"""Test that OTel configuration internals can load the credentials from entrypoint by
name"""
mock_credentials = MagicMock()
mock_credentials.project_id = "test-project"
mock_default.return_value = (mock_credentials, "test-project")
http_exporter = OTLPSpanExporter()
assert isinstance(http_exporter._session, AuthorizedSession)
# Assert that google.auth.default was called
mock_default.assert_called_once()
opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/ 0000775 0000000 0000000 00000000000 15270700723 0032771 5 ustar 00root root 0000000 0000000 README.rst 0000664 0000000 0000000 00000001675 15270700723 0034412 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write OpenTelemetry Prometheus Remote Write Exporter
==============================================
|pypi|
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-exporter-prometheus-remote-write.svg
:target: https://pypi.org/project/opentelemetry-exporter-prometheus-remote-write/
This package contains an exporter to send metrics from the OpenTelemetry Python SDK directly to a Prometheus Remote Write integrated backend
(such as Cortex or Thanos) without having to run an instance of the Prometheus server.
Installation
------------
::
pip install opentelemetry-exporter-prometheus-remote-write
.. _OpenTelemetry: https://github.com/open-telemetry/opentelemetry-python/
.. _Prometheus Remote Write integrated backend: https://prometheus.io/docs/operating/integrations/
References
----------
* `OpenTelemetry Project `_
* `Prometheus Remote Write Integration `_
opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/example/0000775 0000000 0000000 00000000000 15270700723 0034424 5 ustar 00root root 0000000 0000000 Dockerfile 0000664 0000000 0000000 00000000322 15270700723 0036334 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/example FROM python:3.10
RUN apt-get update -y && apt-get install libsnappy-dev -y
WORKDIR /code
COPY . .
RUN pip install -e .
RUN pip install -r ./example/requirements.txt
CMD ["python", "./example/sampleapp.py"]
README.md 0000664 0000000 0000000 00000003745 15270700723 0035635 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/example # Prometheus Remote Write Exporter Example
This example uses [Docker Compose](https://docs.docker.com/compose/) to set up:
1. A Python program that creates 5 instruments with 5 unique
aggregators and a randomized load generator
2. An instance of [Cortex](https://cortexmetrics.io/) to receive the metrics
data
3. An instance of [Grafana](https://grafana.com/) to visualizse the exported
data
## Requirements
* Have Docker Compose [installed](https://docs.docker.com/compose/install/)
*Users do not need to install Python as the app will be run in the Docker Container*
## Instructions
1. Run `docker-compose up -d` in the the `example/` directory
The `-d` flag causes all services to run in detached mode and frees up your
terminal session. This also causes no logs to show up. Users can attach themselves to the service's logs manually using `docker logs ${CONTAINER_ID} --follow`
2. Log into the Grafana instance at [http://localhost:3000](http://localhost:3000)
* login credentials are `username: admin` and `password: admin`
* There may be an additional screen on setting a new password. This can be skipped and is optional
3. Navigate to the `Data Sources` page
* Look for a gear icon on the left sidebar and select `Data Sources`
4. Add a new Prometheus Data Source
* Use `http://cortex:9009/api/prom` as the URL
* (OPTIONAl) set the scrape interval to `2s` to make updates appear quickly
* click `Save & Test`
5. Go to `Metrics Explore` to query metrics
* Look for a compass icon on the left sidebar
* click `Metrics` for a dropdown list of all the available metrics
* (OPTIONAL) Adjust time range by clicking the `Last 6 hours` button on the upper right side of the graph
* (OPTIONAL) Set up auto-refresh by selecting an option under the dropdown next to the refresh button on the upper right side of the graph
* Click the refresh button and data should show up on the graph
6. Shutdown the services when finished
* Run `docker-compose down` in the example directory
cortex-config.yml 0000664 0000000 0000000 00000005161 15270700723 0037642 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/example # This Cortex Config is copied from the Cortex Project documentation
# Source: https://github.com/cortexproject/cortex/blob/master/docs/configuration/single-process-config.yaml
# Configuration for running Cortex in single-process mode.
# This configuration should not be used in production.
# It is only for getting started and development.
# Disable the requirement that every request to Cortex has a
# X-Scope-OrgID header. `fake` will be substituted in instead.
# pylint: skip-file
auth_enabled: false
server:
http_listen_port: 9009
# Configure the server to allow messages up to 100MB.
grpc_server_max_recv_msg_size: 104857600
grpc_server_max_send_msg_size: 104857600
grpc_server_max_concurrent_streams: 1000
distributor:
shard_by_all_labels: true
pool:
health_check_ingesters: true
ingester_client:
grpc_client_config:
# Configure the client to allow messages up to 100MB.
max_recv_msg_size: 104857600
max_send_msg_size: 104857600
use_gzip_compression: true
ingester:
# We want our ingesters to flush chunks at the same time to optimise
# deduplication opportunities.
spread_flushes: true
chunk_age_jitter: 0
walconfig:
wal_enabled: true
recover_from_wal: true
wal_dir: /tmp/cortex/wal
lifecycler:
# The address to advertise for this ingester. Will be autodiscovered by
# looking up address on eth0 or en0; can be specified if this fails.
# address: 127.0.0.1
# We want to start immediately and flush on shutdown.
join_after: 0
min_ready_duration: 0s
final_sleep: 0s
num_tokens: 512
tokens_file_path: /tmp/cortex/wal/tokens
# Use an in memory ring store, so we don't need to launch a Consul.
ring:
kvstore:
store: inmemory
replication_factor: 1
# Use local storage - BoltDB for the index, and the filesystem
# for the chunks.
schema:
configs:
- from: 2019-07-29
store: boltdb
object_store: filesystem
schema: v10
index:
prefix: index_
period: 1w
storage:
boltdb:
directory: /tmp/cortex/index
filesystem:
directory: /tmp/cortex/chunks
delete_store:
store: boltdb
purger:
object_store_type: filesystem
frontend_worker:
# Configure the frontend worker in the querier to match worker count
# to max_concurrent on the queriers.
match_max_concurrent: true
# Configure the ruler to scan the /tmp/cortex/rules directory for prometheus
# rules: https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules
ruler:
enable_api: true
enable_sharding: false
storage:
type: local
local:
directory: /tmp/cortex/rules
docker-compose.yml 0000664 0000000 0000000 00000001731 15270700723 0040004 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/example # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: "3.8"
services:
cortex:
image: quay.io/cortexproject/cortex:v1.5.0
command:
- -config.file=./config/cortex-config.yml
volumes:
- ./cortex-config.yml:/config/cortex-config.yml:ro
ports:
- 9009:9009
grafana:
image: grafana/grafana:latest
ports:
- 3000:3000
sample_app:
build:
context: ../
dockerfile: ./example/Dockerfile
requirements.txt 0000664 0000000 0000000 00000000166 15270700723 0037634 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/example psutil
protobuf>=3.13.0
requests>=2.25.0
python-snappy>=0.5.4
opentelemetry-api
opentelemetry-sdk
opentelemetry-proto
sampleapp.py 0000664 0000000 0000000 00000005223 15270700723 0036703 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/example # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
import logging
import random
import sys
import time
from logging import INFO
import psutil
from opentelemetry import metrics
from opentelemetry.exporter.prometheus_remote_write import (
PrometheusRemoteWriteMetricsExporter,
)
from opentelemetry.metrics import Observation
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logger = logging.getLogger(__name__)
testing_labels = {"environment": "testing"}
exporter = PrometheusRemoteWriteMetricsExporter(
endpoint="http://cortex:9009/api/prom/push",
headers={"X-Scope-Org-ID": "5"},
)
reader = PeriodicExportingMetricReader(exporter, 1000)
provider = MeterProvider(metric_readers=[reader])
metrics.set_meter_provider(provider)
meter = metrics.get_meter(__name__)
# Callback to gather cpu usage
def get_cpu_usage_callback(observer):
for number, percent in enumerate(psutil.cpu_percent(percpu=True)):
labels = {"cpu_number": str(number)}
yield Observation(percent, labels)
# Callback to gather RAM usage
def get_ram_usage_callback(observer):
ram_percent = psutil.virtual_memory().percent
yield Observation(ram_percent, {})
requests_counter = meter.create_counter(
name="requests",
description="number of requests",
unit="1",
)
request_min_max = meter.create_counter(
name="requests_min_max",
description="min max sum count of requests",
unit="1",
)
request_last_value = meter.create_counter(
name="requests_last_value",
description="last value number of requests",
unit="1",
)
requests_active = meter.create_up_down_counter(
name="requests_active",
description="number of active requests",
unit="1",
)
meter.create_observable_counter(
callbacks=[get_ram_usage_callback],
name="ram_usage",
description="ram usage",
unit="1",
)
meter.create_observable_up_down_counter(
callbacks=[get_cpu_usage_callback],
name="cpu_percent",
description="per-cpu usage",
unit="1",
)
request_latency = meter.create_histogram("request_latency")
# Load generator
num = random.randint(0, 1000)
while True:
# counters
requests_counter.add(num % 131 + 200, testing_labels)
request_min_max.add(num % 181 + 200, testing_labels)
request_last_value.add(num % 101 + 200, testing_labels)
# updown counter
requests_active.add(num % 7231 + 200, testing_labels)
request_latency.record(num % 92, testing_labels)
logger.log(level=INFO, msg="completed metrics collection cycle")
time.sleep(1)
num += 9791
opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/proto/ 0000775 0000000 0000000 00000000000 15270700723 0034134 5 ustar 00root root 0000000 0000000 .gitignore 0000664 0000000 0000000 00000000016 15270700723 0036042 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/proto opentelemetry
README.md 0000664 0000000 0000000 00000000342 15270700723 0035333 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/proto ## Instructions
1. Install protobuf tools. Can use your package manager or download from [GitHub](https://github.com/protocolbuffers/protobuf/releases/tag/v26.0)
2. Run `generate-proto-py.sh` from inside the `proto/` directory generate-proto-py.sh 0000775 0000000 0000000 00000004132 15270700723 0037775 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/proto #!/bin/bash
set -e
PROM_VERSION=v2.39.0
PROTO_VERSION=v1.3.2
# SRC_DIR is from protoc perspective. ie its the destination for our checkouts/clones
SRC_DIR=opentelemetry/exporter/prometheus_remote_write/gen/
#TODO:
# Check that black & protoc are installed properly
echo "Creating our destination directory"
mkdir -p ${SRC_DIR}/gogoproto
# Clone prometheus
echo "Grabbing Prometheus protobuf files"
git clone --filter=blob:none --sparse https://github.com/prometheus/prometheus.git
cd prometheus
git checkout ${PROM_VERSION}
git sparse-checkout set prompb
cd ..
# We also need gogo.proto which is in the protobuf Repo
# Could also try to pull this locally from the install location of protobuf
# but that will be harder in a platform agnostic way.
echo "Grabbing gogo.proto"
git clone --filter=blob:none --sparse https://github.com/gogo/protobuf.git
cd protobuf
git checkout ${PROTO_VERSION}
git sparse-checkout set /gogoproto/gogo.proto
cd ..
# Move the proto files into our structure
echo "Moving proto files to ${SRC_DIR}"
cp prometheus/prompb/remote.proto prometheus/prompb/types.proto ${SRC_DIR}
cp protobuf/gogoproto/gogo.proto ${SRC_DIR}/gogoproto/
# A bit of a hack, but we need to fix the imports to fit the python structure.
# using sed to find the 3 files and point them at each other using OUR structure
echo "Fixing imports"
sed -i 's/import "types.proto";/import "opentelemetry\/exporter\/prometheus_remote_write\/gen\/types.proto";/' ${SRC_DIR}/remote.proto
sed -i 's/import "gogoproto\/gogo.proto";/import "opentelemetry\/exporter\/prometheus_remote_write\/gen\/gogoproto\/gogo.proto";/' ${SRC_DIR}/remote.proto
sed -i 's/import "gogoproto\/gogo.proto";/import "opentelemetry\/exporter\/prometheus_remote_write\/gen\/gogoproto\/gogo.proto";/' ${SRC_DIR}/types.proto
# Cleanup the repos
echo "Removing clones..."
rm -rf protobuf prometheus
# Used libprotoc 26
echo "Compiling proto files to Python"
protoc -I . --python_out=../src ${SRC_DIR}/gogoproto/gogo.proto ${SRC_DIR}/remote.proto ${SRC_DIR}/types.proto
echo "Running formatting on the generated files"
../../../scripts/eachdist.py format --path $PWD/..
pyproject.toml 0000664 0000000 0000000 00000002716 15270700723 0035634 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write [build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "opentelemetry-exporter-prometheus-remote-write"
dynamic = ["version"]
description = "Prometheus Remote Write Metrics Exporter for OpenTelemetry"
readme = "README.rst"
license = "Apache-2.0"
requires-python = ">=3.10"
authors = [
{ name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"protobuf >=5.26, <7.0",
"requests ~= 2.28",
"opentelemetry-api ~= 1.12",
"opentelemetry-sdk ~= 1.12",
"python-snappy ~= 0.6",
]
[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/exporter/opentelemetry-exporter-prometheus-remote-write"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"
[tool.hatch.version]
path = "src/opentelemetry/exporter/prometheus_remote_write/version.py"
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
]
[tool.hatch.build.targets.wheel]
packages = ["src/opentelemetry"]
opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/src/ 0000775 0000000 0000000 00000000000 15270700723 0033560 5 ustar 00root root 0000000 0000000 opentelemetry/ 0000775 0000000 0000000 00000000000 15270700723 0036375 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/src exporter/ 0000775 0000000 0000000 00000000000 15270700723 0040245 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry prometheus_remote_write/ 0000775 0000000 0000000 00000000000 15270700723 0045225 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter __init__.py 0000664 0000000 0000000 00000033124 15270700723 0047341 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
import logging
import re
from collections import defaultdict
from collections.abc import Mapping, Sequence
from itertools import chain
import requests
import snappy
from opentelemetry.exporter.prometheus_remote_write.gen.remote_pb2 import ( # pylint: disable=no-name-in-module
WriteRequest,
)
from opentelemetry.exporter.prometheus_remote_write.gen.types_pb2 import ( # pylint: disable=no-name-in-module
Label,
Sample,
TimeSeries,
)
from opentelemetry.sdk.metrics import (
Counter,
ObservableCounter,
ObservableGauge,
ObservableUpDownCounter,
UpDownCounter,
)
from opentelemetry.sdk.metrics import Histogram as ClientHistogram
from opentelemetry.sdk.metrics.export import (
AggregationTemporality,
Gauge,
Histogram,
Metric,
MetricExporter,
MetricExportResult,
MetricsData,
Sum,
)
logger = logging.getLogger(__name__)
PROMETHEUS_NAME_REGEX = re.compile(r"^\d|[^\w:]")
PROMETHEUS_LABEL_REGEX = re.compile(r"^\d|[^\w]")
UNDERSCORE_REGEX = re.compile(r"_+")
class PrometheusRemoteWriteMetricsExporter(MetricExporter):
"""
Prometheus remote write metric exporter for OpenTelemetry.
Args:
endpoint: url where data will be sent (Required)
basic_auth: username and password for authentication (Optional)
headers: additional headers for remote write request (Optional)
timeout: timeout for remote write requests in seconds, defaults to 30 (Optional)
proxies: dict mapping request proxy protocols to proxy urls (Optional)
tls_config: configuration for remote write TLS settings (Optional)
"""
def __init__(
self,
endpoint: str,
basic_auth: dict = None,
headers: dict = None,
timeout: int = 30,
tls_config: dict = None,
proxies: dict = None,
resources_as_labels: bool = True,
preferred_temporality: dict[type, AggregationTemporality] = None,
preferred_aggregation: dict = None,
):
self.endpoint = endpoint
self.basic_auth = basic_auth
self.headers = headers
self.timeout = timeout
self.tls_config = tls_config
self.proxies = proxies
self.resources_as_labels = resources_as_labels
if not preferred_temporality:
preferred_temporality = {
Counter: AggregationTemporality.CUMULATIVE,
UpDownCounter: AggregationTemporality.CUMULATIVE,
ClientHistogram: AggregationTemporality.CUMULATIVE,
ObservableCounter: AggregationTemporality.CUMULATIVE,
ObservableUpDownCounter: AggregationTemporality.CUMULATIVE,
ObservableGauge: AggregationTemporality.CUMULATIVE,
}
super().__init__(preferred_temporality, preferred_aggregation)
@property
def endpoint(self):
return self._endpoint
@endpoint.setter
def endpoint(self, endpoint: str):
if endpoint == "":
raise ValueError("endpoint required")
self._endpoint = endpoint
@property
def basic_auth(self):
return self._basic_auth
@basic_auth.setter
def basic_auth(self, basic_auth: dict):
if basic_auth:
if "username" not in basic_auth:
raise ValueError("username required in basic_auth")
if "password_file" in basic_auth:
if "password" in basic_auth:
raise ValueError("basic_auth cannot contain password and password_file")
with open( # pylint: disable=unspecified-encoding
basic_auth["password_file"]
) as file:
basic_auth["password"] = file.readline().strip()
elif "password" not in basic_auth:
raise ValueError("password required in basic_auth")
self._basic_auth = basic_auth
@property
def timeout(self):
return self._timeout
@timeout.setter
def timeout(self, timeout: int):
if timeout <= 0:
raise ValueError("timeout must be greater than 0")
self._timeout = timeout
@property
def tls_config(self):
return self._tls_config
@tls_config.setter
def tls_config(self, tls_config: dict):
if tls_config:
new_config = {}
if "ca_file" in tls_config:
new_config["ca_file"] = tls_config["ca_file"]
if "cert_file" in tls_config and "key_file" in tls_config:
new_config["cert_file"] = tls_config["cert_file"]
new_config["key_file"] = tls_config["key_file"]
elif "cert_file" in tls_config or "key_file" in tls_config:
raise ValueError("tls_config requires both cert_file and key_file")
if "insecure_skip_verify" in tls_config:
new_config["insecure_skip_verify"] = tls_config["insecure_skip_verify"]
self._tls_config = tls_config
@property
def proxies(self):
return self._proxies
@proxies.setter
def proxies(self, proxies: dict):
self._proxies = proxies
@property
def headers(self):
return self._headers
@headers.setter
def headers(self, headers: dict):
self._headers = headers
def export(
self,
metrics_data: MetricsData,
timeout_millis: float = 10_000,
**kwargs,
) -> MetricExportResult:
if not metrics_data:
return MetricExportResult.SUCCESS
timeseries = self._translate_data(metrics_data)
if not timeseries:
logger.error("All records contain unsupported aggregators, export aborted")
return MetricExportResult.FAILURE
message = self._build_message(timeseries)
headers = self._build_headers()
return self._send_message(message, headers)
def _translate_data(self, data: MetricsData) -> Sequence[TimeSeries]:
rw_timeseries = []
for resource_metrics in data.resource_metrics:
resource = resource_metrics.resource
# OTLP Data model suggests combining some attrs into job/instance
# Should we do that here?
if self.resources_as_labels:
resource_labels = [(n, str(v)) for n, v in resource.attributes.items()]
else:
resource_labels = []
# Scope name/version probably not too useful from a labeling perspective
for scope_metrics in resource_metrics.scope_metrics:
for metric in scope_metrics.metrics:
rw_timeseries.extend(self._parse_metric(metric, resource_labels))
return rw_timeseries
def _parse_metric(self, metric: Metric, resource_labels: Sequence) -> Sequence[TimeSeries]:
"""
Parses the Metric & lower objects, then converts the output into
OM TimeSeries. Returns a List of TimeSeries objects based on one Metric
"""
# Create the metric name, will be a label later
if metric.unit:
# Prom. naming guidelines add unit to the name
name = f"{metric.name}_{metric.unit}"
else:
name = metric.name
# datapoints have attributes associated with them. these would be sent
# to RW as different metrics: name & labels is a unique time series
sample_sets = defaultdict(list)
if isinstance(metric.data, (Gauge, Sum)):
for dp in metric.data.data_points:
attrs, sample = self._parse_data_point(dp, name)
sample_sets[attrs].append(sample)
elif isinstance(metric.data, Histogram):
for dp in metric.data.data_points:
dp_result = self._parse_histogram_data_point(dp, name)
for attrs, sample in dp_result:
sample_sets[attrs].append(sample)
else:
logger.warning("Unsupported Metric Type: %s", type(metric.data))
return []
return self._convert_to_timeseries(sample_sets, resource_labels)
def _convert_to_timeseries(
self, sample_sets: Mapping[tuple, Sequence], resource_labels: Sequence
) -> Sequence[TimeSeries]:
timeseries = []
for labels, samples in sample_sets.items():
ts = TimeSeries()
for label_name, label_value in sorted(chain(resource_labels, labels)):
# Previous implementation did not str() the names...
ts.labels.append(self._label(label_name, str(label_value)))
for value, timestamp in samples:
ts.samples.append(self._sample(value, timestamp))
timeseries.append(ts)
return timeseries
@staticmethod
def _sample(value: int, timestamp: int) -> Sample:
sample = Sample()
sample.value = value
sample.timestamp = timestamp
return sample
def _label(self, name: str, value: str) -> Label:
label = Label()
label.name = self._sanitize_string(name, "label")
label.value = value
return label
@staticmethod
def _sanitize_string(string: str, type_: str) -> str:
# I Think Prometheus requires names to NOT start with a number this
# would not catch that, but do cover the other cases. The naming rules
# don't explicit say this, but the supplied regex implies it.
# Got a little weird trying to do substitution with it, but can be
# fixed if we allow numeric beginnings to metric names
if type_ == "name":
sanitized = PROMETHEUS_NAME_REGEX.sub("_", string)
elif type_ == "label":
sanitized = PROMETHEUS_LABEL_REGEX.sub("_", string)
else:
raise TypeError(f"Unsupported string type: {type_}")
# Remove consecutive underscores
# TODO: Unfortunately this clobbbers __name__
# sanitized = UNDERSCORE_REGEX.sub("_",sanitized)
return sanitized
def _parse_histogram_data_point(self, data_point, name):
sample_attr_pairs = []
base_attrs = list(data_point.attributes.items())
timestamp = data_point.time_unix_nano // 1_000_000
def handle_bucket(value, bound=None, name_override=None):
# Metric Level attributes + the bucket boundary attribute + name
ts_attrs = base_attrs.copy()
ts_attrs.append(
(
"__name__",
self._sanitize_string(name_override or name, "name"),
)
)
if bound:
ts_attrs.append(("le", str(bound)))
# Value is count of values in each bucket
ts_sample = (value, timestamp)
return tuple(ts_attrs), ts_sample
for bound_pos, bound in enumerate(data_point.explicit_bounds):
sample_attr_pairs.append(handle_bucket(data_point.bucket_counts[bound_pos], bound))
# Add the last label for implicit +inf bucket
sample_attr_pairs.append(handle_bucket(data_point.bucket_counts[-1], bound="+Inf"))
# Lastly, add series for count & sum
sample_attr_pairs.append(handle_bucket(data_point.sum, name_override=f"{name}_sum"))
sample_attr_pairs.append(handle_bucket(data_point.count, name_override=f"{name}_count"))
return sample_attr_pairs
def _parse_data_point(self, data_point, name=None):
attrs = tuple(data_point.attributes.items()) + (("__name__", self._sanitize_string(name, "name")),)
sample = (data_point.value, (data_point.time_unix_nano // 1_000_000))
return attrs, sample
@staticmethod
def _build_message(timeseries: Sequence[TimeSeries]) -> bytes:
write_request = WriteRequest()
write_request.timeseries.extend(timeseries)
serialized_message = write_request.SerializeToString()
return snappy.compress(serialized_message)
def _build_headers(self) -> dict:
headers = {
"Content-Encoding": "snappy",
"Content-Type": "application/x-protobuf",
"X-Prometheus-Remote-Write-Version": "0.1.0",
}
if self.headers:
for header_name, header_value in self.headers.items():
headers[header_name] = header_value
return headers
def _send_message(self, message: bytes, headers: dict) -> MetricExportResult:
auth = None
if self.basic_auth:
auth = (self.basic_auth["username"], self.basic_auth["password"])
cert = None
verify = True
if self.tls_config:
if "ca_file" in self.tls_config:
verify = self.tls_config["ca_file"]
elif "insecure_skip_verify" in self.tls_config:
verify = self.tls_config["insecure_skip_verify"]
if "cert_file" in self.tls_config and "key_file" in self.tls_config:
cert = (
self.tls_config["cert_file"],
self.tls_config["key_file"],
)
try:
response = requests.post(
self.endpoint,
data=message,
headers=headers,
auth=auth,
timeout=self.timeout,
proxies=self.proxies,
cert=cert,
verify=verify,
)
if not response.ok:
response.raise_for_status()
except requests.exceptions.RequestException as err:
logger.error("Export POST request failed with reason: %s", err)
return MetricExportResult.FAILURE
return MetricExportResult.SUCCESS
def force_flush(self, timeout_millis: float = 10_000) -> bool:
return True
def shutdown(self, timeout_millis: float = 30_000, **kwargs) -> None:
pass
gen/ 0000775 0000000 0000000 00000000000 15270700723 0045776 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write gogoproto/ 0000775 0000000 0000000 00000000000 15270700723 0050015 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen gogoproto/gogo_pb2.py 0000664 0000000 0000000 00000017252 15270700723 0052074 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo.proto
# Protobuf Python Version: 5.26.0
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nGopentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo.proto\x12\tgogoproto\x1a google/protobuf/descriptor.proto:;\n\x13goproto_enum_prefix\x12\x1c.google.protobuf.EnumOptions\x18\xb1\xe4\x03 \x01(\x08:=\n\x15goproto_enum_stringer\x12\x1c.google.protobuf.EnumOptions\x18\xc5\xe4\x03 \x01(\x08:5\n\renum_stringer\x12\x1c.google.protobuf.EnumOptions\x18\xc6\xe4\x03 \x01(\x08:7\n\x0f\x65num_customname\x12\x1c.google.protobuf.EnumOptions\x18\xc7\xe4\x03 \x01(\t:0\n\x08\x65numdecl\x12\x1c.google.protobuf.EnumOptions\x18\xc8\xe4\x03 \x01(\x08:A\n\x14\x65numvalue_customname\x12!.google.protobuf.EnumValueOptions\x18\xd1\x83\x04 \x01(\t:;\n\x13goproto_getters_all\x12\x1c.google.protobuf.FileOptions\x18\x99\xec\x03 \x01(\x08:?\n\x17goproto_enum_prefix_all\x12\x1c.google.protobuf.FileOptions\x18\x9a\xec\x03 \x01(\x08:<\n\x14goproto_stringer_all\x12\x1c.google.protobuf.FileOptions\x18\x9b\xec\x03 \x01(\x08:9\n\x11verbose_equal_all\x12\x1c.google.protobuf.FileOptions\x18\x9c\xec\x03 \x01(\x08:0\n\x08\x66\x61\x63\x65_all\x12\x1c.google.protobuf.FileOptions\x18\x9d\xec\x03 \x01(\x08:4\n\x0cgostring_all\x12\x1c.google.protobuf.FileOptions\x18\x9e\xec\x03 \x01(\x08:4\n\x0cpopulate_all\x12\x1c.google.protobuf.FileOptions\x18\x9f\xec\x03 \x01(\x08:4\n\x0cstringer_all\x12\x1c.google.protobuf.FileOptions\x18\xa0\xec\x03 \x01(\x08:3\n\x0bonlyone_all\x12\x1c.google.protobuf.FileOptions\x18\xa1\xec\x03 \x01(\x08:1\n\tequal_all\x12\x1c.google.protobuf.FileOptions\x18\xa5\xec\x03 \x01(\x08:7\n\x0f\x64\x65scription_all\x12\x1c.google.protobuf.FileOptions\x18\xa6\xec\x03 \x01(\x08:3\n\x0btestgen_all\x12\x1c.google.protobuf.FileOptions\x18\xa7\xec\x03 \x01(\x08:4\n\x0c\x62\x65nchgen_all\x12\x1c.google.protobuf.FileOptions\x18\xa8\xec\x03 \x01(\x08:5\n\rmarshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xa9\xec\x03 \x01(\x08:7\n\x0funmarshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xaa\xec\x03 \x01(\x08:<\n\x14stable_marshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xab\xec\x03 \x01(\x08:1\n\tsizer_all\x12\x1c.google.protobuf.FileOptions\x18\xac\xec\x03 \x01(\x08:A\n\x19goproto_enum_stringer_all\x12\x1c.google.protobuf.FileOptions\x18\xad\xec\x03 \x01(\x08:9\n\x11\x65num_stringer_all\x12\x1c.google.protobuf.FileOptions\x18\xae\xec\x03 \x01(\x08:<\n\x14unsafe_marshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xaf\xec\x03 \x01(\x08:>\n\x16unsafe_unmarshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xb0\xec\x03 \x01(\x08:B\n\x1agoproto_extensions_map_all\x12\x1c.google.protobuf.FileOptions\x18\xb1\xec\x03 \x01(\x08:@\n\x18goproto_unrecognized_all\x12\x1c.google.protobuf.FileOptions\x18\xb2\xec\x03 \x01(\x08:8\n\x10gogoproto_import\x12\x1c.google.protobuf.FileOptions\x18\xb3\xec\x03 \x01(\x08:6\n\x0eprotosizer_all\x12\x1c.google.protobuf.FileOptions\x18\xb4\xec\x03 \x01(\x08:3\n\x0b\x63ompare_all\x12\x1c.google.protobuf.FileOptions\x18\xb5\xec\x03 \x01(\x08:4\n\x0ctypedecl_all\x12\x1c.google.protobuf.FileOptions\x18\xb6\xec\x03 \x01(\x08:4\n\x0c\x65numdecl_all\x12\x1c.google.protobuf.FileOptions\x18\xb7\xec\x03 \x01(\x08:<\n\x14goproto_registration\x12\x1c.google.protobuf.FileOptions\x18\xb8\xec\x03 \x01(\x08:7\n\x0fmessagename_all\x12\x1c.google.protobuf.FileOptions\x18\xb9\xec\x03 \x01(\x08:=\n\x15goproto_sizecache_all\x12\x1c.google.protobuf.FileOptions\x18\xba\xec\x03 \x01(\x08:;\n\x13goproto_unkeyed_all\x12\x1c.google.protobuf.FileOptions\x18\xbb\xec\x03 \x01(\x08::\n\x0fgoproto_getters\x12\x1f.google.protobuf.MessageOptions\x18\x81\xf4\x03 \x01(\x08:;\n\x10goproto_stringer\x12\x1f.google.protobuf.MessageOptions\x18\x83\xf4\x03 \x01(\x08:8\n\rverbose_equal\x12\x1f.google.protobuf.MessageOptions\x18\x84\xf4\x03 \x01(\x08:/\n\x04\x66\x61\x63\x65\x12\x1f.google.protobuf.MessageOptions\x18\x85\xf4\x03 \x01(\x08:3\n\x08gostring\x12\x1f.google.protobuf.MessageOptions\x18\x86\xf4\x03 \x01(\x08:3\n\x08populate\x12\x1f.google.protobuf.MessageOptions\x18\x87\xf4\x03 \x01(\x08:3\n\x08stringer\x12\x1f.google.protobuf.MessageOptions\x18\xc0\x8b\x04 \x01(\x08:2\n\x07onlyone\x12\x1f.google.protobuf.MessageOptions\x18\x89\xf4\x03 \x01(\x08:0\n\x05\x65qual\x12\x1f.google.protobuf.MessageOptions\x18\x8d\xf4\x03 \x01(\x08:6\n\x0b\x64\x65scription\x12\x1f.google.protobuf.MessageOptions\x18\x8e\xf4\x03 \x01(\x08:2\n\x07testgen\x12\x1f.google.protobuf.MessageOptions\x18\x8f\xf4\x03 \x01(\x08:3\n\x08\x62\x65nchgen\x12\x1f.google.protobuf.MessageOptions\x18\x90\xf4\x03 \x01(\x08:4\n\tmarshaler\x12\x1f.google.protobuf.MessageOptions\x18\x91\xf4\x03 \x01(\x08:6\n\x0bunmarshaler\x12\x1f.google.protobuf.MessageOptions\x18\x92\xf4\x03 \x01(\x08:;\n\x10stable_marshaler\x12\x1f.google.protobuf.MessageOptions\x18\x93\xf4\x03 \x01(\x08:0\n\x05sizer\x12\x1f.google.protobuf.MessageOptions\x18\x94\xf4\x03 \x01(\x08:;\n\x10unsafe_marshaler\x12\x1f.google.protobuf.MessageOptions\x18\x97\xf4\x03 \x01(\x08:=\n\x12unsafe_unmarshaler\x12\x1f.google.protobuf.MessageOptions\x18\x98\xf4\x03 \x01(\x08:A\n\x16goproto_extensions_map\x12\x1f.google.protobuf.MessageOptions\x18\x99\xf4\x03 \x01(\x08:?\n\x14goproto_unrecognized\x12\x1f.google.protobuf.MessageOptions\x18\x9a\xf4\x03 \x01(\x08:5\n\nprotosizer\x12\x1f.google.protobuf.MessageOptions\x18\x9c\xf4\x03 \x01(\x08:2\n\x07\x63ompare\x12\x1f.google.protobuf.MessageOptions\x18\x9d\xf4\x03 \x01(\x08:3\n\x08typedecl\x12\x1f.google.protobuf.MessageOptions\x18\x9e\xf4\x03 \x01(\x08:6\n\x0bmessagename\x12\x1f.google.protobuf.MessageOptions\x18\xa1\xf4\x03 \x01(\x08:<\n\x11goproto_sizecache\x12\x1f.google.protobuf.MessageOptions\x18\xa2\xf4\x03 \x01(\x08::\n\x0fgoproto_unkeyed\x12\x1f.google.protobuf.MessageOptions\x18\xa3\xf4\x03 \x01(\x08:1\n\x08nullable\x12\x1d.google.protobuf.FieldOptions\x18\xe9\xfb\x03 \x01(\x08:.\n\x05\x65mbed\x12\x1d.google.protobuf.FieldOptions\x18\xea\xfb\x03 \x01(\x08:3\n\ncustomtype\x12\x1d.google.protobuf.FieldOptions\x18\xeb\xfb\x03 \x01(\t:3\n\ncustomname\x12\x1d.google.protobuf.FieldOptions\x18\xec\xfb\x03 \x01(\t:0\n\x07jsontag\x12\x1d.google.protobuf.FieldOptions\x18\xed\xfb\x03 \x01(\t:1\n\x08moretags\x12\x1d.google.protobuf.FieldOptions\x18\xee\xfb\x03 \x01(\t:1\n\x08\x63\x61sttype\x12\x1d.google.protobuf.FieldOptions\x18\xef\xfb\x03 \x01(\t:0\n\x07\x63\x61stkey\x12\x1d.google.protobuf.FieldOptions\x18\xf0\xfb\x03 \x01(\t:2\n\tcastvalue\x12\x1d.google.protobuf.FieldOptions\x18\xf1\xfb\x03 \x01(\t:0\n\x07stdtime\x12\x1d.google.protobuf.FieldOptions\x18\xf2\xfb\x03 \x01(\x08:4\n\x0bstdduration\x12\x1d.google.protobuf.FieldOptions\x18\xf3\xfb\x03 \x01(\x08:3\n\nwktpointer\x12\x1d.google.protobuf.FieldOptions\x18\xf4\xfb\x03 \x01(\x08\x42\x45\n\x13\x63om.google.protobufB\nGoGoProtosZ\"github.com/gogo/protobuf/gogoproto')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.exporter.prometheus_remote_write.gen.gogoproto.gogo_pb2', _globals)
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'\n\023com.google.protobufB\nGoGoProtosZ\"github.com/gogo/protobuf/gogoproto'
# @@protoc_insertion_point(module_scope)
remote_pb2.py 0000664 0000000 0000000 00000007260 15270700723 0050413 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/exporter/prometheus_remote_write/gen/remote.proto
# Protobuf Python Version: 5.26.0
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from opentelemetry.exporter.prometheus_remote_write.gen import types_pb2 as opentelemetry_dot_exporter_dot_prometheus__remote__write_dot_gen_dot_types__pb2
from opentelemetry.exporter.prometheus_remote_write.gen.gogoproto import gogo_pb2 as opentelemetry_dot_exporter_dot_prometheus__remote__write_dot_gen_dot_gogoproto_dot_gogo__pb2
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n?opentelemetry/exporter/prometheus_remote_write/gen/remote.proto\x12\nprometheus\x1a>opentelemetry/exporter/prometheus_remote_write/gen/types.proto\x1aGopentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo.proto\"z\n\x0cWriteRequest\x12\x30\n\ntimeseries\x18\x01 \x03(\x0b\x32\x16.prometheus.TimeSeriesB\x04\xc8\xde\x1f\x00\x12\x32\n\x08metadata\x18\x03 \x03(\x0b\x32\x1a.prometheus.MetricMetadataB\x04\xc8\xde\x1f\x00J\x04\x08\x02\x10\x03\"\xae\x01\n\x0bReadRequest\x12\"\n\x07queries\x18\x01 \x03(\x0b\x32\x11.prometheus.Query\x12\x45\n\x17\x61\x63\x63\x65pted_response_types\x18\x02 \x03(\x0e\x32$.prometheus.ReadRequest.ResponseType\"4\n\x0cResponseType\x12\x0b\n\x07SAMPLES\x10\x00\x12\x17\n\x13STREAMED_XOR_CHUNKS\x10\x01\"8\n\x0cReadResponse\x12(\n\x07results\x18\x01 \x03(\x0b\x32\x17.prometheus.QueryResult\"\x8f\x01\n\x05Query\x12\x1a\n\x12start_timestamp_ms\x18\x01 \x01(\x03\x12\x18\n\x10\x65nd_timestamp_ms\x18\x02 \x01(\x03\x12*\n\x08matchers\x18\x03 \x03(\x0b\x32\x18.prometheus.LabelMatcher\x12$\n\x05hints\x18\x04 \x01(\x0b\x32\x15.prometheus.ReadHints\"9\n\x0bQueryResult\x12*\n\ntimeseries\x18\x01 \x03(\x0b\x32\x16.prometheus.TimeSeries\"]\n\x13\x43hunkedReadResponse\x12\x31\n\x0e\x63hunked_series\x18\x01 \x03(\x0b\x32\x19.prometheus.ChunkedSeries\x12\x13\n\x0bquery_index\x18\x02 \x01(\x03\x42\x08Z\x06prompbb\x06proto3')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.exporter.prometheus_remote_write.gen.remote_pb2', _globals)
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'Z\006prompb'
_globals['_WRITEREQUEST'].fields_by_name['timeseries']._loaded_options = None
_globals['_WRITEREQUEST'].fields_by_name['timeseries']._serialized_options = b'\310\336\037\000'
_globals['_WRITEREQUEST'].fields_by_name['metadata']._loaded_options = None
_globals['_WRITEREQUEST'].fields_by_name['metadata']._serialized_options = b'\310\336\037\000'
_globals['_WRITEREQUEST']._serialized_start=216
_globals['_WRITEREQUEST']._serialized_end=338
_globals['_READREQUEST']._serialized_start=341
_globals['_READREQUEST']._serialized_end=515
_globals['_READREQUEST_RESPONSETYPE']._serialized_start=463
_globals['_READREQUEST_RESPONSETYPE']._serialized_end=515
_globals['_READRESPONSE']._serialized_start=517
_globals['_READRESPONSE']._serialized_end=573
_globals['_QUERY']._serialized_start=576
_globals['_QUERY']._serialized_end=719
_globals['_QUERYRESULT']._serialized_start=721
_globals['_QUERYRESULT']._serialized_end=778
_globals['_CHUNKEDREADRESPONSE']._serialized_start=780
_globals['_CHUNKEDREADRESPONSE']._serialized_end=873
# @@protoc_insertion_point(module_scope)
types_pb2.py 0000664 0000000 0000000 00000013634 15270700723 0050266 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/exporter/prometheus_remote_write/gen/types.proto
# Protobuf Python Version: 5.26.0
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from opentelemetry.exporter.prometheus_remote_write.gen.gogoproto import gogo_pb2 as opentelemetry_dot_exporter_dot_prometheus__remote__write_dot_gen_dot_gogoproto_dot_gogo__pb2
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n>opentelemetry/exporter/prometheus_remote_write/gen/types.proto\x12\nprometheus\x1aGopentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo.proto\"\xf8\x01\n\x0eMetricMetadata\x12\x33\n\x04type\x18\x01 \x01(\x0e\x32%.prometheus.MetricMetadata.MetricType\x12\x1a\n\x12metric_family_name\x18\x02 \x01(\t\x12\x0c\n\x04help\x18\x04 \x01(\t\x12\x0c\n\x04unit\x18\x05 \x01(\t\"y\n\nMetricType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07\x43OUNTER\x10\x01\x12\t\n\x05GAUGE\x10\x02\x12\r\n\tHISTOGRAM\x10\x03\x12\x12\n\x0eGAUGEHISTOGRAM\x10\x04\x12\x0b\n\x07SUMMARY\x10\x05\x12\x08\n\x04INFO\x10\x06\x12\x0c\n\x08STATESET\x10\x07\"*\n\x06Sample\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x11\n\ttimestamp\x18\x02 \x01(\x03\"U\n\x08\x45xemplar\x12\'\n\x06labels\x18\x01 \x03(\x0b\x32\x11.prometheus.LabelB\x04\xc8\xde\x1f\x00\x12\r\n\x05value\x18\x02 \x01(\x01\x12\x11\n\ttimestamp\x18\x03 \x01(\x03\"\x8f\x01\n\nTimeSeries\x12\'\n\x06labels\x18\x01 \x03(\x0b\x32\x11.prometheus.LabelB\x04\xc8\xde\x1f\x00\x12)\n\x07samples\x18\x02 \x03(\x0b\x32\x12.prometheus.SampleB\x04\xc8\xde\x1f\x00\x12-\n\texemplars\x18\x03 \x03(\x0b\x32\x14.prometheus.ExemplarB\x04\xc8\xde\x1f\x00\"$\n\x05Label\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"1\n\x06Labels\x12\'\n\x06labels\x18\x01 \x03(\x0b\x32\x11.prometheus.LabelB\x04\xc8\xde\x1f\x00\"\x82\x01\n\x0cLabelMatcher\x12+\n\x04type\x18\x01 \x01(\x0e\x32\x1d.prometheus.LabelMatcher.Type\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\"(\n\x04Type\x12\x06\n\x02\x45Q\x10\x00\x12\x07\n\x03NEQ\x10\x01\x12\x06\n\x02RE\x10\x02\x12\x07\n\x03NRE\x10\x03\"|\n\tReadHints\x12\x0f\n\x07step_ms\x18\x01 \x01(\x03\x12\x0c\n\x04\x66unc\x18\x02 \x01(\t\x12\x10\n\x08start_ms\x18\x03 \x01(\x03\x12\x0e\n\x06\x65nd_ms\x18\x04 \x01(\x03\x12\x10\n\x08grouping\x18\x05 \x03(\t\x12\n\n\x02\x62y\x18\x06 \x01(\x08\x12\x10\n\x08range_ms\x18\x07 \x01(\x03\"\x8b\x01\n\x05\x43hunk\x12\x13\n\x0bmin_time_ms\x18\x01 \x01(\x03\x12\x13\n\x0bmax_time_ms\x18\x02 \x01(\x03\x12(\n\x04type\x18\x03 \x01(\x0e\x32\x1a.prometheus.Chunk.Encoding\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\" \n\x08\x45ncoding\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x07\n\x03XOR\x10\x01\"a\n\rChunkedSeries\x12\'\n\x06labels\x18\x01 \x03(\x0b\x32\x11.prometheus.LabelB\x04\xc8\xde\x1f\x00\x12\'\n\x06\x63hunks\x18\x02 \x03(\x0b\x32\x11.prometheus.ChunkB\x04\xc8\xde\x1f\x00\x42\x08Z\x06prompbb\x06proto3')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.exporter.prometheus_remote_write.gen.types_pb2', _globals)
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'Z\006prompb'
_globals['_EXEMPLAR'].fields_by_name['labels']._loaded_options = None
_globals['_EXEMPLAR'].fields_by_name['labels']._serialized_options = b'\310\336\037\000'
_globals['_TIMESERIES'].fields_by_name['labels']._loaded_options = None
_globals['_TIMESERIES'].fields_by_name['labels']._serialized_options = b'\310\336\037\000'
_globals['_TIMESERIES'].fields_by_name['samples']._loaded_options = None
_globals['_TIMESERIES'].fields_by_name['samples']._serialized_options = b'\310\336\037\000'
_globals['_TIMESERIES'].fields_by_name['exemplars']._loaded_options = None
_globals['_TIMESERIES'].fields_by_name['exemplars']._serialized_options = b'\310\336\037\000'
_globals['_LABELS'].fields_by_name['labels']._loaded_options = None
_globals['_LABELS'].fields_by_name['labels']._serialized_options = b'\310\336\037\000'
_globals['_CHUNKEDSERIES'].fields_by_name['labels']._loaded_options = None
_globals['_CHUNKEDSERIES'].fields_by_name['labels']._serialized_options = b'\310\336\037\000'
_globals['_CHUNKEDSERIES'].fields_by_name['chunks']._loaded_options = None
_globals['_CHUNKEDSERIES'].fields_by_name['chunks']._serialized_options = b'\310\336\037\000'
_globals['_METRICMETADATA']._serialized_start=152
_globals['_METRICMETADATA']._serialized_end=400
_globals['_METRICMETADATA_METRICTYPE']._serialized_start=279
_globals['_METRICMETADATA_METRICTYPE']._serialized_end=400
_globals['_SAMPLE']._serialized_start=402
_globals['_SAMPLE']._serialized_end=444
_globals['_EXEMPLAR']._serialized_start=446
_globals['_EXEMPLAR']._serialized_end=531
_globals['_TIMESERIES']._serialized_start=534
_globals['_TIMESERIES']._serialized_end=677
_globals['_LABEL']._serialized_start=679
_globals['_LABEL']._serialized_end=715
_globals['_LABELS']._serialized_start=717
_globals['_LABELS']._serialized_end=766
_globals['_LABELMATCHER']._serialized_start=769
_globals['_LABELMATCHER']._serialized_end=899
_globals['_LABELMATCHER_TYPE']._serialized_start=859
_globals['_LABELMATCHER_TYPE']._serialized_end=899
_globals['_READHINTS']._serialized_start=901
_globals['_READHINTS']._serialized_end=1025
_globals['_CHUNK']._serialized_start=1028
_globals['_CHUNK']._serialized_end=1167
_globals['_CHUNK_ENCODING']._serialized_start=1135
_globals['_CHUNK_ENCODING']._serialized_end=1167
_globals['_CHUNKEDSERIES']._serialized_start=1169
_globals['_CHUNKEDSERIES']._serialized_end=1266
# @@protoc_insertion_point(module_scope)
version.py 0000664 0000000 0000000 00000000144 15270700723 0047263 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
__version__ = "0.66b2"
test-requirements.txt 0000664 0000000 0000000 00000000572 15270700723 0037157 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write asgiref==3.8.1
certifi==2024.7.4
charset-normalizer==3.3.2
cramjam==2.11.0
Deprecated==1.2.14
idna==3.7
iniconfig==2.0.0
packaging==24.0
pluggy==1.6.0
protobuf==6.33.5
py-cpuinfo==9.0.0
pytest==7.4.4
python-snappy==0.7.1
requests==2.33.1
tomli==2.0.1
typing_extensions==4.12.2
urllib3==2.7.0
wrapt==1.16.0
zipp==3.19.2
-e exporter/opentelemetry-exporter-prometheus-remote-write
opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/tests/ 0000775 0000000 0000000 00000000000 15270700723 0034133 5 ustar 00root root 0000000 0000000 __init__.py 0000664 0000000 0000000 00000000114 15270700723 0036161 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/tests # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
conftest.py 0000664 0000000 0000000 00000003053 15270700723 0036254 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/tests # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
import random
import pytest
import opentelemetry.test.metrictestutil as metric_util
# pylint: disable=no-name-in-module
from opentelemetry.exporter.prometheus_remote_write import (
PrometheusRemoteWriteMetricsExporter,
)
from opentelemetry.sdk.metrics.export import (
AggregationTemporality,
Histogram,
HistogramDataPoint,
Metric,
)
@pytest.fixture
def prom_rw():
return PrometheusRemoteWriteMetricsExporter("http://victoria:8428/api/v1/write")
@pytest.fixture
def metric(request):
if hasattr(request, "param"):
type_ = request.param
else:
type_ = random.choice(["gauge", "sum"])
if type_ == "gauge":
return metric_util._generate_gauge("test.gauge", random.randint(0, 100))
if type_ == "sum":
return metric_util._generate_sum("test.sum", random.randint(0, 9_999_999_999))
if type_ == "histogram":
return _generate_histogram("test_histogram")
raise ValueError(f"Unsupported metric type '{type_}'.")
def _generate_histogram(name):
dp = HistogramDataPoint(
attributes={"foo": "bar", "baz": 42},
start_time_unix_nano=1641946016139533244,
time_unix_nano=1641946016139533244,
count=5,
sum=420,
bucket_counts=[1, 4],
explicit_bounds=[10.0],
min=8,
max=80,
)
data = Histogram(
[dp],
AggregationTemporality.CUMULATIVE,
)
return Metric(
name,
"foo",
"tu",
data=data,
)
test_prometheus_remote_write_exporter.py 0000664 0000000 0000000 00000025661 15270700723 0044407 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-prometheus-remote-write/tests # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
import unittest
from unittest.mock import patch
import pytest
# pylint: disable=no-name-in-module
from opentelemetry.exporter.prometheus_remote_write import (
PrometheusRemoteWriteMetricsExporter,
)
from opentelemetry.exporter.prometheus_remote_write.gen.types_pb2 import ( # pylint: disable=E0611
Label,
Sample,
TimeSeries,
)
from opentelemetry.sdk.metrics.export import (
Histogram,
HistogramDataPoint,
MetricExportResult,
MetricsData,
NumberDataPoint,
ResourceMetrics,
ScopeMetrics,
)
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.util.instrumentation import InstrumentationScope
@pytest.mark.parametrize(
"name,result",
[
("abc.124", "abc_124"),
(":abc", ":abc"),
("abc.name.hi", "abc_name_hi"),
("service.name...", "service_name___"),
("4hellowor:ld5∂©∑", "_hellowor:ld5___"),
],
)
def test_regex(name, result, prom_rw):
assert prom_rw._sanitize_string(name, "name") == result
def test_regex_invalid(prom_rw):
with pytest.raises(TypeError):
prom_rw("foo_bar", "A random type")
def test_parse_data_point(prom_rw):
attrs = {"Foo": "Bar", "Baz": 42}
timestamp = 1641946016139533244
value = 242.42
dp = NumberDataPoint(attrs, 0, timestamp, value)
name = "abc.123_42"
labels, sample = prom_rw._parse_data_point(dp, name)
name = "abc_123_42"
assert labels == (("Foo", "Bar"), ("Baz", 42), ("__name__", name))
assert sample == (value, timestamp // 1_000_000)
def test_parse_histogram_dp(prom_rw):
attrs = {"foo": "bar", "baz": 42}
timestamp = 1641946016139533244
bounds = [10.0, 20.0]
dp = HistogramDataPoint(
attributes=attrs,
start_time_unix_nano=1641946016139533244,
time_unix_nano=timestamp,
count=9,
sum=180,
bucket_counts=[1, 4, 4],
explicit_bounds=bounds,
min=8,
max=80,
)
name = "foo_histogram"
label_sample_pairs = prom_rw._parse_histogram_data_point(dp, name)
timestamp = timestamp // 1_000_000
bounds.append("+Inf")
for pos, bound in enumerate(bounds):
# We have to attributes, we kinda assume the bucket label is last...
assert ("le", str(bound)) == label_sample_pairs[pos][0][-1]
# Check and make sure we are putting the bucket counts in there
assert (dp.bucket_counts[pos], timestamp) == label_sample_pairs[pos][1]
# Last two are the sum & total count
assert ("__name__", f"{name}_sum") in label_sample_pairs[-2][0]
assert (dp.sum, timestamp) == label_sample_pairs[-2][1]
assert ("__name__", f"{name}_count") in label_sample_pairs[-1][0]
assert (dp.count, timestamp) == label_sample_pairs[-1][1]
@pytest.mark.parametrize(
"metric",
[
"gauge",
"sum",
"histogram",
],
indirect=["metric"],
)
def test_parse_metric(metric, prom_rw):
"""
Ensures output from parse_metrics are TimeSeries with expected data/size
"""
attributes = {
"service_name": "foo",
"bool_value": True,
}
assert len(metric.data.data_points) == 1, "We can only support a single datapoint in tests"
series = prom_rw._parse_metric(metric, tuple(attributes.items()))
timestamp = metric.data.data_points[0].time_unix_nano // 1_000_000
for single_series in series:
labels = str(single_series.labels)
# Its a bit easier to validate these stringified where we dont have to
# worry about ordering and protobuf TimeSeries object structure
# This doesn't guarantee the labels aren't mixed up, but our other
# test cases already do.
assert "__name__" in labels
assert prom_rw._sanitize_string(metric.name, "name") in labels
combined_attrs = list(attributes.items()) + list(metric.data.data_points[0].attributes.items())
for name, value in combined_attrs:
assert prom_rw._sanitize_string(name, "label") in labels
assert str(value) in labels
if isinstance(metric.data, Histogram):
values = [
metric.data.data_points[0].count,
metric.data.data_points[0].sum,
metric.data.data_points[0].bucket_counts[0],
metric.data.data_points[0].bucket_counts[1],
]
else:
values = [
metric.data.data_points[0].value,
]
for sample in single_series.samples:
assert sample.timestamp == timestamp
assert sample.value in values
def test_convert_to_timeseries(prom_rw):
resource_labels = (("service_name", "foo"), ("bool_value", True))
sample_sets = {
(("foo", "bar"), ("baz", 42), ("__name__", "test_histogram_tu")): [(1, 1641946016139)],
(("baz", "42"), ("foo", "bar")): [(4, 1641946016139)],
}
timeseries = prom_rw._convert_to_timeseries(sample_sets, resource_labels)
assert timeseries == [
TimeSeries(
labels=[
Label(name="__name__", value="test_histogram_tu"),
Label(name="baz", value="42"),
Label(name="bool_value", value="True"),
Label(name="foo", value="bar"),
Label(name="service_name", value="foo"),
],
samples=[Sample(value=1, timestamp=1641946016139)],
),
TimeSeries(
labels=[
Label(name="baz", value="42"),
Label(name="bool_value", value="True"),
Label(name="foo", value="bar"),
Label(name="service_name", value="foo"),
],
samples=[Sample(value=4, timestamp=1641946016139)],
),
]
class TestValidation(unittest.TestCase):
# Test cases to ensure exporter parameter validation works as intended
def test_valid_standard_param(self):
exporter = PrometheusRemoteWriteMetricsExporter(
endpoint="/prom/test_endpoint",
)
self.assertEqual(exporter.endpoint, "/prom/test_endpoint")
def test_valid_basic_auth_param(self):
exporter = PrometheusRemoteWriteMetricsExporter(
endpoint="/prom/test_endpoint",
basic_auth={
"username": "test_username",
"password": "test_password",
},
)
self.assertEqual(exporter.basic_auth["username"], "test_username")
self.assertEqual(exporter.basic_auth["password"], "test_password")
def test_invalid_no_endpoint_param(self):
with self.assertRaises(ValueError):
PrometheusRemoteWriteMetricsExporter("")
def test_invalid_no_username_param(self):
with self.assertRaises(ValueError):
PrometheusRemoteWriteMetricsExporter(
endpoint="/prom/test_endpoint",
basic_auth={"password": "test_password"},
)
def test_invalid_no_password_param(self):
with self.assertRaises(ValueError):
PrometheusRemoteWriteMetricsExporter(
endpoint="/prom/test_endpoint",
basic_auth={"username": "test_username"},
)
def test_invalid_conflicting_passwords_param(self):
with self.assertRaises(ValueError):
PrometheusRemoteWriteMetricsExporter(
endpoint="/prom/test_endpoint",
basic_auth={
"username": "test_username",
"password": "test_password",
"password_file": "test_file",
},
)
def test_invalid_timeout_param(self):
with self.assertRaises(ValueError):
PrometheusRemoteWriteMetricsExporter(endpoint="/prom/test_endpoint", timeout=0)
def test_valid_tls_config_param(self):
tls_config = {
"ca_file": "test_ca_file",
"cert_file": "test_cert_file",
"key_file": "test_key_file",
"insecure_skip_verify": True,
}
exporter = PrometheusRemoteWriteMetricsExporter(endpoint="/prom/test_endpoint", tls_config=tls_config)
self.assertEqual(exporter.tls_config["ca_file"], tls_config["ca_file"])
self.assertEqual(exporter.tls_config["cert_file"], tls_config["cert_file"])
self.assertEqual(exporter.tls_config["key_file"], tls_config["key_file"])
self.assertEqual(
exporter.tls_config["insecure_skip_verify"],
tls_config["insecure_skip_verify"],
)
# if cert_file is provided, then key_file must also be provided
def test_invalid_tls_config_cert_only_param(self):
tls_config = {"cert_file": "value"}
with self.assertRaises(ValueError):
PrometheusRemoteWriteMetricsExporter(endpoint="/prom/test_endpoint", tls_config=tls_config)
# if cert_file is provided, then key_file must also be provided
def test_invalid_tls_config_key_only_param(self):
tls_config = {"cert_file": "value"}
with self.assertRaises(ValueError):
PrometheusRemoteWriteMetricsExporter(endpoint="/prom/test_endpoint", tls_config=tls_config)
# Ensures export is successful with valid export_records and config
@patch("requests.post")
def test_valid_export(mock_post, prom_rw, metric):
mock_post.return_value.configure_mock(status_code=200)
# Assumed a "None" for Scope or Resource aren't valid, so build them here
scope = ScopeMetrics(InstrumentationScope(name="prom-rw-test"), [metric], None)
resource = ResourceMetrics(Resource({"service.name": "foo"}), [scope], None)
record = MetricsData([resource])
result = prom_rw.export(record)
assert result == MetricExportResult.SUCCESS
assert mock_post.call_count == 1
result = prom_rw.export([])
assert result == MetricExportResult.SUCCESS
def test_invalid_export(prom_rw):
record = MetricsData([])
result = prom_rw.export(record)
assert result == MetricExportResult.FAILURE
@patch("requests.post")
def test_valid_send_message(mock_post, prom_rw):
mock_post.return_value.configure_mock(ok=True)
result = prom_rw._send_message(b"", {})
assert mock_post.call_count == 1
assert result == MetricExportResult.SUCCESS
def test_invalid_send_message(prom_rw):
result = prom_rw._send_message(b"", {})
assert result == MetricExportResult.FAILURE
# Verifies that build_message calls snappy.compress and returns SerializedString
@patch("snappy.compress", return_value=b"")
def test_build_message(mock_compress, prom_rw):
message = prom_rw._build_message([TimeSeries()])
assert mock_compress.call_count == 1
assert isinstance(message, bytes)
# Ensure correct headers are added when valid config is provided
def test_build_headers(prom_rw):
prom_rw.headers = {"Custom Header": "test_header"}
headers = prom_rw._build_headers()
assert headers["Content-Encoding"] == "snappy"
assert headers["Content-Type"] == "application/x-protobuf"
assert headers["X-Prometheus-Remote-Write-Version"] == "0.1.0"
assert headers["Custom Header"] == "test_header"
opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole/ 0000775 0000000 0000000 00000000000 15270700723 0030465 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole/README.rst 0000664 0000000 0000000 00000001423 15270700723 0032154 0 ustar 00root root 0000000 0000000 OpenTelemetry Rich Console Exporter
===================================
|pypi|
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-exporter-richconsole.svg
:target: https://pypi.org/project/opentelemetry-exporter-richconsole/
This library is a console exporter using the Rich tree view. When used with a batch span processor, the rich console exporter will show the trace as a
tree and all related spans as children within the tree, including properties.
Installation
------------
::
pip install opentelemetry-exporter-richconsole
.. _Rich: https://rich.readthedocs.io/
.. _OpenTelemetry: https://github.com/open-telemetry/opentelemetry-python/
References
----------
* `Rich `_
* `OpenTelemetry Project `_
opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole/pyproject.toml 0000664 0000000 0000000 00000002617 15270700723 0033407 0 ustar 00root root 0000000 0000000 [build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "opentelemetry-exporter-richconsole"
dynamic = ["version"]
description = "Rich Console Exporter for OpenTelemetry"
readme = "README.rst"
license = "Apache-2.0"
requires-python = ">=3.10"
authors = [
{ name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-sdk ~= 1.12",
"opentelemetry-semantic-conventions == 0.66b2",
"rich>=10.0.0",
]
[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/exporter/opentelemetry-exporter-richconsole"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"
[tool.hatch.version]
path = "src/opentelemetry/exporter/richconsole/version.py"
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
]
[tool.hatch.build.targets.wheel]
packages = ["src/opentelemetry"]
opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole/src/ 0000775 0000000 0000000 00000000000 15270700723 0031254 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/ 0000775 0000000 0000000 00000000000 15270700723 0034150 5 ustar 00root root 0000000 0000000 exporter/ 0000775 0000000 0000000 00000000000 15270700723 0035741 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole/src/opentelemetry richconsole/ 0000775 0000000 0000000 00000000000 15270700723 0040251 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter __init__.py 0000664 0000000 0000000 00000014115 15270700723 0042364 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
"""
The **OpenTelemetry Rich Console Exporter** provides a span exporter from a batch span processor
to print `OpenTelemetry`_ traces using `Rich`_.
Installation
------------
::
pip install opentelemetry-exporter-richconsole
Usage
-----
The Rich Console Exporter is a console exporter that prints a tree view onto stdout of the traces
with the related spans and properties as children of that tree. For the tree view, the Rich
Console Exporter should be used with a BatchSpanProcessor. If used within a SimpleSpanProcessor,
all spans will be printed in a list.
.. code:: python
from opentelemetry import trace
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.richconsole import RichConsoleSpanExporter
from opentelemetry.sdk.trace import TracerProvider
trace.set_tracer_provider(TracerProvider())
tracer = trace.get_tracer(__name__)
tracer.add_span_processor(BatchSpanProcessor(RichConsoleSpanExporter()))
API
---
.. _Rich: https://rich.readthedocs.io/
.. _OpenTelemetry: https://github.com/open-telemetry/opentelemetry-python/
"""
# pylint: disable=import-error
import datetime
import typing
from rich.console import Console
from rich.syntax import Syntax
from rich.text import Text
from rich.tree import Tree
import opentelemetry.trace
from opentelemetry.sdk.trace import ReadableSpan
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
from opentelemetry.semconv._incubating.attributes.db_attributes import (
DB_STATEMENT,
)
def _ns_to_time(nanoseconds):
ts = datetime.datetime.fromtimestamp(nanoseconds / 1e9, datetime.timezone.utc)
return ts.strftime("%H:%M:%S.%f")
def _child_to_tree(child: Tree, span: ReadableSpan, *, suppress_resource: bool):
child.add(Text.from_markup(f"[bold cyan]Kind :[/bold cyan] {span.kind.name}"))
_add_status(child, span)
_child_add_optional_attributes(child, span, suppress_resource=suppress_resource)
def _add_status(child: Tree, span: ReadableSpan):
if not span.status.is_unset:
if not span.status.is_ok:
child.add(Text.from_markup(f"[bold cyan]Status :[/bold cyan] [red]{span.status.status_code}[/red]"))
else:
child.add(Text.from_markup(f"[bold cyan]Status :[/bold cyan] {span.status.status_code}"))
if span.status.description:
child.add(Text.from_markup(f"[bold cyan]Description :[/bold cyan] {span.status.description}"))
def _child_add_optional_attributes(child: Tree, span: ReadableSpan, *, suppress_resource: bool):
if span.events:
events = child.add(label=Text.from_markup("[bold cyan]Events :[/bold cyan] "))
for event in span.events:
event_node = events.add(Text(event.name))
for key, val in event.attributes.items():
event_node.add(Text.from_markup(f"[bold cyan]{key} :[/bold cyan] {val}"))
if span.attributes:
attributes = child.add(label=Text.from_markup("[bold cyan]Attributes :[/bold cyan] "))
for attribute in span.attributes:
if attribute == DB_STATEMENT:
attributes.add(Text.from_markup(f"[bold cyan]{attribute} :[/bold cyan] "))
attributes.add(Syntax(span.attributes[attribute], "sql"))
else:
attributes.add(Text.from_markup(f"[bold cyan]{attribute} :[/bold cyan] {span.attributes[attribute]}"))
if span.resource and not suppress_resource:
resources = child.add(label=Text.from_markup("[bold cyan]Resources :[/bold cyan] "))
for resource in span.resource.attributes:
resources.add(Text.from_markup(f"[bold cyan]{resource} :[/bold cyan] {span.resource.attributes[resource]}"))
class RichConsoleSpanExporter(SpanExporter):
"""Implementation of :class:`SpanExporter` that prints spans to the
console.
Should be used within a BatchSpanProcessor
"""
def __init__(
self,
service_name: str | None = None,
suppress_resource: bool = False,
):
self.service_name = service_name
self.suppress_resource = suppress_resource
self.console = Console()
def export(self, spans: typing.Sequence[ReadableSpan]) -> SpanExportResult:
if not spans:
return SpanExportResult.SUCCESS
for tree in self.spans_to_tree(spans, suppress_resource=self.suppress_resource).values():
self.console.print(tree)
return SpanExportResult.SUCCESS
@staticmethod
def spans_to_tree(
spans: typing.Sequence[ReadableSpan],
*,
suppress_resource: bool = False,
) -> dict[str, Tree]:
trees = {}
parents = {}
spans = list(spans)
span_ids = {s.context.span_id for s in spans}
while spans:
for span in spans:
if not span.parent or span.parent.span_id not in span_ids:
trace_id = opentelemetry.trace.format_trace_id(span.context.trace_id)
tree = trees.setdefault(trace_id, Tree(label=f"Trace {trace_id}"))
child = tree.add(
label=Text.from_markup(
f"[blue][{_ns_to_time(span.start_time)}][/blue] [bold]{span.name}[/bold], span {opentelemetry.trace.format_span_id(span.context.span_id)}"
)
)
parents[span.context.span_id] = child
_child_to_tree(child, span, suppress_resource=suppress_resource)
spans.remove(span)
elif span.parent and span.parent.span_id in parents:
child = parents[span.parent.span_id].add(
label=Text.from_markup(
f"[blue][{_ns_to_time(span.start_time)}][/blue] [bold]{span.name}[/bold], span {opentelemetry.trace.format_span_id(span.context.span_id)}"
)
)
parents[span.context.span_id] = child
_child_to_tree(child, span, suppress_resource=suppress_resource)
spans.remove(span)
return trees
version.py 0000664 0000000 0000000 00000000144 15270700723 0042307 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
__version__ = "0.66b2"
test-requirements.txt 0000664 0000000 0000000 00000000506 15270700723 0034650 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole asgiref==3.8.1
Deprecated==1.2.14
flaky==3.7.0
iniconfig==2.0.0
markdown-it-py==3.0.0
mdurl==0.1.2
packaging==24.0
pluggy==1.6.0
py-cpuinfo==9.0.0
Pygments==2.17.2
pytest==7.4.4
pytest-timeout==2.3.1
rich==13.7.1
tomli==2.0.1
typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e exporter/opentelemetry-exporter-richconsole
opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole/tests/ 0000775 0000000 0000000 00000000000 15270700723 0031627 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole/tests/__init__.py 0000664 0000000 0000000 00000000000 15270700723 0033726 0 ustar 00root root 0000000 0000000 test_rich_exporter.py 0000664 0000000 0000000 00000007261 15270700723 0036044 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/exporter/opentelemetry-exporter-richconsole/tests # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
import pytest
from rich.text import Text
from rich.tree import Tree
import opentelemetry.trace
from opentelemetry.exporter.richconsole import RichConsoleSpanExporter
from opentelemetry.sdk import trace
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace.export import BatchSpanProcessor
@pytest.fixture(name="span_processor")
def fixture_span_processor():
exporter = RichConsoleSpanExporter()
span_processor = BatchSpanProcessor(exporter)
yield span_processor
span_processor.shutdown()
@pytest.fixture(name="tracer_provider")
def fixture_tracer_provider(span_processor):
tracer_provider = trace.TracerProvider()
tracer_provider.add_span_processor(span_processor)
yield tracer_provider
def test_span_exporter(tracer_provider, span_processor, capsys):
tracer = tracer_provider.get_tracer(__name__)
span = tracer.start_span("test_span")
span.set_attribute("key", "V4LuE")
span.end()
span_processor.force_flush()
captured = capsys.readouterr()
assert "V4LuE" in captured.out
def walk_tree(root: Tree) -> int:
# counts the amount of spans in a tree that contains a span
return sum(walk_tree(child) for child in root.children) + int("span" in root.label)
def test_multiple_traces(tracer_provider):
exporter = RichConsoleSpanExporter()
tracer = tracer_provider.get_tracer(__name__)
with tracer.start_as_current_span("parent_1") as parent_1:
with tracer.start_as_current_span("child_1") as child_1:
pass
with tracer.start_as_current_span("parent_2") as parent_2:
pass
trees = exporter.spans_to_tree((parent_2, parent_1, child_1))
# asserts that we have all traces
assert len(trees) == 2
traceid_1 = opentelemetry.trace.format_trace_id(parent_1.context.trace_id)
assert traceid_1 in trees
assert opentelemetry.trace.format_trace_id(parent_2.context.trace_id) in trees
# asserts that we have exactly the number of spans we exported
assert sum(walk_tree(tree) for tree in trees.values()) == 3
# assert that the relationship is correct
assert parent_1.name in trees[traceid_1].children[0].label
assert any(child_1.name in child.label for child in trees[traceid_1].children[0].children)
assert not any(parent_1.name in child.label for child in trees[traceid_1].children[0].children)
assert not any(parent_2.name in child.label for child in trees[traceid_1].children[0].children)
@pytest.mark.timeout(30)
def test_no_deadlock(tracer_provider):
# non-regression test for https://github.com/open-telemetry/opentelemetry-python-contrib/issues/3254
tracer = tracer_provider.get_tracer(__name__)
with tracer.start_as_current_span("parent"):
with tracer.start_as_current_span("child") as child:
pass
RichConsoleSpanExporter.spans_to_tree((child,))
def test_suppress_resource(span_processor):
attributes = {"resource.key": "resource.value"}
resource = Resource(attributes)
tracer_provider = trace.TracerProvider(resource=resource)
tracer_provider.add_span_processor(span_processor)
tracer = tracer_provider.get_tracer(__name__)
with tracer.start_as_current_span("parent") as parent:
with tracer.start_as_current_span("child") as child:
pass
trees = RichConsoleSpanExporter.spans_to_tree((parent, child), suppress_resource=True)
assert len(trees) == 1
nodes = [next(t for t in trees.values())]
for node in nodes:
label = node.label
if isinstance(label, Text):
label = label.plain
assert "resource" not in label.lower()
nodes.extend(node.children)
opentelemetry-python-contrib-0.66b2/gen-requirements.txt 0000664 0000000 0000000 00000000157 15270700723 0023603 0 ustar 00root root 0000000 0000000 -c dev-requirements.txt
astor==0.8.1
jinja2==3.1.6
markupsafe==2.0.1
ruff==0.16.1
requests
tomli
tomli_w
hatch
opentelemetry-python-contrib-0.66b2/instrumentation-genai/ 0000775 0000000 0000000 00000000000 15270700723 0024071 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/AGENTS.md 0000664 0000000 0000000 00000001260 15270700723 0025373 0 ustar 00root root 0000000 0000000 # GenAI Instrumentation — Agent and Contributor Guidelines
**GenAI instrumentations are no longer developed in this repository.** They live in
[opentelemetry-python-genai](https://github.com/open-telemetry/opentelemetry-python-genai),
which is where new instrumentations, features, and bug fixes go.
The packages still present under this directory are deprecated, receive security patches only,
and will be removed from this repository in the future.
Do not add instrumentations here, and do not fix bugs or add features to the ones that remain.
Send any such change to the `opentelemetry-python-genai` repo instead. Security patches are the
only changes accepted in this directory.
opentelemetry-python-contrib-0.66b2/instrumentation-genai/CLAUDE.md 0000777 0000000 0000000 00000000000 15270700723 0026646 2AGENTS.md ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/README.md 0000664 0000000 0000000 00000004327 15270700723 0025356 0 ustar 00root root 0000000 0000000
> [!WARNING]
> GenAI instrumentations have been moved to the
> [opentelemetry-python-genai](https://github.com/open-telemetry/opentelemetry-python-genai)
> repository, which is now their home for new development and releases. The copies that
> still live in this directory only receive security patches and will be removed from
> here in the future.
| Instrumentation | Supported Packages | Metrics support | Semconv status |
| --------------- | ------------------ | --------------- | -------------- |
| [opentelemetry-instrumentation-genai-anthropic](https://github.com/open-telemetry/opentelemetry-python-genai/tree/main/instrumentation/opentelemetry-instrumentation-genai-anthropic) | anthropic >= 0.16.0 | Yes | development
| [opentelemetry-instrumentation-genai-claude-agent-sdk](https://github.com/open-telemetry/opentelemetry-python-genai/tree/main/instrumentation/opentelemetry-instrumentation-genai-claude-agent-sdk) | claude-agent-sdk >= 0.1.14 | No | development
| [opentelemetry-instrumentation-google-genai](https://github.com/open-telemetry/opentelemetry-python-genai/tree/main/instrumentation/opentelemetry-instrumentation-google-genai) | google-genai >= 1.32.0 | No | development
| [opentelemetry-instrumentation-genai-langchain](https://github.com/open-telemetry/opentelemetry-python-genai/tree/main/instrumentation/opentelemetry-instrumentation-genai-langchain) | langchain >= 0.3.21 | Yes | development
| [opentelemetry-instrumentation-genai-openai-agents](https://github.com/open-telemetry/opentelemetry-python-genai/tree/main/instrumentation/opentelemetry-instrumentation-genai-openai-agents) | openai-agents >= 0.3.3 | No | development
| [opentelemetry-instrumentation-genai-openai](https://github.com/open-telemetry/opentelemetry-python-genai/tree/main/instrumentation/opentelemetry-instrumentation-genai-openai) | openai >= 1.26.0 | Yes | development
| [opentelemetry-instrumentation-vertexai](./opentelemetry-instrumentation-vertexai) | google-cloud-aiplatform >= 1.64 | No | development
| [opentelemetry-instrumentation-genai-weaviate-client](https://github.com/open-telemetry/opentelemetry-python-genai/tree/main/instrumentation/opentelemetry-instrumentation-genai-weaviate-client) | weaviate-client >= 3.0.0,<5.0.0 | No | development opentelemetry-instrumentation-openai-agents-v2/ 0000775 0000000 0000000 00000000000 15270700723 0035224 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai .gitignore 0000664 0000000 0000000 00000000116 15270700723 0037212 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2 examples/.env
examples/openai_agents_multi_agent_travel/.env
examples/**/.env
CHANGELOG.md 0000664 0000000 0000000 00000003041 15270700723 0037033 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2 # Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
- Deprecate `opentelemetry-instrumentation-openai-agents-v2`. Use the
`opentelemetry-instrumentation-genai-openai-agents` package instead. This
package now only receives security patches.
- Align AgentSpanData test stubs and span processor with real OpenAI Agents SDK;
remove non-existent `operation`, `description`, `agent_id`, and `model` fields.
([#4229](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4229))
- Document official package metadata and README for the OpenAI Agents instrumentation.
([#3859](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3859))
- Populate instructions and tool definitions from Response obj.
([#4196](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4196))
## Version 0.1.0 (2025-10-15)
- Initial barebones package skeleton: minimal instrumentor stub, version module,
and packaging metadata/entry point.
([#3805](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3805))
- Implement OpenAI Agents span processing aligned with GenAI semantic conventions.
([#3817](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3817))
- Input and output according to GenAI spec.
([#3824](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3824))
LICENSE 0000664 0000000 0000000 00000026155 15270700723 0036242 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2 Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(which shall not include communication that is clearly marked or
otherwise designated in writing by the copyright owner as "Not a Work").
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based upon (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and derivative works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control
systems, and issue tracking systems that are managed by, or on behalf
of, the Licensor for the purpose of discussing and improving the Work,
but excluding communication that is clearly marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to use, reproduce, modify, distribute, and prepare
Derivative Works of, publicly display, publicly perform, sublicense,
and distribute the Work and such Derivative Works in Source or Object
form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, trademark, patent,
attribution and other notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright notice to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Support. When redistributing the Work or
Derivative Works thereof, You may choose to offer, and charge a fee
for, acceptance of support, warranty, indemnity, or other liability
obligations and/or rights consistent with this License. However, in
accepting such obligations, You may act only on Your own behalf and on
Your sole responsibility, not on behalf of any other Contributor, and
only if You agree to indemnify, defend, and hold each Contributor
harmless for any liability incurred by, or claims asserted against,
such Contributor by reason of your accepting any such warranty or support.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
README.rst 0000664 0000000 0000000 00000011616 15270700723 0036720 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2 OpenTelemetry OpenAI Agents Instrumentation
===========================================
.. warning::
**This package is deprecated.** Use the
`opentelemetry-instrumentation-genai-openai-agents `_
package instead. ``opentelemetry-instrumentation-openai-agents-v2`` now only
receives security patches. Please
migrate by replacing it with ``opentelemetry-instrumentation-genai-openai-agents``:
.. code-block:: console
pip uninstall opentelemetry-instrumentation-openai-agents-v2
pip install opentelemetry-instrumentation-genai-openai-agents
The replacement package contains **breaking changes** relative to this one.
Review the
`CHANGELOG `_
before upgrading.
|pypi|
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-openai-agents-v2.svg
:target: https://pypi.org/project/opentelemetry-instrumentation-openai-agents-v2/
This library provides the official OpenTelemetry instrumentation for the
`openai-agents SDK `_. It converts
the rich trace data emitted by the Agents runtime
into the GenAI semantic conventions, enriches spans with request/response payload
metadata, and records duration/token usage metrics.
Features
--------
* Generates spans for agents, tools, generations, guardrails, and handoffs using
the OpenTelemetry GenAI semantic conventions.
* Captures prompts, responses, tool arguments, and system instructions when content
capture is enabled.
* Publishes duration and token metrics for every operation.
* Supports environment overrides so you can configure agent metadata or disable
telemetry without code changes.
Installation
------------
If your application is already configured with OpenTelemetry, install the package
and its optional instruments:
.. code-block:: console
pip install opentelemetry-instrumentation-openai-agents-v2
pip install openai-agents
Usage
-----
Instrumentation automatically wires the Agents tracing processor into the SDK.
Configure OpenTelemetry as usual, then call :class:`OpenAIAgentsInstrumentor`.
.. code-block:: python
from agents import Agent, Runner, function_tool
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
from opentelemetry.instrumentation.openai_agents import OpenAIAgentsInstrumentor
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
def configure_otel() -> None:
provider = TracerProvider()
provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
trace.set_tracer_provider(provider)
OpenAIAgentsInstrumentor().instrument(tracer_provider=provider)
@function_tool
def get_weather(city: str) -> str:
return f"The forecast for {city} is sunny with pleasant temperatures."
assistant = Agent(
name="Travel Concierge",
instructions="You are a concise travel concierge.",
tools=[get_weather],
)
result = Runner.run_sync(assistant, "I'm visiting Barcelona this weekend. How should I pack?")
print(result.final_output)
Configuration
-------------
The instrumentor exposes runtime toggles through keyword arguments and environment
variables:
* ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT`` or
``OTEL_INSTRUMENTATION_OPENAI_AGENTS_CAPTURE_CONTENT`` – controls how much
message content is captured. Valid values map to
:class:`opentelemetry.instrumentation.openai_agents.ContentCaptureMode`
(``span_only``, ``event_only``, ``span_and_event``, ``no_content``).
* ``OTEL_INSTRUMENTATION_OPENAI_AGENTS_CAPTURE_METRICS`` – set to ``false`` to
disable duration/token metrics.
* ``OTEL_INSTRUMENTATION_OPENAI_AGENTS_SYSTEM`` – overrides the ``gen_ai.system``
attribute when your deployment is not the default OpenAI platform.
You can also override agent metadata directly when calling
``OpenAIAgentsInstrumentor().instrument(...)`` using ``agent_name``, ``agent_id``,
``agent_description``, ``base_url``, ``server_address``, and ``server_port``.
Examples
--------
The :mod:`examples` directory contains runnable scenarios, including:
* ``examples/manual`` – manual OpenTelemetry configuration for a single agent run.
* ``examples/content-capture`` – demonstrates span and event content capture.
* ``examples/zero-code`` – end-to-end setup using environment configuration only.
References
----------
* `OpenTelemetry Python Contrib `_
* `OpenTelemetry GenAI semantic conventions `_
* `OpenAI Agents SDK `_
examples/ 0000775 0000000 0000000 00000000000 15270700723 0037042 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2 content-capture/ 0000775 0000000 0000000 00000000000 15270700723 0042155 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples .env.example 0000664 0000000 0000000 00000000522 15270700723 0044377 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples/content-capture # Copy to .env and add values before running the sample.
# Required for OpenAI client (only used if you swap in a real OpenAI call)
OPENAI_API_KEY=
# Optional overrides for span attributes / exporters
OTEL_SERVICE_NAME=openai-agents-content-capture-demo
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
README.md 0000664 0000000 0000000 00000002636 15270700723 0043443 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples/content-capture # OpenAI Agents Content Capture Demo
This example exercises the `OpenAIAgentsInstrumentor` with message content
capture enabled, illustrating how prompts, responses, and tool payloads are
recorded on spans and span events.
> The demo uses the local tracing utilities from the `openai-agents`
> package—no outbound API calls are made.
## Prerequisites
1. Activate the repository virtual environment:
```bash
source ../../.venv/bin/activate
```
2. Copy `.env.example` to `.env` and provide any overrides you need (for example,
setting `OTEL_EXPORTER_OTLP_ENDPOINT`).
3. Ensure `openai-agents` is installed in the environment (it is included in
the shared development venv for this repository).
## Run the demo
```bash
python main.py
```
The script will:
- Configure the OpenTelemetry SDK with an OTLP exporter so spans reach your collector.
- Instrument the OpenAI Agents tracing hooks with content capture enabled.
- Simulate an agent invocation that performs a generation and a tool call.
- Print the resulting spans, attributes, and events (including JSON-encoded
prompts and responses) to stdout.
## Customisation tips
- Set `OTEL_SERVICE_NAME` before running to override the default service name.
- Adjust the OTLP exporter configuration (endpoint, protocol) through `.env`.
- Modify the prompts, tool payloads, or add additional spans in `run_workflow`
to explore different content capture scenarios.
main.py 0000664 0000000 0000000 00000007105 15270700723 0043456 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples/content-capture # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
"""
Content capture demo for the OpenAI Agents instrumentation.
This script spins up the instrumentation with message capture enabled and
simulates an agent invocation plus a tool call using the tracing helpers from
the ``openai-agents`` package. Spans are exported to the console so you can
inspect captured prompts, responses, and tool payloads without making any
OpenAI API calls.
"""
from __future__ import annotations
import json
import os
from typing import Any
from agents.tracing import agent_span, function_span, generation_span, trace
from dotenv import load_dotenv
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import (
OTLPSpanExporter,
)
from opentelemetry.instrumentation.openai_agents import (
OpenAIAgentsInstrumentor,
)
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
load_dotenv() # take environment variables from .env.
def configure_tracing() -> None:
"""Configure a tracer provider that exports spans via OTLP."""
resource = Resource.create(
{"service.name": os.environ.get("OTEL_SERVICE_NAME", "openai-agents-content-capture-demo")}
)
provider = TracerProvider(resource=resource)
provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
# Instrument with explicit content capture mode to ensure prompts/responses are recorded.
OpenAIAgentsInstrumentor().instrument(
tracer_provider=provider,
capture_message_content="span_and_event",
system="openai",
agent_name="Travel Concierge",
base_url="https://api.openai.com/v1",
)
def dump(title: str, payload: Any) -> None:
"""Pretty-print helper used to show intermediate context."""
print(f"\n=== {title} ===")
print(json.dumps(payload, indent=2))
def run_workflow() -> None:
"""Simulate an agent workflow with a generation and a tool invocation."""
itinerary_prompt = [
{"role": "system", "content": "Plan high level travel itineraries."},
{
"role": "user",
"content": "I'm visiting Paris for 3 days in November.",
},
]
tool_args = {"city": "Paris", "date": "2025-11-12"}
tool_result = {
"forecast": "Mostly sunny, highs 15°C",
"packing_tips": ["light jacket", "comfortable shoes"],
}
with trace("travel-booking-workflow"):
with agent_span(name="travel_planner") as agent:
dump(
"Agent span started",
{"span_id": agent.span_id, "trace_id": agent.trace_id},
)
with generation_span(
input=itinerary_prompt,
output=[
{
"role": "assistant",
"content": ("Day 1 visit the Louvre, Day 2 tour Versailles, Day 3 explore Montmartre."),
}
],
model="gpt-4o-mini",
usage={
"input_tokens": 128,
"output_tokens": 96,
"total_tokens": 224,
},
):
pass
with function_span(
name="fetch_weather",
input=json.dumps(tool_args),
output=tool_result,
):
pass
print("\nWorkflow complete – spans exported to the configured OTLP endpoint.")
def main() -> None:
configure_tracing()
run_workflow()
if __name__ == "__main__":
main()
manual/ 0000775 0000000 0000000 00000000000 15270700723 0040317 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples .env.example 0000664 0000000 0000000 00000000311 15270700723 0042535 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples/manual # Copy to .env and add real values before running main.py
OPENAI_API_KEY=
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_SERVICE_NAME=openai-agents-manual-demo
README.rst 0000664 0000000 0000000 00000002700 15270700723 0042005 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples/manual OpenTelemetry OpenAI Agents Instrumentation Example
===================================================
This example demonstrates how to manually configure the OpenTelemetry SDK
alongside the OpenAI Agents instrumentation.
Running `main.py `_ produces spans for the end-to-end agent run,
including tool invocations and model generations. Spans are exported through
OTLP/gRPC to the endpoint configured in the environment.
Setup
-----
1. Copy `.env.example <.env.example>`_ to `.env` and update it with your real
``OPENAI_API_KEY``. If your
OTLP collector is not reachable via ``http://localhost:4317``, adjust the
endpoint variables as needed.
2. Create a virtual environment and install the dependencies:
::
python3 -m venv .venv
source .venv/bin/activate
pip install "python-dotenv[cli]"
uv pip install -r requirements.txt --prerelease=allow
Run
---
Execute the sample with ``dotenv`` so the environment variables from ``.env``
are applied:
::
dotenv run -- python main.py
Ensure ``OPENAI_API_KEY`` is present in your environment (or ``.env`` file); the OpenAI client raises ``OpenAIError`` if the key is missing.
The script automatically loads environment variables from ``.env`` so running
``python main.py`` directly also works if the shell already has the required
values exported.
You should see the agent response printed to the console while spans export to
your configured observability backend.
main.py 0000664 0000000 0000000 00000003277 15270700723 0041626 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples/manual # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# pylint: skip-file
"""Manual OpenAI Agents instrumentation example."""
from __future__ import annotations
from agents import Agent, Runner, function_tool
from dotenv import load_dotenv
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import (
OTLPSpanExporter,
)
from opentelemetry.instrumentation.openai_agents import (
OpenAIAgentsInstrumentor,
)
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
def configure_otel() -> None:
"""Configure the OpenTelemetry SDK for exporting spans."""
provider = TracerProvider()
provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
trace.set_tracer_provider(provider)
OpenAIAgentsInstrumentor().instrument(tracer_provider=provider)
@function_tool
def get_weather(city: str) -> str:
"""Return a canned weather response for the requested city."""
return f"The forecast for {city} is sunny with pleasant temperatures."
def run_agent() -> None:
"""Create a simple agent and execute a single run."""
assistant = Agent(
name="Travel Concierge",
instructions=(
"You are a concise travel concierge. Use the weather tool when the traveler asks about local conditions."
),
tools=[get_weather],
)
result = Runner.run_sync(
assistant,
"I'm visiting Barcelona this weekend. How should I pack?",
)
print("Agent response:")
print(result.final_output)
def main() -> None:
load_dotenv()
configure_otel()
run_agent()
if __name__ == "__main__":
main()
requirements.txt 0000664 0000000 0000000 00000000254 15270700723 0043604 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples/manual openai-agents~=0.3.3
python-dotenv~=1.0
opentelemetry-sdk~=1.36.0
opentelemetry-exporter-otlp-proto-grpc~=1.36.0
opentelemetry-instrumentation-openai-agents-v2~=0.1.0.dev
zero-code/ 0000775 0000000 0000000 00000000000 15270700723 0040731 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples .env.example 0000664 0000000 0000000 00000000614 15270700723 0043155 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples/zero-code # Update this with your real OpenAI API key
OPENAI_API_KEY=sk-YOUR_API_KEY
# Uncomment and adjust if you use a non-default OTLP collector endpoint
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
# OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_SERVICE_NAME=opentelemetry-python-openai-agents-zero-code
# Optionally override the agent name reported on spans
# OTEL_GENAI_AGENT_NAME=Travel Concierge
README.rst 0000664 0000000 0000000 00000002764 15270700723 0042431 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples/zero-code OpenTelemetry OpenAI Agents Zero-Code Instrumentation Example
=============================================================
This example shows how to capture telemetry from OpenAI Agents without
changing your application code by using ``opentelemetry-instrument``.
When `main.py `_ is executed, spans describing the agent workflow are
exported to the configured OTLP endpoint. The spans include details such as the
operation name, tool usage, and token consumption (when available).
Setup
-----
1. Copy `.env.example <.env.example>`_ to `.env` and update it with your real
``OPENAI_API_KEY``. Adjust the
OTLP endpoint settings if your collector is not reachable via
``http://localhost:4317``.
2. Create a virtual environment and install the dependencies:
::
python3 -m venv .venv
source .venv/bin/activate
pip install "python-dotenv[cli]"
uv pip install -r requirements.txt --prerelease=allow
Run
---
Execute the sample via ``opentelemetry-instrument`` so the OpenAI Agents
instrumentation is activated automatically:
::
dotenv run -- opentelemetry-instrument python main.py
Ensure ``OPENAI_API_KEY`` is set in your shell or `.env`; the OpenAI client raises ``OpenAIError`` if the key is missing.
Because ``main.py`` invokes ``load_dotenv``, running ``python main.py`` directly
also works when the required environment variables are already exported.
You should see the agent response printed to the console while spans export to
your observability backend.
main.py 0000664 0000000 0000000 00000003426 15270700723 0042234 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples/zero-code # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
"""Zero-code OpenAI Agents example."""
from __future__ import annotations
from agents import Agent, Runner, function_tool
from dotenv import load_dotenv
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import (
OTLPSpanExporter,
)
from opentelemetry.instrumentation.openai_agents import (
OpenAIAgentsInstrumentor,
)
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
def configure_tracing() -> None:
"""Ensure tracing exports spans even without auto-instrumentation."""
current_provider = trace.get_tracer_provider()
if isinstance(current_provider, TracerProvider):
provider = current_provider
else:
provider = TracerProvider()
provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
trace.set_tracer_provider(provider)
OpenAIAgentsInstrumentor().instrument(tracer_provider=provider)
@function_tool
def get_weather(city: str) -> str:
"""Return a canned weather response for the requested city."""
return f"The forecast for {city} is sunny with pleasant temperatures."
def run_agent() -> None:
assistant = Agent(
name="Travel Concierge",
instructions=(
"You are a concise travel concierge. Use the weather tool when the traveler asks about local conditions."
),
tools=[get_weather],
)
result = Runner.run_sync(
assistant,
"I'm visiting Barcelona this weekend. How should I pack?",
)
print("Agent response:")
print(result.final_output)
def main() -> None:
load_dotenv()
configure_tracing()
run_agent()
if __name__ == "__main__":
main()
requirements.txt 0000664 0000000 0000000 00000000311 15270700723 0044210 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/examples/zero-code openai-agents~=0.3.3
python-dotenv~=1.0
opentelemetry-sdk~=1.36.0
opentelemetry-exporter-otlp-proto-grpc~=1.36.0
opentelemetry-distro~=0.57b0
opentelemetry-instrumentation-openai-agents-v2~=0.1.0.dev
pyproject.toml 0000664 0000000 0000000 00000003343 15270700723 0040143 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2 [build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "opentelemetry-instrumentation-openai-agents-v2"
dynamic = ["version"]
description = "OpenTelemetry Official OpenAI Agents instrumentation"
readme = "README.rst"
license = "Apache-2.0"
requires-python = ">=3.10"
authors = [
{ name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"opentelemetry-api >= 1.40",
"opentelemetry-instrumentation >= 0.61b0",
"opentelemetry-semantic-conventions >= 0.61b0",
"opentelemetry-util-genai >= 0.4b0, < 0.6b0",
"typing-extensions >= 4.5.0",
]
[project.optional-dependencies]
instruments = [
"openai-agents >= 0.3.3",
]
[project.entry-points.opentelemetry_instrumentor]
openai_agents = "opentelemetry.instrumentation.openai_agents:OpenAIAgentsInstrumentor"
[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"
[tool.hatch.version]
path = "src/opentelemetry/instrumentation/openai_agents/version.py"
[tool.hatch.build.targets.sdist]
include = [
"/src",
]
[tool.hatch.build.targets.wheel]
packages = ["src/opentelemetry"]
src/ 0000775 0000000 0000000 00000000000 15270700723 0036013 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2 opentelemetry/ 0000775 0000000 0000000 00000000000 15270700723 0040707 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/src instrumentation/ 0000775 0000000 0000000 00000000000 15270700723 0044152 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/src/opentelemetry openai_agents/ 0000775 0000000 0000000 00000000000 15270700723 0046766 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/src/opentelemetry/instrumentation __init__.py 0000664 0000000 0000000 00000016175 15270700723 0051111 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/src/opentelemetry/instrumentation/openai_agents # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
"""OpenAI Agents instrumentation for OpenTelemetry."""
# pylint: disable=too-many-locals
from __future__ import annotations
import importlib
import logging
import os
from collections.abc import Collection
from typing import Any
from typing_extensions import deprecated
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.semconv._incubating.attributes import (
gen_ai_attributes as GenAI,
)
from opentelemetry.semconv.schemas import Schemas
from opentelemetry.trace import get_tracer
from .package import _instruments
from .span_processor import (
ContentCaptureMode,
GenAIEvaluationAttributes,
GenAIOperationName,
GenAIOutputType,
GenAIProvider,
GenAISemanticProcessor,
GenAIToolType,
)
__all__ = [
"GenAIEvaluationAttributes",
"GenAIOperationName",
"GenAIOutputType",
"GenAIProvider",
"GenAIToolType",
"OpenAIAgentsInstrumentor",
]
logger = logging.getLogger(__name__)
_CONTENT_CAPTURE_ENV = "OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT"
_SYSTEM_OVERRIDE_ENV = "OTEL_INSTRUMENTATION_OPENAI_AGENTS_SYSTEM"
_CAPTURE_CONTENT_ENV = "OTEL_INSTRUMENTATION_OPENAI_AGENTS_CAPTURE_CONTENT"
_CAPTURE_METRICS_ENV = "OTEL_INSTRUMENTATION_OPENAI_AGENTS_CAPTURE_METRICS"
def _load_tracing_module(): # pragma: no cover - exercised via tests
return importlib.import_module("agents.tracing")
def _get_registered_processors(provider) -> list:
multi = getattr(provider, "_multi_processor", None)
processors = getattr(multi, "_processors", ())
return list(processors)
def _resolve_system(value: str | None) -> str:
if not value:
return GenAI.GenAiSystemValues.OPENAI.value
normalized = value.strip().lower()
for member in GenAI.GenAiSystemValues:
if normalized == member.value:
return member.value
if normalized == member.name.lower():
return member.value
return value
def _resolve_content_mode(value: Any) -> ContentCaptureMode:
if isinstance(value, ContentCaptureMode):
return value
if isinstance(value, bool):
return ContentCaptureMode.SPAN_AND_EVENT if value else ContentCaptureMode.NO_CONTENT
if value is None:
return ContentCaptureMode.SPAN_AND_EVENT
text = str(value).strip().lower()
if not text:
return ContentCaptureMode.SPAN_AND_EVENT
mapping = {
"span_only": ContentCaptureMode.SPAN_ONLY,
"span-only": ContentCaptureMode.SPAN_ONLY,
"span": ContentCaptureMode.SPAN_ONLY,
"event_only": ContentCaptureMode.EVENT_ONLY,
"event-only": ContentCaptureMode.EVENT_ONLY,
"event": ContentCaptureMode.EVENT_ONLY,
"span_and_event": ContentCaptureMode.SPAN_AND_EVENT,
"span-and-event": ContentCaptureMode.SPAN_AND_EVENT,
"span_and_events": ContentCaptureMode.SPAN_AND_EVENT,
"all": ContentCaptureMode.SPAN_AND_EVENT,
"true": ContentCaptureMode.SPAN_AND_EVENT,
"1": ContentCaptureMode.SPAN_AND_EVENT,
"yes": ContentCaptureMode.SPAN_AND_EVENT,
"no_content": ContentCaptureMode.NO_CONTENT,
"false": ContentCaptureMode.NO_CONTENT,
"0": ContentCaptureMode.NO_CONTENT,
"no": ContentCaptureMode.NO_CONTENT,
"none": ContentCaptureMode.NO_CONTENT,
}
return mapping.get(text, ContentCaptureMode.SPAN_AND_EVENT)
def _resolve_bool(value: Any, default: bool) -> bool:
if value is None:
return default
if isinstance(value, bool):
return value
text = str(value).strip().lower()
if text in {"true", "1", "yes", "on"}:
return True
if text in {"false", "0", "no", "off"}:
return False
return default
@deprecated(
"opentelemetry-instrumentation-openai-agents-v2 is deprecated. Use the "
"opentelemetry-instrumentation-genai-openai-agents package instead. This "
"package only receives security patches."
)
class OpenAIAgentsInstrumentor(BaseInstrumentor):
"""Instrumentation that bridges OpenAI Agents tracing to OpenTelemetry.
.. deprecated:: 0.2.0
Use the ``opentelemetry-instrumentation-genai-openai-agents`` package
instead. This package only receives security patches.
"""
def __init__(self) -> None:
super().__init__()
self._processor: GenAISemanticProcessor | None = None
def _instrument(self, **kwargs) -> None:
if self._processor is not None:
return
tracer_provider = kwargs.get("tracer_provider")
tracer = get_tracer(
__name__,
"",
tracer_provider,
schema_url=Schemas.V1_28_0.value,
)
system_override = kwargs.get("system") or os.getenv(_SYSTEM_OVERRIDE_ENV)
system = _resolve_system(system_override)
content_override = kwargs.get("capture_message_content")
if content_override is None:
content_override = os.getenv(_CONTENT_CAPTURE_ENV) or os.getenv(_CAPTURE_CONTENT_ENV)
content_mode = _resolve_content_mode(content_override)
metrics_override = kwargs.get("capture_metrics")
if metrics_override is None:
metrics_override = os.getenv(_CAPTURE_METRICS_ENV)
metrics_enabled = _resolve_bool(metrics_override, default=True)
agent_name = kwargs.get("agent_name")
agent_id = kwargs.get("agent_id")
agent_description = kwargs.get("agent_description")
base_url = kwargs.get("base_url")
server_address = kwargs.get("server_address")
server_port = kwargs.get("server_port")
processor = GenAISemanticProcessor(
tracer=tracer,
system_name=system,
include_sensitive_data=content_mode != ContentCaptureMode.NO_CONTENT,
content_mode=content_mode,
metrics_enabled=metrics_enabled,
agent_name=agent_name,
agent_id=agent_id,
agent_description=agent_description,
base_url=base_url,
server_address=server_address,
server_port=server_port,
agent_name_default="OpenAI Agent",
agent_id_default="agent",
agent_description_default="OpenAI Agents instrumentation",
base_url_default="https://api.openai.com",
server_address_default="api.openai.com",
server_port_default=443,
)
tracing = _load_tracing_module()
provider = tracing.get_trace_provider()
existing = _get_registered_processors(provider)
provider.set_processors([*existing, processor])
self._processor = processor
def _uninstrument(self, **kwargs) -> None:
if self._processor is None:
return
tracing = _load_tracing_module()
provider = tracing.get_trace_provider()
current = _get_registered_processors(provider)
filtered = [proc for proc in current if proc is not self._processor]
provider.set_processors(filtered)
try:
self._processor.shutdown()
finally:
self._processor = None
def instrumentation_dependencies(self) -> Collection[str]:
return _instruments
package.py 0000664 0000000 0000000 00000000222 15270700723 0050727 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/src/opentelemetry/instrumentation/openai_agents # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
_instruments = ("openai-agents >= 0.3.3",)
_supports_metrics = False
span_processor.py 0000664 0000000 0000000 00000234342 15270700723 0052410 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/src/opentelemetry/instrumentation/openai_agents # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
"""
GenAI Semantic Convention Trace Processor
This module implements a custom trace processor that enriches spans with
OpenTelemetry GenAI semantic conventions attributes following the
OpenInference processor pattern. It adds standardized attributes for
generative AI operations using iterator-based attribute extraction.
References:
- OpenTelemetry GenAI Semantic Conventions:
https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/
- OpenInference Pattern: https://github.com/Arize-ai/openinference
"""
# pylint: disable=too-many-lines,invalid-name,too-many-locals,too-many-branches,too-many-statements,too-many-return-statements,too-many-nested-blocks,too-many-arguments,too-many-instance-attributes,broad-exception-caught,no-self-use,consider-iterating-dictionary,unused-variable,unnecessary-pass
from __future__ import annotations
import importlib
import logging
from collections.abc import Iterator, Sequence
from dataclasses import dataclass
from datetime import datetime, timezone
from enum import Enum
from typing import Any
from urllib.parse import urlparse
from opentelemetry.util.genai.utils import gen_ai_json_dumps
try:
from agents.tracing import Span, Trace, TracingProcessor
from agents.tracing.span_data import (
AgentSpanData,
FunctionSpanData,
GenerationSpanData,
GuardrailSpanData,
HandoffSpanData,
ResponseSpanData,
SpeechSpanData,
TranscriptionSpanData,
)
except ModuleNotFoundError: # pragma: no cover - test stubs
tracing_module = importlib.import_module("agents.tracing")
Span = tracing_module.Span
Trace = tracing_module.Trace
TracingProcessor = tracing_module.TracingProcessor
AgentSpanData = getattr(tracing_module, "AgentSpanData", Any) # type: ignore[assignment]
FunctionSpanData = getattr(tracing_module, "FunctionSpanData", Any) # type: ignore[assignment]
GenerationSpanData = getattr(tracing_module, "GenerationSpanData", Any) # type: ignore[assignment]
GuardrailSpanData = getattr(tracing_module, "GuardrailSpanData", Any) # type: ignore[assignment]
HandoffSpanData = getattr(tracing_module, "HandoffSpanData", Any) # type: ignore[assignment]
ResponseSpanData = getattr(tracing_module, "ResponseSpanData", Any) # type: ignore[assignment]
SpeechSpanData = getattr(tracing_module, "SpeechSpanData", Any) # type: ignore[assignment]
TranscriptionSpanData = getattr(tracing_module, "TranscriptionSpanData", Any) # type: ignore[assignment]
from opentelemetry.context import attach, detach
from opentelemetry.metrics import Histogram, get_meter
from opentelemetry.semconv._incubating.attributes import (
gen_ai_attributes as GenAIAttributes,
)
from opentelemetry.semconv._incubating.attributes import (
server_attributes as ServerAttributes,
)
from opentelemetry.trace import Span as OtelSpan
from opentelemetry.trace import (
SpanKind,
Status,
StatusCode,
Tracer,
set_span_in_context,
)
from opentelemetry.util.types import AttributeValue
# Import all semantic convention constants
# ---- GenAI semantic convention helpers (embedded from constants.py) ----
def _enum_values(enum_cls) -> dict[str, str]:
"""Return mapping of enum member name to value."""
return {member.name: member.value for member in enum_cls}
_PROVIDER_VALUES = _enum_values(GenAIAttributes.GenAiProviderNameValues)
class GenAIProvider:
OPENAI = _PROVIDER_VALUES["OPENAI"]
GCP_GEN_AI = _PROVIDER_VALUES["GCP_GEN_AI"]
GCP_VERTEX_AI = _PROVIDER_VALUES["GCP_VERTEX_AI"]
GCP_GEMINI = _PROVIDER_VALUES["GCP_GEMINI"]
ANTHROPIC = _PROVIDER_VALUES["ANTHROPIC"]
COHERE = _PROVIDER_VALUES["COHERE"]
AZURE_AI_INFERENCE = _PROVIDER_VALUES["AZURE_AI_INFERENCE"]
AZURE_AI_OPENAI = _PROVIDER_VALUES["AZURE_AI_OPENAI"]
IBM_WATSONX_AI = _PROVIDER_VALUES["IBM_WATSONX_AI"]
AWS_BEDROCK = _PROVIDER_VALUES["AWS_BEDROCK"]
PERPLEXITY = _PROVIDER_VALUES["PERPLEXITY"]
X_AI = _PROVIDER_VALUES["X_AI"]
DEEPSEEK = _PROVIDER_VALUES["DEEPSEEK"]
GROQ = _PROVIDER_VALUES["GROQ"]
MISTRAL_AI = _PROVIDER_VALUES["MISTRAL_AI"]
ALL = set(_PROVIDER_VALUES.values())
_OPERATION_VALUES = _enum_values(GenAIAttributes.GenAiOperationNameValues)
class GenAIOperationName:
CHAT = _OPERATION_VALUES["CHAT"]
GENERATE_CONTENT = _OPERATION_VALUES["GENERATE_CONTENT"]
TEXT_COMPLETION = _OPERATION_VALUES["TEXT_COMPLETION"]
EMBEDDINGS = _OPERATION_VALUES["EMBEDDINGS"]
CREATE_AGENT = _OPERATION_VALUES["CREATE_AGENT"]
INVOKE_AGENT = _OPERATION_VALUES["INVOKE_AGENT"]
EXECUTE_TOOL = _OPERATION_VALUES["EXECUTE_TOOL"]
# Operations below are not yet covered by the spec but remain for backwards compatibility
TRANSCRIPTION = "transcription"
SPEECH = "speech_generation"
GUARDRAIL = "guardrail_check"
HANDOFF = "agent_handoff"
RESPONSE = "response" # internal aggregator in current processor
CLASS_FALLBACK = {
"generationspan": CHAT,
"responsespan": RESPONSE,
"functionspan": EXECUTE_TOOL,
"agentspan": INVOKE_AGENT,
}
_OUTPUT_VALUES = _enum_values(GenAIAttributes.GenAiOutputTypeValues)
class GenAIOutputType:
TEXT = _OUTPUT_VALUES["TEXT"]
JSON = _OUTPUT_VALUES["JSON"]
IMAGE = _OUTPUT_VALUES["IMAGE"]
SPEECH = _OUTPUT_VALUES["SPEECH"]
class GenAIToolType:
FUNCTION = "function"
EXTENSION = "extension"
DATASTORE = "datastore"
ALL = {FUNCTION, EXTENSION, DATASTORE}
class GenAIEvaluationAttributes:
NAME = "gen_ai.evaluation.name"
SCORE_VALUE = "gen_ai.evaluation.score.value"
SCORE_LABEL = "gen_ai.evaluation.score.label"
EXPLANATION = "gen_ai.evaluation.explanation"
def _attr(name: str, fallback: str) -> str:
return getattr(GenAIAttributes, name, fallback)
GEN_AI_PROVIDER_NAME = _attr("GEN_AI_PROVIDER_NAME", "gen_ai.provider.name")
GEN_AI_OPERATION_NAME = _attr("GEN_AI_OPERATION_NAME", "gen_ai.operation.name")
GEN_AI_REQUEST_MODEL = _attr("GEN_AI_REQUEST_MODEL", "gen_ai.request.model")
GEN_AI_REQUEST_MAX_TOKENS = _attr("GEN_AI_REQUEST_MAX_TOKENS", "gen_ai.request.max_tokens")
GEN_AI_REQUEST_TEMPERATURE = _attr("GEN_AI_REQUEST_TEMPERATURE", "gen_ai.request.temperature")
GEN_AI_REQUEST_TOP_P = _attr("GEN_AI_REQUEST_TOP_P", "gen_ai.request.top_p")
GEN_AI_REQUEST_TOP_K = _attr("GEN_AI_REQUEST_TOP_K", "gen_ai.request.top_k")
GEN_AI_REQUEST_FREQUENCY_PENALTY = _attr("GEN_AI_REQUEST_FREQUENCY_PENALTY", "gen_ai.request.frequency_penalty")
GEN_AI_REQUEST_PRESENCE_PENALTY = _attr("GEN_AI_REQUEST_PRESENCE_PENALTY", "gen_ai.request.presence_penalty")
GEN_AI_REQUEST_CHOICE_COUNT = _attr("GEN_AI_REQUEST_CHOICE_COUNT", "gen_ai.request.choice.count")
GEN_AI_REQUEST_STOP_SEQUENCES = _attr("GEN_AI_REQUEST_STOP_SEQUENCES", "gen_ai.request.stop_sequences")
GEN_AI_REQUEST_ENCODING_FORMATS = _attr("GEN_AI_REQUEST_ENCODING_FORMATS", "gen_ai.request.encoding_formats")
GEN_AI_REQUEST_SEED = _attr("GEN_AI_REQUEST_SEED", "gen_ai.request.seed")
GEN_AI_RESPONSE_ID = _attr("GEN_AI_RESPONSE_ID", "gen_ai.response.id")
GEN_AI_RESPONSE_MODEL = _attr("GEN_AI_RESPONSE_MODEL", "gen_ai.response.model")
GEN_AI_RESPONSE_FINISH_REASONS = _attr("GEN_AI_RESPONSE_FINISH_REASONS", "gen_ai.response.finish_reasons")
GEN_AI_USAGE_INPUT_TOKENS = _attr("GEN_AI_USAGE_INPUT_TOKENS", "gen_ai.usage.input_tokens")
GEN_AI_USAGE_OUTPUT_TOKENS = _attr("GEN_AI_USAGE_OUTPUT_TOKENS", "gen_ai.usage.output_tokens")
GEN_AI_CONVERSATION_ID = _attr("GEN_AI_CONVERSATION_ID", "gen_ai.conversation.id")
GEN_AI_AGENT_ID = _attr("GEN_AI_AGENT_ID", "gen_ai.agent.id")
GEN_AI_AGENT_NAME = _attr("GEN_AI_AGENT_NAME", "gen_ai.agent.name")
GEN_AI_AGENT_DESCRIPTION = _attr("GEN_AI_AGENT_DESCRIPTION", "gen_ai.agent.description")
GEN_AI_TOOL_NAME = _attr("GEN_AI_TOOL_NAME", "gen_ai.tool.name")
GEN_AI_TOOL_TYPE = _attr("GEN_AI_TOOL_TYPE", "gen_ai.tool.type")
GEN_AI_TOOL_CALL_ID = _attr("GEN_AI_TOOL_CALL_ID", "gen_ai.tool.call.id")
GEN_AI_TOOL_DESCRIPTION = _attr("GEN_AI_TOOL_DESCRIPTION", "gen_ai.tool.description")
GEN_AI_OUTPUT_TYPE = _attr("GEN_AI_OUTPUT_TYPE", "gen_ai.output.type")
GEN_AI_SYSTEM_INSTRUCTIONS = _attr("GEN_AI_SYSTEM_INSTRUCTIONS", "gen_ai.system_instructions")
GEN_AI_INPUT_MESSAGES = _attr("GEN_AI_INPUT_MESSAGES", "gen_ai.input.messages")
GEN_AI_OUTPUT_MESSAGES = _attr("GEN_AI_OUTPUT_MESSAGES", "gen_ai.output.messages")
GEN_AI_DATA_SOURCE_ID = _attr("GEN_AI_DATA_SOURCE_ID", "gen_ai.data_source.id")
# The semantic conventions currently expose multiple usage token attributes; we retain the
# completion/prompt aliases for backwards compatibility where used.
GEN_AI_USAGE_PROMPT_TOKENS = _attr("GEN_AI_USAGE_PROMPT_TOKENS", "gen_ai.usage.prompt_tokens")
GEN_AI_USAGE_COMPLETION_TOKENS = _attr("GEN_AI_USAGE_COMPLETION_TOKENS", "gen_ai.usage.completion_tokens")
# Attributes not (yet) defined in the spec retain their literal values.
GEN_AI_TOOL_CALL_ARGUMENTS = "gen_ai.tool.call.arguments"
GEN_AI_TOOL_CALL_RESULT = "gen_ai.tool.call.result"
GEN_AI_TOOL_DEFINITIONS = "gen_ai.tool.definitions"
GEN_AI_ORCHESTRATOR_AGENT_DEFINITIONS = "gen_ai.orchestrator.agent.definitions"
GEN_AI_GUARDRAIL_NAME = "gen_ai.guardrail.name"
GEN_AI_GUARDRAIL_TRIGGERED = "gen_ai.guardrail.triggered"
GEN_AI_HANDOFF_FROM_AGENT = "gen_ai.handoff.from_agent"
GEN_AI_HANDOFF_TO_AGENT = "gen_ai.handoff.to_agent"
GEN_AI_EMBEDDINGS_DIMENSION_COUNT = "gen_ai.embeddings.dimension.count"
GEN_AI_TOKEN_TYPE = _attr("GEN_AI_TOKEN_TYPE", "gen_ai.token.type")
# ---- Normalization utilities (embedded from utils.py) ----
def normalize_provider(provider: str | None) -> str | None:
"""Normalize provider name to spec-compliant value."""
if not provider:
return None
normalized = provider.strip().lower()
if normalized in GenAIProvider.ALL:
return normalized
return provider # passthrough if unknown (forward compat)
def validate_tool_type(tool_type: str | None) -> str:
"""Validate and normalize tool type."""
if not tool_type:
return GenAIToolType.FUNCTION # default
normalized = tool_type.strip().lower()
return normalized if normalized in GenAIToolType.ALL else GenAIToolType.FUNCTION
def normalize_output_type(output_type: str | None) -> str:
"""Normalize output type to spec-compliant value."""
if not output_type:
return GenAIOutputType.TEXT # default
normalized = output_type.strip().lower()
base_map = {
"json_object": GenAIOutputType.JSON,
"jsonschema": GenAIOutputType.JSON,
"speech_audio": GenAIOutputType.SPEECH,
"audio_speech": GenAIOutputType.SPEECH,
"image_png": GenAIOutputType.IMAGE,
"function_arguments_json": GenAIOutputType.JSON,
"tool_call": GenAIOutputType.JSON,
"transcription_json": GenAIOutputType.JSON,
}
if normalized in base_map:
return base_map[normalized]
if normalized in {
GenAIOutputType.TEXT,
GenAIOutputType.JSON,
GenAIOutputType.IMAGE,
GenAIOutputType.SPEECH,
}:
return normalized
return GenAIOutputType.TEXT # default for unknown
# Legacy attributes removed
logger = logging.getLogger(__name__)
GEN_AI_SYSTEM_KEY = getattr(GenAIAttributes, "GEN_AI_SYSTEM", "gen_ai.system")
class ContentCaptureMode(Enum):
"""Controls whether sensitive content is recorded on spans, events, or both."""
NO_CONTENT = "no_content"
SPAN_ONLY = "span_only"
EVENT_ONLY = "event_only"
SPAN_AND_EVENT = "span_and_event"
@property
def capture_in_span(self) -> bool:
return self in (
ContentCaptureMode.SPAN_ONLY,
ContentCaptureMode.SPAN_AND_EVENT,
)
@property
def capture_in_event(self) -> bool:
return self in (
ContentCaptureMode.EVENT_ONLY,
ContentCaptureMode.SPAN_AND_EVENT,
)
@dataclass
class ContentPayload:
"""Container for normalized content associated with a span."""
input_messages: list[dict[str, Any]] | None = None
output_messages: list[dict[str, Any]] | None = None
system_instructions: list[dict[str, str]] | None = None
tool_arguments: Any = None
tool_result: Any = None
def _is_instance_of(value: Any, classes: Any) -> bool:
"""Safe isinstance that tolerates typing.Any placeholders."""
if not isinstance(classes, tuple):
classes = (classes,)
for cls in classes:
try:
if isinstance(value, cls):
return True
except TypeError:
continue
return False
def _infer_server_attributes(base_url: str | None) -> dict[str, Any]:
"""Return server.address / server.port attributes if base_url provided."""
out: dict[str, Any] = {}
if not base_url:
return out
try:
parsed = urlparse(base_url)
if parsed.hostname:
out[ServerAttributes.SERVER_ADDRESS] = parsed.hostname
if parsed.port:
out[ServerAttributes.SERVER_PORT] = parsed.port
except Exception:
return out
return out
def safe_json_dumps(obj: Any) -> str:
"""Safely convert object to JSON string (fallback to str)."""
try:
return gen_ai_json_dumps(obj)
except (TypeError, ValueError):
return str(obj)
def _as_utc_nano(dt: datetime) -> int:
"""Convert datetime to UTC nanoseconds timestamp."""
return int(dt.astimezone(timezone.utc).timestamp() * 1_000_000_000)
def _get_span_status(span: Span[Any]) -> Status:
"""Get OpenTelemetry span status from agent span."""
if error := getattr(span, "error", None):
return Status(
status_code=StatusCode.ERROR,
description=f"{error.get('message', '')}: {error.get('data', '')}",
)
return Status(StatusCode.OK)
def get_span_name(
operation_name: str,
model: str | None = None,
agent_name: str | None = None,
tool_name: str | None = None,
) -> str:
"""Generate spec-compliant span name based on operation type."""
base_name = operation_name
if operation_name in {
GenAIOperationName.CHAT,
GenAIOperationName.TEXT_COMPLETION,
GenAIOperationName.EMBEDDINGS,
GenAIOperationName.TRANSCRIPTION,
GenAIOperationName.SPEECH,
}:
return f"{base_name} {model}" if model else base_name
if operation_name == GenAIOperationName.CREATE_AGENT:
return f"{base_name} {agent_name}" if agent_name else base_name
if operation_name == GenAIOperationName.INVOKE_AGENT:
return f"{base_name} {agent_name}" if agent_name else base_name
if operation_name == GenAIOperationName.EXECUTE_TOOL:
return f"{base_name} {tool_name}" if tool_name else base_name
if operation_name == GenAIOperationName.HANDOFF:
return f"{base_name} {agent_name}" if agent_name else base_name
return base_name
class GenAISemanticProcessor(TracingProcessor):
"""Trace processor adding GenAI semantic convention attributes with metrics."""
# pylint: disable=too-many-positional-arguments
def __init__(
self,
tracer: Tracer | None = None,
system_name: str = "openai",
include_sensitive_data: bool = True,
content_mode: ContentCaptureMode = ContentCaptureMode.SPAN_AND_EVENT,
base_url: str | None = None,
agent_name: str | None = None,
agent_id: str | None = None,
agent_description: str | None = None,
server_address: str | None = None,
server_port: int | None = None,
metrics_enabled: bool = True,
agent_name_default: str | None = None,
agent_id_default: str | None = None,
agent_description_default: str | None = None,
base_url_default: str | None = None,
server_address_default: str | None = None,
server_port_default: int | None = None,
):
"""Initialize processor with metrics support.
Args:
tracer: Optional OpenTelemetry tracer
system_name: Provider name (openai/azure.ai.inference/etc.)
include_sensitive_data: Include model/tool IO when True
base_url: API endpoint for server.address/port
agent_name: Name of the agent (can be overridden by env var)
agent_id: ID of the agent (can be overridden by env var)
agent_description: Description of the agent (can be overridden by env var)
server_address: Server address (can be overridden by env var or base_url)
server_port: Server port (can be overridden by env var or base_url)
"""
self._tracer = tracer
self.system_name = normalize_provider(system_name) or system_name
self._content_mode = content_mode
self.include_sensitive_data = include_sensitive_data and (
content_mode.capture_in_span or content_mode.capture_in_event
)
effective_base_url = base_url or base_url_default
self.base_url = effective_base_url
# Agent information - prefer explicit overrides; otherwise defer to span data
self.agent_name = agent_name
self.agent_id = agent_id
self.agent_description = agent_description
self._agent_name_default = agent_name_default
self._agent_id_default = agent_id_default
self._agent_description_default = agent_description_default
# Server information - use init parameters, then base_url inference
self.server_address = server_address or server_address_default
resolved_port = server_port if server_port is not None else server_port_default
self.server_port = resolved_port
# If server info not provided, try to extract from base_url
if (not self.server_address or not self.server_port) and effective_base_url:
server_attrs = _infer_server_attributes(effective_base_url)
if not self.server_address:
self.server_address = server_attrs.get(ServerAttributes.SERVER_ADDRESS)
if not self.server_port:
self.server_port = server_attrs.get(ServerAttributes.SERVER_PORT)
# Content capture configuration
self._capture_messages = content_mode.capture_in_span or content_mode.capture_in_event
self._capture_system_instructions = True
self._capture_tool_definitions = True
# Span tracking
self._root_spans: dict[str, OtelSpan] = {}
self._otel_spans: dict[str, OtelSpan] = {}
self._tokens: dict[str, object] = {}
self._span_parents: dict[str, str | None] = {}
self._agent_content: dict[str, dict[str, list[Any]]] = {}
# Metrics configuration
self._metrics_enabled = metrics_enabled
self._meter = None
self._duration_histogram: Histogram | None = None
self._token_usage_histogram: Histogram | None = None
if self._metrics_enabled:
self._init_metrics()
def _get_server_attributes(self) -> dict[str, Any]:
"""Get server attributes from configured values."""
attrs = {}
if self.server_address:
attrs[ServerAttributes.SERVER_ADDRESS] = self.server_address
if self.server_port:
attrs[ServerAttributes.SERVER_PORT] = self.server_port
return attrs
def _init_metrics(self):
"""Initialize metric instruments."""
self._meter = get_meter("opentelemetry.instrumentation.openai_agents", "0.1.0")
# Operation duration histogram
self._duration_histogram = self._meter.create_histogram(
name="gen_ai.client.operation.duration",
description="GenAI operation duration",
unit="s",
)
# Token usage histogram
self._token_usage_histogram = self._meter.create_histogram(
name="gen_ai.client.token.usage",
description="Number of input and output tokens used",
unit="{token}",
)
def _record_metrics(self, span: Span[Any], attributes: dict[str, AttributeValue]) -> None:
"""Record metrics for the span."""
if not self._metrics_enabled or (self._duration_histogram is None and self._token_usage_histogram is None):
return
try:
# Calculate duration
duration = None
if hasattr(span, "started_at") and hasattr(span, "ended_at"):
try:
start = datetime.fromisoformat(span.started_at)
end = datetime.fromisoformat(span.ended_at)
duration = (end - start).total_seconds()
except Exception:
pass
# Build metric attributes
metric_attrs = {
GEN_AI_PROVIDER_NAME: attributes.get(GEN_AI_PROVIDER_NAME),
GEN_AI_OPERATION_NAME: attributes.get(GEN_AI_OPERATION_NAME),
GEN_AI_REQUEST_MODEL: (attributes.get(GEN_AI_REQUEST_MODEL) or attributes.get(GEN_AI_RESPONSE_MODEL)),
ServerAttributes.SERVER_ADDRESS: attributes.get(ServerAttributes.SERVER_ADDRESS),
ServerAttributes.SERVER_PORT: attributes.get(ServerAttributes.SERVER_PORT),
}
# Add error type if present
if error := getattr(span, "error", None):
error_type = error.get("type") or error.get("name")
if error_type:
metric_attrs["error.type"] = error_type
# Remove None values
metric_attrs = {k: v for k, v in metric_attrs.items() if v is not None}
# Record duration
if duration is not None and self._duration_histogram is not None:
self._duration_histogram.record(duration, metric_attrs)
# Record token usage
if self._token_usage_histogram:
input_tokens = attributes.get(GEN_AI_USAGE_INPUT_TOKENS)
if isinstance(input_tokens, (int, float)):
token_attrs = dict(metric_attrs)
token_attrs[GEN_AI_TOKEN_TYPE] = "input"
self._token_usage_histogram.record(input_tokens, token_attrs)
output_tokens = attributes.get(GEN_AI_USAGE_OUTPUT_TOKENS)
if isinstance(output_tokens, (int, float)):
token_attrs = dict(metric_attrs)
token_attrs[GEN_AI_TOKEN_TYPE] = "output"
self._token_usage_histogram.record(output_tokens, token_attrs)
except Exception as e:
logger.debug("Failed to record metrics: %s", e)
def _emit_content_events(
self,
span: Span[Any],
otel_span: OtelSpan,
payload: ContentPayload,
agent_content: dict[str, list[Any]] | None = None,
) -> None:
"""Intentionally skip emitting gen_ai.* events to avoid payload duplication."""
if not self.include_sensitive_data or not self._content_mode.capture_in_event or not otel_span.is_recording():
return
logger.debug(
"Event capture requested for span %s but is currently disabled",
getattr(span, "span_id", ""),
)
return
def _collect_system_instructions(self, messages: Sequence[Any] | None) -> list[dict[str, str]]:
"""Return system/ai role instructions as typed text objects.
Enforces format: [{"type": "text", "content": "..."}].
Handles message content that may be a string, list of parts,
or a dict with text/content fields.
"""
if not messages:
return []
out: list[dict[str, str]] = []
for m in messages:
if not isinstance(m, dict):
continue
role = m.get("role")
if role in {"system", "ai"}:
content = m.get("content")
out.extend(self._normalize_to_text_parts(content))
return out
def _normalize_to_text_parts(self, content: Any) -> list[dict[str, str]]:
"""Normalize arbitrary content into typed text parts.
- String -> [{type: text, content: }]
- List/Tuple -> map each item to a text part (string/dict supported)
- Dict -> use 'text' or 'content' field when available; else str(dict)
- Other -> str(value)
"""
parts: list[dict[str, str]] = []
if content is None:
return parts
if isinstance(content, str):
parts.append({"type": "text", "content": content})
return parts
if isinstance(content, (list, tuple)):
for item in content:
if isinstance(item, str):
parts.append({"type": "text", "content": item})
elif isinstance(item, dict):
txt = item.get("text") or item.get("content")
if isinstance(txt, str) and txt:
parts.append({"type": "text", "content": txt})
else:
parts.append({"type": "text", "content": str(item)})
else:
parts.append({"type": "text", "content": str(item)})
return parts
if isinstance(content, dict):
txt = content.get("text") or content.get("content")
if isinstance(txt, str) and txt:
parts.append({"type": "text", "content": txt})
else:
parts.append({"type": "text", "content": str(content)})
return parts
# Fallback for other types
parts.append({"type": "text", "content": str(content)})
return parts
def _redacted_text_parts(self) -> list[dict[str, str]]:
"""Return a single redacted text part for system instructions."""
return [{"type": "text", "content": "readacted"}]
def _normalize_messages_to_role_parts(self, messages: Sequence[Any] | None) -> list[dict[str, Any]]:
"""Normalize input messages to enforced role+parts schema.
Each message becomes: {"role": , "parts": [ {"type": ..., ...} ]}
Redaction: when include_sensitive_data is False, replace text content,
tool_call arguments, and tool_call_response result with "readacted".
"""
if not messages:
return []
normalized: list[dict[str, Any]] = []
for m in messages:
if not isinstance(m, dict):
# Fallback: treat as user text
normalized.append(
{
"role": "user",
"parts": [
{
"type": "text",
"content": "readacted" if not self.include_sensitive_data else str(m),
}
],
}
)
continue
role = m.get("role") or "user"
parts: list[dict[str, Any]] = []
# Existing parts array
if isinstance(m.get("parts"), (list, tuple)):
for p in m["parts"]:
if isinstance(p, dict):
ptype = p.get("type") or "text"
newp: dict[str, Any] = {"type": ptype}
if ptype == "text":
txt = p.get("content") or p.get("text")
newp["content"] = (
"readacted"
if not self.include_sensitive_data
else (txt if isinstance(txt, str) else str(p))
)
elif ptype == "tool_call":
newp["id"] = p.get("id")
newp["name"] = p.get("name")
args = p.get("arguments")
newp["arguments"] = "readacted" if not self.include_sensitive_data else args
elif ptype == "tool_call_response":
newp["id"] = p.get("id") or m.get("tool_call_id")
result = p.get("result") or p.get("content")
newp["result"] = "readacted" if not self.include_sensitive_data else result
else:
newp["content"] = "readacted" if not self.include_sensitive_data else str(p)
parts.append(newp)
else:
parts.append(
{
"type": "text",
"content": "readacted" if not self.include_sensitive_data else str(p),
}
)
# OpenAI content
content = m.get("content")
if isinstance(content, str):
parts.append(
{
"type": "text",
"content": "readacted" if not self.include_sensitive_data else content,
}
)
elif isinstance(content, (list, tuple)):
for item in content:
if isinstance(item, dict):
itype = item.get("type") or "text"
if itype == "text":
txt = item.get("text") or item.get("content")
parts.append(
{
"type": "text",
"content": "readacted"
if not self.include_sensitive_data
else (txt if isinstance(txt, str) else str(item)),
}
)
else:
# Fallback for other part types
parts.append(
{
"type": "text",
"content": "readacted" if not self.include_sensitive_data else str(item),
}
)
else:
parts.append(
{
"type": "text",
"content": "readacted" if not self.include_sensitive_data else str(item),
}
)
# Assistant tool_calls
if role == "assistant" and isinstance(m.get("tool_calls"), (list, tuple)):
for tc in m["tool_calls"]:
if not isinstance(tc, dict):
continue
p = {"type": "tool_call"}
p["id"] = tc.get("id")
fn = tc.get("function") or {}
if isinstance(fn, dict):
p["name"] = fn.get("name")
args = fn.get("arguments")
p["arguments"] = "readacted" if not self.include_sensitive_data else args
parts.append(p)
# Tool call response
if role in {"tool", "function"}:
p = {"type": "tool_call_response"}
p["id"] = m.get("tool_call_id") or m.get("id")
result = m.get("result") or m.get("content")
p["result"] = "readacted" if not self.include_sensitive_data else result
parts.append(p)
if parts:
normalized.append({"role": role, "parts": parts})
elif not self.include_sensitive_data:
normalized.append({"role": role, "parts": self._redacted_text_parts()})
return normalized
def _normalize_output_messages_to_role_parts(self, span_data: Any) -> list[dict[str, Any]]:
"""Normalize output messages to enforced role+parts schema.
Produces: [{"role": "assistant", "parts": [{"type": "text", "content": "..."}],
optional "finish_reason": "..." }]
"""
messages: list[dict[str, Any]] = []
parts: list[dict[str, Any]] = []
finish_reason: str | None = None
# Response span: prefer consolidated output_text
response = getattr(span_data, "response", None)
if response is not None:
# Collect text content
output_text = getattr(response, "output_text", None)
if isinstance(output_text, str) and output_text:
parts.append(
{
"type": "text",
"content": ("readacted" if not self.include_sensitive_data else output_text),
}
)
else:
output = getattr(response, "output", None)
if isinstance(output, Sequence):
for item in output:
# ResponseOutputMessage may have a string representation
txt = getattr(item, "content", None)
if isinstance(txt, str) and txt:
parts.append(
{
"type": "text",
"content": ("readacted" if not self.include_sensitive_data else txt),
}
)
else:
# Fallback: stringified
parts.append(
{
"type": "text",
"content": ("readacted" if not self.include_sensitive_data else str(item)),
}
)
# Capture finish_reason from parts when present
fr = getattr(item, "finish_reason", None)
if isinstance(fr, str) and not finish_reason:
finish_reason = fr
# Generation span: use span_data.output
if not parts:
output = getattr(span_data, "output", None)
if isinstance(output, Sequence):
for item in output:
if isinstance(item, dict):
if item.get("type") == "text":
txt = item.get("content") or item.get("text")
if isinstance(txt, str) and txt:
parts.append(
{
"type": "text",
"content": ("readacted" if not self.include_sensitive_data else txt),
}
)
elif "content" in item and isinstance(item["content"], str):
parts.append(
{
"type": "text",
"content": ("readacted" if not self.include_sensitive_data else item["content"]),
}
)
else:
parts.append(
{
"type": "text",
"content": ("readacted" if not self.include_sensitive_data else str(item)),
}
)
if not finish_reason and isinstance(item.get("finish_reason"), str):
finish_reason = item.get("finish_reason")
elif isinstance(item, str):
parts.append(
{
"type": "text",
"content": ("readacted" if not self.include_sensitive_data else item),
}
)
else:
parts.append(
{
"type": "text",
"content": ("readacted" if not self.include_sensitive_data else str(item)),
}
)
# Build assistant message
msg: dict[str, Any] = {"role": "assistant", "parts": parts}
if finish_reason:
msg["finish_reason"] = finish_reason
# Only include if there is content
if parts:
messages.append(msg)
return messages
def _build_content_payload(self, span: Span[Any]) -> ContentPayload:
"""Normalize content from span data for attribute/event capture."""
payload = ContentPayload()
span_data = getattr(span, "span_data", None)
if span_data is None or not self.include_sensitive_data:
return payload
capture_messages = self._capture_messages and (
self._content_mode.capture_in_span or self._content_mode.capture_in_event
)
capture_system = self._capture_system_instructions and (
self._content_mode.capture_in_span or self._content_mode.capture_in_event
)
capture_tools = self._content_mode.capture_in_span or (
self._content_mode.capture_in_event and _is_instance_of(span_data, FunctionSpanData)
)
if _is_instance_of(span_data, GenerationSpanData):
span_input = getattr(span_data, "input", None)
if capture_messages and span_input:
payload.input_messages = self._normalize_messages_to_role_parts(span_input)
if capture_system and span_input:
sys_instr = self._collect_system_instructions(span_input)
if sys_instr:
payload.system_instructions = sys_instr
if capture_messages and (getattr(span_data, "output", None) or getattr(span_data, "response", None)):
normalized_out = self._normalize_output_messages_to_role_parts(span_data)
if normalized_out:
payload.output_messages = normalized_out
elif _is_instance_of(span_data, ResponseSpanData):
span_input = getattr(span_data, "input", None)
response_obj = getattr(span_data, "response", None)
if capture_messages and span_input:
payload.input_messages = self._normalize_messages_to_role_parts(span_input)
if capture_system and response_obj and hasattr(response_obj, "instructions"):
payload.system_instructions = self._normalize_to_text_parts(response_obj.instructions)
if capture_system and span_input:
sys_instr = self._collect_system_instructions(span_input)
if sys_instr:
payload.system_instructions = sys_instr
if capture_messages:
normalized_out = self._normalize_output_messages_to_role_parts(span_data)
if normalized_out:
payload.output_messages = normalized_out
elif _is_instance_of(span_data, FunctionSpanData) and capture_tools:
def _serialize_tool_value(value: Any) -> str | None:
if value is None:
return None
if isinstance(value, (dict, list)):
return safe_json_dumps(value)
return str(value)
payload.tool_arguments = _serialize_tool_value(getattr(span_data, "input", None))
payload.tool_result = _serialize_tool_value(getattr(span_data, "output", None))
return payload
def _find_agent_parent_span_id(self, span_id: str | None) -> str | None:
"""Return nearest ancestor span id that represents an agent."""
current = span_id
visited: set[str] = set()
while current:
if current in visited:
break
visited.add(current)
if current in self._agent_content:
return current
current = self._span_parents.get(current)
return None
def _update_agent_aggregate(self, span: Span[Any], payload: ContentPayload) -> None:
"""Accumulate child span content for parent agent span."""
agent_id = self._find_agent_parent_span_id(span.parent_id)
if not agent_id:
return
entry = self._agent_content.setdefault(
agent_id,
{
"input_messages": [],
"output_messages": [],
"system_instructions": [],
"request_model": None,
},
)
if payload.input_messages:
entry["input_messages"] = self._merge_content_sequence(entry["input_messages"], payload.input_messages)
if payload.output_messages:
entry["output_messages"] = self._merge_content_sequence(entry["output_messages"], payload.output_messages)
if payload.system_instructions:
entry["system_instructions"] = self._merge_content_sequence(
entry["system_instructions"], payload.system_instructions
)
if not entry.get("request_model"):
model = getattr(span.span_data, "model", None)
if not model:
response_obj = getattr(span.span_data, "response", None)
model = getattr(response_obj, "model", None)
if model:
entry["request_model"] = model
def _infer_output_type(self, span_data: Any) -> str:
"""Infer gen_ai.output.type for multiple span kinds."""
if _is_instance_of(span_data, FunctionSpanData):
# Tool results are typically JSON
return GenAIOutputType.JSON
if _is_instance_of(span_data, TranscriptionSpanData):
return GenAIOutputType.TEXT
if _is_instance_of(span_data, SpeechSpanData):
return GenAIOutputType.SPEECH
if _is_instance_of(span_data, GuardrailSpanData):
return GenAIOutputType.TEXT
if _is_instance_of(span_data, HandoffSpanData):
return GenAIOutputType.TEXT
# Check for embeddings operation
if _is_instance_of(span_data, GenerationSpanData):
if hasattr(span_data, "embedding_dimension"):
return GenAIOutputType.TEXT # Embeddings are numeric but represented as text
# Generation/Response - check output structure
output = getattr(span_data, "output", None) or getattr(getattr(span_data, "response", None), "output", None)
if isinstance(output, Sequence) and output:
first = output[0]
if isinstance(first, dict):
item_type = first.get("type")
if isinstance(item_type, str):
normalized = item_type.strip().lower()
if normalized in {"image", "image_url"}:
return GenAIOutputType.IMAGE
if normalized in {"audio", "speech", "audio_url"}:
return GenAIOutputType.SPEECH
if normalized in {
"json",
"json_object",
"jsonschema",
"function_call",
"tool_call",
"tool_result",
}:
return GenAIOutputType.JSON
if normalized in {
"text",
"output_text",
"message",
"assistant",
}:
return GenAIOutputType.TEXT
# Conversation style payloads
if "role" in first:
parts = first.get("parts")
if isinstance(parts, Sequence) and parts:
# If all parts are textual (or missing explicit type), treat as text
textual = True
for part in parts:
if isinstance(part, dict):
part_type = str(part.get("type", "")).lower()
if part_type in {"image", "image_url"}:
return GenAIOutputType.IMAGE
if part_type in {
"audio",
"speech",
"audio_url",
}:
return GenAIOutputType.SPEECH
if part_type and part_type not in {
"text",
"output_text",
"assistant",
}:
textual = False
elif not isinstance(part, str):
textual = False
if textual:
return GenAIOutputType.TEXT
content_value = first.get("content")
if isinstance(content_value, str):
return GenAIOutputType.TEXT
# Detect structured data without explicit type
json_like_keys = {
"schema",
"properties",
"arguments",
"result",
"data",
"json",
"output_json",
}
if json_like_keys.intersection(first.keys()):
return GenAIOutputType.JSON
return GenAIOutputType.TEXT
@staticmethod
def _sanitize_usage_payload(usage: Any) -> None:
"""Remove non-spec usage fields (e.g., total tokens) in-place."""
if not usage:
return
if isinstance(usage, dict):
usage.pop("total_tokens", None)
return
if hasattr(usage, "total_tokens"):
try:
usage.total_tokens = None
except Exception: # pragma: no cover - defensive
try:
delattr(usage, "total_tokens")
except Exception: # pragma: no cover - defensive
pass
def _get_span_kind(self, span_data: Any) -> SpanKind:
"""Determine appropriate span kind based on span data type."""
if _is_instance_of(span_data, FunctionSpanData):
return SpanKind.INTERNAL # Tool execution is internal
if _is_instance_of(
span_data,
(
GenerationSpanData,
ResponseSpanData,
TranscriptionSpanData,
SpeechSpanData,
),
):
return SpanKind.CLIENT # API calls to model providers
if _is_instance_of(span_data, AgentSpanData):
return SpanKind.CLIENT
if _is_instance_of(span_data, (GuardrailSpanData, HandoffSpanData)):
return SpanKind.INTERNAL # Agent operations are internal
return SpanKind.INTERNAL
def on_trace_start(self, trace: Trace) -> None:
"""Create root span when trace starts."""
if self._tracer:
attributes = {
GEN_AI_PROVIDER_NAME: self.system_name,
GEN_AI_SYSTEM_KEY: self.system_name,
GEN_AI_OPERATION_NAME: GenAIOperationName.INVOKE_AGENT,
}
# Legacy emission removed
# Add configured agent and server attributes
if self.agent_name:
attributes[GEN_AI_AGENT_NAME] = self.agent_name
if self.agent_id:
attributes[GEN_AI_AGENT_ID] = self.agent_id
if self.agent_description:
attributes[GEN_AI_AGENT_DESCRIPTION] = self.agent_description
attributes.update(self._get_server_attributes())
otel_span = self._tracer.start_span(
name=trace.name,
attributes=attributes,
kind=SpanKind.SERVER, # Root span is typically server
)
self._root_spans[trace.trace_id] = otel_span
def on_trace_end(self, trace: Trace) -> None:
"""End root span when trace ends."""
if root_span := self._root_spans.pop(trace.trace_id, None):
if root_span.is_recording():
root_span.set_status(Status(StatusCode.OK))
root_span.end()
self._cleanup_spans_for_trace(trace.trace_id)
def on_span_start(self, span: Span[Any]) -> None:
"""Start child span for agent span."""
if not self._tracer or not span.started_at:
return
self._span_parents[span.span_id] = span.parent_id
if _is_instance_of(span.span_data, AgentSpanData) and span.span_id not in self._agent_content:
self._agent_content[span.span_id] = {
"input_messages": [],
"output_messages": [],
"system_instructions": [],
"request_model": None,
}
parent_span = self._otel_spans.get(span.parent_id) if span.parent_id else self._root_spans.get(span.trace_id)
context = set_span_in_context(parent_span) if parent_span else None
# Get operation details for span naming
operation_name = self._get_operation_name(span.span_data)
model = getattr(span.span_data, "model", None)
if model is None:
response_obj = getattr(span.span_data, "response", None)
model = getattr(response_obj, "model", None)
# Use configured agent name or get from span data
agent_name = self.agent_name
if not agent_name and _is_instance_of(span.span_data, AgentSpanData):
agent_name = getattr(span.span_data, "name", None)
if not agent_name:
agent_name = self._agent_name_default
tool_name = getattr(span.span_data, "name", None) if _is_instance_of(span.span_data, FunctionSpanData) else None
# Generate spec-compliant span name
span_name = get_span_name(operation_name, model, agent_name, tool_name)
attributes = {
GEN_AI_PROVIDER_NAME: self.system_name,
GEN_AI_SYSTEM_KEY: self.system_name,
GEN_AI_OPERATION_NAME: operation_name,
}
# Legacy emission removed
# Add configured agent and server attributes
agent_name_override = self.agent_name or self._agent_name_default
agent_id_override = self.agent_id or self._agent_id_default
agent_desc_override = self.agent_description or self._agent_description_default
if agent_name_override:
attributes[GEN_AI_AGENT_NAME] = agent_name_override
if agent_id_override:
attributes[GEN_AI_AGENT_ID] = agent_id_override
if agent_desc_override:
attributes[GEN_AI_AGENT_DESCRIPTION] = agent_desc_override
attributes.update(self._get_server_attributes())
otel_span = self._tracer.start_span(
name=span_name,
context=context,
attributes=attributes,
kind=self._get_span_kind(span.span_data),
)
self._otel_spans[span.span_id] = otel_span
self._tokens[span.span_id] = attach(set_span_in_context(otel_span))
def on_span_end(self, span: Span[Any]) -> None:
"""Finalize span with attributes, events, and metrics."""
if token := self._tokens.pop(span.span_id, None):
detach(token)
payload = self._build_content_payload(span)
self._update_agent_aggregate(span, payload)
agent_content = (
self._agent_content.get(span.span_id) if _is_instance_of(span.span_data, AgentSpanData) else None
)
if not (otel_span := self._otel_spans.pop(span.span_id, None)):
# Log attributes even without OTel span
try:
attributes = dict(self._extract_genai_attributes(span, payload, agent_content))
for key, value in attributes.items():
logger.debug("GenAI attr span %s: %s=%s", span.span_id, key, value)
except Exception as e:
logger.warning(
"Failed to extract attributes for span %s: %s",
span.span_id,
e,
)
if _is_instance_of(span.span_data, AgentSpanData):
self._agent_content.pop(span.span_id, None)
self._span_parents.pop(span.span_id, None)
return
try:
# Extract and set attributes
attributes: dict[str, AttributeValue] = {}
# Optimize for non-sampled spans to avoid heavy work
if not otel_span.is_recording():
otel_span.end()
return
for key, value in self._extract_genai_attributes(span, payload, agent_content):
otel_span.set_attribute(key, value)
attributes[key] = value
if _is_instance_of(span.span_data, (GenerationSpanData, ResponseSpanData)):
operation_name = attributes.get(GEN_AI_OPERATION_NAME)
model_for_name = attributes.get(GEN_AI_REQUEST_MODEL) or (attributes.get(GEN_AI_RESPONSE_MODEL))
if operation_name and model_for_name:
agent_name_for_name = attributes.get(GEN_AI_AGENT_NAME)
tool_name_for_name = attributes.get(GEN_AI_TOOL_NAME)
new_name = get_span_name(
operation_name,
model_for_name,
agent_name_for_name,
tool_name_for_name,
)
if new_name != otel_span.name:
otel_span.update_name(new_name)
# Emit span events for captured content when configured
self._emit_content_events(span, otel_span, payload, agent_content)
# Emit operation details event if configured
# Set error status if applicable
otel_span.set_status(status=_get_span_status(span))
if getattr(span, "error", None):
err_obj = span.error
err_type = err_obj.get("type") or err_obj.get("name")
if err_type:
otel_span.set_attribute("error.type", err_type)
# Record metrics before ending span
self._record_metrics(span, attributes)
# End the span
otel_span.end()
except Exception as e:
logger.warning("Failed to enrich span %s: %s", span.span_id, e)
otel_span.set_status(Status(StatusCode.ERROR, str(e)))
otel_span.end()
finally:
if _is_instance_of(span.span_data, AgentSpanData):
self._agent_content.pop(span.span_id, None)
self._span_parents.pop(span.span_id, None)
def shutdown(self) -> None:
"""Clean up resources on shutdown."""
for span_id, otel_span in list(self._otel_spans.items()):
otel_span.set_status(Status(StatusCode.ERROR, "Application shutdown"))
otel_span.end()
for trace_id, root_span in list(self._root_spans.items()):
root_span.set_status(Status(StatusCode.ERROR, "Application shutdown"))
root_span.end()
self._otel_spans.clear()
self._root_spans.clear()
self._tokens.clear()
self._span_parents.clear()
self._agent_content.clear()
def force_flush(self) -> None:
"""Force flush (no-op for this processor)."""
def _get_operation_name(self, span_data: Any) -> str:
"""Determine operation name from span data type."""
if _is_instance_of(span_data, GenerationSpanData):
# Check if it's embeddings
if hasattr(span_data, "embedding_dimension"):
return GenAIOperationName.EMBEDDINGS
# Check if it's chat or completion
if span_data.input:
first_input = span_data.input[0] if span_data.input else None
if isinstance(first_input, dict) and "role" in first_input:
return GenAIOperationName.CHAT
return GenAIOperationName.TEXT_COMPLETION
if _is_instance_of(span_data, AgentSpanData):
# The OpenAI Agents SDK AgentSpanData has no "operation" field;
# agent spans always represent invoke_agent.
return GenAIOperationName.INVOKE_AGENT
if _is_instance_of(span_data, FunctionSpanData):
return GenAIOperationName.EXECUTE_TOOL
if _is_instance_of(span_data, ResponseSpanData):
return GenAIOperationName.CHAT # Response typically from chat
if _is_instance_of(span_data, TranscriptionSpanData):
return GenAIOperationName.TRANSCRIPTION
if _is_instance_of(span_data, SpeechSpanData):
return GenAIOperationName.SPEECH
if _is_instance_of(span_data, GuardrailSpanData):
return GenAIOperationName.GUARDRAIL
if _is_instance_of(span_data, HandoffSpanData):
return GenAIOperationName.HANDOFF
return "unknown"
def _extract_genai_attributes(
self,
span: Span[Any],
payload: ContentPayload,
agent_content: dict[str, list[Any]] | None = None,
) -> Iterator[tuple[str, AttributeValue]]:
"""Yield (attr, value) pairs for GenAI semantic conventions."""
span_data = span.span_data
# Base attributes
yield GEN_AI_PROVIDER_NAME, self.system_name
yield GEN_AI_SYSTEM_KEY, self.system_name
# Legacy emission removed
# Add configured agent attributes (always include when set)
agent_name_override = self.agent_name or self._agent_name_default
agent_id_override = self.agent_id or self._agent_id_default
agent_desc_override = self.agent_description or self._agent_description_default
if agent_name_override:
yield GEN_AI_AGENT_NAME, agent_name_override
if agent_id_override:
yield GEN_AI_AGENT_ID, agent_id_override
if agent_desc_override:
yield GEN_AI_AGENT_DESCRIPTION, agent_desc_override
# Server attributes
for key, value in self._get_server_attributes().items():
yield key, value
# Process different span types
if _is_instance_of(span_data, GenerationSpanData):
yield from self._get_attributes_from_generation_span_data(span_data, payload)
elif _is_instance_of(span_data, AgentSpanData):
yield from self._get_attributes_from_agent_span_data(span_data, agent_content)
elif _is_instance_of(span_data, FunctionSpanData):
yield from self._get_attributes_from_function_span_data(span_data, payload)
elif _is_instance_of(span_data, ResponseSpanData):
yield from self._get_attributes_from_response_span_data(span_data, payload)
elif _is_instance_of(span_data, TranscriptionSpanData):
yield from self._get_attributes_from_transcription_span_data(span_data)
elif _is_instance_of(span_data, SpeechSpanData):
yield from self._get_attributes_from_speech_span_data(span_data)
elif _is_instance_of(span_data, GuardrailSpanData):
yield from self._get_attributes_from_guardrail_span_data(span_data)
elif _is_instance_of(span_data, HandoffSpanData):
yield from self._get_attributes_from_handoff_span_data(span_data)
def _get_attributes_from_generation_span_data(
self, span_data: GenerationSpanData, payload: ContentPayload
) -> Iterator[tuple[str, AttributeValue]]:
"""Extract attributes from generation span."""
# Operation name
operation_name = self._get_operation_name(span_data)
yield GEN_AI_OPERATION_NAME, operation_name
# Model information
if span_data.model:
yield GEN_AI_REQUEST_MODEL, span_data.model
# Check for embeddings-specific attributes
if hasattr(span_data, "embedding_dimension"):
yield (
GEN_AI_EMBEDDINGS_DIMENSION_COUNT,
span_data.embedding_dimension,
)
# Check for data source
if hasattr(span_data, "data_source_id"):
yield GEN_AI_DATA_SOURCE_ID, span_data.data_source_id
finish_reasons: list[Any] = []
if span_data.output:
for part in span_data.output:
if isinstance(part, dict):
fr = part.get("finish_reason") or part.get("stop_reason")
else:
fr = getattr(part, "finish_reason", None)
if fr:
finish_reasons.append(fr if isinstance(fr, str) else str(fr))
if finish_reasons:
yield GEN_AI_RESPONSE_FINISH_REASONS, finish_reasons
# Usage information
if span_data.usage:
usage = span_data.usage
self._sanitize_usage_payload(usage)
if "prompt_tokens" in usage or "input_tokens" in usage:
tokens = usage.get("prompt_tokens") or usage.get("input_tokens")
if tokens is not None:
yield GEN_AI_USAGE_INPUT_TOKENS, tokens
if "completion_tokens" in usage or "output_tokens" in usage:
tokens = usage.get("completion_tokens") or usage.get("output_tokens")
if tokens is not None:
yield GEN_AI_USAGE_OUTPUT_TOKENS, tokens
# Model configuration
if span_data.model_config:
mc = span_data.model_config
param_map = {
"temperature": GEN_AI_REQUEST_TEMPERATURE,
"top_p": GEN_AI_REQUEST_TOP_P,
"top_k": GEN_AI_REQUEST_TOP_K,
"max_tokens": GEN_AI_REQUEST_MAX_TOKENS,
"presence_penalty": GEN_AI_REQUEST_PRESENCE_PENALTY,
"frequency_penalty": GEN_AI_REQUEST_FREQUENCY_PENALTY,
"seed": GEN_AI_REQUEST_SEED,
"n": GEN_AI_REQUEST_CHOICE_COUNT,
"stop": GEN_AI_REQUEST_STOP_SEQUENCES,
"encoding_formats": GEN_AI_REQUEST_ENCODING_FORMATS,
}
for k, attr in param_map.items():
if hasattr(mc, "__contains__") and k in mc:
value = mc[k]
else:
value = getattr(mc, k, None)
if value is not None:
yield attr, value
if hasattr(mc, "get"):
base_url = mc.get("base_url") or mc.get("baseUrl") or mc.get("endpoint")
else:
base_url = (
getattr(mc, "base_url", None) or getattr(mc, "baseUrl", None) or getattr(mc, "endpoint", None)
)
for key, value in _infer_server_attributes(base_url).items():
yield key, value
# Sensitive data capture
if (
self.include_sensitive_data
and self._content_mode.capture_in_span
and self._capture_messages
and payload.input_messages
):
yield (
GEN_AI_INPUT_MESSAGES,
safe_json_dumps(payload.input_messages),
)
if (
self.include_sensitive_data
and self._content_mode.capture_in_span
and self._capture_system_instructions
and payload.system_instructions
):
yield (
GEN_AI_SYSTEM_INSTRUCTIONS,
safe_json_dumps(payload.system_instructions),
)
if (
self.include_sensitive_data
and self._content_mode.capture_in_span
and self._capture_messages
and payload.output_messages
):
yield (
GEN_AI_OUTPUT_MESSAGES,
safe_json_dumps(payload.output_messages),
)
# Output type
yield (
GEN_AI_OUTPUT_TYPE,
normalize_output_type(self._infer_output_type(span_data)),
)
def _merge_content_sequence(
self,
existing: list[Any],
incoming: Sequence[Any],
) -> list[Any]:
"""Merge normalized message/content lists without duplicating snapshots."""
if not incoming:
return existing
incoming_list = [self._clone_message(item) for item in incoming]
if self.include_sensitive_data:
filtered = [msg for msg in incoming_list if not self._is_placeholder_message(msg)]
if filtered:
incoming_list = filtered
if not existing:
return incoming_list
result = [self._clone_message(item) for item in existing]
for idx, new_msg in enumerate(incoming_list):
if idx < len(result):
if (
self.include_sensitive_data
and self._is_placeholder_message(new_msg)
and not self._is_placeholder_message(result[idx])
):
continue
if result[idx] != new_msg:
result[idx] = self._clone_message(new_msg)
else:
if self.include_sensitive_data and self._is_placeholder_message(new_msg):
if (
any(not self._is_placeholder_message(existing_msg) for existing_msg in result)
or new_msg in result
):
continue
result.append(self._clone_message(new_msg))
return result
def _clone_message(self, message: Any) -> Any:
if isinstance(message, dict):
return {
key: self._clone_message(value) if isinstance(value, (dict, list)) else value
for key, value in message.items()
}
if isinstance(message, list):
return [self._clone_message(item) for item in message]
return message
def _is_placeholder_message(self, message: Any) -> bool:
if not isinstance(message, dict):
return False
parts = message.get("parts")
if not isinstance(parts, list) or not parts:
return False
for part in parts:
if not isinstance(part, dict) or part.get("type") != "text" or part.get("content") != "readacted":
return False
return True
def _get_attributes_from_agent_span_data(
self,
span_data: AgentSpanData,
agent_content: dict[str, list[Any]] | None = None,
) -> Iterator[tuple[str, AttributeValue]]:
"""Extract attributes from agent span."""
yield GEN_AI_OPERATION_NAME, self._get_operation_name(span_data)
name = self.agent_name or getattr(span_data, "name", None) or self._agent_name_default
if name:
yield GEN_AI_AGENT_NAME, name
# agent_id and description are not available on the OpenAI Agents SDK
# AgentSpanData; only use user-configured overrides.
agent_id = self.agent_id or self._agent_id_default
if agent_id:
yield GEN_AI_AGENT_ID, agent_id
description = self.agent_description or self._agent_description_default
if description:
yield GEN_AI_AGENT_DESCRIPTION, description
# The OpenAI Agents SDK AgentSpanData has no "model" field; fall back to
# the model aggregated from child generation/response spans.
model = None
if agent_content:
model = agent_content.get("request_model")
if model:
yield GEN_AI_REQUEST_MODEL, model
if hasattr(span_data, "conversation_id") and span_data.conversation_id:
yield GEN_AI_CONVERSATION_ID, span_data.conversation_id
# Agent definitions
if self._capture_tool_definitions and hasattr(span_data, "agent_definitions"):
yield (
GEN_AI_ORCHESTRATOR_AGENT_DEFINITIONS,
safe_json_dumps(span_data.agent_definitions),
)
# System instructions from agent definitions
if self._capture_system_instructions and hasattr(span_data, "agent_definitions"):
try:
defs = span_data.agent_definitions
if isinstance(defs, (list, tuple)):
collected: list[dict[str, str]] = []
for d in defs:
if isinstance(d, dict):
msgs = d.get("messages") or d.get("system_messages")
if isinstance(msgs, (list, tuple)):
collected.extend(self._collect_system_instructions(msgs))
if collected:
yield (
GEN_AI_SYSTEM_INSTRUCTIONS,
safe_json_dumps(collected),
)
except Exception:
pass
if (
self.include_sensitive_data
and self._content_mode.capture_in_span
and self._capture_messages
and agent_content
):
if agent_content.get("input_messages"):
yield (
GEN_AI_INPUT_MESSAGES,
safe_json_dumps(agent_content["input_messages"]),
)
if agent_content.get("output_messages"):
yield (
GEN_AI_OUTPUT_MESSAGES,
safe_json_dumps(agent_content["output_messages"]),
)
if (
self.include_sensitive_data
and self._content_mode.capture_in_span
and self._capture_system_instructions
and agent_content
and agent_content.get("system_instructions")
):
yield (
GEN_AI_SYSTEM_INSTRUCTIONS,
safe_json_dumps(agent_content["system_instructions"]),
)
yield (
GEN_AI_OUTPUT_TYPE,
normalize_output_type(self._infer_output_type(span_data)),
)
def _get_attributes_from_function_span_data(
self, span_data: FunctionSpanData, payload: ContentPayload
) -> Iterator[tuple[str, AttributeValue]]:
"""Extract attributes from function/tool span."""
yield GEN_AI_OPERATION_NAME, GenAIOperationName.EXECUTE_TOOL
if span_data.name:
yield GEN_AI_TOOL_NAME, span_data.name
# Tool type - validate and normalize
tool_type = "function" # Default for function spans
if hasattr(span_data, "tool_type"):
tool_type = span_data.tool_type
yield GEN_AI_TOOL_TYPE, validate_tool_type(tool_type)
if hasattr(span_data, "call_id") and span_data.call_id:
yield GEN_AI_TOOL_CALL_ID, span_data.call_id
if hasattr(span_data, "description") and span_data.description:
yield GEN_AI_TOOL_DESCRIPTION, span_data.description
# Tool definitions
if self._capture_tool_definitions and hasattr(span_data, "tool_definitions"):
yield (
GEN_AI_TOOL_DEFINITIONS,
safe_json_dumps(span_data.tool_definitions),
)
# Tool input/output (sensitive)
if self.include_sensitive_data and self._content_mode.capture_in_span and payload.tool_arguments is not None:
yield GEN_AI_TOOL_CALL_ARGUMENTS, payload.tool_arguments
if self.include_sensitive_data and self._content_mode.capture_in_span and payload.tool_result is not None:
yield GEN_AI_TOOL_CALL_RESULT, payload.tool_result
yield (
GEN_AI_OUTPUT_TYPE,
normalize_output_type(self._infer_output_type(span_data)),
)
def _get_attributes_from_response_span_data(
self, span_data: ResponseSpanData, payload: ContentPayload
) -> Iterator[tuple[str, AttributeValue]]:
"""Extract attributes from response span."""
yield GEN_AI_OPERATION_NAME, GenAIOperationName.CHAT
# Response information
if span_data.response:
if hasattr(span_data.response, "id") and span_data.response.id:
yield GEN_AI_RESPONSE_ID, span_data.response.id
# Model from response
if hasattr(span_data.response, "model") and span_data.response.model:
yield GEN_AI_RESPONSE_MODEL, span_data.response.model
if not getattr(span_data, "model", None):
yield GEN_AI_REQUEST_MODEL, span_data.response.model
# Finish reasons
finish_reasons = []
if hasattr(span_data.response, "output") and span_data.response.output:
for part in span_data.response.output:
if isinstance(part, dict):
fr = part.get("finish_reason") or part.get("stop_reason")
else:
fr = getattr(part, "finish_reason", None)
if fr:
finish_reasons.append(fr)
if finish_reasons:
yield GEN_AI_RESPONSE_FINISH_REASONS, finish_reasons
# Usage from response
if hasattr(span_data.response, "usage") and span_data.response.usage:
usage = span_data.response.usage
self._sanitize_usage_payload(usage)
input_tokens = getattr(usage, "input_tokens", None)
if input_tokens is None:
input_tokens = getattr(usage, "prompt_tokens", None)
if input_tokens is not None:
yield GEN_AI_USAGE_INPUT_TOKENS, input_tokens
output_tokens = getattr(usage, "output_tokens", None)
if output_tokens is None:
output_tokens = getattr(usage, "completion_tokens", None)
if output_tokens is not None:
yield GEN_AI_USAGE_OUTPUT_TOKENS, output_tokens
# Tool definitions from response
if self._capture_tool_definitions and hasattr(span_data.response, "tools"):
yield (
GEN_AI_TOOL_DEFINITIONS,
safe_json_dumps(
list(
map(
lambda tool: tool.to_dict(),
span_data.response.tools,
)
)
),
)
# Input/output messages
if (
self.include_sensitive_data
and self._content_mode.capture_in_span
and self._capture_messages
and payload.input_messages
):
yield (
GEN_AI_INPUT_MESSAGES,
safe_json_dumps(payload.input_messages),
)
if (
self.include_sensitive_data
and self._content_mode.capture_in_span
and self._capture_system_instructions
and payload.system_instructions
):
yield (
GEN_AI_SYSTEM_INSTRUCTIONS,
safe_json_dumps(payload.system_instructions),
)
if (
self.include_sensitive_data
and self._content_mode.capture_in_span
and self._capture_messages
and payload.output_messages
):
yield (
GEN_AI_OUTPUT_MESSAGES,
safe_json_dumps(payload.output_messages),
)
yield (
GEN_AI_OUTPUT_TYPE,
normalize_output_type(self._infer_output_type(span_data)),
)
def _get_attributes_from_transcription_span_data(
self, span_data: TranscriptionSpanData
) -> Iterator[tuple[str, AttributeValue]]:
"""Extract attributes from transcription span."""
yield GEN_AI_OPERATION_NAME, GenAIOperationName.TRANSCRIPTION
if hasattr(span_data, "model") and span_data.model:
yield GEN_AI_REQUEST_MODEL, span_data.model
# Audio format
if hasattr(span_data, "format") and span_data.format:
yield "gen_ai.audio.input.format", span_data.format
# Transcript (sensitive)
if (
self.include_sensitive_data
and self._content_mode.capture_in_span
and self._capture_messages
and hasattr(span_data, "transcript")
):
yield "gen_ai.transcription.text", span_data.transcript
yield (
GEN_AI_OUTPUT_TYPE,
normalize_output_type(self._infer_output_type(span_data)),
)
def _get_attributes_from_speech_span_data(self, span_data: SpeechSpanData) -> Iterator[tuple[str, AttributeValue]]:
"""Extract attributes from speech span."""
yield GEN_AI_OPERATION_NAME, GenAIOperationName.SPEECH
if hasattr(span_data, "model") and span_data.model:
yield GEN_AI_REQUEST_MODEL, span_data.model
if hasattr(span_data, "voice") and span_data.voice:
yield "gen_ai.speech.voice", span_data.voice
if hasattr(span_data, "format") and span_data.format:
yield "gen_ai.audio.output.format", span_data.format
# Input text (sensitive)
if (
self.include_sensitive_data
and self._content_mode.capture_in_span
and self._capture_messages
and hasattr(span_data, "input_text")
):
yield "gen_ai.speech.input_text", span_data.input_text
yield (
GEN_AI_OUTPUT_TYPE,
normalize_output_type(self._infer_output_type(span_data)),
)
def _get_attributes_from_guardrail_span_data(
self, span_data: GuardrailSpanData
) -> Iterator[tuple[str, AttributeValue]]:
"""Extract attributes from guardrail span."""
yield GEN_AI_OPERATION_NAME, GenAIOperationName.GUARDRAIL
if span_data.name:
yield GEN_AI_GUARDRAIL_NAME, span_data.name
yield GEN_AI_GUARDRAIL_TRIGGERED, span_data.triggered
yield (
GEN_AI_OUTPUT_TYPE,
normalize_output_type(self._infer_output_type(span_data)),
)
def _get_attributes_from_handoff_span_data(
self, span_data: HandoffSpanData
) -> Iterator[tuple[str, AttributeValue]]:
"""Extract attributes from handoff span."""
yield GEN_AI_OPERATION_NAME, GenAIOperationName.HANDOFF
if span_data.from_agent:
yield GEN_AI_HANDOFF_FROM_AGENT, span_data.from_agent
if span_data.to_agent:
yield GEN_AI_HANDOFF_TO_AGENT, span_data.to_agent
yield (
GEN_AI_OUTPUT_TYPE,
normalize_output_type(self._infer_output_type(span_data)),
)
def _cleanup_spans_for_trace(self, trace_id: str) -> None:
"""Clean up spans for a trace to prevent memory leaks."""
spans_to_remove = [span_id for span_id in self._otel_spans.keys() if span_id.startswith(trace_id)]
for span_id in spans_to_remove:
if otel_span := self._otel_spans.pop(span_id, None):
otel_span.set_status(Status(StatusCode.ERROR, "Trace ended before span completion"))
otel_span.end()
self._tokens.pop(span_id, None)
__all__ = [
"ContentCaptureMode",
"ContentPayload",
"GenAIEvaluationAttributes",
"GenAIOperationName",
"GenAIOutputType",
"GenAIProvider",
"GenAISemanticProcessor",
"GenAIToolType",
"normalize_output_type",
"normalize_provider",
"validate_tool_type",
]
version.py 0000664 0000000 0000000 00000000147 15270700723 0051027 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/src/opentelemetry/instrumentation/openai_agents # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
__version__ = "0.2.0.dev"
tests/ 0000775 0000000 0000000 00000000000 15270700723 0036366 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2 conftest.py 0000664 0000000 0000000 00000001202 15270700723 0040560 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import sys
from pathlib import Path
TESTS_ROOT = Path(__file__).resolve().parent
GENAI_ROOT = TESTS_ROOT.parent
REPO_ROOT = GENAI_ROOT.parent
PROJECT_ROOT = REPO_ROOT.parent
for path in (
PROJECT_ROOT / "opentelemetry-instrumentation" / "src",
GENAI_ROOT / "src",
PROJECT_ROOT / "util" / "opentelemetry-util-genai" / "src",
REPO_ROOT / "openai_agents_lib",
REPO_ROOT / "openai_lib",
TESTS_ROOT / "stubs",
):
path_str = str(path)
if path_str not in sys.path:
sys.path.insert(0, path_str)
requirements.latest.txt 0000664 0000000 0000000 00000003454 15270700723 0043153 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ********************************
# WARNING: NOT HERMETIC !!!!!!!!!!
# ********************************
#
# This "requirements.txt" is installed in conjunction
# with multiple other dependencies in the top-level "tox.ini"
# file. In particular, please see:
#
# openai_agents-latest: {[testenv]test_deps}
# openai_agents-latest: -r {toxinidir}/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/requirements.latest.txt
#
# This provides additional dependencies, namely:
#
# opentelemetry-api
# opentelemetry-sdk
# opentelemetry-semantic-conventions
#
# ... with a "dev" version based on the latest distribution.
# This variant of the requirements aims to test the system using
# the newest supported version of external dependencies.
openai-agents==0.3.3
pydantic>=2.10,<3
httpx==0.27.2
Deprecated==1.2.14
importlib-metadata==6.11.0
packaging==24.0
pytest==7.4.4
pytest-asyncio==0.21.0
wrapt==1.16.0
# test with the latest version of opentelemetry-api, sdk, and semantic conventions
grpcio>=1.60.0; implementation_name != "pypy"
grpcio<1.60.0; implementation_name == "pypy"
-e opentelemetry-instrumentation
-e instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2
-e util/opentelemetry-util-genai
requirements.oldest.txt 0000664 0000000 0000000 00000002644 15270700723 0043151 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This variant of the requirements aims to test the system using
# the oldest supported version of external dependencies.
openai-agents==0.3.3
pydantic>=2.10,<3
httpx==0.27.2
Deprecated==1.2.14
importlib-metadata==6.11.0
packaging==24.0
pytest==7.4.4
pytest-asyncio==0.21.0
wrapt==1.16.0
opentelemetry-exporter-otlp-proto-grpc~=1.30
opentelemetry-exporter-otlp-proto-http~=1.30
opentelemetry-api==1.40 # when updating, also update in pyproject.toml
opentelemetry-sdk==1.40 # when updating, also update in pyproject.toml
opentelemetry-semantic-conventions==0.61b0 # when updating, also update in pyproject.toml
opentelemetry-util-genai==0.4b.0 # when updating, also update in pyproject.toml
grpcio>=1.60.0; implementation_name != "pypy"
grpcio<1.60.0; implementation_name == "pypy"
-e instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2
stubs/ 0000775 0000000 0000000 00000000000 15270700723 0037526 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests agents/ 0000775 0000000 0000000 00000000000 15270700723 0041007 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/stubs __init__.py 0000664 0000000 0000000 00000000146 15270700723 0043121 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/stubs/agents # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# Stub package for tests
tracing/ 0000775 0000000 0000000 00000000000 15270700723 0042436 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/stubs/agents __init__.py 0000664 0000000 0000000 00000013637 15270700723 0044561 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/stubs/agents/tracing # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# pylint: skip-file
from __future__ import annotations
from collections.abc import Mapping, Sequence
from contextlib import contextmanager
from dataclasses import dataclass
from itertools import count
from typing import Any
from .processor_interface import TracingProcessor
from .spans import Span
from .traces import Trace
SPAN_TYPE_AGENT = "agent"
SPAN_TYPE_FUNCTION = "function"
SPAN_TYPE_GENERATION = "generation"
SPAN_TYPE_RESPONSE = "response"
__all__ = [
"AgentSpanData",
"FunctionSpanData",
"GenerationSpanData",
"ResponseSpanData",
"TraceProvider",
"agent_span",
"function_span",
"generation_span",
"get_trace_provider",
"response_span",
"set_trace_processors",
"trace",
]
@dataclass
class AgentSpanData:
name: str | None = None
handoffs: list[str] | None = None
tools: list[str] | None = None
output_type: str | None = None
@property
def type(self) -> str:
return SPAN_TYPE_AGENT
@dataclass
class FunctionSpanData:
name: str | None = None
input: Any = None
output: Any = None
@property
def type(self) -> str:
return SPAN_TYPE_FUNCTION
@dataclass
class GenerationSpanData:
input: Sequence[Mapping[str, Any]] | None = None
output: Sequence[Mapping[str, Any]] | None = None
model: str | None = None
model_config: Mapping[str, Any] | None = None
usage: Mapping[str, Any] | None = None
@property
def type(self) -> str:
return SPAN_TYPE_GENERATION
@dataclass
class ResponseSpanData:
response: Any = None
@property
def type(self) -> str:
return SPAN_TYPE_RESPONSE
class _ProcessorFanout(TracingProcessor):
def __init__(self) -> None:
self._processors: list[TracingProcessor] = []
def add_tracing_processor(self, processor: TracingProcessor) -> None:
self._processors.append(processor)
def set_processors(self, processors: list[TracingProcessor]) -> None:
self._processors = list(processors)
def on_trace_start(self, trace: Trace) -> None:
for processor in list(self._processors):
processor.on_trace_start(trace)
def on_trace_end(self, trace: Trace) -> None:
for processor in list(self._processors):
processor.on_trace_end(trace)
def on_span_start(self, span: Span) -> None:
for processor in list(self._processors):
processor.on_span_start(span)
def on_span_end(self, span: Span) -> None:
for processor in list(self._processors):
processor.on_span_end(span)
def shutdown(self) -> None:
for processor in list(self._processors):
processor.shutdown()
def force_flush(self) -> None:
for processor in list(self._processors):
processor.force_flush()
class TraceProvider:
def __init__(self) -> None:
self._multi_processor = _ProcessorFanout()
self._ids = count(1)
def register_processor(self, processor: TracingProcessor) -> None:
self._multi_processor.add_tracing_processor(processor)
def set_processors(self, processors: list[TracingProcessor]) -> None:
self._multi_processor.set_processors(processors)
def create_trace(
self,
name: str,
trace_id: str | None = None,
group_id: str | None = None,
metadata: Mapping[str, Any] | None = None,
disabled: bool = False,
) -> Trace:
trace_id = trace_id or f"trace_{next(self._ids)}"
return Trace(name, trace_id, self._multi_processor)
def create_span(
self,
span_data: Any,
span_id: str | None = None,
parent: Trace | Span | None = None,
disabled: bool = False,
) -> Span:
span_id = span_id or f"span_{next(self._ids)}"
if isinstance(parent, Span):
trace_id = parent.trace_id
parent_id = parent.span_id
elif isinstance(parent, Trace):
trace_id = parent.trace_id
parent_id = None
else:
trace_id = f"trace_{next(self._ids)}"
parent_id = None
return Span(trace_id, span_id, span_data, parent_id, self._multi_processor)
def shutdown(self) -> None:
self._multi_processor.shutdown()
_PROVIDER = TraceProvider()
_CURRENT_TRACE: Trace | None = None
def get_trace_provider() -> TraceProvider:
return _PROVIDER
def set_trace_processors(processors: list[TracingProcessor]) -> None:
_PROVIDER.set_processors(processors)
@contextmanager
def trace(name: str, **kwargs: Any):
global _CURRENT_TRACE
trace_obj = _PROVIDER.create_trace(name, **kwargs)
previous = _CURRENT_TRACE
_CURRENT_TRACE = trace_obj
trace_obj.start()
try:
yield trace_obj
finally:
trace_obj.finish()
_CURRENT_TRACE = previous
@contextmanager
def generation_span(**kwargs: Any):
data = GenerationSpanData(**kwargs)
span = _PROVIDER.create_span(data, parent=_CURRENT_TRACE)
span.start()
try:
yield span
finally:
span.finish()
@contextmanager
def agent_span(
name: str,
handoffs: list[str] | None = None,
tools: list[str] | None = None,
output_type: str | None = None,
**kwargs: Any,
):
data = AgentSpanData(name=name, handoffs=handoffs, tools=tools, output_type=output_type)
span = _PROVIDER.create_span(data, parent=_CURRENT_TRACE)
span.start()
try:
yield span
finally:
span.finish()
@contextmanager
def function_span(**kwargs: Any):
data = FunctionSpanData(**kwargs)
span = _PROVIDER.create_span(data, parent=_CURRENT_TRACE)
span.start()
try:
yield span
finally:
span.finish()
@contextmanager
def response_span(**kwargs: Any):
data = ResponseSpanData(**kwargs)
span = _PROVIDER.create_span(data, parent=_CURRENT_TRACE)
span.start()
try:
yield span
finally:
span.finish()
processor_interface.py 0000664 0000000 0000000 00000001116 15270700723 0047046 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/stubs/agents/tracing # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
class TracingProcessor:
def on_trace_start(self, trace): # pragma: no cover - stub
pass
def on_trace_end(self, trace): # pragma: no cover - stub
pass
def on_span_start(self, span): # pragma: no cover - stub
pass
def on_span_end(self, span): # pragma: no cover - stub
pass
def shutdown(self) -> None: # pragma: no cover - stub
pass
def force_flush(self) -> None: # pragma: no cover - stub
pass
spans.py 0000664 0000000 0000000 00000002210 15270700723 0044127 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/stubs/agents/tracing # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from datetime import datetime
from typing import Any
class Span:
def __init__(
self,
trace_id: str,
span_id: str,
span_data: Any,
parent_id: str | None,
processor,
) -> None:
self.trace_id = trace_id
self.span_id = span_id
self.span_data = span_data
self.parent_id = parent_id
self.started_at: str | None = None
self.ended_at: str | None = None
self.error = None
self._processor = processor
def start(self) -> None:
if self.started_at is not None:
return
self.started_at = datetime.utcnow().isoformat() + "Z"
self._processor.on_span_start(self)
def finish(self) -> None:
if self.ended_at is not None:
return
self.ended_at = datetime.utcnow().isoformat() + "Z"
self._processor.on_span_end(self)
def __enter__(self) -> Span:
self.start()
return self
def __exit__(self, exc_type, exc, tb) -> None:
self.finish()
traces.py 0000664 0000000 0000000 00000001656 15270700723 0044301 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/stubs/agents/tracing # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from datetime import datetime
class Trace:
def __init__(self, name: str, trace_id: str, processor) -> None:
self.name = name
self.trace_id = trace_id
self._processor = processor
self.started_at: str | None = None
self.ended_at: str | None = None
def start(self) -> None:
if self.started_at is not None:
return
self.started_at = datetime.utcnow().isoformat() + "Z"
self._processor.on_trace_start(self)
def finish(self) -> None:
if self.ended_at is not None:
return
self.ended_at = datetime.utcnow().isoformat() + "Z"
self._processor.on_trace_end(self)
def __enter__(self) -> Trace:
self.start()
return self
def __exit__(self, exc_type, exc, tb) -> None:
self.finish()
opentelemetry/ 0000775 0000000 0000000 00000000000 15270700723 0042422 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/stubs instrumentation/ 0000775 0000000 0000000 00000000000 15270700723 0045665 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/stubs/opentelemetry instrumentor.py 0000664 0000000 0000000 00000001377 15270700723 0051020 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/stubs/opentelemetry/instrumentation # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# pylint: skip-file
from __future__ import annotations
from collections.abc import Collection
class BaseInstrumentor:
def __init__(self) -> None:
pass
def instrument(self, **kwargs) -> None:
self._instrument(**kwargs)
def uninstrument(self, **kwargs) -> None:
self._uninstrument(**kwargs)
# Subclasses override
def _instrument(self, **kwargs) -> None: # pragma: no cover - stub
raise NotImplementedError
def _uninstrument(self, **kwargs) -> None: # pragma: no cover - stub
raise NotImplementedError
def instrumentation_dependencies(
self,
) -> Collection[str]: # pragma: no cover
return []
wrapt.py 0000664 0000000 0000000 00000001107 15270700723 0041234 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/stubs # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
class ObjectProxy:
"""Minimal stand-in for wrapt.ObjectProxy used in tests."""
def __init__(self, wrapped):
self.__wrapped__ = wrapped
def __getattr__(self, item):
return getattr(self.__wrapped__, item)
def __setattr__(self, key, value):
if key == "__wrapped__":
super().__setattr__(key, value)
else:
setattr(self.__wrapped__, key, value)
def __call__(self, *args, **kwargs):
return self.__wrapped__(*args, **kwargs)
test_tracer.py 0000664 0000000 0000000 00000042347 15270700723 0041271 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=wrong-import-position,wrong-import-order,import-error,no-name-in-module,unexpected-keyword-arg,no-value-for-parameter,redefined-outer-name
from __future__ import annotations
import json
import sys
from pathlib import Path
from types import SimpleNamespace
from typing import Any
TESTS_ROOT = Path(__file__).resolve().parent
stub_path = TESTS_ROOT / "stubs"
if str(stub_path) not in sys.path:
sys.path.insert(0, str(stub_path))
sys.modules.pop("agents", None)
sys.modules.pop("agents.tracing", None)
import agents.tracing as agents_tracing # noqa: E402
from agents.tracing import ( # noqa: E402
agent_span,
function_span,
generation_span,
response_span,
set_trace_processors,
trace,
)
from openai.types.responses import FunctionTool # noqa: E402
from opentelemetry.instrumentation.openai_agents import ( # noqa: E402
OpenAIAgentsInstrumentor,
)
from opentelemetry.instrumentation.openai_agents.span_processor import ( # noqa: E402
ContentPayload,
GenAISemanticProcessor,
)
from opentelemetry.sdk.trace import TracerProvider # noqa: E402
try:
from opentelemetry.sdk.trace.export import ( # type: ignore[attr-defined]
InMemorySpanExporter,
SimpleSpanProcessor,
)
except ImportError: # pragma: no cover - support older/newer SDK layouts
from opentelemetry.sdk.trace.export import (
SimpleSpanProcessor,
)
from opentelemetry.sdk.trace.export.in_memory_span_exporter import (
InMemorySpanExporter,
)
from opentelemetry.semconv._incubating.attributes import ( # noqa: E402
gen_ai_attributes as GenAI,
)
from opentelemetry.semconv._incubating.attributes import ( # noqa: E402
server_attributes as ServerAttributes,
)
from opentelemetry.trace import SpanKind # noqa: E402
GEN_AI_PROVIDER_NAME = GenAI.GEN_AI_PROVIDER_NAME
GEN_AI_INPUT_MESSAGES = getattr(GenAI, "GEN_AI_INPUT_MESSAGES", "gen_ai.input.messages")
GEN_AI_OUTPUT_MESSAGES = getattr(GenAI, "GEN_AI_OUTPUT_MESSAGES", "gen_ai.output.messages")
GEN_AI_TOOL_DEFINITIONS = getattr(GenAI, "GEN_AI_TOOL_DEFINITIONS", "gen_ai.tool.definitions")
def _instrument_with_provider(**instrument_kwargs):
set_trace_processors([])
provider = TracerProvider()
exporter = InMemorySpanExporter()
provider.add_span_processor(SimpleSpanProcessor(exporter))
instrumentor = OpenAIAgentsInstrumentor()
instrumentor.instrument(tracer_provider=provider, **instrument_kwargs)
return instrumentor, exporter
def test_generation_span_creates_client_span():
instrumentor, exporter = _instrument_with_provider()
try:
with trace("workflow"):
with generation_span(
input=[{"role": "user", "content": "hi"}],
model="gpt-4o-mini",
model_config={
"temperature": 0.2,
"base_url": "https://api.openai.com",
},
usage={"input_tokens": 12, "output_tokens": 3},
):
pass
spans = exporter.get_finished_spans()
client_span = next(span for span in spans if span.kind is SpanKind.CLIENT)
assert client_span.attributes[GEN_AI_PROVIDER_NAME] == "openai"
assert client_span.attributes[GenAI.GEN_AI_OPERATION_NAME] == "chat"
assert client_span.attributes[GenAI.GEN_AI_REQUEST_MODEL] == "gpt-4o-mini"
assert client_span.name == "chat gpt-4o-mini"
assert client_span.attributes[GenAI.GEN_AI_USAGE_INPUT_TOKENS] == 12
assert client_span.attributes[GenAI.GEN_AI_USAGE_OUTPUT_TOKENS] == 3
assert client_span.attributes[ServerAttributes.SERVER_ADDRESS] == "api.openai.com"
finally:
instrumentor.uninstrument()
exporter.clear()
def test_generation_span_without_roles_uses_text_completion():
instrumentor, exporter = _instrument_with_provider()
try:
with trace("workflow"):
with generation_span(
input=[{"content": "tell me a joke"}],
model="gpt-4o-mini",
model_config={"temperature": 0.7},
):
pass
spans = exporter.get_finished_spans()
completion_span = next(
span
for span in spans
if span.attributes[GenAI.GEN_AI_OPERATION_NAME] == GenAI.GenAiOperationNameValues.TEXT_COMPLETION.value
)
assert completion_span.kind is SpanKind.CLIENT
assert completion_span.name == "text_completion gpt-4o-mini"
assert completion_span.attributes[GenAI.GEN_AI_REQUEST_MODEL] == "gpt-4o-mini"
finally:
instrumentor.uninstrument()
exporter.clear()
def test_function_span_records_tool_attributes():
instrumentor, exporter = _instrument_with_provider()
try:
with trace("workflow"):
with function_span(name="fetch_weather", input='{"city": "Paris"}'):
pass
spans = exporter.get_finished_spans()
tool_span = next(span for span in spans if span.kind is SpanKind.INTERNAL)
assert tool_span.attributes[GenAI.GEN_AI_OPERATION_NAME] == "execute_tool"
assert tool_span.attributes[GenAI.GEN_AI_TOOL_NAME] == "fetch_weather"
assert tool_span.attributes[GenAI.GEN_AI_TOOL_TYPE] == "function"
assert tool_span.attributes[GEN_AI_PROVIDER_NAME] == "openai"
finally:
instrumentor.uninstrument()
exporter.clear()
def test_agent_invoke_span_records_attributes():
instrumentor, exporter = _instrument_with_provider()
try:
with trace("workflow"):
with agent_span(
name="support_bot",
handoffs=["escalation_bot"],
tools=["search"],
output_type="str",
):
pass
spans = exporter.get_finished_spans()
invoke_span = next(
span
for span in spans
if span.attributes[GenAI.GEN_AI_OPERATION_NAME] == GenAI.GenAiOperationNameValues.INVOKE_AGENT.value
)
assert invoke_span.kind is SpanKind.CLIENT
assert invoke_span.name == "invoke_agent support_bot"
assert invoke_span.attributes[GEN_AI_PROVIDER_NAME] == "openai"
assert invoke_span.attributes[GenAI.GEN_AI_AGENT_NAME] == "support_bot"
finally:
instrumentor.uninstrument()
exporter.clear()
def _placeholder_message() -> dict[str, Any]:
return {
"role": "user",
"parts": [{"type": "text", "content": "readacted"}],
}
def test_normalize_messages_skips_empty_when_sensitive_enabled():
processor = GenAISemanticProcessor(metrics_enabled=False)
normalized = processor._normalize_messages_to_role_parts([{"role": "user", "content": None}])
assert not normalized
def test_normalize_messages_emits_placeholder_when_sensitive_disabled():
processor = GenAISemanticProcessor(include_sensitive_data=False, metrics_enabled=False)
normalized = processor._normalize_messages_to_role_parts([{"role": "user", "content": None}])
assert normalized == [_placeholder_message()]
def test_agent_content_aggregation_skips_duplicate_snapshots():
processor = GenAISemanticProcessor(metrics_enabled=False)
agent_id = "agent-span"
processor._agent_content[agent_id] = {
"input_messages": [],
"output_messages": [],
"system_instructions": [],
}
payload = ContentPayload(
input_messages=[
{"role": "user", "parts": [{"type": "text", "content": "hello"}]},
{
"role": "user",
"parts": [{"type": "text", "content": "readacted"}],
},
]
)
processor._update_agent_aggregate(
SimpleNamespace(span_id="child-1", parent_id=agent_id, span_data=None),
payload,
)
processor._update_agent_aggregate(
SimpleNamespace(span_id="child-2", parent_id=agent_id, span_data=None),
payload,
)
aggregated = processor._agent_content[agent_id]["input_messages"]
assert aggregated == [{"role": "user", "parts": [{"type": "text", "content": "hello"}]}]
# ensure data copied rather than reused to prevent accidental mutation
assert aggregated is not payload.input_messages
def test_agent_content_aggregation_filters_placeholder_append_when_sensitive():
processor = GenAISemanticProcessor(metrics_enabled=False)
agent_id = "agent-span"
processor._agent_content[agent_id] = {
"input_messages": [],
"output_messages": [],
"system_instructions": [],
}
initial_payload = ContentPayload(input_messages=[{"role": "user", "parts": [{"type": "text", "content": "hello"}]}])
processor._update_agent_aggregate(
SimpleNamespace(span_id="child-1", parent_id=agent_id, span_data=None),
initial_payload,
)
placeholder_payload = ContentPayload(input_messages=[_placeholder_message()])
processor._update_agent_aggregate(
SimpleNamespace(span_id="child-2", parent_id=agent_id, span_data=None),
placeholder_payload,
)
aggregated = processor._agent_content[agent_id]["input_messages"]
assert aggregated == [{"role": "user", "parts": [{"type": "text", "content": "hello"}]}]
def test_agent_content_aggregation_retains_placeholder_when_sensitive_disabled():
processor = GenAISemanticProcessor(include_sensitive_data=False, metrics_enabled=False)
agent_id = "agent-span"
processor._agent_content[agent_id] = {
"input_messages": [],
"output_messages": [],
"system_instructions": [],
}
placeholder_payload = ContentPayload(input_messages=[_placeholder_message()])
processor._update_agent_aggregate(
SimpleNamespace(span_id="child-1", parent_id=agent_id, span_data=None),
placeholder_payload,
)
aggregated = processor._agent_content[agent_id]["input_messages"]
assert aggregated == [_placeholder_message()]
def test_agent_content_aggregation_appends_new_messages_once():
processor = GenAISemanticProcessor(metrics_enabled=False)
agent_id = "agent-span"
processor._agent_content[agent_id] = {
"input_messages": [],
"output_messages": [],
"system_instructions": [],
}
initial_payload = ContentPayload(input_messages=[{"role": "user", "parts": [{"type": "text", "content": "hello"}]}])
processor._update_agent_aggregate(
SimpleNamespace(span_id="child-1", parent_id=agent_id, span_data=None),
initial_payload,
)
extended_messages = [
{"role": "user", "parts": [{"type": "text", "content": "hello"}]},
{
"role": "assistant",
"parts": [{"type": "text", "content": "hi there"}],
},
]
extended_payload = ContentPayload(input_messages=extended_messages)
processor._update_agent_aggregate(
SimpleNamespace(span_id="child-2", parent_id=agent_id, span_data=None),
extended_payload,
)
aggregated = processor._agent_content[agent_id]["input_messages"]
assert aggregated == extended_messages
assert extended_payload.input_messages == extended_messages
def test_agent_span_collects_child_messages():
instrumentor, exporter = _instrument_with_provider()
try:
provider = agents_tracing.get_trace_provider()
with trace("workflow") as workflow:
agent_span_obj = provider.create_span(
agents_tracing.AgentSpanData(name="helper"),
parent=workflow,
)
agent_span_obj.start()
generation = agents_tracing.GenerationSpanData(
input=[{"role": "user", "content": "hi"}],
output=[{"type": "text", "content": "hello"}],
model="gpt-4o-mini",
)
gen_span = provider.create_span(generation, parent=agent_span_obj)
gen_span.start()
gen_span.finish()
agent_span_obj.finish()
spans = exporter.get_finished_spans()
agent_span = next(
span
for span in spans
if span.attributes.get(GenAI.GEN_AI_OPERATION_NAME) == GenAI.GenAiOperationNameValues.INVOKE_AGENT.value
)
prompt = json.loads(agent_span.attributes[GEN_AI_INPUT_MESSAGES])
completion = json.loads(agent_span.attributes[GEN_AI_OUTPUT_MESSAGES])
assert prompt == [
{
"role": "user",
"parts": [{"type": "text", "content": "hi"}],
}
]
assert completion == [
{
"role": "assistant",
"parts": [{"type": "text", "content": "hello"}],
}
]
assert not agent_span.events
finally:
instrumentor.uninstrument()
exporter.clear()
def test_agent_name_override_applied_to_agent_spans():
instrumentor, exporter = _instrument_with_provider(agent_name="Travel Concierge")
try:
with trace("workflow"):
with agent_span(name="support_bot"):
pass
spans = exporter.get_finished_spans()
agent_span_record = next(
span
for span in spans
if span.attributes[GenAI.GEN_AI_OPERATION_NAME] == GenAI.GenAiOperationNameValues.INVOKE_AGENT.value
)
assert agent_span_record.kind is SpanKind.CLIENT
assert agent_span_record.name == "invoke_agent Travel Concierge"
assert agent_span_record.attributes[GenAI.GEN_AI_AGENT_NAME] == "Travel Concierge"
finally:
instrumentor.uninstrument()
exporter.clear()
def test_capture_mode_can_be_disabled():
instrumentor, exporter = _instrument_with_provider(capture_message_content="no_content")
try:
with trace("workflow"):
with generation_span(
input=[{"role": "user", "content": "hi"}],
output=[{"role": "assistant", "content": "hello"}],
model="gpt-4o-mini",
):
pass
spans = exporter.get_finished_spans()
client_span = next(span for span in spans if span.kind is SpanKind.CLIENT)
assert GEN_AI_INPUT_MESSAGES not in client_span.attributes
assert GEN_AI_OUTPUT_MESSAGES not in client_span.attributes
for event in client_span.events:
assert GEN_AI_INPUT_MESSAGES not in event.attributes
assert GEN_AI_OUTPUT_MESSAGES not in event.attributes
finally:
instrumentor.uninstrument()
exporter.clear()
def test_response_span_records_response_attributes():
instrumentor, exporter = _instrument_with_provider()
class _Usage:
def __init__(self, input_tokens: int, output_tokens: int) -> None:
self.input_tokens = input_tokens
self.output_tokens = output_tokens
class _Response:
def __init__(self) -> None:
self.id = "resp-123"
self.instructions = "You are a helpful assistant."
self.model = "gpt-4o-mini"
self.usage = _Usage(42, 9)
self.tools = [
FunctionTool(
name="get_current_weather",
type="function",
description="Get the current weather in a given location",
parameters={
"type": "object",
"properties": {
"location": {
"title": "Location",
"type": "string",
},
},
"required": ["location"],
},
)
]
self.output = [{"finish_reason": "stop"}]
try:
with trace("workflow"):
with response_span(response=_Response()):
pass
spans = exporter.get_finished_spans()
response = next(
span
for span in spans
if span.attributes[GenAI.GEN_AI_OPERATION_NAME] == GenAI.GenAiOperationNameValues.CHAT.value
)
assert response.kind is SpanKind.CLIENT
assert response.name == "chat gpt-4o-mini"
assert response.attributes[GEN_AI_PROVIDER_NAME] == "openai"
assert response.attributes[GenAI.GEN_AI_RESPONSE_ID] == "resp-123"
assert response.attributes[GenAI.GEN_AI_RESPONSE_MODEL] == "gpt-4o-mini"
assert response.attributes[GenAI.GEN_AI_USAGE_INPUT_TOKENS] == 42
assert response.attributes[GenAI.GEN_AI_USAGE_OUTPUT_TOKENS] == 9
assert response.attributes[GenAI.GEN_AI_RESPONSE_FINISH_REASONS] == ("stop",)
system_instructions = json.loads(response.attributes[GenAI.GEN_AI_SYSTEM_INSTRUCTIONS])
assert system_instructions == [{"type": "text", "content": "You are a helpful assistant."}]
tool_definitions = json.loads(response.attributes[GEN_AI_TOOL_DEFINITIONS])
assert tool_definitions == [
{
"type": "function",
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {"title": "Location", "type": "string"},
},
"required": ["location"],
},
}
]
finally:
instrumentor.uninstrument()
exporter.clear()
test_z_instrumentor_behaviors.py 0000664 0000000 0000000 00000004206 15270700723 0045145 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=wrong-import-position,wrong-import-order,import-error
from __future__ import annotations
import sys
from pathlib import Path
TESTS_ROOT = Path(__file__).resolve().parent
stub_path = TESTS_ROOT / "stubs"
if str(stub_path) not in sys.path:
sys.path.insert(0, str(stub_path))
from agents.tracing import ( # noqa: E402
get_trace_provider,
set_trace_processors,
)
from opentelemetry.instrumentation.openai_agents import ( # noqa: E402
OpenAIAgentsInstrumentor,
)
from opentelemetry.instrumentation.openai_agents.package import ( # noqa: E402
_instruments,
)
from opentelemetry.sdk.trace import TracerProvider # noqa: E402
def test_double_instrument_is_noop():
set_trace_processors([])
provider = TracerProvider()
instrumentor = OpenAIAgentsInstrumentor()
instrumentor.instrument(tracer_provider=provider)
trace_provider = get_trace_provider()
assert len(trace_provider._multi_processor._processors) == 1
instrumentor.instrument(tracer_provider=provider)
assert len(trace_provider._multi_processor._processors) == 1
instrumentor.uninstrument()
instrumentor.uninstrument()
set_trace_processors([])
def test_instrumentation_dependencies_exposed():
instrumentor = OpenAIAgentsInstrumentor()
assert instrumentor.instrumentation_dependencies() == _instruments
def test_default_agent_configuration():
set_trace_processors([])
provider = TracerProvider()
instrumentor = OpenAIAgentsInstrumentor()
try:
instrumentor.instrument(tracer_provider=provider)
processor = instrumentor._processor
assert processor is not None
assert processor._agent_name_default == "OpenAI Agent"
assert processor._agent_id_default == "agent"
assert processor._agent_description_default == "OpenAI Agents instrumentation"
assert processor.base_url == "https://api.openai.com"
assert processor.server_address == "api.openai.com"
assert processor.server_port == 443
finally:
instrumentor.uninstrument()
set_trace_processors([])
test_z_span_processor_unit.py 0000664 0000000 0000000 00000040153 15270700723 0044432 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=wrong-import-position,wrong-import-order,import-error,no-name-in-module,unexpected-keyword-arg,no-value-for-parameter,redefined-outer-name,too-many-locals,too-many-statements,too-many-branches
from __future__ import annotations
import importlib
import json
from dataclasses import dataclass
from datetime import datetime, timezone
from enum import Enum
from types import SimpleNamespace
from typing import Any
import pytest
from agents.tracing import (
AgentSpanData,
FunctionSpanData,
GenerationSpanData,
ResponseSpanData,
)
import opentelemetry.semconv._incubating.attributes.gen_ai_attributes as _gen_ai_attributes
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.semconv._incubating.attributes import (
server_attributes as _server_attributes,
)
from opentelemetry.trace import SpanKind
from opentelemetry.trace.status import StatusCode
def _ensure_semconv_enums() -> None:
if not hasattr(_gen_ai_attributes, "GenAiProviderNameValues"):
class _GenAiProviderNameValues(Enum):
OPENAI = "openai"
GCP_GEN_AI = "gcp.gen_ai"
GCP_VERTEX_AI = "gcp.vertex_ai"
GCP_GEMINI = "gcp.gemini"
ANTHROPIC = "anthropic"
COHERE = "cohere"
AZURE_AI_INFERENCE = "azure.ai.inference"
AZURE_AI_OPENAI = "azure.ai.openai"
IBM_WATSONX_AI = "ibm.watsonx.ai"
AWS_BEDROCK = "aws.bedrock"
PERPLEXITY = "perplexity"
X_AI = "x.ai"
DEEPSEEK = "deepseek"
GROQ = "groq"
MISTRAL_AI = "mistral.ai"
class _GenAiOperationNameValues(Enum):
CHAT = "chat"
GENERATE_CONTENT = "generate_content"
TEXT_COMPLETION = "text_completion"
EMBEDDINGS = "embeddings"
CREATE_AGENT = "create_agent"
INVOKE_AGENT = "invoke_agent"
EXECUTE_TOOL = "execute_tool"
class _GenAiOutputTypeValues(Enum):
TEXT = "text"
JSON = "json"
IMAGE = "image"
SPEECH = "speech"
_gen_ai_attributes.GenAiProviderNameValues = _GenAiProviderNameValues
_gen_ai_attributes.GenAiOperationNameValues = _GenAiOperationNameValues
_gen_ai_attributes.GenAiOutputTypeValues = _GenAiOutputTypeValues
if not hasattr(_server_attributes, "SERVER_ADDRESS"):
_server_attributes.SERVER_ADDRESS = "server.address"
if not hasattr(_server_attributes, "SERVER_PORT"):
_server_attributes.SERVER_PORT = "server.port"
_ensure_semconv_enums()
ServerAttributes = _server_attributes
sp = importlib.import_module("opentelemetry.instrumentation.openai_agents.span_processor")
try:
from opentelemetry.sdk.trace.export import ( # type: ignore[attr-defined]
InMemorySpanExporter,
SimpleSpanProcessor,
)
except ImportError: # pragma: no cover
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from opentelemetry.sdk.trace.export.in_memory_span_exporter import (
InMemorySpanExporter,
)
def _collect(iterator) -> dict[str, Any]:
return dict(iterator)
@pytest.fixture
def processor_setup():
provider = TracerProvider()
exporter = InMemorySpanExporter()
provider.add_span_processor(SimpleSpanProcessor(exporter))
tracer = provider.get_tracer(__name__)
processor = sp.GenAISemanticProcessor(tracer=tracer, system_name="openai")
yield processor, exporter
processor.shutdown()
exporter.clear()
def test_time_helpers():
dt = datetime(2024, 1, 1, tzinfo=timezone.utc)
assert sp._as_utc_nano(dt) == 1704067200 * 1_000_000_000
class Fallback:
def __str__(self) -> str:
return "fallback"
assert sp.safe_json_dumps({"foo": "bar"}) == '{"foo":"bar"}'
assert sp.safe_json_dumps(Fallback()) == "fallback"
def test_infer_server_attributes_variants(monkeypatch):
assert sp._infer_server_attributes(None) == {}
assert sp._infer_server_attributes(123) == {}
attrs = sp._infer_server_attributes("https://api.example.com:8080/v1")
assert attrs[ServerAttributes.SERVER_ADDRESS] == "api.example.com"
assert attrs[ServerAttributes.SERVER_PORT] == 8080
def boom(_: str):
raise ValueError("unparsable url")
monkeypatch.setattr(sp, "urlparse", boom)
assert sp._infer_server_attributes("bad") == {}
def test_operation_and_span_naming(processor_setup):
processor, _ = processor_setup
generation = GenerationSpanData(input=[{"role": "user"}], model="gpt-4o")
assert processor._get_operation_name(generation) == sp.GenAIOperationName.CHAT
completion = GenerationSpanData(input=[])
assert processor._get_operation_name(completion) == sp.GenAIOperationName.TEXT_COMPLETION
embeddings = GenerationSpanData(input=None)
embeddings.embedding_dimension = 128
assert processor._get_operation_name(embeddings) == sp.GenAIOperationName.EMBEDDINGS
# AgentSpanData always maps to invoke_agent (no operation field in OpenAI Agents SDK)
agent_data = AgentSpanData(name="bot")
assert processor._get_operation_name(agent_data) == sp.GenAIOperationName.INVOKE_AGENT
agent_default = AgentSpanData()
assert processor._get_operation_name(agent_default) == sp.GenAIOperationName.INVOKE_AGENT
function_data = FunctionSpanData()
assert processor._get_operation_name(function_data) == sp.GenAIOperationName.EXECUTE_TOOL
response_data = ResponseSpanData()
assert processor._get_operation_name(response_data) == sp.GenAIOperationName.CHAT
class UnknownSpanData:
pass
unknown = UnknownSpanData()
assert processor._get_operation_name(unknown) == "unknown"
assert processor._get_span_kind(GenerationSpanData()) is SpanKind.CLIENT
assert processor._get_span_kind(FunctionSpanData()) is SpanKind.INTERNAL
assert sp.get_span_name(sp.GenAIOperationName.CHAT, model="gpt-4o") == "chat gpt-4o"
assert sp.get_span_name(sp.GenAIOperationName.EXECUTE_TOOL, tool_name="weather") == "execute_tool weather"
assert sp.get_span_name(sp.GenAIOperationName.INVOKE_AGENT, agent_name=None) == "invoke_agent"
assert sp.get_span_name(sp.GenAIOperationName.CREATE_AGENT, agent_name=None) == "create_agent"
def test_attribute_builders(processor_setup):
processor, _ = processor_setup
payload = sp.ContentPayload(
input_messages=[
{
"role": "user",
"parts": [{"type": "text", "content": "hi"}],
}
],
output_messages=[
{
"role": "assistant",
"parts": [{"type": "text", "content": "hello"}],
}
],
system_instructions=[{"type": "text", "content": "be helpful"}],
)
model_config = {
"base_url": "https://api.openai.com:443/v1",
"temperature": 0.2,
"top_p": 0.9,
"top_k": 3,
"frequency_penalty": 0.1,
"presence_penalty": 0.4,
"seed": 1234,
"n": 2,
"max_tokens": 128,
"stop": ["foo", None, "bar"],
}
generation_span = GenerationSpanData(
input=[{"role": "user"}],
output=[{"finish_reason": "stop"}],
model="gpt-4o",
model_config=model_config,
usage={
"prompt_tokens": 10,
"completion_tokens": 3,
"total_tokens": 13,
},
)
gen_attrs = _collect(processor._get_attributes_from_generation_span_data(generation_span, payload))
assert gen_attrs[sp.GEN_AI_REQUEST_MODEL] == "gpt-4o"
assert gen_attrs[sp.GEN_AI_REQUEST_MAX_TOKENS] == 128
assert gen_attrs[sp.GEN_AI_REQUEST_STOP_SEQUENCES] == [
"foo",
None,
"bar",
]
assert gen_attrs[ServerAttributes.SERVER_ADDRESS] == "api.openai.com"
assert gen_attrs[ServerAttributes.SERVER_PORT] == 443
assert gen_attrs[sp.GEN_AI_USAGE_INPUT_TOKENS] == 10
assert gen_attrs[sp.GEN_AI_USAGE_OUTPUT_TOKENS] == 3
assert gen_attrs[sp.GEN_AI_RESPONSE_FINISH_REASONS] == ["stop"]
assert json.loads(gen_attrs[sp.GEN_AI_INPUT_MESSAGES])[0]["role"] == "user"
assert json.loads(gen_attrs[sp.GEN_AI_OUTPUT_MESSAGES])[0]["role"] == "assistant"
assert json.loads(gen_attrs[sp.GEN_AI_SYSTEM_INSTRUCTIONS])[0]["content"] == "be helpful"
assert gen_attrs[sp.GEN_AI_OUTPUT_TYPE] == sp.GenAIOutputType.TEXT
class _Usage:
def __init__(self) -> None:
self.input_tokens = None
self.prompt_tokens = 7
self.output_tokens = None
self.completion_tokens = 2
self.total_tokens = 9
class _Response:
def __init__(self) -> None:
self.id = "resp-1"
self.model = "gpt-4o"
self.usage = _Usage()
self.output = [{"finish_reason": "stop"}]
response_span = ResponseSpanData(response=_Response())
response_attrs = _collect(processor._get_attributes_from_response_span_data(response_span, sp.ContentPayload()))
assert response_attrs[sp.GEN_AI_RESPONSE_ID] == "resp-1"
assert response_attrs[sp.GEN_AI_RESPONSE_MODEL] == "gpt-4o"
assert response_attrs[sp.GEN_AI_RESPONSE_FINISH_REASONS] == ["stop"]
assert response_attrs[sp.GEN_AI_USAGE_INPUT_TOKENS] == 7
assert response_attrs[sp.GEN_AI_USAGE_OUTPUT_TOKENS] == 2
assert response_attrs[sp.GEN_AI_OUTPUT_TYPE] == sp.GenAIOutputType.TEXT
agent_span = AgentSpanData(
name="helper",
output_type="json",
)
agent_attrs = _collect(processor._get_attributes_from_agent_span_data(agent_span, None))
assert agent_attrs[sp.GEN_AI_AGENT_NAME] == "helper"
assert sp.GEN_AI_AGENT_ID not in agent_attrs
assert sp.GEN_AI_REQUEST_MODEL not in agent_attrs
assert agent_attrs[sp.GEN_AI_OUTPUT_TYPE] == sp.GenAIOutputType.TEXT
# Fallback to aggregated model when span data lacks it
agent_span_no_model = AgentSpanData(
name="helper-2",
output_type="json",
)
agent_content = {
"input_messages": [],
"output_messages": [],
"system_instructions": [],
"request_model": "gpt-fallback",
}
agent_attrs_fallback = _collect(processor._get_attributes_from_agent_span_data(agent_span_no_model, agent_content))
assert agent_attrs_fallback[sp.GEN_AI_REQUEST_MODEL] == "gpt-fallback"
function_span = FunctionSpanData(name="lookup_weather")
function_span.tool_type = "extension"
function_span.call_id = "call-42"
function_span.description = "desc"
function_payload = sp.ContentPayload(
tool_arguments={"city": "seattle"},
tool_result={"temperature": 70},
)
function_attrs = _collect(processor._get_attributes_from_function_span_data(function_span, function_payload))
assert function_attrs[sp.GEN_AI_TOOL_NAME] == "lookup_weather"
assert function_attrs[sp.GEN_AI_TOOL_TYPE] == "extension"
assert function_attrs[sp.GEN_AI_TOOL_CALL_ID] == "call-42"
assert function_attrs[sp.GEN_AI_TOOL_DESCRIPTION] == "desc"
assert function_attrs[sp.GEN_AI_TOOL_CALL_ARGUMENTS] == {"city": "seattle"}
assert function_attrs[sp.GEN_AI_TOOL_CALL_RESULT] == {"temperature": 70}
assert function_attrs[sp.GEN_AI_OUTPUT_TYPE] == sp.GenAIOutputType.JSON
def test_extract_genai_attributes_unknown_type(processor_setup):
processor, _ = processor_setup
class UnknownSpanData:
pass
class StubSpan:
def __init__(self) -> None:
self.span_data = UnknownSpanData()
attrs = _collect(processor._extract_genai_attributes(StubSpan(), sp.ContentPayload(), None))
assert attrs[sp.GEN_AI_PROVIDER_NAME] == "openai"
assert attrs[sp.GEN_AI_SYSTEM_KEY] == "openai"
assert sp.GEN_AI_OPERATION_NAME not in attrs
def test_span_status_helper():
status = sp._get_span_status(SimpleNamespace(error={"message": "boom", "data": "bad"}))
assert status.status_code is StatusCode.ERROR
assert status.description == "boom: bad"
ok_status = sp._get_span_status(SimpleNamespace(error=None))
assert ok_status.status_code is StatusCode.OK
@dataclass
class FakeTrace:
name: str
trace_id: str
started_at: str | None = None
ended_at: str | None = None
@dataclass
class FakeSpan:
trace_id: str
span_id: str
span_data: Any
parent_id: str | None = None
started_at: str | None = None
ended_at: str | None = None
error: dict[str, Any] | None = None
def test_span_lifecycle_and_shutdown(processor_setup):
processor, exporter = processor_setup
trace = FakeTrace(
name="workflow",
trace_id="trace-1",
started_at="not-a-timestamp",
ended_at="2024-01-01T00:00:05Z",
)
processor.on_trace_start(trace)
parent_span = FakeSpan(
trace_id="trace-1",
span_id="span-1",
span_data=AgentSpanData(name="agent"),
started_at="2024-01-01T00:00:00Z",
ended_at="2024-01-01T00:00:02Z",
)
processor.on_span_start(parent_span)
missing_span = FakeSpan(
trace_id="trace-1",
span_id="missing",
span_data=FunctionSpanData(name="lookup"),
started_at="2024-01-01T00:00:01Z",
ended_at="2024-01-01T00:00:02Z",
)
processor.on_span_end(missing_span)
child_span = FakeSpan(
trace_id="trace-1",
span_id="span-2",
parent_id="span-1",
span_data=FunctionSpanData(name="lookup"),
started_at="2024-01-01T00:00:02Z",
ended_at="2024-01-01T00:00:03Z",
error={"message": "boom", "data": "bad"},
)
processor.on_span_start(child_span)
processor.on_span_end(child_span)
processor.on_span_end(parent_span)
processor.on_trace_end(trace)
linger_trace = FakeTrace(
name="linger",
trace_id="trace-2",
started_at="2024-01-01T00:00:06Z",
)
processor.on_trace_start(linger_trace)
linger_span = FakeSpan(
trace_id="trace-2",
span_id="span-3",
span_data=AgentSpanData(),
started_at="2024-01-01T00:00:06Z",
)
processor.on_span_start(linger_span)
assert processor.force_flush() is None
processor.shutdown()
finished = exporter.get_finished_spans()
statuses = {span.name: span.status for span in finished}
assert (
statuses["execute_tool lookup"].status_code is StatusCode.ERROR
and statuses["execute_tool lookup"].description == "boom: bad"
)
assert statuses["invoke_agent agent"].status_code is StatusCode.OK
assert statuses["workflow"].status_code is StatusCode.OK
assert (
statuses["invoke_agent"].status_code is StatusCode.ERROR
and statuses["invoke_agent"].description == "Application shutdown"
)
assert (
statuses["linger"].status_code is StatusCode.ERROR and statuses["linger"].description == "Application shutdown"
)
workflow_span = next(span for span in finished if span.name == "workflow")
assert workflow_span.attributes[sp.GEN_AI_OPERATION_NAME] == sp.GenAIOperationName.INVOKE_AGENT
def test_chat_span_renamed_with_model(processor_setup):
processor, exporter = processor_setup
trace = FakeTrace(name="workflow", trace_id="trace-rename")
processor.on_trace_start(trace)
agent = FakeSpan(
trace_id=trace.trace_id,
span_id="agent-span",
span_data=AgentSpanData(
name="Agent",
),
started_at="2025-01-01T00:00:00Z",
ended_at="2025-01-01T00:00:02Z",
)
processor.on_span_start(agent)
generation_data = GenerationSpanData(
input=[{"role": "user", "content": "question"}],
output=[{"finish_reason": "stop"}],
usage={"prompt_tokens": 1, "completion_tokens": 1},
)
generation_span = FakeSpan(
trace_id=trace.trace_id,
span_id="child-span",
parent_id=agent.span_id,
span_data=generation_data,
started_at="2025-01-01T00:00:00Z",
ended_at="2025-01-01T00:00:01Z",
)
processor.on_span_start(generation_span)
# Model becomes available before span end (e.g., once response arrives)
generation_data.model = "gpt-4o"
processor.on_span_end(generation_span)
processor.on_span_end(agent)
processor.on_trace_end(trace)
span_names = {span.name for span in exporter.get_finished_spans()}
assert "chat gpt-4o" in span_names
test_zz_coverage_improvements.py 0000664 0000000 0000000 00000077144 15270700723 0045142 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=wrong-import-position,wrong-import-order,import-error,no-name-in-module,unexpected-keyword-arg,no-value-for-parameter,redefined-outer-name,too-many-locals,too-many-statements,protected-access,import-outside-toplevel,no-self-use,invalid-name
# ruff: noqa: PLC0415
"""
Tests for improving coverage of OpenAI Agents instrumentation.
This file targets uncovered lines identified in the coverage report:
- __init__.py: _resolve_system, _resolve_bool, _resolve_content_mode
- span_processor.py: normalization utilities, span data handlers, message normalization,
output type inference, metrics recording, and various edge cases.
NOTE: Imports are done inside functions to avoid module-level import conflicts
that can occur when pytest collects tests across multiple files.
"""
from __future__ import annotations
def _get_modules():
"""Lazy import to avoid module conflicts."""
import importlib
sp = importlib.import_module("opentelemetry.instrumentation.openai_agents.span_processor")
init_module = importlib.import_module("opentelemetry.instrumentation.openai_agents")
return sp, init_module
def _get_span_data_classes():
"""Lazy import span data classes."""
from agents.tracing import (
AgentSpanData,
FunctionSpanData,
GenerationSpanData,
ResponseSpanData,
)
return (
AgentSpanData,
FunctionSpanData,
GenerationSpanData,
ResponseSpanData,
)
def _get_otel_test_fixtures():
"""Get OpenTelemetry test fixtures."""
from opentelemetry.sdk.trace import TracerProvider
try:
from opentelemetry.sdk.trace.export import (
InMemorySpanExporter,
SimpleSpanProcessor,
)
except ImportError:
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from opentelemetry.sdk.trace.export.in_memory_span_exporter import (
InMemorySpanExporter,
)
return TracerProvider, InMemorySpanExporter, SimpleSpanProcessor
# ============================================================================
# Tests for __init__.py functions
# ============================================================================
class TestResolveSystem:
"""Tests for _resolve_system function."""
def test_resolve_system_returns_openai_for_none(self):
_, init_module = _get_modules()
result = init_module._resolve_system(None)
assert result == "openai"
def test_resolve_system_returns_openai_for_empty_string(self):
_, init_module = _get_modules()
result = init_module._resolve_system("")
assert result == "openai"
def test_resolve_system_matches_enum_value(self):
_, init_module = _get_modules()
result = init_module._resolve_system("openai")
assert result == "openai"
def test_resolve_system_matches_enum_name(self):
_, init_module = _get_modules()
result = init_module._resolve_system("OPENAI")
assert result == "openai"
def test_resolve_system_matches_enum_name_when_name_differs(self):
_, init_module = _get_modules()
from opentelemetry.semconv._incubating.attributes import (
gen_ai_attributes as GenAI,
)
candidate = next(
(member for member in GenAI.GenAiSystemValues if member.name.lower() != member.value),
None,
)
assert candidate is not None
assert init_module._resolve_system(candidate.name.lower()) == candidate.value
def test_resolve_system_matches_with_whitespace(self):
_, init_module = _get_modules()
result = init_module._resolve_system(" openai ")
assert result == "openai"
def test_resolve_system_returns_custom_value_when_not_found(self):
_, init_module = _get_modules()
result = init_module._resolve_system("custom_provider")
assert result == "custom_provider"
class TestResolveBool:
"""Tests for _resolve_bool function."""
def test_resolve_bool_returns_default_for_none(self):
_, init_module = _get_modules()
assert init_module._resolve_bool(None, True) is True
assert init_module._resolve_bool(None, False) is False
def test_resolve_bool_returns_value_for_bool(self):
_, init_module = _get_modules()
assert init_module._resolve_bool(True, False) is True
assert init_module._resolve_bool(False, True) is False
def test_resolve_bool_parses_true_strings(self):
_, init_module = _get_modules()
for value in ["true", "TRUE", "1", "yes", "on", " YES "]:
assert init_module._resolve_bool(value, False) is True, f"Failed for {value}"
def test_resolve_bool_parses_false_strings(self):
_, init_module = _get_modules()
for value in ["false", "FALSE", "0", "no", "off", " NO "]:
assert init_module._resolve_bool(value, True) is False, f"Failed for {value}"
def test_resolve_bool_returns_default_for_unknown(self):
_, init_module = _get_modules()
assert init_module._resolve_bool("maybe", True) is True
assert init_module._resolve_bool("maybe", False) is False
class TestResolveContentMode:
"""Tests for _resolve_content_mode function."""
def test_resolve_content_mode_returns_value_for_enum(self):
sp, init_module = _get_modules()
result = init_module._resolve_content_mode(sp.ContentCaptureMode.SPAN_ONLY)
assert result == sp.ContentCaptureMode.SPAN_ONLY
def test_resolve_content_mode_for_bool_true(self):
sp, init_module = _get_modules()
result = init_module._resolve_content_mode(True)
assert result == sp.ContentCaptureMode.SPAN_AND_EVENT
def test_resolve_content_mode_for_bool_false(self):
sp, init_module = _get_modules()
result = init_module._resolve_content_mode(False)
assert result == sp.ContentCaptureMode.NO_CONTENT
def test_resolve_content_mode_for_none(self):
sp, init_module = _get_modules()
result = init_module._resolve_content_mode(None)
assert result == sp.ContentCaptureMode.SPAN_AND_EVENT
def test_resolve_content_mode_for_empty_string(self):
sp, init_module = _get_modules()
result = init_module._resolve_content_mode("")
assert result == sp.ContentCaptureMode.SPAN_AND_EVENT
def test_resolve_content_mode_span_only_variants(self):
sp, init_module = _get_modules()
for value in ["span_only", "span-only", "span"]:
result = init_module._resolve_content_mode(value)
assert result == sp.ContentCaptureMode.SPAN_ONLY, f"Failed for {value}"
def test_resolve_content_mode_event_only_variants(self):
sp, init_module = _get_modules()
for value in ["event_only", "event-only", "event"]:
result = init_module._resolve_content_mode(value)
assert result == sp.ContentCaptureMode.EVENT_ONLY, f"Failed for {value}"
def test_resolve_content_mode_span_and_event_variants(self):
sp, init_module = _get_modules()
for value in [
"span_and_event",
"span-and-event",
"span_and_events",
"all",
"true",
"1",
"yes",
]:
result = init_module._resolve_content_mode(value)
assert result == sp.ContentCaptureMode.SPAN_AND_EVENT, f"Failed for {value}"
def test_resolve_content_mode_no_content_variants(self):
sp, init_module = _get_modules()
for value in ["no_content", "false", "0", "no", "none"]:
result = init_module._resolve_content_mode(value)
assert result == sp.ContentCaptureMode.NO_CONTENT, f"Failed for {value}"
# ============================================================================
# Tests for span_processor.py normalization utilities
# ============================================================================
class TestNormalizeProvider:
"""Tests for normalize_provider function."""
def test_normalize_provider_returns_none_for_none(self):
sp, _ = _get_modules()
assert sp.normalize_provider(None) is None
def test_normalize_provider_returns_none_for_empty(self):
sp, _ = _get_modules()
assert sp.normalize_provider("") is None
def test_normalize_provider_normalizes_valid_provider(self):
sp, _ = _get_modules()
result = sp.normalize_provider("OPENAI")
assert result == "openai"
def test_normalize_provider_passes_through_unknown(self):
sp, _ = _get_modules()
result = sp.normalize_provider("MyCustomProvider")
assert result == "MyCustomProvider"
class TestValidateToolType:
"""Tests for validate_tool_type function."""
def test_validate_tool_type_returns_default_for_none(self):
sp, _ = _get_modules()
assert sp.validate_tool_type(None) == "function"
def test_validate_tool_type_returns_default_for_empty(self):
sp, _ = _get_modules()
assert sp.validate_tool_type("") == "function"
def test_validate_tool_type_normalizes_valid_types(self):
sp, _ = _get_modules()
assert sp.validate_tool_type("FUNCTION") == "function"
assert sp.validate_tool_type("extension") == "extension"
assert sp.validate_tool_type("DATASTORE") == "datastore"
def test_validate_tool_type_returns_default_for_unknown(self):
sp, _ = _get_modules()
assert sp.validate_tool_type("unknown_type") == "function"
class TestNormalizeOutputType:
"""Tests for normalize_output_type function."""
def test_normalize_output_type_returns_text_for_none(self):
sp, _ = _get_modules()
assert sp.normalize_output_type(None) == "text"
def test_normalize_output_type_returns_text_for_empty(self):
sp, _ = _get_modules()
assert sp.normalize_output_type("") == "text"
def test_normalize_output_type_normalizes_known_types(self):
sp, _ = _get_modules()
assert sp.normalize_output_type("TEXT") == "text"
assert sp.normalize_output_type("json") == "json"
assert sp.normalize_output_type("image") == "image"
assert sp.normalize_output_type("speech") == "speech"
def test_normalize_output_type_handles_mappings(self):
sp, _ = _get_modules()
assert sp.normalize_output_type("json_object") == "json"
assert sp.normalize_output_type("jsonschema") == "json"
assert sp.normalize_output_type("speech_audio") == "speech"
assert sp.normalize_output_type("audio_speech") == "speech"
assert sp.normalize_output_type("image_png") == "image"
assert sp.normalize_output_type("function_arguments_json") == "json"
assert sp.normalize_output_type("tool_call") == "json"
assert sp.normalize_output_type("transcription_json") == "json"
def test_normalize_output_type_returns_text_for_unknown(self):
sp, _ = _get_modules()
assert sp.normalize_output_type("unknown_type") == "text"
# ============================================================================
# Tests for span naming and output type inference
# ============================================================================
class TestGetSpanName:
"""Tests for get_span_name function."""
def test_span_name_handoff(self):
sp, _ = _get_modules()
name = sp.get_span_name("agent_handoff", agent_name="target_agent")
assert name == "agent_handoff target_agent"
def test_span_name_handoff_no_agent(self):
sp, _ = _get_modules()
name = sp.get_span_name("agent_handoff")
assert name == "agent_handoff"
def test_span_name_transcription(self):
sp, _ = _get_modules()
name = sp.get_span_name("transcription", model="whisper-1")
assert name == "transcription whisper-1"
def test_span_name_speech(self):
sp, _ = _get_modules()
name = sp.get_span_name("speech_generation", model="tts-1")
assert name == "speech_generation tts-1"
def test_span_name_unknown_operation(self):
sp, _ = _get_modules()
name = sp.get_span_name("unknown_operation")
assert name == "unknown_operation"
class TestInferOutputType:
"""Tests for _infer_output_type method."""
def _make_processor(self):
sp, _ = _get_modules()
TracerProvider, _, _ = _get_otel_test_fixtures()
provider = TracerProvider()
tracer = provider.get_tracer(__name__)
return sp.GenAISemanticProcessor(tracer=tracer, system_name="openai", metrics_enabled=False)
def test_infer_output_type_function_span(self):
_, FunctionSpanData, _, _ = _get_span_data_classes()
processor = self._make_processor()
span_data = FunctionSpanData()
assert processor._infer_output_type(span_data) == "json"
def test_infer_output_type_embeddings(self):
_, _, GenerationSpanData, _ = _get_span_data_classes()
processor = self._make_processor()
span_data = GenerationSpanData()
span_data.embedding_dimension = 128
assert processor._infer_output_type(span_data) == "text"
def test_infer_output_type_image_output(self):
_, _, GenerationSpanData, _ = _get_span_data_classes()
processor = self._make_processor()
span_data = GenerationSpanData(output=[{"type": "image"}])
assert processor._infer_output_type(span_data) == "image"
def test_infer_output_type_audio_output(self):
_, _, GenerationSpanData, _ = _get_span_data_classes()
processor = self._make_processor()
span_data = GenerationSpanData(output=[{"type": "audio"}])
assert processor._infer_output_type(span_data) == "speech"
def test_infer_output_type_json_output(self):
_, _, GenerationSpanData, _ = _get_span_data_classes()
processor = self._make_processor()
span_data = GenerationSpanData(output=[{"type": "json_object"}])
assert processor._infer_output_type(span_data) == "json"
def test_infer_output_type_text_output(self):
_, _, GenerationSpanData, _ = _get_span_data_classes()
processor = self._make_processor()
span_data = GenerationSpanData(output=[{"type": "text"}])
assert processor._infer_output_type(span_data) == "text"
def test_infer_output_type_json_like_keys(self):
_, _, GenerationSpanData, _ = _get_span_data_classes()
processor = self._make_processor()
span_data = GenerationSpanData(output=[{"schema": {}, "properties": {}}])
assert processor._infer_output_type(span_data) == "json"
# ============================================================================
# Tests for content capture mode properties
# ============================================================================
class TestContentCaptureMode:
"""Tests for ContentCaptureMode properties."""
def test_capture_in_span(self):
sp, _ = _get_modules()
assert sp.ContentCaptureMode.NO_CONTENT.capture_in_span is False
assert sp.ContentCaptureMode.SPAN_ONLY.capture_in_span is True
assert sp.ContentCaptureMode.EVENT_ONLY.capture_in_span is False
assert sp.ContentCaptureMode.SPAN_AND_EVENT.capture_in_span is True
def test_capture_in_event(self):
sp, _ = _get_modules()
assert sp.ContentCaptureMode.NO_CONTENT.capture_in_event is False
assert sp.ContentCaptureMode.SPAN_ONLY.capture_in_event is False
assert sp.ContentCaptureMode.EVENT_ONLY.capture_in_event is True
assert sp.ContentCaptureMode.SPAN_AND_EVENT.capture_in_event is True
# ============================================================================
# Tests for sanitize usage payload
# ============================================================================
class TestSanitizeUsagePayload:
"""Tests for _sanitize_usage_payload method."""
def test_sanitize_dict_usage(self):
sp, _ = _get_modules()
usage = {"input_tokens": 10, "output_tokens": 5, "total_tokens": 15}
sp.GenAISemanticProcessor._sanitize_usage_payload(usage)
assert "total_tokens" not in usage
assert usage["input_tokens"] == 10
def test_sanitize_object_usage(self):
sp, _ = _get_modules()
class Usage:
def __init__(self):
self.input_tokens = 10
self.output_tokens = 5
self.total_tokens = 15
usage = Usage()
sp.GenAISemanticProcessor._sanitize_usage_payload(usage)
assert usage.total_tokens is None
def test_sanitize_none_usage(self):
sp, _ = _get_modules()
# Should not raise
sp.GenAISemanticProcessor._sanitize_usage_payload(None)
# ============================================================================
# Tests for message normalization
# ============================================================================
class TestNormalizeMessagesToRoleParts:
"""Tests for _normalize_messages_to_role_parts method."""
def _make_processor(self, sensitive=True):
sp, _ = _get_modules()
TracerProvider, _, _ = _get_otel_test_fixtures()
provider = TracerProvider()
tracer = provider.get_tracer(__name__)
return sp.GenAISemanticProcessor(
tracer=tracer,
system_name="openai",
include_sensitive_data=sensitive,
metrics_enabled=False,
)
def test_normalize_non_dict_message(self):
processor = self._make_processor()
messages = ["plain text message"]
normalized = processor._normalize_messages_to_role_parts(messages)
assert len(normalized) == 1
assert normalized[0]["role"] == "user"
assert normalized[0]["parts"][0]["type"] == "text"
def test_normalize_with_redaction(self):
processor = self._make_processor(sensitive=False)
messages = [{"role": "user", "content": "Secret message"}]
normalized = processor._normalize_messages_to_role_parts(messages)
assert normalized[0]["parts"][0]["content"] == "readacted"
def test_normalize_empty_messages_returns_empty_list(self):
processor = self._make_processor()
normalized = processor._normalize_messages_to_role_parts([])
assert normalized == []
def test_normalize_parts_tool_calls_and_tool_responses(self):
processor = self._make_processor(sensitive=False)
messages = [
{
"role": "assistant",
"parts": [
{"type": "text", "content": "hello"},
{
"type": "tool_call",
"id": "call_1",
"name": "weather",
"arguments": {"city": "Paris"},
},
{
"type": "tool_call_response",
"id": "call_1",
"result": {"temp": 70},
},
{"type": "weird", "payload": {"x": 1}},
123,
],
"content": [
{"type": "text", "text": "from-content"},
{"type": "image", "url": "http://example.com"},
"raw",
],
"tool_calls": [
{
"id": "call_2",
"function": {"name": "calc", "arguments": '{"x":1}'},
},
"not-dict",
],
},
{"role": "tool", "tool_call_id": "call_2", "content": {"x": 1}},
]
normalized = processor._normalize_messages_to_role_parts(messages)
assert normalized[0]["role"] == "assistant"
assistant_part_types = {p["type"] for p in normalized[0]["parts"]}
assert "tool_call" in assistant_part_types
assert "tool_call_response" in assistant_part_types
tool_call = next(p for p in normalized[0]["parts"] if p["type"] == "tool_call")
assert tool_call["arguments"] == "readacted"
tool_response = next(p for p in normalized[0]["parts"] if p["type"] == "tool_call_response")
assert tool_response["result"] == "readacted"
assert normalized[1]["role"] == "tool"
assert normalized[1]["parts"][0]["type"] == "tool_call_response"
assert normalized[1]["parts"][0]["result"] == "readacted"
# ============================================================================
# Tests for helper functions
# ============================================================================
class TestHelperFunctions:
"""Tests for various helper functions."""
def test_is_instance_of_single_class(self):
sp, _ = _get_modules()
assert sp._is_instance_of("hello", str) is True
assert sp._is_instance_of(123, str) is False
def test_is_instance_of_tuple_classes(self):
sp, _ = _get_modules()
assert sp._is_instance_of("hello", (str, int)) is True
assert sp._is_instance_of(123, (str, int)) is True
assert sp._is_instance_of(3.14, (str, int)) is False
def test_span_status_helper(self):
from types import SimpleNamespace
from opentelemetry.trace.status import StatusCode
sp, _ = _get_modules()
status = sp._get_span_status(SimpleNamespace(error={"message": "boom", "data": "bad"}))
assert status.status_code is StatusCode.ERROR
assert status.description == "boom: bad"
ok_status = sp._get_span_status(SimpleNamespace(error=None))
assert ok_status.status_code is StatusCode.OK
# ============================================================================
# Tests for processor initialization and configuration
# ============================================================================
class TestProcessorConfiguration:
"""Tests for GenAISemanticProcessor configuration."""
def test_processor_with_metrics_disabled(self):
sp, _ = _get_modules()
TracerProvider, _, _ = _get_otel_test_fixtures()
provider = TracerProvider()
tracer = provider.get_tracer(__name__)
processor = sp.GenAISemanticProcessor(
tracer=tracer,
system_name="openai",
metrics_enabled=False,
)
assert processor._metrics_enabled is False
assert processor._duration_histogram is None
assert processor._token_usage_histogram is None
processor.shutdown()
def test_processor_with_custom_system_name(self):
sp, _ = _get_modules()
TracerProvider, _, _ = _get_otel_test_fixtures()
provider = TracerProvider()
tracer = provider.get_tracer(__name__)
processor = sp.GenAISemanticProcessor(
tracer=tracer,
system_name="azure.ai.inference",
metrics_enabled=False,
)
assert processor.system_name == "azure.ai.inference"
processor.shutdown()
def test_processor_force_flush_is_noop(self):
sp, _ = _get_modules()
TracerProvider, _, _ = _get_otel_test_fixtures()
provider = TracerProvider()
tracer = provider.get_tracer(__name__)
processor = sp.GenAISemanticProcessor(
tracer=tracer,
system_name="openai",
metrics_enabled=False,
)
# Should not raise
result = processor.force_flush()
assert result is None
processor.shutdown()
def test_processor_infers_server_from_base_url(self):
sp, _ = _get_modules()
TracerProvider, _, _ = _get_otel_test_fixtures()
provider = TracerProvider()
tracer = provider.get_tracer(__name__)
processor = sp.GenAISemanticProcessor(
tracer=tracer,
system_name="openai",
metrics_enabled=False,
base_url="https://api.example.com:8443/v1",
)
assert processor.server_address == "api.example.com"
assert processor.server_port == 8443
server_attrs = processor._get_server_attributes()
assert server_attrs[sp.ServerAttributes.SERVER_ADDRESS] == "api.example.com"
assert server_attrs[sp.ServerAttributes.SERVER_PORT] == 8443
processor.shutdown()
class TestRecordMetrics:
def test_record_metrics_noop_when_disabled(self):
sp, _ = _get_modules()
processor = sp.GenAISemanticProcessor(metrics_enabled=False)
processor._record_metrics(object(), {})
def test_record_metrics_records_duration_and_tokens(self):
from types import SimpleNamespace
sp, _ = _get_modules()
TracerProvider, _, _ = _get_otel_test_fixtures()
provider = TracerProvider()
tracer = provider.get_tracer(__name__)
class _Histogram:
def __init__(self) -> None:
self.records = []
def record(self, value, attributes) -> None:
self.records.append((value, attributes))
duration_histogram = _Histogram()
token_histogram = _Histogram()
processor = sp.GenAISemanticProcessor(tracer=tracer, system_name="openai", metrics_enabled=False)
processor._metrics_enabled = True
processor._duration_histogram = duration_histogram
processor._token_usage_histogram = token_histogram
span = SimpleNamespace(
started_at="2024-01-01T00:00:00+00:00",
ended_at="2024-01-01T00:00:02+00:00",
error={"type": "timeout"},
)
attributes = {
sp.GEN_AI_PROVIDER_NAME: "openai",
sp.GEN_AI_OPERATION_NAME: sp.GenAIOperationName.CHAT,
sp.GEN_AI_REQUEST_MODEL: "gpt-4o-mini",
sp.ServerAttributes.SERVER_ADDRESS: "api.example.com",
sp.ServerAttributes.SERVER_PORT: 443,
sp.GEN_AI_USAGE_INPUT_TOKENS: 2,
sp.GEN_AI_USAGE_OUTPUT_TOKENS: 3,
}
processor._record_metrics(span, attributes)
assert duration_histogram.records
duration_value, duration_attrs = duration_histogram.records[0]
assert duration_value == 2.0
assert duration_attrs["error.type"] == "timeout"
assert len(token_histogram.records) == 2
token_types = {token_attrs[sp.GEN_AI_TOKEN_TYPE] for _, token_attrs in token_histogram.records}
assert token_types == {"input", "output"}
def test_record_metrics_swallows_exceptions(self):
from types import SimpleNamespace
sp, _ = _get_modules()
TracerProvider, _, _ = _get_otel_test_fixtures()
provider = TracerProvider()
tracer = provider.get_tracer(__name__)
class _BoomHistogram:
def record(self, value, attributes) -> None:
raise RuntimeError("boom")
processor = sp.GenAISemanticProcessor(tracer=tracer, system_name="openai", metrics_enabled=False)
processor._metrics_enabled = True
processor._duration_histogram = _BoomHistogram()
span = SimpleNamespace(
started_at="2024-01-01T00:00:00+00:00",
ended_at="2024-01-01T00:00:02+00:00",
)
attributes = {
sp.GEN_AI_PROVIDER_NAME: "openai",
sp.GEN_AI_OPERATION_NAME: sp.GenAIOperationName.CHAT,
sp.GEN_AI_REQUEST_MODEL: "gpt-4o-mini",
}
processor._record_metrics(span, attributes)
class TestVersionModule:
def test_version_importable(self):
import importlib
version_module = importlib.import_module("opentelemetry.instrumentation.openai_agents.version")
assert isinstance(version_module.__version__, str)
assert version_module.__version__
# ============================================================================
# Tests for normalize_to_text_parts
# ============================================================================
class TestNormalizeToTextParts:
"""Tests for _normalize_to_text_parts method."""
def _make_processor(self):
sp, _ = _get_modules()
TracerProvider, _, _ = _get_otel_test_fixtures()
provider = TracerProvider()
tracer = provider.get_tracer(__name__)
return sp.GenAISemanticProcessor(tracer=tracer, system_name="openai", metrics_enabled=False)
def test_normalize_string_content(self):
processor = self._make_processor()
parts = processor._normalize_to_text_parts("Hello")
assert len(parts) == 1
assert parts[0] == {"type": "text", "content": "Hello"}
def test_normalize_list_content(self):
processor = self._make_processor()
parts = processor._normalize_to_text_parts(["Hello", "World"])
assert len(parts) == 2
assert parts[0]["content"] == "Hello"
assert parts[1]["content"] == "World"
def test_normalize_list_with_dict_missing_text_and_other_types(self):
processor = self._make_processor()
parts = processor._normalize_to_text_parts([{"nope": "missing"}, 123, "ok"])
assert [part["content"] for part in parts] == [
"{'nope': 'missing'}",
"123",
"ok",
]
def test_normalize_dict_content_with_text(self):
processor = self._make_processor()
parts = processor._normalize_to_text_parts({"text": "From text key"})
assert len(parts) == 1
assert parts[0]["content"] == "From text key"
def test_normalize_dict_without_text_or_content(self):
processor = self._make_processor()
parts = processor._normalize_to_text_parts({"nope": "missing"})
assert parts[0]["content"] == "{'nope': 'missing'}"
def test_normalize_none_content(self):
processor = self._make_processor()
parts = processor._normalize_to_text_parts(None)
assert parts == []
def test_normalize_other_type_content(self):
processor = self._make_processor()
parts = processor._normalize_to_text_parts(123)
assert len(parts) == 1
assert parts[0]["content"] == "123"
# ============================================================================
# Tests for collect_system_instructions
# ============================================================================
class TestCollectSystemInstructions:
"""Tests for _collect_system_instructions method."""
def _make_processor(self):
sp, _ = _get_modules()
TracerProvider, _, _ = _get_otel_test_fixtures()
provider = TracerProvider()
tracer = provider.get_tracer(__name__)
return sp.GenAISemanticProcessor(tracer=tracer, system_name="openai", metrics_enabled=False)
def test_collect_system_role_message(self):
processor = self._make_processor()
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello"},
]
collected = processor._collect_system_instructions(messages)
assert len(collected) == 1
assert collected[0]["type"] == "text"
assert collected[0]["content"] == "You are a helpful assistant."
def test_collect_ai_role_message(self):
processor = self._make_processor()
messages = [
{"role": "ai", "content": "AI assistant instructions."},
]
collected = processor._collect_system_instructions(messages)
assert len(collected) == 1
assert collected[0]["content"] == "AI assistant instructions."
def test_collect_empty_messages(self):
processor = self._make_processor()
collected = processor._collect_system_instructions([])
assert collected == []
def test_collect_none_messages(self):
processor = self._make_processor()
collected = processor._collect_system_instructions(None)
assert collected == []
def test_collect_skips_non_dict_messages(self):
processor = self._make_processor()
collected = processor._collect_system_instructions(["not-a-dict", {"role": "system", "content": "hi"}])
assert collected[0]["content"] == "hi"
opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/ 0000775 0000000 0000000 00000000000 15270700723 0034024 5 ustar 00root root 0000000 0000000 .changelog/ 0000775 0000000 0000000 00000000000 15270700723 0035752 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2 .gitignore 0000664 0000000 0000000 00000000000 15270700723 0037730 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/.changelog 4500.changed 0000664 0000000 0000000 00000000127 15270700723 0037655 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/.changelog Refactor chat completion stream wrappers to use shared GenAI stream lifecycle helpers.
4554.changed 0000664 0000000 0000000 00000000245 15270700723 0037667 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/.changelog Pass tool definitions from `tools` kwarg to `InferenceInvocation.tool_definitions` so `gen_ai.tool.definitions` span attribute is populated on chat completion spans
4751.fixed 0000664 0000000 0000000 00000000347 15270700723 0037377 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/.changelog `opentelemetry-instrumentation-openai-v2`: await `AsyncStream.close` when closing an async streaming chat completion on the default semantic convention path so the underlying httpx response/connection is released instead of leaked
CHANGELOG.md 0000664 0000000 0000000 00000014070 15270700723 0035560 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2 # Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Version 2.4b0 (2026-05-01)
- Migrate experimental path from deprecated `LLMInvocation` to `InferenceInvocation`,
using `handler.start_inference()` and `invocation.stop()`/`invocation.fail()` directly
([#4502](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4502))
- Use `create_duration_histogram` and `create_token_histogram` from
`opentelemetry-util-genai` instead of defining bucket boundaries locally
([#4501](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4501))
- Import `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` from
`opentelemetry.util.genai.environment_variables` instead of re-defining it locally,
making `opentelemetry-util-genai` the single source of truth for this constant.
([#4455](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4455))
- Fix compatibility with wrapt 2.x by using positional arguments in `wrap_function_wrapper()` calls
([#4445](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4445))
- Fix `ChoiceBuffer` crash on streaming tool-call deltas with `arguments=None`
([#4350](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4350))
- Fix `StreamWrapper` missing `.headers` and other attributes when using `with_raw_response` streaming
([#4113](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/4113))
- Add opt-in support for latest experimental semantic conventions (v1.37.0). Set
`OTEL_SEMCONV_STABILITY_OPT_IN` to `gen_ai_latest_experimental` to enable.
Add dependency on `opentelemetry-util-genai` pypi package.
([#3715](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3715))
- Add wrappers for OpenAI Responses API streams and response stream managers
([#4280](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4280))
- Add async wrappers for OpenAI Responses API streams and response stream managers
([#4325](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4325))
- Add strongly typed Responses API extractors with validation and content
extraction improvements
([#4337](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4337))
- Add instrumentation for OpenAI Responses API `create`
([#4474](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4474))
- Add completion hook support.
([#4315](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4315))
- Fix `response_format` handling: map `json_object`/`json_schema` to `json` output type.
([#4315](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4315))
- Skip attribute values with `openai.Omit` value.
([#4315](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4315))
- Default empty string for `gen_ai.request.model` attribute on missing model.
([#4494](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4494))
## Version 2.3b0 (2025-12-24)
- Fix `AttributeError` when handling `LegacyAPIResponse` (from `with_raw_response`)
([#4017](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4017))
- Add support for chat completions choice count and stop sequences span attributes
([#4028](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4028))
- Fix crash with streaming `with_raw_response`
([#4033](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4033))
- Bump to 1.30.0 semconv schema: `gen_ai.request.seed` instead of `gen_ai.openai.request.seed`
([#4036](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4036))
## Version 2.2b0 (2025-11-25)
- Fix service tier attribute names: use `GEN_AI_OPENAI_REQUEST_SERVICE_TIER` for request
attributes and `GEN_AI_OPENAI_RESPONSE_SERVICE_TIER` for response attributes.
([#3920](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/3920))
- Added support for OpenAI embeddings instrumentation
([#3461](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3461))
- Record prompt and completion events regardless of span sampling decision.
([#3226](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3226))
- Filter out attributes with the value of NotGiven instances
([#3760](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3760))
- Migrate off the deprecated events API to use the logs API
([#3625](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3628))
## Version 2.1b0 (2025-01-18)
- Coerce openai response_format to semconv format
([#3073](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3073))
- Add example to `opentelemetry-instrumentation-openai-v2`
([#3006](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3006))
- Support for `AsyncOpenAI/AsyncCompletions` ([#2984](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2984))
- Add metrics ([#3180](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3180))
## Version 2.0b0 (2024-11-08)
- Use generic `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` environment variable
to control if content of prompt, completion, and other messages is captured.
([#2947](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2947))
- Update OpenAI instrumentation to Semantic Conventions v1.28.0: add new attributes
and switch prompts and completions to log-based events.
([#2925](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2925))
- Initial OpenAI instrumentation
([#2759](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2759))
LICENSE 0000664 0000000 0000000 00000026135 15270700723 0034761 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2 Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
README.rst 0000664 0000000 0000000 00000015170 15270700723 0035440 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2 OpenTelemetry OpenAI Instrumentation
====================================
.. warning::
**This package is deprecated.** Use the
`opentelemetry-instrumentation-genai-openai `_
package instead. ``opentelemetry-instrumentation-openai-v2`` now only
receives security patches. Please
migrate by replacing it with ``opentelemetry-instrumentation-genai-openai``:
.. code-block:: console
pip uninstall opentelemetry-instrumentation-openai-v2
pip install opentelemetry-instrumentation-genai-openai
The replacement package contains **breaking changes** relative to this one.
Review the
`CHANGELOG `_
before upgrading.
|pypi|
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-openai-v2.svg
:target: https://pypi.org/project/opentelemetry-instrumentation-openai-v2/
This library allows tracing LLM requests and logging of messages made by the
`OpenAI Python API library `_. It also captures
the duration of the operations and the number of tokens used as metrics.
Many LLM platforms support the OpenAI SDK. This means systems such as the following are observable with this instrumentation when accessed using it:
.. list-table:: OpenAI Compatible Platforms
:widths: 40 25
:header-rows: 1
* - Name
- gen_ai.system
* - `Azure OpenAI `_
- ``azure.ai.openai``
* - `Gemini `_
- ``gemini``
* - `Perplexity `_
- ``perplexity``
* - `xAI `_ (Compatible with Anthropic)
- ``xai``
* - `DeepSeek `_
- ``deepseek``
* - `Groq `_
- ``groq``
* - `MistralAI `_
- ``mistral_ai``
Installation
------------
If your application is already instrumented with OpenTelemetry, add this
package to your requirements.
::
pip install opentelemetry-instrumentation-openai-v2
If you don't have an OpenAI application, yet, try our `examples `_
which only need a valid OpenAI API key.
Check out `zero-code example `_ for a quick start.
Usage
-----
This section describes how to set up OpenAI instrumentation if you're setting OpenTelemetry up manually.
Check out the `manual example `_ for more details.
Instrumenting all clients
*************************
When using the instrumentor, all clients will automatically trace OpenAI operations including chat completions and embeddings.
You can also optionally capture prompts and completions as log events.
Make sure to configure OpenTelemetry tracing, logging, and events to capture all telemetry emitted by the instrumentation.
.. code-block:: python
from opentelemetry.instrumentation.openai_v2 import OpenAIInstrumentor
OpenAIInstrumentor().instrument()
client = OpenAI()
# Chat completion example
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "user", "content": "Write a short poem on open telemetry."},
],
)
# Embeddings example
embedding_response = client.embeddings.create(
model="text-embedding-3-small",
input="Generate vector embeddings for this text"
)
Enabling message content
*************************
Message content such as the contents of the prompt, completion, function arguments and return values
are not captured by default. To capture message content as log events, set the environment variable
``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT`` to one of the following values:
- ``true`` - Legacy. Used to enable content capturing on ``gen_ai.{role}.message`` and ``gen_ai.choice`` events when
`latest experimental features <#enabling-the-latest-experimental-features>`_ are *not* enabled.
- ``span_only`` - Used to enable content capturing on *span* attributes when
`latest experimental features <#enabling-the-latest-experimental-features>`_ are enabled.
- ``event_only`` - Used to enable content capturing on *event* attributes when
`latest experimental features <#enabling-the-latest-experimental-features>`_ are enabled.
- ``span_and_event`` - Used to enable content capturing on both *span* and *event* attributes when
`latest experimental features <#enabling-the-latest-experimental-features>`_ are enabled.
Uploading prompts and completions
*********************************
To enable the built-in upload hook, set:
- ``OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK=upload``
- ``OTEL_INSTRUMENTATION_GENAI_UPLOAD_BASE_PATH`` to an ``fsspec``-compatible URI/path
(e.g. ``/path/to/prompts`` or ``gs://my_bucket``).
Install the ``upload`` extra to pull in ``fsspec``::
pip install opentelemetry-util-genai[upload]
See the `opentelemetry-util-genai
`_
for additional options.
Enabling the latest experimental features
***********************************************
To enable the latest experimental features, set the environment variable
``OTEL_SEMCONV_STABILITY_OPT_IN`` to ``gen_ai_latest_experimental``. Or, if you use
``OTEL_SEMCONV_STABILITY_OPT_IN`` to enable other features, append ``,gen_ai_latest_experimental`` to its value.
Without this setting, OpenAI instrumentation aligns with `Semantic Conventions v1.30.0 `_
and would not capture additional details introduced in later versions.
.. note:: Generative AI semantic conventions are still evolving. The latest experimental features will introduce breaking changes in future releases.
Uninstrument
************
To uninstrument clients, call the uninstrument method:
.. code-block:: python
from opentelemetry.instrumentation.openai_v2 import OpenAIInstrumentor
OpenAIInstrumentor().instrument()
# ...
# Uninstrument all clients
OpenAIInstrumentor().uninstrument()
References
----------
* `OpenTelemetry OpenAI Instrumentation `_
* `OpenTelemetry Project `_
* `OpenTelemetry Python Examples `_
examples/ 0000775 0000000 0000000 00000000000 15270700723 0035563 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2 embeddings/ 0000775 0000000 0000000 00000000000 15270700723 0037664 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples .env 0000664 0000000 0000000 00000001122 15270700723 0040451 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/embeddings # Update this with your real OpenAI API key
OPENAI_API_KEY=sk-YOUR_API_KEY
# Uncomment to use Ollama instead of OpenAI
# OPENAI_BASE_URL=http://localhost:11434/v1
# OPENAI_API_KEY=unused
# CHAT_MODEL=qwen2.5:0.5b
# Uncomment and change to your OTLP endpoint
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
# OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_SERVICE_NAME=opentelemetry-python-openai
# Uncomment if your OTLP endpoint doesn't support logs
# OTEL_LOGS_EXPORTER=console
# Change to 'false' to hide prompt and completion content
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true
README.rst 0000664 0000000 0000000 00000002544 15270700723 0041360 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/embeddings OpenTelemetry OpenAI Embeddings API Instrumentation Example
===========================================================
This is an example of how to instrument OpenAI Embeddings API calls with zero code changes,
using ``opentelemetry-instrument``.
When ``main.py`` is run, it exports traces and metrics to an OTLP
compatible endpoint. Traces include details such as the model used,
dimensions of embeddings, and the duration of the embedding request.
Metrics capture token usage and performance data.
Note: ``.env`` file configures additional environment variables:
- ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true`` configures OpenAI instrumentation to capture content on events.
- ``OTEL_LOGS_EXPORTER=otlp`` to specify exporter type.
Setup
-----
Minimally, update the ``.env`` file with your ``OPENAI_API_KEY``. An
OTLP compatible endpoint should be listening for traces and logs on
http://localhost:4317. If not, update ``OTEL_EXPORTER_OTLP_ENDPOINT`` as well.
Next, set up a virtual environment like this:
::
python3 -m venv .venv
source .venv/bin/activate
pip install "python-dotenv[cli]"
pip install -r requirements.txt
Run
---
Run the example like this:
::
dotenv run -- opentelemetry-instrument python main.py
You should see embedding information printed while traces and metrics export to your
configured observability tool.
main.py 0000664 0000000 0000000 00000001572 15270700723 0041167 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/embeddings # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
import os
from openai import OpenAI
def main():
client = OpenAI()
# Create embeddings with OpenAI API
embedding_response = client.embeddings.create(
model=os.getenv("EMBEDDING_MODEL", "text-embedding-3-small"),
input="OpenTelemetry provides observability for your applications.",
)
# Print embedding information
print(f"Model: {embedding_response.model}")
print(f"Dimensions: {len(embedding_response.data[0].embedding)}")
print(
f"Token usage - Prompt: {embedding_response.usage.prompt_tokens}, Total: {embedding_response.usage.total_tokens}"
)
# Print a sample of the embedding vector (first 5 dimensions)
print(f"Embedding sample (first 5 dimensions): {embedding_response.data[0].embedding[:5]}")
if __name__ == "__main__":
main()
requirements.txt 0000664 0000000 0000000 00000000245 15270700723 0043151 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/embeddings openai~=1.57.3
opentelemetry-sdk~=1.36.0
opentelemetry-exporter-otlp-proto-grpc~=1.36.0
opentelemetry-distro~=0.57b0
opentelemetry-instrumentation-openai-v2~=2.2b0
manual/ 0000775 0000000 0000000 00000000000 15270700723 0037040 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples .env 0000664 0000000 0000000 00000003022 15270700723 0037626 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/manual # Update this with your real OpenAI API key
OPENAI_API_KEY=sk-YOUR_API_KEY
# Uncomment to use Ollama instead of OpenAI
# OPENAI_BASE_URL=http://localhost:11434/v1
# OPENAI_API_KEY=unused
# CHAT_MODEL=qwen2.5:0.5b
# Uncomment and change to your OTLP endpoint
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
# OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_SERVICE_NAME=opentelemetry-python-openai
# Remove to hide prompt and completion content
# Possible values (case insensitive):
# - `span_only` - record content on span attibutes
# - `event_only` - record content on event attributes
# - `span_and_event` - record content on both span and event attributes
# - `true` - only used for backward compatibility when
# `gen_ai_latest_experimental` is not set in the
# `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable.
# - everything else - don't record content on any signal
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=span_only
# Enables latest and greatest features available in GenAI semantic conventions.
# Note: since conventions are still in development, using this flag would
# likely result in having breaking changes.
#
# Comment out if you want to use semantic conventions of version 1.30.0.
OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental
# Uncomment to upload prompts and responses to an fsspec-compatible
# destination instead of or in addition to recording them inline on spans/events.
# OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK=upload
# OTEL_INSTRUMENTATION_GENAI_UPLOAD_BASE_PATH=/path/to/prompts
README.rst 0000664 0000000 0000000 00000004414 15270700723 0040532 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/manual OpenTelemetry OpenAI Instrumentation Example
============================================
This is an example of how to instrument OpenAI calls when configuring OpenTelemetry SDK and Instrumentations manually.
When `main.py `_ is run, it exports traces and logs to an OTLP
compatible endpoint. Traces include details such as the model used and the
duration of the chat request. Logs capture the chat request and the generated
response, providing a comprehensive view of the performance and behavior of
your OpenAI requests.
Note: `.env <.env>`_ file configures additional environment variables:
- ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=span_only`` configures OpenAI instrumentation to capture prompt and completion contents on *span* attributes.
- ``OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental`` enables latest experimental features.
- ``OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK`` (commented out) - uncomment along with ``OTEL_INSTRUMENTATION_GENAI_UPLOAD_BASE_PATH`` to upload prompts and completions to an ``fsspec``-compatible destination instead of recording them inline. Also uncomment the ``opentelemetry-util-genai[upload]`` line in `requirements.txt `_ and reinstall.
Setup
-----
Minimally, update the `.env <.env>`_ file with your ``OPENAI_API_KEY``. An
OTLP compatible endpoint should be listening for traces and logs on
http://localhost:4317. If not, update ``OTEL_EXPORTER_OTLP_ENDPOINT`` as well.
Next, set up a virtual environment like this:
::
python3 -m venv .venv
source .venv/bin/activate
pip install "python-dotenv[cli]"
pip install -r requirements.txt
Run
---
Run the example like this:
::
dotenv run -- python main.py
You should see a poem generated by OpenAI while traces and logs export to your
configured observability tool.
Custom completion hook
----------------------
`custom_hook.py `_ is a variant of ``main.py`` that passes a
custom ``CompletionHook`` implementation programmatically via
``OpenAIInstrumentor().instrument(completion_hook=...)``. The example hook
prints prompts and completions to stdout; real hooks typically forward content
to external storage and record reference URIs on the span/log_record.
Run it the same way:
::
dotenv run -- python custom_hook.py
custom_hook.py 0000664 0000000 0000000 00000005357 15270700723 0041756 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/manual # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# pylint: skip-file
"""Same as main.py, but instruments OpenAI with a custom CompletionHook
that prints prompts and completions to stdout.
Run with: dotenv run -- python custom_hook.py
"""
import os
from openai import OpenAI
from opentelemetry import _logs, metrics, trace
from opentelemetry.exporter.otlp.proto.grpc._log_exporter import (
OTLPLogExporter,
)
from opentelemetry.exporter.otlp.proto.grpc.metric_exporter import (
OTLPMetricExporter,
)
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import (
OTLPSpanExporter,
)
from opentelemetry.instrumentation.openai_v2 import OpenAIInstrumentor
from opentelemetry.sdk._logs import LoggerProvider
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.util.genai.completion_hook import CompletionHook
from opentelemetry.util.genai.types import (
InputMessage,
MessagePart,
OutputMessage,
ToolDefinition,
)
class PrintCompletionHook(CompletionHook):
"""Minimal CompletionHook that prints inputs/outputs to stdout.
Real hooks typically forward content to external storage (object store,
database, etc.) and record reference URIs on the span/log_record.
"""
def on_completion(
self,
*,
inputs: list[InputMessage],
outputs: list[OutputMessage],
system_instruction: list[MessagePart],
tool_definitions: list[ToolDefinition] | None = None,
span=None,
log_record=None,
) -> None:
print(f"[hook] inputs: {inputs}")
print(f"[hook] outputs: {outputs}")
trace.set_tracer_provider(TracerProvider())
trace.get_tracer_provider().add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
_logs.set_logger_provider(LoggerProvider())
_logs.get_logger_provider().add_log_record_processor(BatchLogRecordProcessor(OTLPLogExporter()))
metrics.set_meter_provider(
MeterProvider(
metric_readers=[
PeriodicExportingMetricReader(OTLPMetricExporter()),
]
)
)
OpenAIInstrumentor().instrument(completion_hook=PrintCompletionHook())
def main():
client = OpenAI()
chat_completion = client.chat.completions.create(
model=os.getenv("CHAT_MODEL", "gpt-4o-mini"),
messages=[
{
"role": "user",
"content": "Write a short poem on OpenTelemetry.",
},
],
)
print(chat_completion.choices[0].message.content)
if __name__ == "__main__":
main()
main.py 0000664 0000000 0000000 00000003574 15270700723 0040347 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/manual # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# pylint: skip-file
import os
from openai import OpenAI
# NOTE: OpenTelemetry Python Logs API is in beta
from opentelemetry import _logs, metrics, trace
from opentelemetry.exporter.otlp.proto.grpc._log_exporter import (
OTLPLogExporter,
)
from opentelemetry.exporter.otlp.proto.grpc.metric_exporter import (
OTLPMetricExporter,
)
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import (
OTLPSpanExporter,
)
from opentelemetry.instrumentation.openai_v2 import OpenAIInstrumentor
from opentelemetry.sdk._logs import LoggerProvider
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
# configure tracing
trace.set_tracer_provider(TracerProvider())
trace.get_tracer_provider().add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
# configure logging
_logs.set_logger_provider(LoggerProvider())
_logs.get_logger_provider().add_log_record_processor(BatchLogRecordProcessor(OTLPLogExporter()))
# configure metrics
metrics.set_meter_provider(
MeterProvider(
metric_readers=[
PeriodicExportingMetricReader(
OTLPMetricExporter(),
),
]
)
)
# instrument OpenAI
OpenAIInstrumentor().instrument()
def main():
client = OpenAI()
chat_completion = client.chat.completions.create(
model=os.getenv("CHAT_MODEL", "gpt-4o-mini"),
messages=[
{
"role": "user",
"content": "Write a short poem on OpenTelemetry.",
},
],
)
print(chat_completion.choices[0].message.content)
if __name__ == "__main__":
main()
requirements.txt 0000664 0000000 0000000 00000000463 15270700723 0042327 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/manual openai~=1.57.3
opentelemetry-sdk~=1.36.0
opentelemetry-exporter-otlp-proto-grpc~=1.36.0
opentelemetry-instrumentation-openai-v2~=2.1b0
# Uncomment to enable the upload completion hook (pulls in fsspec).
# Required when OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK=upload.
# opentelemetry-util-genai[upload]
zero-code/ 0000775 0000000 0000000 00000000000 15270700723 0037452 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples .env 0000664 0000000 0000000 00000003147 15270700723 0040250 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/zero-code # Update this with your real OpenAI API key
OPENAI_API_KEY=sk-YOUR_API_KEY
# Uncomment to use Ollama instead of OpenAI
# OPENAI_BASE_URL=http://localhost:11434/v1
# OPENAI_API_KEY=unused
# CHAT_MODEL=qwen2.5:0.5b
# Uncomment and change to your OTLP endpoint
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
# OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_SERVICE_NAME=opentelemetry-python-openai
# Uncomment if your OTLP endpoint doesn't support logs
# OTEL_LOGS_EXPORTER=console
# Remove to hide prompt and completion content
# Possible values (case insensitive):
# - `span_only` - record content on span attibutes
# - `event_only` - record content on event attributes
# - `span_and_event` - record content on both span and event attributes
# - `true` - only used for backward compatibility when
# `gen_ai_latest_experimental` is not set in the
# `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable.
# - everything else - don't record content on any signal
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=span_only
# Enables latest and greatest features available in GenAI semantic conventions.
# Note: since conventions are still in development, using this flag would
# likely result in having breaking changes.
#
# Comment out if you want to use semantic conventions of version 1.30.0.
OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental
# Uncomment to upload prompts and responses to an fsspec-compatible
# destination instead of or in addition to recording them inline on spans/events.
# OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK=upload
# OTEL_INSTRUMENTATION_GENAI_UPLOAD_BASE_PATH=/path/to/prompts
README.rst 0000664 0000000 0000000 00000003613 15270700723 0041144 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/zero-code OpenTelemetry OpenAI Zero-Code Instrumentation Example
======================================================
This is an example of how to instrument OpenAI calls with zero code changes,
using `opentelemetry-instrument`.
When `main.py `_ is run, it exports traces and logs to an OTLP
compatible endpoint. Traces include details such as the model used and the
duration of the chat request. Logs capture the chat request and the generated
response, providing a comprehensive view of the performance and behavior of
your OpenAI requests.
Note: `.env <.env>`_ file configures additional environment variables:
- ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=span_only`` configures OpenAI instrumentation to capture prompt and completion contents on *span* attributes.
- ``OTEL_LOGS_EXPORTER=otlp`` to specify exporter type.
- ``OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental`` enables latest experimental features.
- ``OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK`` (commented out) - uncomment along with ``OTEL_INSTRUMENTATION_GENAI_UPLOAD_BASE_PATH`` to upload prompts and completions to an ``fsspec``-compatible destination instead of recording them inline. Also uncomment the ``opentelemetry-util-genai[upload]`` line in `requirements.txt `_ and reinstall.
Setup
-----
Minimally, update the `.env <.env>`_ file with your ``OPENAI_API_KEY``. An
OTLP compatible endpoint should be listening for traces and logs on
http://localhost:4317. If not, update ``OTEL_EXPORTER_OTLP_ENDPOINT`` as well.
Next, set up a virtual environment like this:
::
python3 -m venv .venv
source .venv/bin/activate
pip install "python-dotenv[cli]"
pip install -r requirements.txt
Run
---
Run the example like this:
::
dotenv run -- opentelemetry-instrument python main.py
You should see a poem generated by OpenAI while traces and logs export to your
configured observability tool.
main.py 0000664 0000000 0000000 00000001004 15270700723 0040743 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/zero-code # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
import os
from openai import OpenAI
def main():
client = OpenAI()
chat_completion = client.chat.completions.create(
model=os.getenv("CHAT_MODEL", "gpt-4o-mini"),
messages=[
{
"role": "user",
"content": "Write a short poem on OpenTelemetry.",
},
],
)
print(chat_completion.choices[0].message.content)
if __name__ == "__main__":
main()
requirements.txt 0000664 0000000 0000000 00000000520 15270700723 0042733 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/zero-code openai~=1.57.3
opentelemetry-sdk~=1.36.0
opentelemetry-exporter-otlp-proto-grpc~=1.36.0
opentelemetry-distro~=0.57b0
opentelemetry-instrumentation-openai-v2~=2.1b0
# Uncomment to enable the upload completion hook (pulls in fsspec).
# Required when OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK=upload.
# opentelemetry-util-genai[upload]
pyproject.toml 0000664 0000000 0000000 00000004600 15270700723 0036661 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2 [build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "opentelemetry-instrumentation-openai-v2"
dynamic = ["version"]
description = "OpenTelemetry Official OpenAI instrumentation"
readme = "README.rst"
license = "Apache-2.0"
requires-python = ">=3.10"
authors = [
{ name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"opentelemetry-api ~= 1.40",
"opentelemetry-instrumentation ~= 0.61b0",
"opentelemetry-semantic-conventions ~= 0.61b0",
"opentelemetry-util-genai > 0.4b0, < 0.6b0",
"typing-extensions >= 4.5.0",
]
[project.optional-dependencies]
instruments = ["openai >= 1.26.0"]
[project.entry-points.opentelemetry_instrumentor]
openai = "opentelemetry.instrumentation.openai_v2:OpenAIInstrumentor"
[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation-genai/opentelemetry-instrumentation-openai-v2"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"
[tool.hatch.version]
path = "src/opentelemetry/instrumentation/openai_v2/version.py"
[tool.hatch.build.targets.sdist]
include = ["/src", "/tests"]
[tool.hatch.build.targets.wheel]
packages = ["src/opentelemetry"]
[tool.towncrier]
directory = ".changelog"
filename = "CHANGELOG.md"
start_string = "\n"
template = "../../scripts/changelog_template.j2"
issue_format = "[#{issue}](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/{issue})"
wrap = true
issue_pattern = "^(\\d+)"
[[tool.towncrier.type]]
directory = "added"
name = "Added"
showcontent = true
[[tool.towncrier.type]]
directory = "changed"
name = "Changed"
showcontent = true
[[tool.towncrier.type]]
directory = "deprecated"
name = "Deprecated"
showcontent = true
[[tool.towncrier.type]]
directory = "removed"
name = "Removed"
showcontent = true
[[tool.towncrier.type]]
directory = "fixed"
name = "Fixed"
showcontent = true
src/ 0000775 0000000 0000000 00000000000 15270700723 0034534 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2 opentelemetry/ 0000775 0000000 0000000 00000000000 15270700723 0037430 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src instrumentation/ 0000775 0000000 0000000 00000000000 15270700723 0042673 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry openai_v2/ 0000775 0000000 0000000 00000000000 15270700723 0044555 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation __init__.py 0000664 0000000 0000000 00000017475 15270700723 0046704 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
"""
OpenAI client instrumentation supporting `openai`, it can be enabled by
using ``OpenAIInstrumentor``.
.. _openai: https://pypi.org/project/openai/
Usage
-----
.. code:: python
from openai import OpenAI
from opentelemetry.instrumentation.openai_v2 import OpenAIInstrumentor
OpenAIInstrumentor().instrument()
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "user", "content": "Write a short poem on open telemetry."},
],
)
Configuration
-------------
By default, the instrumentation aligns with `Semantic Conventions v1.30.0
`_
and does not capture prompt or completion content. Behavior is controlled
via environment variables:
- ``OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental`` - opt into the
latest GenAI semantic conventions. Required to access the newer attributes
and the ``span_only`` / ``event_only`` / ``span_and_event`` content modes.
Without this flag, the instrumentation stays on v1.30.0 conventions.
- ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT`` - enable capture of
prompts, completions, tool arguments, and return values. Set to ``true``
on the legacy path, or one of ``span_only``, ``event_only``,
``span_and_event`` when experimental conventions are enabled.
- ``OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK=upload`` together with
``OTEL_INSTRUMENTATION_GENAI_UPLOAD_BASE_PATH=`` - upload
prompts and completions to an ``fsspec``-compatible destination
(local filesystem, ``gs://``, ``s3://``, etc.) and record reference URIs as
``gen_ai.input.messages.ref`` / ``gen_ai.output.messages.ref`` attributes.
Inline content is not captured unless
``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT`` is also set.
See the `opentelemetry-util-genai README
`_
for the full list of GenAI configuration variables.
A custom ``CompletionHook`` implementation can also be passed programmatically::
OpenAIInstrumentor().instrument(completion_hook=my_hook)
When provided, this takes precedence over the hook resolved from
``OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK``.
API
---
"""
from collections.abc import Collection
from importlib import import_module
from typing_extensions import deprecated
from wrapt import wrap_function_wrapper
from opentelemetry._logs import get_logger
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.instrumentation.openai_v2.package import _instruments
from opentelemetry.instrumentation.openai_v2.utils import is_content_enabled
from opentelemetry.instrumentation.utils import unwrap
from opentelemetry.metrics import get_meter
from opentelemetry.semconv.schemas import Schemas
from opentelemetry.trace import get_tracer
from opentelemetry.util.genai.completion_hook import load_completion_hook
from opentelemetry.util.genai.handler import (
TelemetryHandler,
)
from opentelemetry.util.genai.utils import is_experimental_mode
from .instruments import Instruments
from .patch import (
async_chat_completions_create_v_new,
async_chat_completions_create_v_old,
async_embeddings_create,
chat_completions_create_v_new,
chat_completions_create_v_old,
embeddings_create,
)
from .patch_responses import (
responses_create,
)
@deprecated(
"opentelemetry-instrumentation-openai-v2 is deprecated. Use the "
"opentelemetry-instrumentation-genai-openai package instead. This package "
"only receives security patches."
)
class OpenAIInstrumentor(BaseInstrumentor):
"""OpenTelemetry instrumentation for the OpenAI Python client.
.. deprecated:: 2.5b0
Use the ``opentelemetry-instrumentation-genai-openai`` package instead.
This package only receives security patches.
"""
def __init__(self):
self._meter = None
def instrumentation_dependencies(self) -> Collection[str]:
return _instruments
def _instrument(self, **kwargs):
"""Enable OpenAI instrumentation."""
latest_experimental_enabled = is_experimental_mode()
tracer_provider = kwargs.get("tracer_provider")
tracer = get_tracer(
__name__,
"",
tracer_provider,
schema_url=Schemas.V1_30_0.value, # only used on the legacy path
)
logger_provider = kwargs.get("logger_provider")
logger = get_logger(
__name__,
"",
logger_provider=logger_provider,
schema_url=Schemas.V1_30_0.value, # only used on the legacy path
)
meter_provider = kwargs.get("meter_provider")
self._meter = get_meter(
__name__,
"",
meter_provider,
schema_url=Schemas.V1_30_0.value, # only used on the legacy path
)
instruments = Instruments(self._meter)
handler = TelemetryHandler(
tracer_provider=tracer_provider,
meter_provider=meter_provider,
logger_provider=logger_provider,
completion_hook=kwargs.get("completion_hook") or load_completion_hook(),
)
wrap_function_wrapper(
"openai.resources.chat.completions",
"Completions.create",
(
chat_completions_create_v_new(handler)
if latest_experimental_enabled
else chat_completions_create_v_old(tracer, logger, instruments, is_content_enabled())
),
)
wrap_function_wrapper(
"openai.resources.chat.completions",
"AsyncCompletions.create",
(
async_chat_completions_create_v_new(handler)
if latest_experimental_enabled
else async_chat_completions_create_v_old(tracer, logger, instruments, is_content_enabled())
),
)
# Add instrumentation for the embeddings API
wrap_function_wrapper(
"openai.resources.embeddings",
"Embeddings.create",
embeddings_create(tracer, instruments, latest_experimental_enabled),
)
wrap_function_wrapper(
"openai.resources.embeddings",
"AsyncEmbeddings.create",
async_embeddings_create(tracer, instruments, latest_experimental_enabled),
)
responses_module = _get_responses_module()
# Responses instrumentation is intentionally limited to the latest
# experimental semconv path. Unlike chat completions, we do not carry
# a second legacy wrapper here; the current implementation is built on
# the inference handler lifecycle and would need a separate old-path
# implementation to support legacy semconv mode.
if responses_module is not None and latest_experimental_enabled:
wrap_function_wrapper(
"openai.resources.responses.responses",
"Responses.create",
responses_create(handler),
)
def _uninstrument(self, **kwargs):
import openai # pylint: disable=import-outside-toplevel # noqa: PLC0415
unwrap(openai.resources.chat.completions.Completions, "create")
unwrap(openai.resources.chat.completions.AsyncCompletions, "create")
unwrap(openai.resources.embeddings.Embeddings, "create")
unwrap(openai.resources.embeddings.AsyncEmbeddings, "create")
responses_module = _get_responses_module()
if responses_module is not None:
unwrap(responses_module.Responses, "create")
def _get_responses_module():
try:
return import_module("openai.resources.responses.responses")
except ImportError:
return None
chat_buffers.py 0000664 0000000 0000000 00000003135 15270700723 0047564 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from openai.types.chat.chat_completion_chunk import ChoiceDeltaToolCall
class ToolCallBuffer:
def __init__(
self,
index: int,
tool_call_id: str | None,
function_name: str | None,
) -> None:
self.index: int = index
self.function_name: str | None = function_name
self.tool_call_id: str | None = tool_call_id
self.arguments: list[str] = []
def append_arguments(self, arguments: str | None) -> None:
if arguments is not None:
self.arguments.append(arguments)
class ChoiceBuffer:
def __init__(self, index: int) -> None:
self.index: int = index
self.finish_reason: str | None = None
self.text_content: list[str] = []
self.tool_calls_buffers: list[ToolCallBuffer | None] = []
def append_text_content(self, content: str) -> None:
self.text_content.append(content)
def append_tool_call(self, tool_call: ChoiceDeltaToolCall) -> None:
idx = tool_call.index
for _ in range(len(self.tool_calls_buffers), idx + 1):
self.tool_calls_buffers.append(None)
function = tool_call.function
buffer = self.tool_calls_buffers[idx]
if buffer is None:
buffer = ToolCallBuffer(
idx,
tool_call.id,
function.name if function else None,
)
self.tool_calls_buffers[idx] = buffer
if function:
buffer.append_arguments(function.arguments)
chat_wrappers.py 0000664 0000000 0000000 00000015560 15270700723 0050000 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import json
from openai import AsyncStream, Stream
from openai.types.chat import ChatCompletionChunk
from opentelemetry.semconv._incubating.attributes import (
openai_attributes as OpenAIAttributes,
)
from opentelemetry.util.genai.invocation import InferenceInvocation
from opentelemetry.util.genai.stream import (
AsyncStreamWrapper,
SyncStreamWrapper,
)
from opentelemetry.util.genai.types import (
OutputMessage,
Text,
ToolCallRequest,
)
from .chat_buffers import ChoiceBuffer
class _ChatStreamMixin:
"""Chat-specific hooks shared by sync and async stream wrappers."""
_self_invocation: InferenceInvocation
_self_capture_content: bool
_self_choice_buffers: list[ChoiceBuffer]
_self_response_id: str | None
_self_response_model: str | None
_self_service_tier: str | None
_self_prompt_tokens: int | None
_self_completion_tokens: int | None
def _set_response_model(self, chunk: ChatCompletionChunk) -> None:
if self._self_response_model:
return
if chunk.model:
self._self_response_model = chunk.model
def _set_response_id(self, chunk: ChatCompletionChunk) -> None:
if self._self_response_id:
return
if chunk.id:
self._self_response_id = chunk.id
def _set_response_service_tier(self, chunk: ChatCompletionChunk) -> None:
if self._self_service_tier:
return
service_tier = getattr(chunk, "service_tier", None)
if service_tier:
self._self_service_tier = service_tier
def _build_streaming_response(self, chunk: ChatCompletionChunk) -> None:
if chunk.choices is None:
return
for choice in chunk.choices:
if not choice.delta:
continue
for idx in range(len(self._self_choice_buffers), choice.index + 1):
self._self_choice_buffers.append(ChoiceBuffer(idx))
if choice.finish_reason:
self._self_choice_buffers[choice.index].finish_reason = choice.finish_reason
if choice.delta.content is not None:
self._self_choice_buffers[choice.index].append_text_content(choice.delta.content)
if choice.delta.tool_calls is not None:
for tool_call in choice.delta.tool_calls:
self._self_choice_buffers[choice.index].append_tool_call(tool_call)
def _set_usage(self, chunk: ChatCompletionChunk) -> None:
usage = getattr(chunk, "usage", None)
if usage:
self._self_completion_tokens = usage.completion_tokens
self._self_prompt_tokens = usage.prompt_tokens
def _process_chunk(self, chunk: ChatCompletionChunk) -> None:
self._set_response_id(chunk)
self._set_response_model(chunk)
self._set_response_service_tier(chunk)
self._build_streaming_response(chunk)
self._set_usage(chunk)
def _set_output_messages(self) -> None:
if not self._self_capture_content: # optimization
return
output_messages = []
for choice in self._self_choice_buffers:
message = OutputMessage(
role="assistant",
finish_reason=choice.finish_reason or "error",
parts=[],
)
if choice.text_content:
message.parts.append(Text(content="".join(choice.text_content)))
if choice.tool_calls_buffers:
tool_calls = []
for tool_call in filter(None, choice.tool_calls_buffers):
arguments = None
arguments_str = "".join(tool_call.arguments)
if arguments_str:
try:
arguments = json.loads(arguments_str)
except json.JSONDecodeError:
arguments = arguments_str
tool_call_part = ToolCallRequest(
name=tool_call.function_name,
id=tool_call.tool_call_id,
arguments=arguments,
)
tool_calls.append(tool_call_part)
message.parts.extend(tool_calls)
output_messages.append(message)
self._self_invocation.output_messages = output_messages
def _on_stream_end(self) -> None:
self._cleanup()
def _on_stream_error(self, error: BaseException) -> None:
self._cleanup(error)
def parse(self) -> _ChatStreamMixin:
"""Called when using with_raw_response with stream=True."""
return self
def _cleanup(self, error: BaseException | None = None) -> None:
self._self_invocation.response_model_name = self._self_response_model
self._self_invocation.response_id = self._self_response_id
self._self_invocation.input_tokens = self._self_prompt_tokens
self._self_invocation.output_tokens = self._self_completion_tokens
finish_reasons = [choice.finish_reason for choice in self._self_choice_buffers if choice.finish_reason]
if finish_reasons:
self._self_invocation.finish_reasons = finish_reasons
if self._self_service_tier:
self._self_invocation.attributes.update(
{OpenAIAttributes.OPENAI_RESPONSE_SERVICE_TIER: self._self_service_tier},
)
self._set_output_messages()
if error:
self._self_invocation.fail(error)
else:
self._self_invocation.stop()
class ChatStreamWrapper(
_ChatStreamMixin,
SyncStreamWrapper[ChatCompletionChunk],
):
def __init__(
self,
stream: Stream[ChatCompletionChunk],
invocation: InferenceInvocation,
capture_content: bool,
) -> None:
super().__init__(stream)
self._self_invocation = invocation
self._self_choice_buffers = []
self._self_capture_content = capture_content
self._self_response_id = None
self._self_response_model = None
self._self_service_tier = None
self._self_prompt_tokens = None
self._self_completion_tokens = None
class AsyncChatStreamWrapper(
_ChatStreamMixin,
AsyncStreamWrapper[ChatCompletionChunk],
):
def __init__(
self,
stream: AsyncStream[ChatCompletionChunk],
invocation: InferenceInvocation,
capture_content: bool,
) -> None:
super().__init__(stream)
self._self_invocation = invocation
self._self_choice_buffers = []
self._self_capture_content = capture_content
self._self_response_id = None
self._self_response_model = None
self._self_service_tier = None
self._self_prompt_tokens = None
self._self_completion_tokens = None
__all__ = [
"AsyncChatStreamWrapper",
"ChatStreamWrapper",
]
instruments.py 0000664 0000000 0000000 00000000721 15270700723 0047522 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
from opentelemetry.metrics import Histogram, Meter
from opentelemetry.util.genai.instruments import (
create_duration_histogram,
create_token_histogram,
)
class Instruments:
def __init__(self, meter: Meter):
self.operation_duration_histogram: Histogram = create_duration_histogram(meter)
self.token_usage_histogram: Histogram = create_token_histogram(meter)
package.py 0000664 0000000 0000000 00000000215 15270700723 0046520 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
_instruments = ("openai >= 1.26.0",)
_supports_metrics = True
patch.py 0000664 0000000 0000000 00000063614 15270700723 0046240 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
from timeit import default_timer
from typing import Any
from openai import AsyncStream, Stream
from opentelemetry._logs import Logger, LogRecord
from opentelemetry.context import get_current
from opentelemetry.semconv._incubating.attributes import (
gen_ai_attributes as GenAIAttributes,
)
from opentelemetry.semconv._incubating.attributes import (
openai_attributes as OpenAIAttributes,
)
from opentelemetry.semconv._incubating.attributes import (
server_attributes as ServerAttributes,
)
from opentelemetry.trace import Span, SpanKind, Tracer
from opentelemetry.trace.propagation import set_span_in_context
from opentelemetry.util.genai.handler import TelemetryHandler
from opentelemetry.util.genai.invocation import InferenceInvocation
from opentelemetry.util.genai.types import (
Error,
)
from .chat_buffers import ChoiceBuffer
from .chat_wrappers import AsyncChatStreamWrapper, ChatStreamWrapper
from .instruments import Instruments
from .utils import (
_prepare_output_messages,
choice_to_event,
create_chat_invocation,
get_llm_request_attributes,
handle_span_exception,
is_streaming,
message_to_event,
set_span_attribute,
)
def chat_completions_create_v_old(
tracer: Tracer,
logger: Logger,
instruments: Instruments,
capture_content: bool,
):
"""Wrap the `create` method of the `ChatCompletion` class to trace it."""
def traced_method(wrapped, instance, args, kwargs):
span_attributes = {**get_llm_request_attributes(kwargs, instance, False)}
operation_name = span_attributes[GenAIAttributes.GEN_AI_OPERATION_NAME]
model = span_attributes.get(GenAIAttributes.GEN_AI_REQUEST_MODEL)
span_name = f"{operation_name} {model}" if model else operation_name
with tracer.start_as_current_span(
name=span_name,
kind=SpanKind.CLIENT,
attributes=span_attributes,
end_on_exit=False,
) as span:
for message in kwargs.get("messages", []):
logger.emit(message_to_event(message, capture_content))
start = default_timer()
result = None
error_type = None
try:
result = wrapped(*args, **kwargs)
if hasattr(result, "parse"):
# result is of type LegacyAPIResponse, call parse to get the actual response
parsed_result = result.parse()
else:
parsed_result = result
if is_streaming(kwargs):
return LegacyChatStreamWrapper(parsed_result, span, logger, capture_content)
if span.is_recording():
_set_response_attributes(span, parsed_result)
for choice in getattr(parsed_result, "choices", []):
logger.emit(choice_to_event(choice, capture_content))
span.end()
return result
except Exception as error:
error_type = type(error).__qualname__
handle_span_exception(span, error)
raise
finally:
duration = max((default_timer() - start), 0)
_record_metrics(
instruments,
duration,
result,
span_attributes,
error_type,
GenAIAttributes.GenAiOperationNameValues.CHAT.value,
)
return traced_method
def chat_completions_create_v_new(
handler: TelemetryHandler,
):
"""Wrap the `create` method of the `ChatCompletion` class to trace it."""
capture_content = handler.should_capture_content()
def traced_method(wrapped, instance, args, kwargs):
chat_invocation = create_chat_invocation(handler, kwargs, instance, capture_content=capture_content)
try:
result = wrapped(*args, **kwargs)
if hasattr(result, "parse"):
# result is of type LegacyAPIResponse, call parse to get the actual response
parsed_result = result.parse()
else:
parsed_result = result
if is_streaming(kwargs):
return ChatStreamWrapper(parsed_result, chat_invocation, capture_content)
_set_response_properties(chat_invocation, parsed_result, capture_content)
chat_invocation.stop()
return result
except Exception as error:
chat_invocation.fail(Error(type=type(error), message=str(error)))
raise
return traced_method
def async_chat_completions_create_v_old(
tracer: Tracer,
logger: Logger,
instruments: Instruments,
capture_content: bool,
):
"""Wrap the `create` method of the `AsyncChatCompletion` class to trace it."""
async def traced_method(wrapped, instance, args, kwargs):
span_attributes = {**get_llm_request_attributes(kwargs, instance, False)}
operation_name = span_attributes[GenAIAttributes.GEN_AI_OPERATION_NAME]
model = span_attributes.get(GenAIAttributes.GEN_AI_REQUEST_MODEL)
span_name = f"{operation_name} {model}" if model else operation_name
with tracer.start_as_current_span(
name=span_name,
kind=SpanKind.CLIENT,
attributes=span_attributes,
end_on_exit=False,
) as span:
for message in kwargs.get("messages", []):
logger.emit(message_to_event(message, capture_content))
start = default_timer()
result = None
error_type = None
try:
result = await wrapped(*args, **kwargs)
if hasattr(result, "parse"):
# result is of type LegacyAPIResponse, calling parse to get the actual response
parsed_result = result.parse()
else:
parsed_result = result
if is_streaming(kwargs):
return AsyncLegacyChatStreamWrapper(parsed_result, span, logger, capture_content)
if span.is_recording():
_set_response_attributes(span, parsed_result)
for choice in getattr(parsed_result, "choices", []):
logger.emit(choice_to_event(choice, capture_content))
span.end()
return result
except Exception as error:
error_type = type(error).__qualname__
handle_span_exception(span, error)
raise
finally:
duration = max((default_timer() - start), 0)
_record_metrics(
instruments,
duration,
result,
span_attributes,
error_type,
GenAIAttributes.GenAiOperationNameValues.CHAT.value,
)
return traced_method
def async_chat_completions_create_v_new(
handler: TelemetryHandler,
):
"""Wrap the `create` method of the `AsyncChatCompletion` class to trace it."""
capture_content = handler.should_capture_content()
async def traced_method(wrapped, instance, args, kwargs):
chat_invocation = create_chat_invocation(handler, kwargs, instance, capture_content=capture_content)
try:
result = await wrapped(*args, **kwargs)
if hasattr(result, "parse"):
# result is of type LegacyAPIResponse, calling parse to get the actual response
parsed_result = result.parse()
else:
parsed_result = result
if is_streaming(kwargs):
return AsyncChatStreamWrapper(parsed_result, chat_invocation, capture_content)
_set_response_properties(chat_invocation, parsed_result, capture_content)
chat_invocation.stop()
return result
except Exception as error:
chat_invocation.fail(Error(type=type(error), message=str(error)))
raise
return traced_method
def embeddings_create(
tracer: Tracer,
instruments: Instruments,
latest_experimental_enabled: bool,
):
"""Wrap the `create` method of the `Embeddings` class to trace it."""
def traced_method(wrapped, instance, args, kwargs):
span_attributes = get_llm_request_attributes(
kwargs,
instance,
latest_experimental_enabled,
GenAIAttributes.GenAiOperationNameValues.EMBEDDINGS.value,
)
span_name = _get_embeddings_span_name(span_attributes)
with tracer.start_as_current_span(
name=span_name,
kind=SpanKind.CLIENT,
attributes=span_attributes,
end_on_exit=True,
) as span:
start = default_timer()
result = None
error_type = None
try:
result = wrapped(*args, **kwargs)
if span.is_recording():
_set_embeddings_response_attributes(span, result)
return result
except Exception as error:
error_type = type(error).__qualname__
handle_span_exception(span, error)
raise
finally:
duration = max((default_timer() - start), 0)
_record_metrics(
instruments,
duration,
result,
span_attributes,
error_type,
GenAIAttributes.GenAiOperationNameValues.EMBEDDINGS.value,
)
return traced_method
def async_embeddings_create(
tracer: Tracer,
instruments: Instruments,
latest_experimental_enabled: bool,
):
"""Wrap the `create` method of the `AsyncEmbeddings` class to trace it."""
async def traced_method(wrapped, instance, args, kwargs):
span_attributes = get_llm_request_attributes(
kwargs,
instance,
latest_experimental_enabled,
GenAIAttributes.GenAiOperationNameValues.EMBEDDINGS.value,
)
span_name = _get_embeddings_span_name(span_attributes)
with tracer.start_as_current_span(
name=span_name,
kind=SpanKind.CLIENT,
attributes=span_attributes,
end_on_exit=True,
) as span:
start = default_timer()
result = None
error_type = None
try:
result = await wrapped(*args, **kwargs)
if span.is_recording():
_set_embeddings_response_attributes(span, result)
return result
except Exception as error:
error_type = type(error).__qualname__
handle_span_exception(span, error)
raise
finally:
duration = max((default_timer() - start), 0)
_record_metrics(
instruments,
duration,
result,
span_attributes,
error_type,
GenAIAttributes.GenAiOperationNameValues.EMBEDDINGS.value,
)
return traced_method
def _get_embeddings_span_name(span_attributes):
"""Get span name for embeddings operations."""
operation_name = span_attributes[GenAIAttributes.GEN_AI_OPERATION_NAME]
model = span_attributes.get(GenAIAttributes.GEN_AI_REQUEST_MODEL)
return f"{operation_name} {model}" if model else operation_name
def _record_metrics(
instruments: Instruments,
duration: float,
result,
request_attributes: dict,
error_type: str | None,
operation_name: str,
):
common_attributes = {
GenAIAttributes.GEN_AI_OPERATION_NAME: operation_name,
GenAIAttributes.GEN_AI_SYSTEM: GenAIAttributes.GenAiSystemValues.OPENAI.value,
GenAIAttributes.GEN_AI_REQUEST_MODEL: request_attributes[GenAIAttributes.GEN_AI_REQUEST_MODEL],
}
if "gen_ai.embeddings.dimension.count" in request_attributes:
common_attributes["gen_ai.embeddings.dimension.count"] = request_attributes["gen_ai.embeddings.dimension.count"]
if error_type:
common_attributes["error.type"] = error_type
if result and getattr(result, "model", None):
common_attributes[GenAIAttributes.GEN_AI_RESPONSE_MODEL] = result.model
if result and getattr(result, "service_tier", None):
common_attributes[GenAIAttributes.GEN_AI_OPENAI_RESPONSE_SERVICE_TIER] = result.service_tier
if result and getattr(result, "system_fingerprint", None):
common_attributes[GenAIAttributes.GEN_AI_OPENAI_RESPONSE_SYSTEM_FINGERPRINT] = result.system_fingerprint
if ServerAttributes.SERVER_ADDRESS in request_attributes:
common_attributes[ServerAttributes.SERVER_ADDRESS] = request_attributes[ServerAttributes.SERVER_ADDRESS]
if ServerAttributes.SERVER_PORT in request_attributes:
common_attributes[ServerAttributes.SERVER_PORT] = request_attributes[ServerAttributes.SERVER_PORT]
instruments.operation_duration_histogram.record(
duration,
attributes=common_attributes,
)
if result and getattr(result, "usage", None):
# Always record input tokens
input_attributes = {
**common_attributes,
GenAIAttributes.GEN_AI_TOKEN_TYPE: GenAIAttributes.GenAiTokenTypeValues.INPUT.value,
}
instruments.token_usage_histogram.record(
result.usage.prompt_tokens,
attributes=input_attributes,
)
# For embeddings, don't record output tokens as all tokens are input tokens
if operation_name != GenAIAttributes.GenAiOperationNameValues.EMBEDDINGS.value:
output_attributes = {
**common_attributes,
GenAIAttributes.GEN_AI_TOKEN_TYPE: GenAIAttributes.GenAiTokenTypeValues.COMPLETION.value,
}
instruments.token_usage_histogram.record(result.usage.completion_tokens, attributes=output_attributes)
def _set_response_attributes(span, result):
if getattr(result, "model", None):
set_span_attribute(span, GenAIAttributes.GEN_AI_RESPONSE_MODEL, result.model)
if getattr(result, "choices", None):
finish_reasons = []
for choice in result.choices:
finish_reasons.append(choice.finish_reason or "error")
set_span_attribute(
span,
GenAIAttributes.GEN_AI_RESPONSE_FINISH_REASONS,
finish_reasons,
)
if getattr(result, "id", None):
set_span_attribute(span, GenAIAttributes.GEN_AI_RESPONSE_ID, result.id)
if getattr(result, "service_tier", None):
set_span_attribute(
span,
GenAIAttributes.GEN_AI_OPENAI_RESPONSE_SERVICE_TIER,
result.service_tier,
)
# Get the usage
if getattr(result, "usage", None):
set_span_attribute(
span,
GenAIAttributes.GEN_AI_USAGE_INPUT_TOKENS,
result.usage.prompt_tokens,
)
set_span_attribute(
span,
GenAIAttributes.GEN_AI_USAGE_OUTPUT_TOKENS,
result.usage.completion_tokens,
)
def _set_response_properties(
chat_invocation: InferenceInvocation, result, capture_content: bool
) -> InferenceInvocation:
if getattr(result, "model", None):
chat_invocation.response_model_name = result.model
if getattr(result, "choices", None):
finish_reasons = []
for choice in result.choices:
finish_reasons.append(choice.finish_reason or "error")
chat_invocation.finish_reasons = finish_reasons
if capture_content: # optimization
chat_invocation.output_messages = _prepare_output_messages(result.choices)
if getattr(result, "id", None):
chat_invocation.response_id = result.id
if getattr(result, "service_tier", None):
chat_invocation.attributes.update(
{OpenAIAttributes.OPENAI_RESPONSE_SERVICE_TIER: result.service_tier},
)
chat_invocation.metric_attributes.update(
{OpenAIAttributes.OPENAI_RESPONSE_SERVICE_TIER: result.service_tier},
)
if getattr(result, "usage", None):
chat_invocation.input_tokens = result.usage.prompt_tokens
chat_invocation.output_tokens = result.usage.completion_tokens
if getattr(result, "system_fingerprint", None):
chat_invocation.attributes.update(
{OpenAIAttributes.OPENAI_RESPONSE_SYSTEM_FINGERPRINT: result.system_fingerprint},
)
chat_invocation.metric_attributes.update(
{OpenAIAttributes.OPENAI_RESPONSE_SYSTEM_FINGERPRINT: result.system_fingerprint},
)
return chat_invocation
def _set_embeddings_response_attributes(
span: Span,
result: Any,
):
set_span_attribute(span, GenAIAttributes.GEN_AI_RESPONSE_MODEL, result.model)
# Set embeddings dimensions if we can determine it from the response
if getattr(result, "data", None) and len(result.data) > 0:
first_embedding = result.data[0]
if getattr(first_embedding, "embedding", None):
set_span_attribute(
span,
"gen_ai.embeddings.dimension.count",
len(first_embedding.embedding),
)
# Get the usage
if getattr(result, "usage", None):
set_span_attribute(
span,
GenAIAttributes.GEN_AI_USAGE_INPUT_TOKENS,
result.usage.prompt_tokens,
)
# Don't set output tokens for embeddings as all tokens are input tokens
class BaseStreamWrapper:
response_id: str | None = None
response_model: str | None = None
service_tier: str | None = None
finish_reasons: list = []
prompt_tokens: int | None = 0
completion_tokens: int | None = 0
def __init__(
self,
stream: Stream,
capture_content: bool,
):
self.stream = stream
self.choice_buffers = []
self._started = False
self.capture_content = capture_content
self._setup()
def _setup(self):
if not self._started:
self._started = True
def cleanup(self, error: BaseException | None = None):
pass
def __enter__(self):
self._setup()
return self
def __exit__(self, exc_type, exc_val, exc_tb):
error = exc_val if exc_type else None
self.cleanup(error)
return False # Propagate the exception
async def __aenter__(self):
self._setup()
return self
async def __aexit__(self, exc_type, exc_val, exc_tb):
error = exc_val if exc_type else None
self.cleanup(error)
return False # Propagate the exception
def close(self):
self.stream.close()
self.cleanup()
def __iter__(self):
return self
def __aiter__(self):
return self
def __next__(self):
try:
chunk = next(self.stream)
self.process_chunk(chunk)
return chunk
except StopIteration:
self.cleanup()
raise
except Exception as error:
self.cleanup(error)
raise
async def __anext__(self):
try:
chunk = await self.stream.__anext__()
self.process_chunk(chunk)
return chunk
except StopAsyncIteration:
self.cleanup()
raise
except Exception as error:
self.cleanup(error)
raise
def set_response_model(self, chunk):
if self.response_model:
return
if getattr(chunk, "model", None):
self.response_model = chunk.model
def set_response_id(self, chunk):
if self.response_id:
return
if getattr(chunk, "id", None):
self.response_id = chunk.id
def set_response_service_tier(self, chunk):
if self.service_tier:
return
if getattr(chunk, "service_tier", None):
self.service_tier = chunk.service_tier
def build_streaming_response(self, chunk):
if getattr(chunk, "choices", None) is None:
return
choices = chunk.choices
for choice in choices:
if not choice.delta:
continue
# make sure we have enough choice buffers
for idx in range(len(self.choice_buffers), choice.index + 1):
self.choice_buffers.append(ChoiceBuffer(idx))
if choice.finish_reason:
self.choice_buffers[choice.index].finish_reason = choice.finish_reason
if choice.delta.content is not None:
self.choice_buffers[choice.index].append_text_content(choice.delta.content)
if choice.delta.tool_calls is not None:
for tool_call in choice.delta.tool_calls:
self.choice_buffers[choice.index].append_tool_call(tool_call)
def set_usage(self, chunk):
if getattr(chunk, "usage", None):
self.completion_tokens = chunk.usage.completion_tokens
self.prompt_tokens = chunk.usage.prompt_tokens
def process_chunk(self, chunk):
self.set_response_id(chunk)
self.set_response_model(chunk)
self.set_response_service_tier(chunk)
self.build_streaming_response(chunk)
self.set_usage(chunk)
def __getattr__(self, name):
return getattr(self.stream, name)
def parse(self):
"""Called when using with_raw_response with stream=True"""
return self
class LegacyChatStreamWrapper(BaseStreamWrapper):
span: Span
response_id: str | None = None
response_model: str | None = None
service_tier: str | None = None
finish_reasons: list = []
prompt_tokens: int | None = 0
completion_tokens: int | None = 0
def __init__(
self,
stream: Stream,
span: Span,
logger: Logger,
capture_content: bool,
):
super().__init__(stream, capture_content=capture_content)
self.span = span
self.logger = logger
def cleanup(self, error: BaseException | None = None):
if not self._started:
return
if self.span.is_recording():
if self.response_model:
set_span_attribute(
self.span,
GenAIAttributes.GEN_AI_RESPONSE_MODEL,
self.response_model,
)
if self.response_id:
set_span_attribute(
self.span,
GenAIAttributes.GEN_AI_RESPONSE_ID,
self.response_id,
)
set_span_attribute(
self.span,
GenAIAttributes.GEN_AI_USAGE_INPUT_TOKENS,
self.prompt_tokens,
)
set_span_attribute(
self.span,
GenAIAttributes.GEN_AI_USAGE_OUTPUT_TOKENS,
self.completion_tokens,
)
if self.service_tier:
set_span_attribute(
self.span,
GenAIAttributes.GEN_AI_OPENAI_RESPONSE_SERVICE_TIER,
self.service_tier,
)
set_span_attribute(
self.span,
GenAIAttributes.GEN_AI_RESPONSE_FINISH_REASONS,
self.finish_reasons,
)
for idx, choice in enumerate(self.choice_buffers):
message = {"role": "assistant"}
if self.capture_content and choice.text_content:
message["content"] = "".join(choice.text_content)
if choice.tool_calls_buffers:
tool_calls = []
for tool_call in filter(None, choice.tool_calls_buffers):
function = {"name": tool_call.function_name}
if self.capture_content:
function["arguments"] = "".join(tool_call.arguments)
tool_call_dict = {
"id": tool_call.tool_call_id,
"type": "function",
"function": function,
}
tool_calls.append(tool_call_dict)
message["tool_calls"] = tool_calls
body = {
"index": idx,
"finish_reason": choice.finish_reason or "error",
"message": message,
}
event_attributes = {GenAIAttributes.GEN_AI_SYSTEM: GenAIAttributes.GenAiSystemValues.OPENAI.value}
context = set_span_in_context(self.span, get_current())
self.logger.emit(
LogRecord(
event_name="gen_ai.choice",
attributes=event_attributes,
body=body,
context=context,
)
)
if error:
handle_span_exception(self.span, error)
else:
self.span.end()
self._started = False
class AsyncLegacyChatStreamWrapper(LegacyChatStreamWrapper):
"""Async variant of :class:`LegacyChatStreamWrapper`.
Wraps an ``openai.AsyncStream`` whose ``close`` is a coroutine. ``close``
and ``__aexit__`` are therefore overridden as awaitables so the underlying
``AsyncStream.close`` is awaited, releasing the httpx response/connection
instead of leaking it (and avoiding the ``coroutine ... was never awaited``
warning).
"""
stream: AsyncStream
async def close(self) -> None:
# Finalize the span even if the underlying close raises, and re-raise
# the original exception unmodified.
try:
await self.stream.close()
finally:
self.cleanup()
async def __aexit__(self, exc_type, exc_val, exc_tb):
# The wrapper replaces the underlying AsyncStream as the async context
# manager, so it must await AsyncStream.close on exit to release the
# httpx response/connection instead of leaking it.
error = exc_val if exc_type else None
try:
await self.stream.close()
finally:
self.cleanup(error)
return False # Propagate the exception
patch_responses.py 0000664 0000000 0000000 00000003207 15270700723 0050331 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from opentelemetry.util.genai.handler import TelemetryHandler
from opentelemetry.util.genai.types import Error
from .response_extractors import (
apply_request_attributes,
extract_params,
get_inference_creation_kwargs,
set_invocation_response_attributes,
)
from .response_wrappers import ResponseStreamWrapper
from .utils import is_streaming
def responses_create(handler: TelemetryHandler):
"""Wrap the `create` method of the `Responses` class to trace it."""
capture_content = handler.should_capture_content()
def traced_method(wrapped, instance, args, kwargs):
params = extract_params(**kwargs)
invocation = handler.start_inference(**get_inference_creation_kwargs(params, instance))
apply_request_attributes(invocation, params, capture_content)
try:
result = wrapped(*args, **kwargs)
parsed_result = _get_response_stream_result(result)
if is_streaming(kwargs):
return ResponseStreamWrapper(
parsed_result,
invocation,
capture_content,
)
set_invocation_response_attributes(invocation, parsed_result, capture_content)
invocation.stop()
return result
except Exception as error:
invocation.fail(Error(type=type(error), message=str(error)))
raise
return traced_method
def _get_response_stream_result(result):
if hasattr(result, "parse"):
return result.parse()
return result
response_extractors.py 0000664 0000000 0000000 00000032316 15270700723 0051250 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import json
from collections.abc import Mapping, Sequence
from dataclasses import dataclass
from typing import TYPE_CHECKING
from opentelemetry.semconv._incubating.attributes import (
gen_ai_attributes as GenAIAttributes,
)
from opentelemetry.semconv._incubating.attributes import (
openai_attributes as OpenAIAttributes,
)
from .utils import (
_openai_response_format_to_output_type,
get_server_address_and_port,
)
if TYPE_CHECKING:
from openai.types.responses.response import Response
from openai.types.responses.response_usage import ResponseUsage
from opentelemetry.util.genai.types import (
InputMessage,
OutputMessage,
Text,
)
try:
from openai.types.responses.response import Response
from openai.types.responses.response_function_tool_call import (
ResponseFunctionToolCall,
)
from openai.types.responses.response_output_message import (
ResponseOutputMessage,
)
from openai.types.responses.response_output_refusal import (
ResponseOutputRefusal,
)
from openai.types.responses.response_output_text import ResponseOutputText
from openai.types.responses.response_reasoning_item import (
ResponseReasoningItem,
)
from openai.types.responses.response_usage import ResponseUsage
except ImportError:
Response = None
ResponseFunctionToolCall = None
ResponseOutputMessage = None
ResponseOutputRefusal = None
ResponseOutputText = None
ResponseReasoningItem = None
ResponseUsage = None
try:
from opentelemetry.util.genai.types import (
InputMessage,
OutputMessage,
Reasoning,
Text,
)
from opentelemetry.util.genai.types import (
ToolCallRequest as ToolCall,
)
except ImportError:
InputMessage = None
OutputMessage = None
Reasoning = None
Text = None
ToolCall = None
@dataclass
class ResponseRequestParams:
model: str | None = None
instructions: str | None = None
input: str | Sequence[object] | None = None
max_output_tokens: int | None = None
service_tier: str | None = None
temperature: float | None = None
output_type: str | None = None
top_p: float | None = None
@dataclass
class UsageTokens:
input_tokens: int | None = None
output_tokens: int | None = None
cache_creation_input_tokens: int | None = None
cache_read_input_tokens: int | None = None
def _get_field(value: object, field_name: str) -> object | None:
if isinstance(value, Mapping):
return value.get(field_name)
return getattr(value, field_name, None)
def _get_sequence(value: object) -> Sequence[object]:
if isinstance(value, Sequence) and not isinstance(value, (str, bytes, bytearray)):
return value
return ()
def _get_int(value: object) -> int | None:
if isinstance(value, bool) or not isinstance(value, int):
return None
return value
def _get_float(value: object) -> float | None:
if isinstance(value, bool) or not isinstance(value, (int, float)):
return None
return float(value)
def _extract_output_type_from_value(text_config: object) -> str | None:
format_config = _get_field(text_config, "format")
if format_config is None:
return None
format_type = _get_field(format_config, "type")
if isinstance(format_type, str):
return _openai_response_format_to_output_type(format_type)
return None
def extract_params(
*,
model: str | None = None,
instructions: str | None = None,
input_items: str | Sequence[object] | None = None,
max_output_tokens: int | None = None,
service_tier: str | None = None,
temperature: float | None = None,
text: object | None = None,
top_p: float | None = None,
**_kwargs: object,
) -> ResponseRequestParams:
if input_items is None and "input" in _kwargs:
input_items = _kwargs["input"]
return ResponseRequestParams(
model=model if isinstance(model, str) else None,
instructions=instructions if isinstance(instructions, str) else None,
input=(
input_items
if isinstance(input_items, str)
or (isinstance(input_items, Sequence) and not isinstance(input_items, (str, bytes, bytearray)))
else None
),
max_output_tokens=_get_int(max_output_tokens),
service_tier=(service_tier if isinstance(service_tier, str) and service_tier != "auto" else None),
temperature=_get_float(temperature),
output_type=_extract_output_type_from_value(text),
top_p=_get_float(top_p),
)
def get_system_instruction(instructions: str | None) -> list[Text]:
if Text is None or instructions is None:
return []
return [Text(content=instructions)]
def get_input_messages(
input_value: str | Sequence[object] | None,
) -> list[InputMessage]:
if InputMessage is None or Text is None:
return []
if isinstance(input_value, str):
return [InputMessage(role="user", parts=[Text(content=input_value)])]
messages: list[InputMessage] = []
for item in _get_sequence(input_value):
role = _get_field(item, "role")
if not isinstance(role, str):
continue
content = _get_field(item, "content")
if isinstance(content, str):
messages.append(InputMessage(role=role, parts=[Text(content=content)]))
continue
parts = []
for part in _get_sequence(content):
text = _get_field(part, "text")
if isinstance(text, str):
parts.append(Text(content=text))
if parts:
messages.append(InputMessage(role=role, parts=parts))
return messages
def _extract_output_parts(content_blocks: Sequence[object]) -> list[Text]:
if Text is None or ResponseOutputText is None or ResponseOutputRefusal is None:
return []
parts: list[Text] = []
for block in content_blocks:
if isinstance(block, ResponseOutputText):
parts.append(Text(content=block.text))
elif isinstance(block, ResponseOutputRefusal):
parts.append(Text(content=block.refusal))
return parts
def _parse_tool_call_arguments(arguments: str | None) -> object:
if arguments is None:
return None
try:
return json.loads(arguments)
except (TypeError, ValueError):
return arguments
def _extract_reasoning_parts(
item: ResponseReasoningItem,
) -> list[Reasoning]:
if Reasoning is None:
return []
parts: list[Reasoning] = []
for block in item.summary:
if isinstance(block.text, str):
parts.append(Reasoning(content=block.text))
for block in item.content or []:
if getattr(block, "type", None) == "reasoning_text" and isinstance(getattr(block, "text", None), str):
parts.append(Reasoning(content=block.text))
return parts
def _finish_reason_from_status(status: str | None) -> str | None:
if status == "completed":
return "stop"
if status in {"failed", "cancelled", "incomplete"}:
return status
return None
def _response_types_available() -> bool:
return (
Response is not None
and ResponseOutputMessage is not None
and ResponseFunctionToolCall is not None
and ResponseReasoningItem is not None
)
def get_output_messages_from_response(
response: Response | None,
) -> list[OutputMessage]:
if not _response_types_available() or not isinstance(response, Response) or OutputMessage is None or Text is None:
return []
messages: list[OutputMessage] = []
for item in response.output:
if isinstance(item, ResponseOutputMessage):
finish_reason = _finish_reason_from_status(item.status)
if finish_reason is None:
continue
messages.append(
OutputMessage(
role=item.role,
parts=_extract_output_parts(item.content),
finish_reason=finish_reason,
)
)
continue
if isinstance(item, ResponseFunctionToolCall):
if ToolCall is None or item.status not in {
"completed",
"incomplete",
}:
continue
messages.append(
OutputMessage(
role="assistant",
parts=[
ToolCall(
id=item.call_id if item.call_id else item.id,
name=item.name,
arguments=_parse_tool_call_arguments(item.arguments),
)
],
finish_reason="tool_calls",
)
)
continue
if isinstance(item, ResponseReasoningItem):
finish_reason = _finish_reason_from_status(item.status)
if finish_reason is None:
continue
parts = _extract_reasoning_parts(item)
if parts:
messages.append(
OutputMessage(
role="assistant",
parts=parts,
finish_reason=finish_reason,
)
)
return messages
def extract_finish_reasons(response: Response | None) -> list[str]:
if (
Response is None
or ResponseOutputMessage is None
or ResponseFunctionToolCall is None
or not isinstance(response, Response)
):
return []
finish_reasons: list[str] = []
for item in response.output:
if isinstance(item, ResponseFunctionToolCall) and item.status in {
"completed",
"incomplete",
}:
finish_reasons.append("tool_calls")
continue
if not isinstance(item, ResponseOutputMessage):
continue
finish_reason = _finish_reason_from_status(item.status)
if finish_reason is not None:
finish_reasons.append(finish_reason)
return list(dict.fromkeys(finish_reasons))
def get_inference_creation_kwargs(
params: ResponseRequestParams,
client_instance: object,
) -> dict[str, object]:
address, port = get_server_address_and_port(client_instance)
creation_kwargs: dict[str, object] = {
"provider": GenAIAttributes.GenAiProviderNameValues.OPENAI.value,
}
if params.model is not None:
creation_kwargs["request_model"] = params.model
if address is not None:
creation_kwargs["server_address"] = address
if port is not None:
creation_kwargs["server_port"] = port
return creation_kwargs
def apply_request_attributes(
invocation,
params: ResponseRequestParams,
capture_content: bool,
) -> None:
invocation.temperature = params.temperature
invocation.top_p = params.top_p
invocation.max_tokens = params.max_output_tokens
if params.service_tier is not None:
invocation.attributes[OpenAIAttributes.OPENAI_REQUEST_SERVICE_TIER] = params.service_tier
if params.output_type is not None:
invocation.attributes[GenAIAttributes.GEN_AI_OUTPUT_TYPE] = params.output_type
if capture_content:
invocation.system_instruction = get_system_instruction(params.instructions)
invocation.input_messages = get_input_messages(params.input)
def extract_usage_tokens(usage: ResponseUsage | None) -> UsageTokens:
if ResponseUsage is None or usage is None or not isinstance(usage, ResponseUsage):
return UsageTokens()
details = usage.input_tokens_details
return UsageTokens(
input_tokens=usage.input_tokens,
output_tokens=usage.output_tokens,
# `cache_creation_input_tokens` is not present on every SDK version's
# input token details model, so keep this attribute access guarded for
# compatibility across the supported OpenAI range.
cache_creation_input_tokens=(
details.cache_creation_input_tokens
if details is not None and hasattr(details, "cache_creation_input_tokens")
else None
),
cache_read_input_tokens=(details.cached_tokens if details is not None else None),
)
def set_invocation_response_attributes(
invocation,
response: Response | None,
capture_content: bool,
) -> None:
if Response is None or not isinstance(response, Response):
return
invocation.response_model_name = response.model
invocation.response_id = response.id
if response.service_tier is not None:
invocation.attributes[OpenAIAttributes.OPENAI_RESPONSE_SERVICE_TIER] = response.service_tier
tokens = extract_usage_tokens(response.usage)
invocation.input_tokens = tokens.input_tokens
invocation.output_tokens = tokens.output_tokens
invocation.cache_creation_input_tokens = tokens.cache_creation_input_tokens
invocation.cache_read_input_tokens = tokens.cache_read_input_tokens
finish_reasons = extract_finish_reasons(response)
if finish_reasons:
invocation.finish_reasons = finish_reasons
if capture_content:
output_messages = get_output_messages_from_response(response)
if output_messages:
invocation.output_messages = output_messages
response_wrappers.py 0000664 0000000 0000000 00000032151 15270700723 0050712 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
"""Wrappers for OpenAI Responses API streams and stream managers."""
from __future__ import annotations
import logging
from collections.abc import Callable, Generator
from contextlib import AsyncExitStack, ExitStack, contextmanager
from types import TracebackType
from typing import TYPE_CHECKING, Generic, TypeVar
from opentelemetry.util.genai.types import Error
try:
from opentelemetry.instrumentation.openai_v2.response_extractors import ( # pylint: disable=no-name-in-module
set_invocation_response_attributes,
)
except ImportError:
set_invocation_response_attributes = None
if TYPE_CHECKING:
from openai.lib.streaming.responses._events import ( # pylint: disable=no-name-in-module
ResponseStreamEvent,
)
from openai.lib.streaming.responses._responses import (
AsyncResponseStream,
AsyncResponseStreamManager,
ResponseStream,
ResponseStreamManager,
) # pylint: disable=no-name-in-module
from openai.types.responses import ( # pylint: disable=no-name-in-module
ParsedResponse,
Response,
)
from opentelemetry.util.genai._invocation import GenAIInvocation
_logger = logging.getLogger(__name__)
TextFormatT = TypeVar("TextFormatT")
ResponseT = TypeVar("ResponseT")
def _set_response_attributes(
invocation: GenAIInvocation,
result: ParsedResponse[TextFormatT] | Response | None,
capture_content: bool,
) -> None:
if set_invocation_response_attributes is None:
return
set_invocation_response_attributes(invocation, result, capture_content)
def _get_stream_response(stream):
try:
return stream._response
except AttributeError:
try:
return stream.response
except AttributeError:
return None
class _ResponseProxy(Generic[ResponseT]):
def __init__(self, response: ResponseT, finalize: Callable[[], None]):
self._response = response
self._finalize = finalize
def close(self) -> None:
try:
self._response.close()
finally:
self._finalize()
def __getattr__(self, name: str):
return getattr(self._response, name)
class _AsyncResponseProxy(Generic[ResponseT]):
def __init__(self, response: ResponseT, finalize: Callable[[], None]):
self._response = response
self._finalize = finalize
async def aclose(self) -> None:
try:
await self._response.aclose()
finally:
self._finalize()
def __getattr__(self, name: str):
return getattr(self._response, name)
class ResponseStreamWrapper(Generic[TextFormatT]):
"""Wrapper for OpenAI Responses API stream objects.
Wraps ResponseStream from the OpenAI SDK:
https://github.com/openai/openai-python/blob/656e3cab4a18262a49b961d41293367e45ee71b9/src/openai/_streaming.py#L55
"""
def __init__(
self,
stream: ResponseStream[TextFormatT],
invocation: GenAIInvocation,
capture_content: bool,
):
self.stream = stream
self.invocation = invocation
self._capture_content = capture_content
self._finalized = False
def __enter__(self) -> ResponseStreamWrapper:
return self
def __exit__(
self,
exc_type: type[BaseException] | None,
exc_val: BaseException | None,
exc_tb: TracebackType | None,
) -> bool:
try:
if exc_type is not None:
self._fail(str(exc_val), type(exc_val) if exc_val else Exception)
finally:
self.close()
return False
def close(self) -> None:
try:
self.stream.close()
finally:
self._stop(None)
def __iter__(self) -> ResponseStreamWrapper:
return self
def __next__(self) -> ResponseStreamEvent[TextFormatT]:
try:
event = next(self.stream)
except StopIteration:
self._stop(None)
raise
except Exception as error:
self._fail(str(error), type(error))
raise
with self._safe_instrumentation("event processing"):
self.process_event(event)
return event
def get_final_response(self) -> ParsedResponse[TextFormatT]:
self.until_done()
return self.stream.get_final_response()
def until_done(self) -> ResponseStreamWrapper:
for _ in self:
pass
return self
def parse(self) -> ResponseStreamWrapper:
"""Called when using with_raw_response with stream=True."""
return self
# TODO: Replace __getattr__ passthrough with wrapt.ObjectProxy in a future
# cleanup once wrapt 2 typing support is available (wrapt PR #3903).
def __getattr__(self, name: str):
return getattr(self.stream, name)
@property
def response(self):
response = _get_stream_response(self.stream)
if response is None:
return None
return _ResponseProxy(response, lambda: self._stop(None))
def _stop(self, result: ParsedResponse[TextFormatT] | Response | None) -> None:
if self._finalized:
return
with self._safe_instrumentation("response attribute extraction"):
_set_response_attributes(self.invocation, result, self._capture_content)
with self._safe_instrumentation("inference.stop"):
self.invocation.stop()
self._finalized = True
def _fail(self, message: str, error_type: type[BaseException]) -> None:
if self._finalized:
return
with self._safe_instrumentation("inference.fail"):
self.invocation.fail(Error(message=message, type=error_type))
self._finalized = True
@staticmethod
@contextmanager
def _safe_instrumentation(context: str) -> Generator[None, None, None]:
try:
yield
except Exception: # pylint: disable=broad-exception-caught
_logger.debug(
"OpenAI responses instrumentation error during %s",
context,
exc_info=True,
stacklevel=2,
)
def process_event(self, event: ResponseStreamEvent[TextFormatT]) -> None:
event_type = event.type
response: ParsedResponse[TextFormatT] | Response | None = getattr(event, "response", None)
if response and not self.invocation.request_model:
model = response.model
if model:
self.invocation.request_model = model
if event_type == "response.completed":
self._stop(response)
return
if event_type in {"response.failed", "response.incomplete"}:
with self._safe_instrumentation("response attribute extraction"):
_set_response_attributes(self.invocation, response, self._capture_content)
self._fail(event_type, RuntimeError)
return
if event_type == "response.error":
error_type = getattr(event, "code", None) or "response.error"
message = getattr(event, "message", None) or error_type
self._fail(message, RuntimeError)
class ResponseStreamManagerWrapper(Generic[TextFormatT]):
"""Wrapper for OpenAI Responses API stream managers.
Wraps ResponseStreamManager from the OpenAI SDK:
https://github.com/openai/openai-python/blob/656e3cab4a18262a49b961d41293367e45ee71b9/src/openai/lib/streaming/responses/_responses.py#L95
"""
def __init__(
self,
manager: ResponseStreamManager[TextFormatT],
invocation,
capture_content: bool,
):
self._manager = manager
self._invocation = invocation
self._capture_content = capture_content
self._stream_wrapper: ResponseStreamWrapper[TextFormatT] | None = None
def __enter__(self) -> ResponseStreamWrapper[TextFormatT]:
stream = self._manager.__enter__()
self._stream_wrapper = ResponseStreamWrapper(
stream,
self._invocation,
self._capture_content,
)
return self._stream_wrapper
def __exit__(
self,
exc_type: type[BaseException] | None,
exc_val: BaseException | None,
exc_tb: TracebackType | None,
) -> bool:
suppressed = False
stream_wrapper = self._stream_wrapper
self._stream_wrapper = None
with ExitStack() as cleanup:
if stream_wrapper is not None:
def finalize_stream_wrapper() -> None:
if suppressed:
stream_wrapper.__exit__(None, None, None)
else:
stream_wrapper.__exit__(exc_type, exc_val, exc_tb)
cleanup.callback(finalize_stream_wrapper)
suppressed = self._manager.__exit__(exc_type, exc_val, exc_tb)
return suppressed
def parse(self) -> ResponseStreamManagerWrapper[TextFormatT]:
raise NotImplementedError("ResponseStreamManagerWrapper.parse() is not implemented")
# TODO: Replace __getattr__ passthrough with wrapt.ObjectProxy in a future
# cleanup once wrapt 2 typing support is available (wrapt PR #3903).
def __getattr__(self, name: str):
return getattr(self._manager, name)
class AsyncResponseStreamWrapper(ResponseStreamWrapper[TextFormatT]):
"""Wrapper for async OpenAI Responses API stream objects."""
stream: AsyncResponseStream[TextFormatT]
async def __aenter__(self) -> AsyncResponseStreamWrapper[TextFormatT]:
return self
async def __aexit__(
self,
exc_type: type[BaseException] | None,
exc_val: BaseException | None,
exc_tb: TracebackType | None,
) -> bool:
try:
if exc_type is not None:
self._fail(str(exc_val), type(exc_val) if exc_val else Exception)
finally:
await self.close()
return False
async def close(self) -> None:
try:
await self.stream.close()
finally:
self._stop(None)
def __aiter__(self) -> AsyncResponseStreamWrapper[TextFormatT]:
return self
async def __anext__(self) -> ResponseStreamEvent[TextFormatT]:
try:
event = await self.stream.__anext__()
except StopAsyncIteration:
self._stop(None)
raise
except Exception as error:
self._fail(str(error), type(error))
raise
with self._safe_instrumentation("event processing"):
self.process_event(event)
return event
async def get_final_response(self) -> ParsedResponse[TextFormatT]:
await self.until_done()
return await self.stream.get_final_response()
async def until_done(self) -> AsyncResponseStreamWrapper[TextFormatT]:
async for _ in self:
pass
return self
def parse(self) -> AsyncResponseStreamWrapper[TextFormatT]:
"""Called when using with_raw_response with stream=True."""
return self
@property
def response(self):
response = _get_stream_response(self.stream)
if response is None:
return None
return _AsyncResponseProxy(response, lambda: self._stop(None))
class AsyncResponseStreamManagerWrapper(Generic[TextFormatT]):
"""Wrapper for async OpenAI Responses API stream managers."""
def __init__(
self,
manager: AsyncResponseStreamManager[TextFormatT],
invocation,
capture_content: bool,
):
self._manager = manager
self._invocation = invocation
self._capture_content = capture_content
self._stream_wrapper: AsyncResponseStreamWrapper[TextFormatT] | None = None
async def __aenter__(self) -> AsyncResponseStreamWrapper[TextFormatT]:
stream = await self._manager.__aenter__()
self._stream_wrapper = AsyncResponseStreamWrapper(
stream,
self._invocation,
self._capture_content,
)
return self._stream_wrapper
async def __aexit__(
self,
exc_type: type[BaseException] | None,
exc_val: BaseException | None,
exc_tb: TracebackType | None,
) -> bool:
suppressed = False
stream_wrapper = self._stream_wrapper
self._stream_wrapper = None
async with AsyncExitStack() as cleanup:
if stream_wrapper is not None:
async def finalize_stream_wrapper() -> None:
if suppressed:
await stream_wrapper.__aexit__(None, None, None)
else:
await stream_wrapper.__aexit__(exc_type, exc_val, exc_tb)
cleanup.push_async_callback(finalize_stream_wrapper)
suppressed = await self._manager.__aexit__(exc_type, exc_val, exc_tb)
return suppressed
def parse(self) -> AsyncResponseStreamManagerWrapper[TextFormatT]:
raise NotImplementedError("AsyncResponseStreamManagerWrapper.parse() is not implemented")
# TODO: Replace __getattr__ passthrough with wrapt.ObjectProxy in a future
# cleanup once wrapt 2 typing support is available (wrapt PR #3903).
def __getattr__(self, name: str):
return getattr(self._manager, name)
utils.py 0000664 0000000 0000000 00000040666 15270700723 0046303 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import json
from collections.abc import Iterable, Mapping
from os import environ
from typing import Any
from urllib.parse import urlparse
import openai
from httpx import URL
from openai import NotGiven
from opentelemetry._logs import LogRecord
from opentelemetry.semconv._incubating.attributes import (
gen_ai_attributes as GenAIAttributes,
)
from opentelemetry.semconv._incubating.attributes import (
openai_attributes as OpenAIAttributes,
)
from opentelemetry.semconv._incubating.attributes import (
server_attributes as ServerAttributes,
)
from opentelemetry.semconv.attributes import (
error_attributes as ErrorAttributes,
)
from opentelemetry.trace.status import Status, StatusCode
from opentelemetry.util.genai.environment_variables import (
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT,
)
from opentelemetry.util.genai.handler import TelemetryHandler
from opentelemetry.util.genai.invocation import InferenceInvocation
from opentelemetry.util.genai.types import (
FunctionToolDefinition,
InputMessage,
OutputMessage,
Text,
ToolCallRequest,
ToolCallResponse,
ToolDefinition,
)
_OpenAIOmit = getattr(openai, "Omit", None)
def is_content_enabled() -> bool:
capture_content = environ.get(OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT, "false")
return capture_content.lower() == "true"
def extract_tool_calls(item, capture_content):
tool_calls = get_property_value(item, "tool_calls")
if tool_calls is None:
return None
calls = []
for tool_call in tool_calls:
tool_call_dict = {}
call_id = get_property_value(tool_call, "id")
if call_id:
tool_call_dict["id"] = call_id
tool_type = get_property_value(tool_call, "type")
if tool_type:
tool_call_dict["type"] = tool_type
func = get_property_value(tool_call, "function")
if func:
tool_call_dict["function"] = {}
name = get_property_value(func, "name")
if name:
tool_call_dict["function"]["name"] = name
arguments = get_property_value(func, "arguments")
if capture_content and arguments:
if isinstance(arguments, str):
arguments = arguments.replace("\n", "")
tool_call_dict["function"]["arguments"] = arguments
calls.append(tool_call_dict)
return calls
def get_server_address_and_port(
client_instance,
) -> tuple[str | None, int | None]:
base_client = getattr(client_instance, "_client", None)
base_url = getattr(base_client, "base_url", None)
if not base_url:
return None, None
address = None
port = None
if isinstance(base_url, URL):
address = base_url.host
port = base_url.port
elif isinstance(base_url, str):
url = urlparse(base_url)
address = url.hostname
port = url.port
if port == 443:
port = None
return address, port
def get_property_value(obj, property_name):
if isinstance(obj, dict):
return obj.get(property_name, None)
return getattr(obj, property_name, None)
def message_to_event(message, capture_content):
attributes = {GenAIAttributes.GEN_AI_SYSTEM: GenAIAttributes.GenAiSystemValues.OPENAI.value}
role = get_property_value(message, "role")
content = get_property_value(message, "content")
body = {}
if capture_content and content:
body["content"] = content
if role == "assistant":
tool_calls = extract_tool_calls(message, capture_content)
if tool_calls:
body = {"tool_calls": tool_calls}
elif role == "tool":
tool_call_id = get_property_value(message, "tool_call_id")
if tool_call_id:
body["id"] = tool_call_id
return LogRecord(
event_name=f"gen_ai.{role}.message",
attributes=attributes,
body=body if body else None,
)
def choice_to_event(choice, capture_content):
attributes = {GenAIAttributes.GEN_AI_SYSTEM: GenAIAttributes.GenAiSystemValues.OPENAI.value}
body = {
"index": choice.index,
"finish_reason": choice.finish_reason or "error",
}
if choice.message:
message = {"role": (choice.message.role if choice.message and choice.message.role else None)}
tool_calls = extract_tool_calls(choice.message, capture_content)
if tool_calls:
message["tool_calls"] = tool_calls
content = get_property_value(choice.message, "content")
if capture_content and content:
message["content"] = content
body["message"] = message
return LogRecord(
event_name="gen_ai.choice",
attributes=attributes,
body=body,
)
def set_span_attributes(span, attributes: dict):
for field, value in attributes.model_dump(by_alias=True).items():
set_span_attribute(span, field, value)
def set_span_attribute(span, name, value):
if non_numerical_value_is_set(value) is False:
return
span.set_attribute(name, value)
def is_streaming(kwargs):
return non_numerical_value_is_set(kwargs.get("stream"))
def non_numerical_value_is_set(value: bool | str | NotGiven | None):
return bool(value) and value_is_set(value)
def value_is_set(value):
if _OpenAIOmit is not None and isinstance(value, _OpenAIOmit):
return False
return value is not None and not isinstance(value, NotGiven)
def _openai_response_format_to_output_type(response_format_type: str) -> str:
if response_format_type in ("json_object", "json_schema"):
return GenAIAttributes.GenAiOutputTypeValues.JSON.value
return response_format_type
def get_llm_request_attributes(
kwargs,
client_instance,
latest_experimental_enabled,
operation_name=GenAIAttributes.GenAiOperationNameValues.CHAT.value,
):
# pylint: disable=too-many-branches,too-many-locals
attributes = {
GenAIAttributes.GEN_AI_OPERATION_NAME: operation_name,
}
model = kwargs.get("model")
if model:
attributes[GenAIAttributes.GEN_AI_REQUEST_MODEL] = model
if latest_experimental_enabled:
attributes.update(
{
GenAIAttributes.GEN_AI_PROVIDER_NAME: (GenAIAttributes.GenAiProviderNameValues.OPENAI.value),
}
)
else:
attributes.update(
{
GenAIAttributes.GEN_AI_SYSTEM: GenAIAttributes.GenAiProviderNameValues.OPENAI.value,
}
)
# Add chat-specific attributes only for chat operations
if operation_name == GenAIAttributes.GenAiOperationNameValues.CHAT.value:
attributes.update(
{
GenAIAttributes.GEN_AI_REQUEST_TEMPERATURE: kwargs.get("temperature"),
GenAIAttributes.GEN_AI_REQUEST_TOP_P: kwargs.get("p") or kwargs.get("top_p"),
GenAIAttributes.GEN_AI_REQUEST_MAX_TOKENS: kwargs.get("max_tokens"),
GenAIAttributes.GEN_AI_REQUEST_PRESENCE_PENALTY: kwargs.get("presence_penalty"),
GenAIAttributes.GEN_AI_REQUEST_FREQUENCY_PENALTY: kwargs.get("frequency_penalty"),
GenAIAttributes.GEN_AI_REQUEST_SEED: kwargs.get("seed"),
}
)
if (choice_count := kwargs.get("n")) is not None:
# Only add non default, meaningful values
if isinstance(choice_count, int) and choice_count != 1:
attributes[GenAIAttributes.GEN_AI_REQUEST_CHOICE_COUNT] = choice_count
if (stop_sequences := kwargs.get("stop")) is not None:
if isinstance(stop_sequences, str):
stop_sequences = [stop_sequences]
attributes[GenAIAttributes.GEN_AI_REQUEST_STOP_SEQUENCES] = stop_sequences
request_response_format_attr_key = (
GenAIAttributes.GEN_AI_OUTPUT_TYPE
if latest_experimental_enabled
else GenAIAttributes.GEN_AI_OPENAI_REQUEST_RESPONSE_FORMAT
)
if (response_format := kwargs.get("response_format")) is not None:
# response_format may be string or object with a string in the `type` key
if isinstance(response_format, Mapping):
if (response_format_type := response_format.get("type")) is not None:
attributes[request_response_format_attr_key] = response_format_type
elif isinstance(response_format, str):
attributes[request_response_format_attr_key] = response_format
# service_tier can be passed directly or in extra_body (in SDK 1.26.0 it's via extra_body)
service_tier = kwargs.get("service_tier")
if service_tier is None:
extra_body = kwargs.get("extra_body")
if isinstance(extra_body, Mapping):
service_tier = extra_body.get("service_tier")
request_service_tier_attr_key = (
OpenAIAttributes.OPENAI_REQUEST_SERVICE_TIER
if latest_experimental_enabled
else GenAIAttributes.GEN_AI_OPENAI_REQUEST_SERVICE_TIER
)
attributes[request_service_tier_attr_key] = service_tier if service_tier != "auto" else None
# Add embeddings-specific attributes
elif operation_name == GenAIAttributes.GenAiOperationNameValues.EMBEDDINGS.value:
# Add embedding dimensions if specified
if (dimensions := kwargs.get("dimensions")) is not None:
# TODO: move to GEN_AI_EMBEDDINGS_DIMENSION_COUNT when 1.39.0 is baseline
attributes["gen_ai.embeddings.dimension.count"] = dimensions
# Add encoding format if specified
if "encoding_format" in kwargs:
attributes[GenAIAttributes.GEN_AI_REQUEST_ENCODING_FORMATS] = [kwargs["encoding_format"]]
address, port = get_server_address_and_port(client_instance)
if address:
attributes[ServerAttributes.SERVER_ADDRESS] = address
if port:
attributes[ServerAttributes.SERVER_PORT] = port
# filter out values not set
return {k: v for k, v in attributes.items() if value_is_set(v)}
def create_chat_invocation(
handler: TelemetryHandler,
kwargs,
client_instance,
capture_content: bool,
) -> InferenceInvocation:
# pylint: disable=too-many-branches
address, port = get_server_address_and_port(client_instance)
invocation = handler.start_inference(
GenAIAttributes.GenAiProviderNameValues.OPENAI.value,
request_model=kwargs.get("model", ""),
server_address=address if address else None,
server_port=port if port else None,
)
invocation.temperature = get_value(kwargs.get("temperature"))
invocation.top_p = get_value(kwargs.get("p") or kwargs.get("top_p"))
invocation.max_tokens = get_value(kwargs.get("max_tokens"))
invocation.presence_penalty = get_value(kwargs.get("presence_penalty"))
invocation.frequency_penalty = get_value(kwargs.get("frequency_penalty"))
invocation.seed = get_value(kwargs.get("seed"))
if (stop_sequences := get_value(kwargs.get("stop"))) is not None:
if isinstance(stop_sequences, str):
stop_sequences = [stop_sequences]
invocation.stop_sequences = stop_sequences
if (choice_count := get_value(kwargs.get("n"))) is not None:
# Only add non default, meaningful values
if isinstance(choice_count, int) and choice_count != 1:
invocation.attributes[GenAIAttributes.GEN_AI_REQUEST_CHOICE_COUNT] = choice_count
if (response_format := get_value(kwargs.get("response_format"))) is not None:
# response_format may be string or object with a string in the `type` key
if isinstance(response_format, Mapping):
if (response_format_type := get_value(response_format.get("type"))) is not None:
invocation.attributes[GenAIAttributes.GEN_AI_OUTPUT_TYPE] = _openai_response_format_to_output_type(
response_format_type
)
elif isinstance(response_format, str):
invocation.attributes[GenAIAttributes.GEN_AI_OUTPUT_TYPE] = _openai_response_format_to_output_type(
response_format
)
# service_tier can be passed directly or in extra_body (in SDK 1.26.0 it's via extra_body)
service_tier = get_value(kwargs.get("service_tier"))
if service_tier is None:
extra_body = get_value(kwargs.get("extra_body"))
if isinstance(extra_body, Mapping):
service_tier = get_value(extra_body.get("service_tier"))
if service_tier is not None and service_tier != "auto":
invocation.attributes[OpenAIAttributes.OPENAI_REQUEST_SERVICE_TIER] = service_tier
if capture_content: # optimization
invocation.input_messages = _prepare_input_messages(kwargs.get("messages", []))
invocation.tool_definitions = _prepare_tool_definitions(kwargs.get("tools"))
return invocation
def get_value(v: Any):
if value_is_set(v):
return v
return None
def handle_span_exception(span, error: BaseException):
span.set_status(Status(StatusCode.ERROR, str(error)))
if span.is_recording():
span.set_attribute(ErrorAttributes.ERROR_TYPE, type(error).__qualname__)
span.end()
def _is_text_part(content: Any) -> bool:
return isinstance(content, str) or (
isinstance(content, Iterable) and all(isinstance(part, str) for part in content)
)
def _prepare_input_messages(messages) -> list[InputMessage]:
chat_messages = []
for message in messages:
role = get_property_value(message, "role")
chat_message = InputMessage(role=str(role), parts=[])
chat_messages.append(chat_message)
content = get_property_value(message, "content")
if role == "assistant":
tool_calls = get_property_value(message, "tool_calls")
if tool_calls:
chat_message.parts += extract_tool_calls_new(tool_calls)
if _is_text_part(content):
chat_message.parts.append(Text(content=str(content)))
elif role == "tool":
tool_call_id = get_property_value(message, "tool_call_id")
chat_message.parts.append(ToolCallResponse(id=tool_call_id, response=content))
else:
# system, developer, user, fallback
if _is_text_part(content):
chat_message.parts.append(Text(content=str(content)))
return chat_messages
def extract_tool_calls_new(tool_calls) -> list[ToolCallRequest]:
parts = []
for tool_call in tool_calls:
call_id = get_property_value(tool_call, "id")
func_name = ""
arguments = None
func = get_property_value(tool_call, "function")
if func:
func_name = get_property_value(func, "name") or ""
arguments_str = get_property_value(func, "arguments")
if arguments_str:
try:
arguments = json.loads(arguments_str)
except json.JSONDecodeError:
arguments = arguments_str
# TODO: support custom
parts.append(ToolCallRequest(id=call_id, name=func_name, arguments=arguments))
return parts
def _prepare_tool_definitions(tools) -> list[ToolDefinition] | None:
if not tools:
return None
definitions: list[ToolDefinition] = []
for tool in tools:
tool_type = get_property_value(tool, "type")
if tool_type == "function":
func = get_property_value(tool, "function")
if func:
definitions.append(
FunctionToolDefinition(
name=get_property_value(func, "name") or "",
description=get_property_value(func, "description"),
parameters=get_property_value(func, "parameters"),
)
)
return definitions
def _prepare_output_messages(choices) -> list[OutputMessage]:
output_messages = []
for choice in choices:
if choice.message:
parts = []
tool_calls = get_property_value(choice.message, "tool_calls")
if tool_calls:
parts += extract_tool_calls_new(tool_calls)
content = get_property_value(choice.message, "content")
if _is_text_part(content):
parts.append(Text(content=str(content)))
message = OutputMessage(
finish_reason=choice.finish_reason or "error",
role=(choice.message.role if choice.message and choice.message.role else ""),
parts=parts,
)
output_messages.append(message)
return output_messages
version.py 0000664 0000000 0000000 00000000147 15270700723 0046616 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2 # Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
__version__ = "2.5b0.dev"
tests/ 0000775 0000000 0000000 00000000000 15270700723 0035107 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2 README.md 0000664 0000000 0000000 00000000530 15270700723 0036364 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests ## Recording calls
If you need to record calls you need to export the `OPENAI_API_KEY` as environment variable.
Since tox blocks environment variables by default you need to override its configuration to let them pass:
```
export TOX_OVERRIDE=testenv.pass_env=OPENAI_API_KEY
```
We are not adding it to tox.ini because of security concerns.
__init__.py 0000664 0000000 0000000 00000000000 15270700723 0037206 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests cassettes/ 0000775 0000000 0000000 00000000000 15270700723 0037105 5 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests test_async_chat_completion_404.yaml 0000664 0000000 0000000 00000003763 15270700723 0045775 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "this-model-does-not-exist"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '103'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"error": {
"message": "The model `this-model-does-not-exist` does not exist or you do not have access to it.",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80827a861852-MRS
Connection:
- keep-alive
Content-Type:
- application/json; charset=utf-8
Date:
- Wed, 13 Nov 2024 00:04:01 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
alt-svc:
- h3=":443"; ma=86400
content-length:
- '231'
openai-organization: test_openai_org_id
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
vary:
- Origin
x-request-id:
- req_5cf06a7fabd45ebe21ee38c14c5b2f76
status:
code: 404
message: Not Found
version: 1
test_async_chat_completion_extra_params.yaml 0000664 0000000 0000000 00000006562 15270700723 0050154 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"max_tokens": 50,
"response_format": {
"type": "text"
},
"seed": 42,
"stream": false,
"temperature": 0.5,
"service_tier": "default"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '220'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.7
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-AbMH3rR6OBMN9hG5w0TRrezuiHLMr",
"object": "chat.completion",
"created": 1733467121,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test. How can I assist you further?",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 12,
"total_tokens": 24,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"service_tier": "default",
"system_fingerprint": "fp_bba3c8e70b"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8eda4640ead3e535-KUL
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Fri, 06 Dec 2024 06:38:42 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '825'
openai-organization: test_openai_org_id
openai-processing-ms:
- '835'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '199943'
x-ratelimit-reset-requests:
- 8.64s
x-ratelimit-reset-tokens:
- 16ms
x-request-id:
- req_fea877c0a861ff92a6a5217247681f24
status:
code: 200
message: OK
version: 1
test_async_chat_completion_metrics.yaml 0000664 0000000 0000000 00000006307 15270700723 0047131 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"stream": false
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '106'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASv9R2E7Yhb2e7bj4Xl0qm9s3J42Y",
"object": "chat.completion",
"created": 1731456237,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test. How can I assist you further?",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"service_tier": "default",
"usage": {
"prompt_tokens": 12,
"completion_tokens": 12,
"total_tokens": 24,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80679a8311a6-MRS
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Wed, 13 Nov 2024 00:03:58 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '796'
openai-organization: test_openai_org_id
openai-processing-ms:
- '359'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '30000'
x-ratelimit-limit-tokens:
- '150000000'
x-ratelimit-remaining-requests:
- '29999'
x-ratelimit-remaining-tokens:
- '149999978'
x-ratelimit-reset-requests:
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_41ea134c1fc450d4ca4cf8d0c6a7c53a
status:
code: 200
message: OK
version: 1
test_async_chat_completion_multiple_choices.yaml 0000664 0000000 0000000 00000006660 15270700723 0051015 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"n": 2,
"stream": false
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '114'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASv9XLlMmT7H3cf50dNTesHDBDwX5",
"object": "chat.completion",
"created": 1731456243,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
},
{
"index": 1,
"message": {
"role": "assistant",
"content": "This is a test.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 10,
"total_tokens": 22,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a808f6d8e0d8b-MRS
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Wed, 13 Nov 2024 00:04:04 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '970'
openai-organization: test_openai_org_id
openai-processing-ms:
- '306'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '30000'
x-ratelimit-limit-tokens:
- '150000000'
x-ratelimit-remaining-requests:
- '29999'
x-ratelimit-remaining-tokens:
- '149999962'
x-ratelimit-reset-requests:
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_1317908e0f9b73276b57d4e171c533ea
status:
code: 200
message: OK
version: 1
test_async_chat_completion_multiple_choices_streaming.yaml 0000664 0000000 0000000 00000122774 15270700723 0053073 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
}
],
"model": "gpt-4o-mini",
"n": 2,
"stream": true,
"stream_options": {
"include_usage": true
}
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '254'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"I'm"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":"I'm"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" unable"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" unable"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" provide"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" provide"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" real"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" real"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"-time"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":"-time"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" updates"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" updates"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" as"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" as"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" my"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" my"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" knowledge"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" knowledge"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" was"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" only"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" last"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" extends"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" until"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" updated"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" October"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" October"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":"202"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"202"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":"3"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"1"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" I"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" I"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" don't"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" have"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" access"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" don't"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" have"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" access"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" live"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" live"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" data"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" data"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" However"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" However"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" you"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" you"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" can"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" can"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" easily"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" easily"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" check"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" check"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" the"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" the"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" current"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" current"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" Seattle"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" Seattle"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" San"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" San"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" Francisco"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" Francisco"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" by"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" using"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" visiting"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" website"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" website"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" or"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" or"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" using"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" mobile"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" app"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" app"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" the"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" most"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" If"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" accurate"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" you"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" need"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" up"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" historical"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" information"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" or"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" general"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" climate"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" data"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" those"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" cities"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" feel"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" free"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" ask"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":"!"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"-to"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"-date"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" information"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null}
data: {"id":"chatcmpl-ASv9hB9He94oQyZr1CDC8coqvmn5U","object":"chat.completion.chunk","created":1731456253,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[],"usage":{"prompt_tokens":26,"completion_tokens":133,"total_tokens":159,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}}
data: [DONE]
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80ceac3ce19a-MRS
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Wed, 13 Nov 2024 00:04:13 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization: test_openai_org_id
openai-processing-ms:
- '126'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '30000'
x-ratelimit-limit-tokens:
- '150000000'
x-ratelimit-remaining-requests:
- '29999'
x-ratelimit-remaining-tokens:
- '149999945'
x-ratelimit-reset-requests:
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_5dd8b6845db59fa55cf226eda1f5a2c6
status:
code: 200
message: OK
version: 1
test_async_chat_completion_multiple_tools_streaming_no_content.yaml 0000664 0000000 0000000 00000022044 15270700723 0055031 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
}
],
"model": "gpt-4o-mini",
"stream": true,
"stream_options": {
"include_usage": true
},
"tool_choice": "auto",
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. Boston, MA"
}
},
"required": [
"location"
],
"additionalProperties": false
}
}
}
]
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '602'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_hqkL24CLEwnniv4GDrjk14Iu","type":"function","function":{"name":"get_current_weather","arguments":""}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"lo"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"catio"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n\": \"S"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"eatt"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"le, W"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"A\"}"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_0s1enkFttXjIR7ozHoGMcnUu","type":"function","function":{"name":"get_current_weather","arguments":""}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"lo"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"catio"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"n\": \"S"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"an F"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"ranci"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"sco, C"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"A\"}"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null}
data: {"id":"chatcmpl-ASv9l0RKJrq2fTx2dK5jhJoIr4rMI","object":"chat.completion.chunk","created":1731456257,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[],"usage":{"prompt_tokens":75,"completion_tokens":51,"total_tokens":126,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}}
data: [DONE]
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80e4cfb00d86-MRS
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Wed, 13 Nov 2024 00:04:19 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization: test_openai_org_id
openai-processing-ms:
- '1597'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '30000'
x-ratelimit-limit-tokens:
- '150000000'
x-ratelimit-remaining-requests:
- '29999'
x-ratelimit-remaining-tokens:
- '149999960'
x-ratelimit-reset-requests:
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_487aef2347cb4d1f97077c488dd93628
status:
code: 200
message: OK
version: 1
test_async_chat_completion_multiple_tools_streaming_with_content.yaml 0000664 0000000 0000000 00000022044 15270700723 0055370 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
}
],
"model": "gpt-4o-mini",
"stream": true,
"stream_options": {
"include_usage": true
},
"tool_choice": "auto",
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. Boston, MA"
}
},
"required": [
"location"
],
"additionalProperties": false
}
}
}
]
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '602'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_oJL2dc4GjWVxqBtWlGLwjbsR","type":"function","function":{"name":"get_current_weather","arguments":""}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"lo"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"catio"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n\": \"S"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"eatt"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"le, W"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"A\"}"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_ON3lp1OWsbw2obNRD43KVDp6","type":"function","function":{"name":"get_current_weather","arguments":""}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"lo"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"catio"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"n\": \"S"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"an F"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"ranci"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"sco, C"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"A\"}"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null}
data: {"id":"chatcmpl-ASv9jfgm5JguNGaR9o9u94HpuhV7T","object":"chat.completion.chunk","created":1731456255,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[],"usage":{"prompt_tokens":75,"completion_tokens":51,"total_tokens":126,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}}
data: [DONE]
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80d8efb9e1c8-MRS
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Wed, 13 Nov 2024 00:04:16 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization: test_openai_org_id
openai-processing-ms:
- '1162'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '30000'
x-ratelimit-limit-tokens:
- '150000000'
x-ratelimit-remaining-requests:
- '29999'
x-ratelimit-remaining-tokens:
- '149999960'
x-ratelimit-reset-requests:
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_0b6729aef347cecd61ba3b7b7a8d4719
status:
code: 200
message: OK
version: 1
test_async_chat_completion_no_content.yaml 0000664 0000000 0000000 00000006242 15270700723 0047627 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"stream": false
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '106'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASv9R2E7Yhb2e7bj4Xl0qm9s3J42Y",
"object": "chat.completion",
"created": 1731456237,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test. How can I assist you further?",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 12,
"total_tokens": 24,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80679a8311a6-MRS
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Wed, 13 Nov 2024 00:03:58 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '796'
openai-organization: test_openai_org_id
openai-processing-ms:
- '359'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '30000'
x-ratelimit-limit-tokens:
- '150000000'
x-ratelimit-remaining-requests:
- '29999'
x-ratelimit-remaining-tokens:
- '149999978'
x-ratelimit-reset-requests:
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_41ea134c1fc450d4ca4cf8d0c6a7c53a
status:
code: 200
message: OK
version: 1
test_async_chat_completion_streaming.yaml 0000664 0000000 0000000 00000010662 15270700723 0047453 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4",
"stream": true,
"stream_options": {
"include_usage": true
}
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '142'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"This"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" test"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":12,"completion_tokens":5,"total_tokens":17,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}}
data: [DONE]
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80bd2f31e1e5-MRS
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Wed, 13 Nov 2024 00:04:11 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization: test_openai_org_id
openai-processing-ms:
- '196'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '1000000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '999977'
x-ratelimit-reset-requests:
- 6ms
x-ratelimit-reset-tokens:
- 1ms
x-request-id:
- req_cc9204ae23338b130df11c8c5b5f31af
status:
code: 200
message: OK
version: 1
test_async_chat_completion_streaming_not_complete.yaml 0000664 0000000 0000000 00000007532 15270700723 0052225 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4",
"stream": true
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '99'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-ASv9gROIIAvRs9QnmLP8Nzs3PGMCX","object":"chat.completion.chunk","created":1731456252,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9gROIIAvRs9QnmLP8Nzs3PGMCX","object":"chat.completion.chunk","created":1731456252,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"This"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9gROIIAvRs9QnmLP8Nzs3PGMCX","object":"chat.completion.chunk","created":1731456252,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9gROIIAvRs9QnmLP8Nzs3PGMCX","object":"chat.completion.chunk","created":1731456252,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9gROIIAvRs9QnmLP8Nzs3PGMCX","object":"chat.completion.chunk","created":1731456252,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" test"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9gROIIAvRs9QnmLP8Nzs3PGMCX","object":"chat.completion.chunk","created":1731456252,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASv9gROIIAvRs9QnmLP8Nzs3PGMCX","object":"chat.completion.chunk","created":1731456252,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
data: [DONE]
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80c54d00e288-MRS
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Wed, 13 Nov 2024 00:04:12 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization: test_openai_org_id
openai-processing-ms:
- '283'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '1000000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '999977'
x-ratelimit-reset-requests:
- 6ms
x-ratelimit-reset-tokens:
- 1ms
x-request-id:
- req_e9e4ea6fd060391e8cc8cfea78ad9a15
status:
code: 200
message: OK
version: 1
test_async_chat_completion_streaming_unsampled.yaml 0000664 0000000 0000000 00000010662 15270700723 0051523 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4",
"stream": true,
"stream_options": {
"include_usage": true
}
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '142'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"This"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" test"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null}
data: {"id":"chatcmpl-ASv9ejXDUtAhGOJJxWuw026zdinc4","object":"chat.completion.chunk","created":1731456250,"model":"gpt-4-0613","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":12,"completion_tokens":5,"total_tokens":17,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}}
data: [DONE]
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80bd2f31e1e5-MRS
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Wed, 13 Nov 2024 00:04:11 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization: test_openai_org_id
openai-processing-ms:
- '196'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '1000000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '999977'
x-ratelimit-reset-requests:
- 6ms
x-ratelimit-reset-tokens:
- 1ms
x-request-id:
- req_cc9204ae23338b130df11c8c5b5f31af
status:
code: 200
message: OK
version: 1
test_async_chat_completion_tool_calls_no_content.yaml 0000664 0000000 0000000 00000021652 15270700723 0052044 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
}
],
"model": "gpt-4o-mini",
"tool_choice": "auto",
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. Boston, MA"
}
},
"required": [
"location"
],
"additionalProperties": false
}
}
}
]
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '543'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASv9bJqWatpvCC0YMsYRcTSIiXoxk",
"object": "chat.completion",
"created": 1731456247,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_vwOezSsB5j9ei1SSMlZjqx7g",
"type": "function",
"function": {
"name": "get_current_weather",
"arguments": "{\"location\": \"Seattle, WA\"}"
}
},
{
"id": "call_LzeIYcKhHnVF60u4LmBpT1tv",
"type": "function",
"function": {
"name": "get_current_weather",
"arguments": "{\"location\": \"San Francisco, CA\"}"
}
}
],
"refusal": null
},
"logprobs": null,
"finish_reason": "tool_calls"
}
],
"usage": {
"prompt_tokens": 75,
"completion_tokens": 51,
"total_tokens": 126,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80a9f8fbe1c9-MRS
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Wed, 13 Nov 2024 00:04:08 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '1308'
openai-organization: test_openai_org_id
openai-processing-ms:
- '808'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '30000'
x-ratelimit-limit-tokens:
- '150000000'
x-ratelimit-remaining-requests:
- '29999'
x-ratelimit-remaining-tokens:
- '149999960'
x-ratelimit-reset-requests:
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_f1b9b75e4a73b542c9b1b992cd52c66f
status:
code: 200
message: OK
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
},
{
"role": "assistant",
"tool_calls": [
{
"id": "call_vwOezSsB5j9ei1SSMlZjqx7g",
"function": {
"arguments": "{\"location\": \"Seattle, WA\"}",
"name": "get_current_weather"
},
"type": "function"
},
{
"id": "call_LzeIYcKhHnVF60u4LmBpT1tv",
"function": {
"arguments": "{\"location\": \"San Francisco, CA\"}",
"name": "get_current_weather"
},
"type": "function"
}
]
},
{
"role": "tool",
"content": "50 degrees and raining",
"tool_call_id": "call_vwOezSsB5j9ei1SSMlZjqx7g"
},
{
"role": "tool",
"content": "70 degrees and sunny",
"tool_call_id": "call_LzeIYcKhHnVF60u4LmBpT1tv"
}
],
"model": "gpt-4o-mini"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '746'
content-type:
- application/json
cookie:
- test_cookie
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASv9dfXfIwGCZgeWzDTbCh0FuU9kh",
"object": "chat.completion",
"created": 1731456249,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Today, the weather in Seattle is 50 degrees and raining, while in San Francisco, it's 70 degrees and sunny.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 99,
"completion_tokens": 25,
"total_tokens": 124,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80b3baade1c9-MRS
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Wed, 13 Nov 2024 00:04:10 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '859'
openai-organization: test_openai_org_id
openai-processing-ms:
- '972'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '30000'
x-ratelimit-limit-tokens:
- '150000000'
x-ratelimit-remaining-requests:
- '29999'
x-ratelimit-remaining-tokens:
- '149999948'
x-ratelimit-reset-requests:
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_754e6b59f1d3da727e2210e3d8c56243
status:
code: 200
message: OK
version: 1
test_async_chat_completion_tool_calls_with_content.yaml 0000664 0000000 0000000 00000021666 15270700723 0052410 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
}
],
"model": "gpt-4o-mini",
"tool_choice": "auto",
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. Boston, MA"
}
},
"required": [
"location"
],
"additionalProperties": false
}
}
}
]
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '543'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASv9ZqgNAOJAOLYMgdmxouatKXJlk",
"object": "chat.completion",
"created": 1731456245,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_O8NOz8VlxosSASEsOY7LDUcP",
"type": "function",
"function": {
"name": "get_current_weather",
"arguments": "{\"location\": \"Seattle, WA\"}"
}
},
{
"id": "call_3m7cyuckijnpiWr6tq0Tl8Mg",
"type": "function",
"function": {
"name": "get_current_weather",
"arguments": "{\"location\": \"San Francisco, CA\"}"
}
}
],
"refusal": null
},
"logprobs": null,
"finish_reason": "tool_calls"
}
],
"usage": {
"prompt_tokens": 75,
"completion_tokens": 51,
"total_tokens": 126,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a8098ac5ae167-MRS
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Wed, 13 Nov 2024 00:04:06 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '1308'
openai-organization: test_openai_org_id
openai-processing-ms:
- '937'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '30000'
x-ratelimit-limit-tokens:
- '150000000'
x-ratelimit-remaining-requests:
- '29999'
x-ratelimit-remaining-tokens:
- '149999960'
x-ratelimit-reset-requests:
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_3cd7152d2c8c10b4f354b27165f6c2b5
status:
code: 200
message: OK
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
},
{
"role": "assistant",
"tool_calls": [
{
"id": "call_O8NOz8VlxosSASEsOY7LDUcP",
"function": {
"arguments": "{\"location\": \"Seattle, WA\"}",
"name": "get_current_weather"
},
"type": "function"
},
{
"id": "call_3m7cyuckijnpiWr6tq0Tl8Mg",
"function": {
"arguments": "{\"location\": \"San Francisco, CA\"}",
"name": "get_current_weather"
},
"type": "function"
}
]
},
{
"role": "tool",
"content": "50 degrees and raining",
"tool_call_id": "call_O8NOz8VlxosSASEsOY7LDUcP"
},
{
"role": "tool",
"content": "70 degrees and sunny",
"tool_call_id": "call_3m7cyuckijnpiWr6tq0Tl8Mg"
}
],
"model": "gpt-4o-mini"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '746'
content-type:
- application/json
cookie:
- test_cookie
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASv9aQnGndy04lqKoPRagym1eEaQK",
"object": "chat.completion",
"created": 1731456246,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Today, Seattle is experiencing 50 degrees and raining, while San Francisco has a pleasant 70 degrees and sunny weather.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 99,
"completion_tokens": 24,
"total_tokens": 123,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_f59a81427f"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80a39c71e167-MRS
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Wed, 13 Nov 2024 00:04:07 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '871'
openai-organization: test_openai_org_id
openai-processing-ms:
- '477'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '30000'
x-ratelimit-limit-tokens:
- '150000000'
x-ratelimit-remaining-requests:
- '29999'
x-ratelimit-remaining-tokens:
- '149999948'
x-ratelimit-reset-requests:
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_193c74758ea30e77e55afe931e89fd6c
status:
code: 200
message: OK
version: 1
test_async_chat_completion_with_content.yaml 0000664 0000000 0000000 00000006242 15270700723 0050166 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"stream": false
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '106'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASv9R2E7Yhb2e7bj4Xl0qm9s3J42Y",
"object": "chat.completion",
"created": 1731456237,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test. How can I assist you further?",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 12,
"total_tokens": 24,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1a80679a8311a6-MRS
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Wed, 13 Nov 2024 00:03:58 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '796'
openai-organization: test_openai_org_id
openai-processing-ms:
- '359'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '30000'
x-ratelimit-limit-tokens:
- '150000000'
x-ratelimit-remaining-requests:
- '29999'
x-ratelimit-remaining-tokens:
- '149999978'
x-ratelimit-reset-requests:
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_41ea134c1fc450d4ca4cf8d0c6a7c53a
status:
code: 200
message: OK
version: 1
test_async_chat_completion_with_raw_response.yaml 0000664 0000000 0000000 00000006262 15270700723 0051225 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '90'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'true'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-raw-response:
- 'true'
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASYMQRl3A3DXL9FWCK9tnGRcKIO7q",
"object": "chat.completion",
"created": 1731368630,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 5,
"total_tokens": 17,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e122593ff368bc8-SIN
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 11 Nov 2024 23:43:50 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '765'
openai-organization: test_openai_org_id
openai-processing-ms:
- '287'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '199977'
x-ratelimit-reset-requests:
- 8.64s
x-ratelimit-reset-tokens:
- 6ms
x-request-id:
- req_58cff97afd0e7c0bba910ccf0b044a6f
status:
code: 200
message: OK
version: 1 test_async_embeddings_error_handling.yaml 0000664 0000000 0000000 00000003664 15270700723 0047414 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for async embeddings with error",
"model": "non-existent-embedding-model"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '100'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"error": {
"message": "The model `non-existent-embedding-model` does not exist or you do not have access to it.",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}
headers:
CF-RAY:
- 939c1721df5f986e-NRT
Connection:
- keep-alive
Content-Type:
- application/json; charset=utf-8
Date:
- Sat, 03 May 2025 01:47:27 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '234'
openai-organization: test_openai_org_id
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
vary:
- Origin
x-request-id:
- req_38df12bea294f0b00173735f303f8f5b
status:
code: 404
message: Not Found
version: 1
test_async_embeddings_no_content.yaml 0000664 0000000 0000000 00000135615 15270700723 0046567 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for async embeddings",
"model": "text-embedding-3-small"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '83'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
-0.0012588563,
-0.029314144,
-0.004568109,
-0.021721158,
-0.025343766,
-0.0004159207,
0.04500728,
0.03663181,
0.009042029,
-0.0049231243,
0.026416058,
-0.030574812,
7.522572e-05,
-0.031241372,
-0.03683468,
0.0045789764,
-0.017837722,
-0.0065569207,
0.017272595,
-0.0049231243,
-0.008542109,
-0.047383714,
0.015185973,
0.042804737,
0.0033654028,
-0.019634536,
0.012171963,
0.041471615,
0.033994555,
-0.034690093,
0.006172924,
-0.038370665,
0.009599911,
-0.028618604,
-0.017069729,
0.06578656,
-0.010759146,
0.036747735,
-0.039819706,
-0.0077886074,
0.0027314464,
-0.03750124,
-0.04993403,
-0.0045898445,
0.013425386,
0.05135409,
-0.03257449,
-0.01773629,
0.018866543,
0.034516208,
-0.048398044,
0.012041549,
-0.0050209346,
0.047876388,
-0.032081816,
-0.007237971,
-0.029792327,
0.030429907,
-0.0102447355,
0.0064736004,
0.061787203,
-0.031212391,
-0.029256182,
-0.018881032,
0.006412016,
-0.00872324,
-0.022416698,
0.025285805,
-0.011730005,
-0.0064736004,
0.05193371,
0.023720838,
-0.009969417,
0.0034740812,
-0.0029632933,
0.021025617,
0.012063284,
0.016519092,
-0.016345207,
-0.034516208,
-0.030111117,
0.027531821,
-0.029256182,
-0.019040428,
-0.01775078,
-0.013179048,
-0.07807445,
-0.009136218,
-0.0018765109,
0.0011746306,
-0.020721318,
-0.028256342,
-0.07679929,
-0.029328635,
0.029343124,
0.011845929,
-0.001069575,
-0.04593467,
-0.03428436,
0.021721158,
0.01576559,
0.02543071,
-0.017576894,
0.008230565,
0.0015187784,
-0.016475622,
0.0012162906,
-0.00537595,
-0.04758658,
-0.003651589,
-0.05671555,
-0.014193378,
0.0036751358,
0.003187895,
0.057150263,
-0.022576094,
-0.00452826,
-0.013323952,
-0.008563845,
-0.021156032,
-0.018576734,
-0.007031482,
0.03628404,
-0.007491553,
-0.024590263,
-0.046166517,
-0.03553054,
-0.047064923,
-0.061787203,
0.0005922964,
0.02082275,
-0.028270833,
0.0557302,
0.039153147,
-0.06288847,
-0.011164878,
-0.077205025,
0.027010165,
-0.0033291767,
0.022981824,
-0.017910173,
-0.04660123,
0.03654487,
-0.022720998,
-0.045673843,
-0.010708429,
-0.021996476,
0.047905367,
0.005970058,
-0.008643542,
-0.011338763,
-0.02548867,
-0.04494932,
0.042456966,
-0.018953485,
-0.031734046,
-0.038370665,
3.5575144e-05,
0.010679448,
-0.0052346685,
-0.036515888,
0.019938834,
0.034139458,
-0.0284737,
0.0017578705,
0.03083564,
0.01005636,
-0.005129613,
-0.022735488,
-0.062830515,
0.004568109,
-0.03750124,
-0.054889757,
0.000167206,
-0.012012568,
-0.014867184,
0.028096948,
-0.06943815,
0.012164718,
-0.011186614,
-0.014722279,
0.024039626,
0.022416698,
0.00039848688,
-0.06074389,
0.06584452,
0.02246017,
0.06404771,
0.0010713863,
0.0025285804,
-0.007006124,
0.058599308,
0.056918416,
-0.008607317,
0.024213511,
-0.031212391,
0.042891677,
0.003068349,
0.031618122,
-0.01223717,
0.0075712507,
0.03990665,
-0.0050173122,
0.0057671918,
0.05199167,
-0.0251409,
-0.023633895,
-0.042312063,
-0.009969417,
0.0045572408,
0.042456966,
-0.019388199,
0.0028763507,
0.010643222,
-0.015953965,
0.007810343,
-0.034371305,
0.013505083,
0.037066527,
-0.018055078,
-0.030980544,
0.043326393,
0.054426063,
0.0402834,
-0.026256664,
-0.0015142502,
-0.016026419,
-0.0013657232,
0.017388519,
0.00015962117,
-0.004473921,
-0.023648385,
-0.0016011928,
-0.01677992,
0.03190793,
-0.015968457,
-0.001709871,
-0.0135558,
-0.02482211,
0.0091144815,
-0.015838042,
-0.034690093,
0.01391806,
-0.021953005,
-0.006654731,
0.023083258,
-0.001220819,
-0.028401246,
0.038167797,
-0.019069409,
-0.019344727,
0.02218485,
-0.014570129,
0.0020576413,
-0.04219614,
-0.023271633,
-0.030024175,
0.03929805,
0.0073176683,
0.005618665,
-0.012910975,
0.042341042,
-0.02146033,
0.007448082,
0.013968777,
-0.05158594,
0.033009205,
-0.008317508,
-0.006031642,
-0.047180846,
-0.00988972,
-0.0060026613,
0.057440072,
-0.036747735,
-0.057816826,
0.006129453,
-0.036370985,
-0.007364762,
-0.007926267,
0.0067597865,
0.004408714,
-0.046977982,
0.010983747,
0.0342264,
-0.011309782,
0.007940757,
0.0013113841,
-0.019518612,
-0.0016138719,
0.011940116,
-0.0052093104,
-0.05868625,
0.051209185,
0.029009845,
0.0051513487,
0.004386978,
0.033443917,
-0.010563525,
0.016533583,
-0.010208509,
0.05222352,
-0.04350028,
0.0322557,
0.02822736,
-0.018634696,
0.033617802,
-0.04865887,
0.040718116,
0.040399324,
0.001111235,
-0.028430227,
0.01275158,
-0.035646465,
0.023039786,
-0.046717152,
0.008795693,
0.02447434,
-0.015635176,
0.034371305,
-0.047702502,
-0.008998558,
-0.036399964,
0.011621326,
-0.045499958,
-0.0063830353,
-0.03118341,
-0.00072678574,
-0.035095826,
0.015301896,
0.029140258,
-0.0068902005,
0.028444719,
0.03663181,
-0.002318469,
0.023691857,
-0.026633414,
-0.00048769361,
-0.023648385,
0.0496732,
-0.0018620205,
-0.04121079,
-0.0017297954,
0.04100792,
-0.025532141,
0.005415799,
0.052803133,
0.027039146,
0.030951563,
0.031734046,
-0.017388519,
0.013447121,
-0.0066112597,
-0.0068865777,
0.003044802,
0.057845805,
-0.05767192,
-0.020243134,
-0.0077596265,
-0.010222999,
-0.019634536,
0.025749497,
-0.0053723278,
-0.009962172,
0.066655986,
0.013505083,
-0.031994876,
-0.007803098,
0.021851571,
-0.002628202,
-0.015562724,
-0.016982786,
0.049876068,
0.004289168,
0.009353574,
-0.02586542,
0.02182259,
-0.026705867,
0.03990665,
0.04590569,
0.054976698,
0.03153118,
-0.032284684,
-0.039182127,
-0.07488655,
-0.02143135,
0.005129613,
-0.014657072,
-0.01912737,
-0.026213191,
-0.011476423,
0.0125849405,
-0.031994876,
-0.025169881,
-0.00569474,
0.024300454,
0.027604273,
0.058077652,
-0.025720516,
0.009382554,
-0.0035429106,
-0.0051404806,
-0.045876708,
-0.010273716,
0.0016645883,
0.0022170362,
0.023097748,
0.02819838,
-0.0016274566,
0.025271313,
-0.0093898,
-0.005988171,
-0.0011338763,
0.044021934,
-0.05630982,
-0.0009980286,
0.019011447,
0.012758825,
-0.043703143,
0.010976503,
0.06729357,
-0.036747735,
-0.0584544,
-0.024445359,
-0.013512328,
0.024039626,
-0.010447602,
0.075929865,
0.0060859816,
0.018315906,
-0.06132351,
-0.043674164,
-0.018996956,
0.043413334,
0.038428627,
-0.021054598,
-0.022938354,
0.036689773,
0.019272275,
-0.029212711,
-0.018489791,
-0.0052165557,
-0.007237971,
-0.0584544,
-0.010527299,
-0.009462252,
-0.011222839,
-0.026024817,
0.0037566444,
-0.006346809,
-0.01291822,
-0.008143622,
-0.067931145,
0.009599911,
-0.029256182,
-0.009027539,
-0.027415898,
0.010143302,
0.0031208768,
0.06735153,
0.007861059,
0.019388199,
-0.050484665,
-0.06010631,
0.035878308,
0.06004835,
0.017374028,
-0.0028093325,
0.010947522,
0.045528937,
0.0018131153,
-0.008237811,
0.04636938,
-0.0013901758,
0.027357936,
0.037530217,
-0.035443597,
0.024010645,
-0.021532781,
-0.00030226135,
-0.022039948,
-0.012106756,
-0.021040108,
-0.039124165,
-0.036313023,
-0.00093463284,
0.14397693,
-0.043065563,
-0.019359218,
0.008773956,
-0.012505243,
-0.026503,
0.017794251,
-0.012222679,
-0.018533263,
0.034371305,
-0.047238808,
-0.01676543,
-0.05094836,
0.03950092,
-0.027560802,
-0.012824032,
0.0063721677,
-0.020170681,
0.021547273,
0.01776527,
-0.0010795372,
-0.041761424,
0.009650628,
-0.014033983,
0.0171132,
-0.014041228,
0.01191838,
-0.020243134,
-0.010831598,
-0.012592185,
-0.004285545,
-0.036168117,
0.054918736,
0.005593307,
-0.04184837,
-0.009230405,
-0.01914186,
-0.0036443437,
-0.041529577,
0.012512488,
0.013193538,
-0.01375142,
-0.057208225,
-0.034139458,
-0.0052708946,
-0.018084059,
-0.015910495,
0.028430227,
-0.026430547,
-0.027937554,
-0.00047275034,
-0.020735808,
0.017243614,
0.018402848,
-0.014772995,
0.03883436,
0.0044884114,
0.034719076,
-0.02112705,
-0.022836922,
0.043413334,
0.023488991,
0.015026578,
-0.020243134,
0.0152439345,
0.022720998,
-0.018996956,
0.028430227,
-0.017388519,
0.01225166,
0.013722439,
0.04500728,
-0.016895844,
-0.018156512,
-0.022228323,
0.021445839,
0.03686366,
0.06706172,
0.035008885,
-0.033067167,
0.03689264,
0.017808741,
-0.0019073031,
0.044050913,
-0.0050245575,
-0.05801969,
0.010317188,
0.021590743,
0.02143135,
0.014533903,
0.01982291,
-0.023517972,
0.018852051,
-0.034342322,
-0.037385315,
-0.017069729,
-0.010817108,
0.02279345,
0.0118241925,
-0.00887539,
0.054049313,
0.004546373,
-0.019170841,
-0.010679448,
0.032516528,
0.02882147,
0.0019471518,
0.019764949,
-0.038109835,
0.025995836,
-0.010715675,
0.048484985,
0.0021337161,
-0.03263245,
0.010578016,
0.011266311,
0.0018746996,
-0.008607317,
-0.005437535,
0.02987927,
0.006506204,
-0.035066847,
0.016519092,
0.04019646,
-0.014041228,
-0.009143462,
-0.030806659,
0.017939154,
-0.0146136,
-0.0031353673,
-0.007006124,
0.008795693,
0.0080277,
0.028096948,
-0.020909693,
0.014780241,
-0.03184997,
-0.00056014577,
0.019735968,
-0.024068607,
0.0015857967,
0.0045318827,
0.00562591,
0.0029614822,
0.025720516,
-0.015229444,
0.0052346685,
0.014910654,
-0.037153468,
-0.037877988,
-0.0160554,
-0.02754631,
0.039442956,
0.011382234,
-0.024126569,
-0.0106939385,
0.0001393572,
0.02315571,
0.0080277,
-0.010998238,
-0.010933031,
0.014316547,
0.0033961951,
-0.004571731,
-0.013425386,
0.0059773033,
-0.032313664,
0.003635287,
-0.010462092,
0.02586542,
-0.07088719,
-0.019837402,
-0.011650307,
-0.013381914,
-0.016649507,
0.0073973658,
0.00247243,
-0.013476102,
0.0129544465,
0.008216075,
0.043094546,
-0.043703143,
0.04636938,
-0.0017823231,
-0.008636298,
0.010027379,
0.012983427,
0.04384805,
-0.02047498,
0.023329595,
-0.039182127,
-0.029560482,
-0.016635016,
0.01743199,
-0.017475462,
-0.0052093104,
0.020706827,
-0.008360979,
-0.026314626,
0.036805697,
-0.0044232043,
0.03889232,
0.0016365132,
0.0021463952,
-0.01844632,
-0.046804097,
-0.028125929,
0.052542306,
-0.0029940854,
-0.0065170717,
0.035762385,
0.010911295,
0.02987927,
-0.018866543,
0.036428947,
0.007650948,
0.017837722,
0.008201584,
-0.025923382,
-0.004933992,
-0.02987927,
0.015881514,
0.029096788,
0.030024175,
-0.005339724,
-0.016707469,
-0.035095826,
0.011701024,
0.026387077,
-0.007455327,
-0.01409919,
0.0060461327,
-0.012548714,
-0.029966213,
-0.038022894,
-0.036660794,
0.0026734846,
-0.0030647265,
-0.0086145615,
-0.0077234004,
-0.042312063,
-0.010063605,
0.0073901205,
-0.013628251,
0.003169782,
-0.010483827,
0.00019460198,
-0.016649507,
-0.011259066,
-0.018736128,
0.00089478417,
0.001361195,
-0.010672203,
-0.040428307,
-0.011925626,
0.01712769,
0.009643382,
0.011483667,
-0.0012733467,
-0.03019806,
0.048484985,
0.02751733,
0.0006565977,
0.0149541255,
-0.011498158,
-0.022923864,
0.012700864,
-0.012027059,
0.022880392,
-0.041819386,
-0.036370985,
0.024054118,
-0.022445679,
-0.0124545265,
0.013635497,
0.02147482,
-0.007089444,
-0.012440036,
0.017953645,
0.015316387,
-0.0112445755,
-0.018562244,
-0.0052817627,
0.045470975,
0.024995996,
0.0036207966,
-0.023720838,
0.016519092,
0.002394544,
0.051701862,
-0.006810503,
-0.02214138,
0.017200142,
-0.034081496,
0.018576734,
-0.0155047625,
0.021909533,
-0.00032105364,
-0.026126249,
-0.010606997,
-0.015490272,
-0.01744648,
0.01673645,
-0.0028147665,
-0.043529257,
-0.057874784,
-0.0042638094,
0.037820026,
-0.028575132,
0.00652794,
-0.0021645082,
-0.044833396,
-0.0630044,
-0.018721638,
0.029140258,
-0.023648385,
-0.0044232043,
0.018518772,
-0.0029687274,
0.01543231,
0.00313899,
0.020214153,
0.038428627,
-0.041326713,
-0.035878308,
-0.029705387,
0.03683468,
-0.009882474,
0.024039626,
-0.01843183,
0.0031317447,
-0.0113749895,
-0.02714058,
0.008998558,
0.03156016,
0.012374829,
-0.036950603,
-0.0088246735,
0.0077234004,
0.008759466,
-0.010143302,
-0.007948002,
-0.018808581,
-0.0038218515,
0.012679128,
0.01257045,
-0.0077523813,
0.0023818647,
0.002454317,
-0.00063622056,
0.025981344,
-0.017939154,
-0.003948643,
-0.028415738,
-0.010672203,
-0.024923543,
0.054628927,
0.010447602,
0.017156672,
0.013693458,
-0.003807361,
-0.030893601,
0.012613921,
0.0013177237,
0.0074082334,
-0.023228163,
-0.00011943286,
0.026358096,
0.005850512,
0.027024657,
0.0057092304,
0.023691857,
-0.026894242,
0.014512167,
0.008527619,
-0.00301401,
0.0292272,
0.005165839,
-0.0052056876,
0.021025617,
-5.7905127e-05,
-0.02009823,
0.025937874,
-0.008578336,
0.061613318,
0.017895684,
-0.017968135,
0.007549515,
0.013816627,
0.035675444,
0.011295292,
0.019156352,
0.050745495,
0.015707629,
0.021300934,
0.017649347,
-0.023387557,
-0.010049115,
-0.03127035,
-0.052252498,
-0.031357296,
0.027749177,
0.043703143,
-0.03663181,
-0.0052455366,
0.014809222,
0.004223961,
-0.00049176905,
0.014983106,
-0.03083564,
0.045036264,
-0.013765911,
0.02822736,
-0.007585741,
-0.02583644,
-0.011215595,
-0.030140098,
-0.014577375,
0.008962332,
0.036805697,
0.0023365822,
-0.015359858,
0.00755676,
0.024923543,
-0.020953165,
-0.037414297,
-0.011505403,
0.011845929,
0.017692817,
0.037964933,
0.022213832,
-0.0044050915,
-0.0018837561,
0.04836906,
-0.015577215,
-0.00789004,
-0.04663021,
0.0025901648,
0.0047999555,
-0.019562082,
-0.0153743485,
0.011309782,
-0.016504603,
0.03118341,
0.0110562,
-0.0428627,
0.008071171,
6.022586e-05,
-0.008339244,
0.0013747797,
-0.035675444,
0.0030574813,
0.022373227,
-0.041036904,
-0.014475942,
-0.021866063,
-0.028908413,
0.02547418,
-0.02282243,
0.020417018,
-0.014910654,
0.0027785404,
0.028082456,
0.0051151225,
-0.021286445,
0.022039948,
0.04428276,
-0.0054592704,
-0.019054918,
-0.017475462,
-0.021909533,
0.0218081,
0.004785465,
0.034979902,
-0.0042203385,
0.0055462127,
0.030053155,
0.0023076013,
-0.040776078,
0.01912737,
-0.026560962,
-0.023083258,
-0.030748697,
0.023271633,
0.008549355,
0.017316066,
0.022054438,
0.016330717,
0.0055751936,
0.027604273,
0.021286445,
0.008933351,
0.027705707,
0.046977982,
-0.015330877,
0.007984228,
0.015591705,
0.012657393,
-0.013200783,
0.0046985224,
-0.008085661,
0.008752221,
0.0062055276,
0.036428947,
-0.0012008946,
0.016577054,
-0.015519253,
-0.036168117,
0.0041189054,
-0.002626391,
-0.020706827,
-0.0050318027,
0.0502818,
-0.02882147,
0.010346169,
-0.0019471518,
-0.020257624,
-0.0055860616,
0.004187735,
0.0048035784,
-0.022692017,
-0.0020413396,
-0.01612785,
-0.008491393,
0.029299654,
0.014287566,
-0.02985029,
0.008092906,
-0.060512044,
-0.028386757,
-0.02282243,
0.0048289364,
-0.023054278,
0.02415555,
-0.020561922,
-0.01205604,
-0.02543071,
0.026705867,
0.010947522,
-0.010317188,
-0.017808741,
-0.005165839,
-0.032806337,
0.01193287,
0.028676566,
-0.010353413,
0.014005003,
-0.0075929863,
-0.025952363,
-0.026169721,
0.045326073,
-0.0023039787,
0.015881514,
0.009628892,
-0.030893601,
-0.023851251,
-0.0017651158,
-0.0004333545,
0.030342964,
0.04494932,
-0.01777976,
0.015403329,
0.004571731,
0.010085341,
0.02511192,
-0.018924505,
0.022010967,
-0.0013892702,
0.0022061684,
0.0018122096,
0.023604915,
0.0018457188,
0.010338923,
0.011664798,
0.0064265067,
-0.03863149,
-0.00028822376,
0.010215755,
-0.013063124,
-0.0027332578,
-0.009462252,
0.010266471,
0.025416218,
0.008252301,
0.029415578,
0.0032023855,
-0.013294972,
0.014142661,
-0.0006253527,
0.027952043,
0.013968777,
-0.012258906,
-0.025242332,
-0.0147440145,
0.003050236,
-0.01343263,
0.006248999,
-0.0076002316,
-0.004633316,
0.021011127,
0.007520534,
0.008049435,
-0.0061040944,
0.025575612,
-0.0024995995,
-0.017649347,
-0.017808741,
0.028806979,
0.0019036805,
-0.016533583,
0.016794411,
-0.017997116,
-0.0153743485,
0.018562244,
-0.007216235,
-0.02854615,
0.01123733,
-0.007962492,
0.020953165,
0.0063612997,
0.025952363,
-0.013947041,
-0.0009142557,
0.0015830797,
0.032226723,
-0.012773315,
0.015707629,
0.030371945,
-0.009925946,
-0.02586542,
-0.025198862,
0.01875062,
-0.04500728,
-0.023706347,
-0.037617162,
0.032081816,
0.005821531,
0.025648065,
0.027386917,
-0.0136644775,
0.008715995,
0.028111437,
0.005158594,
-0.020547433,
0.013287726,
-0.006136698,
-0.037240412,
0.0160554,
-0.026343606,
0.004075434,
-0.04364518,
0.0040066047,
-0.01473677,
0.014925145,
-0.011541629,
0.015953965,
-0.011816948,
0.0036316644,
0.0055208546,
0.032980222,
-0.0036968715,
0.025633574,
0.10792474,
-0.0030701603,
0.002318469,
0.00044671286,
0.016692977,
-0.021924024,
-0.027126089,
-0.0036425323,
-0.01914186,
-0.025937874,
-0.0026535604,
0.032023855,
0.010259226,
-0.016229283,
0.0039341524,
0.008433431,
0.0010949332,
0.002121037,
-0.001087688,
-0.00042044895,
0.010201264,
0.025387237,
-0.0027332578,
0.016504603,
-0.053440712,
-0.009788287,
-0.025242332,
0.010882314,
0.014830957,
0.043790087,
-0.013773155,
0.03663181,
-0.03118341,
0.0101143215,
0.00050942926,
0.023373067,
-0.053759504,
0.008411696,
0.023561442,
-0.013215274,
0.005379573,
-0.009541949,
-0.010128812,
-0.017287085,
-0.009715835,
-0.04257289,
-0.0140847,
-0.020764789,
-0.0054665157,
-0.006690957,
0.0024271475,
0.027604273,
-0.028560642,
0.024532301,
0.042833716,
-0.030603793,
0.008752221,
0.02954599,
0.05129613,
-0.023271633,
0.017533423,
0.025691535,
-0.0402834,
0.023416538,
0.005202065,
-0.022634055,
-0.02543071,
-0.0071365377,
-0.00060678687,
0.03176303,
-0.015953965,
0.021735648,
-0.014635337,
-0.050687533,
-0.000110319736,
0.02080826,
0.01914186,
-0.012302377,
-0.025343766,
0.027357936,
-0.018518772,
0.0054013086,
0.033791687,
0.033646785,
-0.016287245,
0.0044340724,
0.002318469,
-0.001212668,
-0.0008449733,
0.04523913,
-0.035675444,
-0.021677686,
0.011838683,
-0.02882147,
0.002878162,
-0.00016143247,
0.0021898665,
-0.03376271,
0.012838523,
0.010447602,
0.013447121,
0.03054583,
-0.007839324,
0.016577054,
0.016171321,
0.015185973,
-0.054078292,
0.04126875,
0.014758505,
0.036457926,
0.011208349,
-0.028357776,
0.013606516,
-0.012353093,
-0.016939316,
0.012077775,
3.0763866e-05,
0.001561344,
0.0073973658,
-0.028270833,
0.0075277793,
0.0025847307,
0.0046079573,
-0.016359698,
0.0045173923,
-0.043877028,
0.0052093104,
-0.00045237318,
-0.014193378,
-0.021373387,
0.037762064,
-0.0061765467,
0.005745456,
-0.0018837561,
0.039703783,
0.008194339,
0.014367264,
-0.027923062,
-0.01373693,
0.02314122,
0.018996956,
0.024662714,
0.012222679,
-0.0046152025,
0.014381754,
-0.016997278,
0.010396885,
0.0035229863,
-0.03292226,
0.008744976,
-0.0056150425,
-0.041181806,
0.0016229284,
-0.029024335,
0.026198702,
0.0039595105,
0.020286605,
0.008252301,
0.004473921,
-0.039442956,
-0.011295292,
-0.002979595,
-0.03990665,
0.016533583,
0.024532301,
0.0045173923,
0.013577535,
0.016620526,
0.014055719,
0.02277896,
0.028415738,
-0.025735008,
-0.0045789764,
-0.0008984068,
-0.00048135404,
-0.024083098,
0.0006316923,
0.020764789,
-0.05674453,
-0.0098245125,
0.015403329,
-0.029705387,
-0.017634856,
0.036023214,
-0.002251451,
-0.00789004,
0.0067344285,
-0.016533583,
-0.004506524,
-0.00176421,
-0.009578176,
-0.00029682743,
-0.034835,
-0.0073720072,
-0.017707309,
-0.017953645,
-0.026285645,
-0.034168437,
0.0020141702,
0.036718756,
-0.0012244415,
-0.014120926,
0.011382234,
-0.002466996,
0.032052837,
0.05129613,
-0.020243134,
0.0147440145,
-0.013476102,
-0.019562082,
0.039471935,
-0.0047999555,
0.006321451,
0.0026734846,
0.055237528,
-0.008629052,
0.0076944195,
-0.004137018,
-0.0033454786,
0.015852533,
0.0052056876,
0.012193698,
0.012729845,
-0.033733726,
-0.047412694,
0.020895204,
0.024083098,
0.009512968,
-0.021648705,
0.0016174945,
-0.060859814,
-0.047035944,
-0.0221124,
-0.0013412706,
-0.0034106853,
-0.02046049,
-0.017301576,
0.019170841,
0.026372585,
9.8433055e-05,
-0.031936914,
-0.011215595,
0.015041068,
0.06004835,
-0.0091144815,
0.005531722,
-0.0069517847,
0.02175014,
-0.02918373,
-0.0032512906,
-0.00060905097,
0.046079572,
-0.009433271,
-0.020692337,
-0.027444879,
-0.0026426925,
-0.0058613797,
-0.019866383,
-0.0096651185,
-0.012766071,
-0.020214153,
0.002615523,
0.049702182,
0.008237811,
0.007679929,
-0.038080856,
0.013265991,
0.011193858,
-0.0069083134,
0.008049435,
0.005165839,
-0.0035084959,
-0.030111117,
-0.0058831153,
-0.0035247975,
0.012526979,
-0.010578016,
-0.014041228,
-0.0122444155,
-0.03721143,
-0.0057418337,
-0.0076002316,
0.0023836761,
0.0056440234,
0.0015993814,
-0.006495336,
-0.0028799733,
-0.0044123367,
-0.01576559,
-0.021315426,
0.01911288,
-0.022068929,
-0.037617162,
-0.001587608,
-0.0063794125,
0.017605875,
0.0054918737,
-0.019866383,
-0.041471615,
-0.007274197,
-0.032516528,
0.026416058,
0.020040268,
-0.011882154,
-0.0008101057,
0.009911455,
-0.017272595,
0.028053477,
-0.002573863,
0.05468689,
-0.03689264,
0.004408714,
-0.0013965154,
-0.021286445,
0.017852213,
0.019214313,
-0.04121079,
0.029908251,
0.003461402,
0.038515568,
-0.009353574,
0.029125769,
-0.0027459369,
0.02985029,
-0.0030339342,
-0.018678168,
0.040689133,
-0.006488091,
0.029676406,
0.03625506,
-0.009788287,
-0.019083899,
0.012744335,
-0.01090405,
0.044137858,
-0.005995416,
-0.016837882,
0.022025457,
0.012389319,
-0.046253458,
-0.018388359,
0.017316066,
-0.012171963,
0.00987523,
0.0040500755,
0.001626551,
-0.009440516,
-0.028879432,
-0.002937935,
-0.017316066,
-0.005951945,
0.011983587,
0.04094996,
-0.01975046,
-0.016649507,
0.013715194,
0.029343124,
-0.00313899,
0.013381914,
-0.041181806,
-0.0321108,
-0.011317028,
0.033414938,
-0.011230085,
-0.022605075,
-0.008049435,
-0.013483347,
-0.0008010492,
0.0010125189,
-0.0443697,
-0.034690093,
0.011990832,
0.0013385536,
0.0040283403,
-0.008629052,
-0.044137858,
-0.04828212,
-0.022213832,
-0.024677206,
-0.069206305,
0.018214474,
-0.0010704807,
0.0005184858,
0.009773796,
0.013519573,
0.018721638,
0.003521175,
-0.0237788,
-0.012831277
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 7,
"total_tokens": 7
}
}
headers:
CF-RAY:
- 939c170ecd39a608-NRT
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 03 May 2025 01:47:23 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '33338'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '110'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-6d66f695d7-fnmlz
x-envoy-upstream-service-time:
- '66'
x-ratelimit-limit-requests:
- '5000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '4999'
x-ratelimit-remaining-tokens:
- '4999992'
x-ratelimit-reset-requests:
- 12ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_245fc8e62865f5396656bd94248d10fe
status:
code: 200
message: OK
version: 1
test_async_embeddings_token_metrics.yaml 0000664 0000000 0000000 00000135546 15270700723 0047272 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for async embeddings token metrics",
"model": "text-embedding-3-small"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '97'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.0033986655,
-0.027189324,
0.0054322644,
-0.026195275,
-0.006202302,
0.0033024107,
0.018718911,
0.031977557,
0.045110196,
-0.014574709,
0.029513437,
-0.017948873,
-0.029625442,
-0.035673738,
0.0059677907,
0.0135736605,
-0.032845598,
-0.026251279,
0.013461655,
-0.0014490705,
-0.0103605045,
-0.018396895,
0.020721009,
0.03757783,
0.013622663,
-0.0011856827,
0.01929294,
0.0067308275,
0.031053511,
-0.014490706,
0.02014698,
-0.02074901,
0.00924045,
-0.037465826,
-0.029933458,
0.05768281,
-0.010437508,
0.03346163,
-0.016352797,
-0.027973361,
-0.01787887,
-0.024543194,
-0.060818963,
-0.0042002043,
-0.017416848,
0.038277864,
0.0045642224,
-0.028001362,
0.023955166,
0.026503291,
-0.06384311,
0.0086594215,
-0.011536562,
0.034161665,
-0.021939069,
-0.01397268,
-0.01253061,
0.022723107,
-0.023689153,
-0.014896725,
0.049198397,
-0.03222957,
-0.003822186,
-0.023507144,
0.008127396,
0.0033811645,
-0.0052467557,
0.025173226,
-0.019586954,
-0.02343714,
0.06955539,
0.03592575,
0.0026776304,
-0.002689881,
-0.016338795,
-0.00780538,
0.006219803,
-0.0059432895,
0.0020686006,
-0.02690931,
-0.049142394,
0.002299612,
-0.020539,
-0.023535145,
-0.008260402,
-0.01376267,
-0.076443724,
-0.031333525,
0.013132639,
-0.007581369,
-0.04090999,
-0.012138591,
-0.06182701,
-0.022485094,
0.02734333,
-0.015512755,
0.010864529,
-0.028897407,
-0.04090999,
0.0060517946,
0.00051846274,
0.021267036,
-0.01992297,
0.03407766,
-0.0040531973,
-0.00025923137,
0.010934533,
-0.0021386042,
-0.026125273,
-0.013181642,
-0.05275457,
-0.0020668507,
-0.019586954,
0.013419653,
0.062499043,
-0.0034441678,
-0.0007542867,
-0.01498073,
0.005932789,
-0.008792428,
-0.025971264,
0.003104651,
0.035869747,
0.0017010828,
-0.026643297,
-0.04497019,
-0.041218005,
-0.06843533,
-0.0636751,
0.009828478,
0.011893579,
-0.02548124,
0.06748328,
0.025131224,
-0.02648929,
-0.032509584,
-0.034889698,
0.035785742,
-0.028981412,
0.024837209,
-0.015064733,
-0.0328176,
0.05507868,
0.0076303715,
-0.061603,
-0.025551245,
-0.039397918,
0.041246008,
-0.0076723737,
-0.0058277836,
0.006877835,
-0.025957264,
-0.027595343,
0.03306961,
-0.019460948,
-0.02525723,
-0.017416848,
-0.003533422,
0.0035176713,
-0.033041608,
-0.026657298,
0.01561076,
0.024725204,
-0.01047951,
0.017514853,
0.03981794,
-0.0024378686,
-0.014644713,
-0.030493485,
-0.0492544,
0.007924385,
-0.0698914,
-0.01932094,
-0.04004195,
-0.034217667,
-0.031361528,
0.009982486,
-0.0575148,
0.022891115,
0.0018935922,
-0.018942922,
-0.012824625,
0.036709785,
0.013419653,
-0.06137899,
0.062163025,
0.01869091,
0.0761077,
0.031053511,
0.01992297,
-0.028491387,
0.07560368,
0.06748328,
-0.0070913453,
0.020230984,
-0.028645394,
0.035841744,
0.018242888,
0.014700715,
0.002772135,
-0.004378713,
0.0369338,
0.017136835,
-0.014252694,
0.039537925,
-0.021701057,
-0.034189664,
-0.06406712,
-0.0061112978,
0.018200886,
0.039929945,
0.0130276345,
0.01621279,
0.026167274,
-0.028953409,
0.0097514745,
-0.053594608,
0.02445919,
0.057570804,
-0.018606907,
-0.010801526,
0.04415815,
0.05488267,
0.017346844,
-0.026167274,
0.019754961,
-0.005978291,
0.006146299,
0.0102695,
-0.018746912,
-0.0069793398,
-0.004588723,
-0.027665347,
-0.0031484033,
0.0027633845,
-0.029849453,
-0.009002439,
-0.007308356,
-0.007623371,
-0.008162397,
-0.017192837,
-0.027217325,
0.008554417,
-0.013405653,
-0.010185496,
0.0039131907,
-0.014546708,
-0.002894641,
0.032705594,
-0.004823235,
-0.022779109,
0.0097514745,
-0.033349622,
0.008113395,
-0.020847015,
-0.021827063,
-0.02035699,
0.06322708,
0.008897433,
0.0033654138,
-0.0082184,
0.019208936,
-0.040349964,
-0.0002612002,
0.005029745,
-0.052922577,
-0.0028106368,
-0.008183398,
-0.03326562,
-0.034021657,
0.015064733,
0.0026006266,
0.066811256,
-0.024921214,
-0.047126293,
0.014315697,
-0.027553342,
0.019754961,
-0.0046762275,
-0.013832673,
0.027847355,
-0.035589732,
0.01703883,
0.044298157,
-0.021827063,
-0.009170447,
0.038949896,
-0.0019565953,
0.02979345,
0.03466569,
-0.008225401,
-0.05530269,
0.06692326,
0.028519388,
-0.015666762,
-0.0027861355,
0.046930283,
-0.022737106,
-0.016394798,
-0.015232742,
0.0246272,
-0.03878189,
-0.01726284,
-0.012950631,
-0.0056107733,
0.03962193,
-0.014840723,
0.03673779,
0.008939435,
0.0044732178,
-0.025327234,
0.015876774,
-0.016618809,
0.048610367,
-0.046538267,
0.017010828,
0.0554147,
-0.018858919,
0.040797986,
-0.05012244,
-0.027063318,
-0.0656352,
0.0032971606,
-0.044270154,
-0.0015715765,
-0.029121418,
0.0063388087,
-0.016940825,
0.027833356,
0.023297135,
0.004784733,
0.028155372,
0.067651294,
-0.0065453188,
0.01171157,
-0.0014219442,
0.026335282,
-0.015974779,
0.031529535,
0.020062977,
-0.032789595,
-0.021197032,
0.027189324,
-0.030213472,
0.02154705,
0.023465142,
0.022219082,
0.014868724,
0.020076977,
-0.020875016,
9.5106196e-05,
-0.009849479,
0.0016179538,
-0.00636681,
0.035449725,
-0.0738676,
-0.021925068,
-0.012964631,
-0.006653824,
-0.014672714,
0.0067308275,
-0.0022838612,
0.020272987,
0.048974384,
0.033517633,
-0.041414015,
-0.020202983,
0.01968496,
-0.020819014,
-0.03878189,
-0.021995071,
0.055162687,
0.0021893566,
-0.007042343,
-0.02423518,
0.011725571,
0.011263548,
0.034161665,
0.030773498,
0.02917742,
0.058466848,
-0.04127401,
-0.04457817,
-0.041414015,
0.007028342,
-0.0019215936,
-0.001087678,
-0.03015747,
-0.02857539,
0.021729058,
-0.014896725,
-0.025621247,
-0.018018877,
-0.024585197,
0.017220838,
0.044046145,
0.026965313,
-0.03799785,
0.01929294,
7.6784985e-05,
-0.02339514,
-0.028211374,
0.0015882023,
-0.0066818255,
0.01110254,
0.045250203,
0.02034299,
0.0018673409,
0.014126688,
0.027889358,
0.0012766871,
-0.018214887,
0.022667104,
-0.0677633,
0.020525,
0.012586613,
0.019964973,
-0.012838625,
0.007518366,
0.067035265,
-0.07050743,
-0.047378305,
0.0005823409,
-0.008106395,
0.005852285,
-0.032537583,
0.050654467,
-0.013132639,
0.0067063267,
-0.062499043,
-0.03393765,
-0.02174306,
0.054994676,
0.043038096,
-0.017822867,
-0.02753934,
0.026965313,
0.0133146485,
-0.023115125,
0.014105687,
0.0040986994,
-0.0164088,
-0.04455017,
-0.011844576,
-0.02976545,
-0.012887628,
-0.016352797,
-0.03656978,
0.037549827,
-0.02319913,
0.0037661833,
-0.06479515,
0.014840723,
-0.01087153,
-0.041862037,
-0.041386016,
0.024361186,
0.0059817913,
0.055134684,
0.013811672,
0.022345088,
-0.05891487,
-0.036457773,
0.047910333,
0.057850815,
-0.0018708411,
-0.017626857,
0.021799061,
0.05255856,
0.006076296,
0.0126426155,
0.0067938305,
-0.009415458,
0.020090979,
0.038109854,
-0.04062998,
0.02959744,
-0.04539021,
0.00021055713,
-0.0065768203,
-0.022023072,
-0.034049656,
-0.040125955,
-0.036233764,
-0.003920191,
0.13395852,
-0.027049316,
-0.038305864,
-0.010171495,
-0.013216644,
-0.0045677223,
0.010045489,
-5.4225296e-05,
-0.016954826,
0.009807478,
-0.045502216,
-0.018018877,
-0.034637686,
0.03595375,
-0.021085026,
-0.0030363977,
0.012054587,
-0.024697203,
0.057570804,
0.024837209,
0.015526756,
-0.028869405,
0.011522561,
-0.021799061,
0.019348942,
-0.031865552,
0.0025166224,
-0.011823576,
-0.01458871,
-0.010150494,
-0.010633518,
-0.01089253,
0.05239055,
-0.006328308,
-0.011557562,
-0.013636664,
-0.024879212,
-0.0048827375,
-0.02220508,
0.01908293,
-0.0003441105,
-0.009807478,
-0.064123124,
-0.029429432,
-8.919965e-05,
-0.024809208,
-0.02753934,
0.0184949,
-0.005873286,
-0.023717154,
0.022877114,
-0.03144553,
0.023451142,
-0.0032971606,
0.0013046885,
0.056982774,
-0.015554757,
0.026587294,
-0.030297475,
-0.023325136,
0.020062977,
0.0013816922,
0.022135077,
-0.0021491046,
0.012922629,
0.02937343,
-0.020567002,
0.028463386,
-0.011074539,
-0.0048617367,
0.0073643588,
0.04256207,
-0.037325818,
-0.0067868303,
-0.007784379,
0.011844576,
0.03757783,
0.07274754,
0.00924045,
-0.044018142,
0.035617735,
0.03267759,
0.020496998,
0.0369898,
0.0055407695,
-0.039957944,
0.0023538645,
0.002567375,
0.028841404,
-0.003717181,
0.021925068,
-0.02996146,
0.008057392,
-0.01723484,
-0.022849113,
-0.015162738,
0.0054777665,
0.012901628,
0.005708778,
-0.039005898,
0.07375559,
-0.008526416,
0.010437508,
-0.0042247055,
0.02690931,
0.030689495,
0.022415092,
0.031585537,
-0.037017804,
-0.0040986994,
0.0052957577,
0.02940143,
0.0082044,
-0.018018877,
0.009954485,
0.015652763,
-0.007966388,
-0.0064613144,
-0.0075323666,
0.041162003,
0.031669542,
-0.024893211,
0.03144553,
0.03248158,
-0.009632469,
-0.0102625,
-0.053734615,
0.010185496,
-0.03393765,
-0.008806429,
-0.011984584,
-0.004914239,
0.033545632,
0.0055757714,
-0.012264597,
0.009548465,
-0.043850135,
-0.006328308,
-0.00015116361,
-0.02363315,
0.01892892,
-0.0007984764,
-0.017094832,
0.01825689,
0.028267376,
-0.037353817,
0.0246272,
0.015638761,
-0.043206103,
-0.02937343,
-5.8354402e-05,
-0.030213472,
0.060482945,
0.0009887981,
-0.019376943,
0.022695106,
0.0019635956,
0.02178506,
0.011361553,
-0.021029023,
-0.03455368,
0.025705252,
-0.0009887981,
-0.018732913,
-0.006804331,
-0.0003718931,
-0.03777384,
0.00047296053,
0.013489657,
-0.0050157444,
-0.06266705,
-0.016282793,
0.01622679,
-0.03452568,
0.011851577,
0.0068288324,
0.005831284,
-0.013195642,
0.019754961,
0.012376603,
0.06401112,
-0.028169371,
0.04746231,
0.017108833,
0.002997896,
-0.0050437455,
0.042590074,
-0.0011436807,
-0.0070108413,
0.024137175,
-0.012012585,
-0.035281718,
-0.032649588,
-0.018116882,
-0.021393042,
-0.015456753,
0.014063684,
0.0009152946,
-0.02363315,
0.014840723,
-0.018760914,
0.053902626,
0.025551245,
0.013671665,
-0.02857539,
-0.0349457,
-0.017682862,
0.04964642,
-0.011928581,
-0.022275085,
0.02814137,
0.011844576,
0.037073806,
-0.01724884,
0.053118587,
0.010164495,
0.021645054,
-0.0024886213,
-0.030493485,
-0.009688471,
0.019628955,
0.009898482,
0.009429459,
0.033321623,
0.006261805,
-0.02363315,
-0.015246742,
0.0018585905,
-0.0014893225,
-0.014574709,
-0.010094492,
0.0060972967,
-0.021757059,
-0.021197032,
-0.03819386,
-0.029289426,
0.0025848758,
-0.021225033,
0.012887628,
0.010248499,
-0.029513437,
-0.010241498,
0.0070073414,
-0.011935581,
-0.01376267,
-0.0046657273,
0.019068928,
-0.020412995,
-0.011564563,
-0.017738864,
-0.012243596,
0.019950971,
-0.017906873,
-0.035169713,
0.0013571911,
0.0054672663,
0.02237309,
-0.009282452,
-0.011368553,
-0.01808888,
0.037297815,
0.016268792,
-0.011340552,
0.03208956,
-0.023115125,
-0.023227131,
0.011473559,
0.0010273,
0.034217667,
-0.037353817,
-0.04329011,
0.029625442,
-0.025901262,
0.0010920531,
0.030465484,
0.004497719,
-0.0052922578,
-0.017052831,
0.03225757,
-0.014420702,
-0.0063528093,
-0.032929603,
-0.0007958512,
0.014203692,
0.015358748,
-0.0151487375,
-0.018214887,
0.0184669,
-0.023493145,
0.052726567,
-0.01129155,
-0.019978972,
-0.005778781,
-0.040965993,
0.03816586,
-0.011445558,
-0.0029208923,
-0.005642275,
-0.030045463,
-0.015428751,
-0.011690569,
0.005792782,
0.005498768,
0.015918775,
-0.03346163,
-0.070955455,
-0.0031204019,
0.050430454,
-0.042646077,
-0.014105687,
0.005173252,
-0.031949557,
-0.03225757,
-0.021127028,
0.044438165,
-0.030633492,
-0.00431921,
0.023493145,
-0.012306599,
-0.011662568,
-0.03572974,
0.019838966,
0.025775256,
-0.050374452,
-0.03228557,
-0.02280711,
0.045894235,
-0.0058662854,
0.012796623,
-0.0070178416,
0.01129155,
0.00019808777,
-0.018676909,
0.02363315,
0.040405966,
0.019880967,
-0.019236937,
-0.0038431871,
-0.006842833,
0.011564563,
0.0041162004,
-0.004616725,
0.0130906375,
-0.005176752,
0.017556855,
0.0035649235,
-0.0026548794,
0.015764767,
0.00021558862,
-0.0035036707,
0.013055636,
-0.009429459,
0.00924045,
-0.028701397,
0.0041197008,
-0.0041022,
0.062219027,
-0.0057402793,
0.014133688,
0.0011358053,
-0.009156446,
-0.022065075,
0.013230644,
-0.0048897383,
0.0047007287,
-0.021897066,
0.016352797,
0.021393042,
0.023045123,
0.00555127,
0.00025026218,
0.032901604,
-0.020104978,
0.019236937,
0.006454314,
-0.022149079,
0.0059047877,
0.019502949,
-0.021057025,
0.011466558,
-0.006590821,
-0.010612517,
0.044018142,
0.00079366367,
0.061098974,
0.008533415,
-0.03015747,
0.016590808,
0.01664681,
0.00032748468,
0.00028307628,
0.013503658,
0.03430167,
0.010724522,
0.0492544,
0.022779109,
-0.002695131,
0.016758816,
-0.031501535,
-0.04357012,
-0.025747254,
0.009597467,
0.043626126,
-0.038109854,
0.005257256,
0.041218005,
0.005274757,
0.0008912309,
0.020553,
-0.018816916,
0.044494167,
-0.016072782,
0.022737106,
-0.016520804,
-0.019068928,
-0.0051242495,
-0.022989118,
-0.019852966,
-0.0009835479,
0.02549524,
-0.013426654,
-0.01334265,
-0.0014149438,
0.03864188,
-0.012502609,
0.01108854,
-0.0014411951,
0.029345429,
0.022639101,
0.02095902,
0.03785784,
-0.00882743,
0.012467607,
0.04827435,
-0.019852966,
0.005257256,
-0.04373813,
0.016744815,
-0.009555466,
-0.005855785,
-0.016884822,
-0.00028723275,
-0.0010360505,
0.037745837,
-0.006713327,
-0.044690177,
0.00028373257,
0.021631053,
-0.00057402794,
-0.0056597753,
-0.027049316,
0.010423508,
0.01458871,
-0.0034354173,
0.00534476,
-0.016506804,
-0.02238709,
-0.0077353767,
-0.016072782,
0.0107455235,
-0.0036296768,
-0.0075463676,
0.0153727485,
0.006713327,
-0.0011848077,
0.025831258,
0.017024828,
0.022695106,
-0.021659054,
-0.014574709,
-0.013916678,
0.020230984,
-0.0102695,
0.050486457,
0.0011139292,
-0.0029698946,
0.046958286,
-0.0036261766,
-0.051074486,
0.014658714,
-0.016520804,
-0.02504722,
-0.0102625,
-0.008939435,
0.0021876064,
0.020174982,
0.0016870821,
0.010017488,
-0.0071578487,
0.031529535,
0.021995071,
-0.007084345,
0.021799061,
0.049366403,
-0.0080153905,
0.006429813,
0.020693008,
-0.0014543209,
-0.00964647,
0.01128455,
-0.017738864,
0.002485121,
0.015764767,
0.04886238,
0.013545659,
0.039481923,
-0.01807488,
-0.04824635,
0.012901628,
0.0014306947,
-0.018354893,
0.0057647806,
0.033545632,
-0.03018547,
0.020553,
0.014224692,
-0.0068708346,
-0.017948873,
0.010192497,
0.014896725,
-0.015708765,
0.0013781921,
-0.00087810523,
-0.0004913364,
0.0021928567,
0.020595003,
-0.03365764,
-0.015232742,
-0.06507517,
-0.039397918,
-0.015512755,
0.017640859,
-0.048610367,
0.026419286,
-0.0098144775,
-0.010941532,
-0.02014698,
0.041386016,
0.013706667,
-0.014546708,
-0.0037486826,
-0.0044872183,
-0.036233764,
0.017920872,
0.020847015,
-0.017192837,
0.01829889,
0.010164495,
-0.025523243,
-0.015274744,
0.042338062,
0.0030959006,
0.010045489,
0.004616725,
-0.028603392,
-0.011592564,
-0.0020003475,
0.0067833303,
0.03452568,
0.04533421,
-0.023717154,
-0.0017413348,
0.015204741,
0.020721009,
0.021701057,
-0.015526756,
0.017724862,
0.0102765,
0.002997896,
-0.011081539,
0.02790336,
-0.01355266,
0.00054121384,
0.00698634,
0.010836528,
-0.030381478,
-0.007210351,
0.0047357306,
-0.0044207154,
-0.0031956555,
-0.007427362,
0.008540416,
0.026461288,
0.0011253048,
0.024935214,
0.0082184,
-0.020973021,
0.006814832,
0.0012390603,
0.014672714,
-0.0004443029,
0.0018183385,
-0.036485776,
-0.02035699,
0.001313439,
-0.024207179,
-0.010549514,
0.0026548794,
0.008701424,
0.014077686,
0.014322697,
0.016926825,
-0.00923345,
0.039537925,
0.0128666265,
-0.012404604,
-0.019502949,
0.030549487,
0.0054392647,
-0.025957264,
0.024291182,
-0.02198107,
0.0009301703,
0.004739231,
-0.018914921,
-0.022443093,
0.007987389,
0.005355261,
0.0225831,
0.016576808,
0.005642275,
-0.0034756693,
0.0020213483,
-0.016058782,
-0.00097479747,
0.020595003,
-0.0011751822,
0.011319551,
-0.0061708004,
-0.036065757,
-0.017402848,
0.02835138,
-0.021589052,
-0.025327234,
-0.0389779,
0.021631053,
0.0124816075,
0.043178104,
0.028239375,
-0.020777011,
0.013125639,
0.032061562,
0.00016713314,
-0.006468315,
0.01047251,
-0.011151543,
-0.025075221,
0.02707732,
-0.026013266,
-0.015862772,
-0.03514171,
-0.01972696,
-0.008162397,
0.016254792,
-0.0103605045,
-0.005505768,
-0.0063773105,
0.022709105,
0.009562465,
0.031109514,
-0.0004079886,
0.029905455,
0.10959733,
0.004000695,
0.023451142,
0.00802239,
0.0004681478,
-0.014868724,
-0.016786817,
0.003181655,
-0.020104978,
-0.008841431,
0.00064403133,
0.044074144,
0.020763012,
-0.022219082,
-0.0053097587,
0.007861382,
-0.008169398,
0.013636664,
0.0075953696,
-0.0075253663,
0.032649588,
0.008575417,
0.0043612123,
0.022471095,
-0.050794475,
-0.011053538,
-0.008162397,
0.013846674,
-0.00031545287,
0.044858184,
-0.01932094,
0.033713643,
-0.019698959,
0.018760914,
0.01580677,
0.0128666265,
-0.05295058,
0.029289426,
0.022149079,
-0.0135736605,
0.015736766,
-0.015092735,
-0.009793477,
-0.029009413,
-0.016492803,
-0.040125955,
-0.0010999285,
-0.019026926,
-0.004588723,
-0.008582418,
-0.00016768005,
0.010822527,
-0.023899164,
0.0032936605,
0.0430941,
0.024207179,
0.021029023,
0.043234106,
0.040601976,
-0.03015747,
0.03301361,
0.006923337,
-0.026125273,
0.008281403,
0.002486871,
-0.03141753,
-0.021561049,
-0.023353137,
0.0052432553,
0.008155397,
-0.012852626,
0.01932094,
-0.013783671,
-0.042618074,
-0.0030486484,
0.008456412,
0.017682862,
-0.015078735,
-0.011851577,
0.019418946,
-0.040993996,
0.0045292205,
0.009625468,
0.025201228,
-0.03945392,
0.012341601,
0.026573293,
-0.0054742666,
-0.01458871,
0.03878189,
-0.044494167,
-0.014266695,
0.00078010047,
-0.022219082,
-0.0047637317,
0.0041022,
-0.0058837864,
-0.021393042,
-0.0015978278,
0.016156787,
0.010500511,
0.018396895,
-0.0030171468,
0.014329698,
0.031137517,
0.010647519,
-0.027973361,
0.039201908,
0.009849479,
0.024347186,
0.031921554,
-0.022849113,
0.02564925,
-0.01892892,
0.00062740553,
0.01724884,
0.0069933403,
0.015134737,
-0.008190399,
-0.009667471,
0.017906873,
0.017122833,
-0.0034441678,
-0.034889698,
0.007742377,
-0.022107076,
-0.0003841437,
0.0061287982,
-0.032537583,
0.0063213077,
0.039481923,
0.009408458,
-0.0045852233,
-0.0053727617,
0.01909693,
0.01703883,
0.010486511,
-0.013258645,
-0.012341601,
0.016128786,
0.006093797,
0.020987023,
-0.011319551,
-0.009478462,
0.018606907,
-0.0072523532,
0.007623371,
0.016688813,
-0.010339503,
0.00072059757,
-0.016940825,
-0.031669542,
0.015960777,
-0.003881689,
0.040937994,
-0.017640859,
0.011977583,
0.00013606912,
-0.01274762,
-0.010206497,
-0.021393042,
-0.0072803544,
-0.041582026,
-0.0048092343,
0.026349284,
0.0021053525,
0.013594662,
0.03620576,
0.018046878,
0.03427367,
0.036457773,
-0.033797644,
0.0073503577,
0.00024151176,
0.008792428,
0.0029313928,
-0.008043392,
0.009219449,
-0.06865934,
-0.018172884,
0.005299258,
-0.008092394,
-0.021939069,
0.025621247,
0.009128445,
-0.03864188,
0.021393042,
-0.03102551,
0.0067728297,
0.018998925,
0.006247804,
-0.03612176,
-0.032117564,
0.018396895,
-0.012061588,
-0.009555466,
-0.018508902,
-0.04236606,
-0.003958693,
0.028365381,
-0.0041127005,
0.008575417,
0.0021823563,
0.0018463399,
0.030101465,
0.079747885,
-0.036681786,
-0.001602203,
-0.01829889,
-0.0025411237,
0.025383236,
-0.008848431,
0.014952728,
0.008330406,
0.042254057,
-0.0246692,
-0.00657332,
-0.0013668166,
0.012754621,
0.011781573,
-0.008120395,
0.020188984,
0.011116541,
-0.04065798,
-0.044074144,
-0.008512414,
0.0151487375,
0.0037941847,
-0.013930678,
-0.011865578,
-0.06020293,
-0.029037414,
-0.023129126,
0.0058172834,
-0.00029729572,
-0.020777011,
-0.031865552,
0.013874675,
0.03060549,
-0.0022033572,
-0.0073853596,
-0.026573293,
0.0006099047,
0.06401112,
-0.0024781206,
0.012446606,
0.0059082876,
0.029653443,
-0.022513095,
-0.018564904,
-0.005789282,
0.0095904665,
-0.008988437,
-0.034021657,
-0.037213814,
0.007150848,
0.0011384304,
-0.014294696,
-0.0184809,
-0.007434362,
-0.03679379,
0.017416848,
0.03945392,
-0.0027913859,
0.009394458,
-0.020244986,
0.016534805,
0.0022086075,
-0.012684617,
0.011991584,
-0.009373456,
-0.029037414,
-0.014532708,
-0.018970923,
0.009625468,
0.012026586,
0.015078735,
-0.01622679,
-0.009422459,
-0.05264256,
0.010661519,
0.008967437,
-0.0061427993,
0.020300988,
-0.0080783935,
-0.014462704,
0.0072523532,
-0.0074833645,
0.011487559,
-0.015932776,
0.012005584,
-0.025313232,
-0.04270208,
-0.009359456,
-0.02237309,
0.025607247,
0.016688813,
-0.04048997,
-0.027763352,
-0.0097164735,
-0.029261425,
0.023871163,
-0.00045589719,
-0.020735009,
-0.00067290774,
-0.004784733,
-0.002957644,
0.023661152,
-0.004350712,
0.048582364,
-0.056450747,
0.0021911068,
-0.00016253916,
-0.02360515,
0.015666762,
0.015582759,
-0.044326156,
0.009961485,
0.005155751,
0.026363283,
-0.0064228126,
0.020721009,
-0.019362943,
0.015470753,
0.016688813,
-0.01727684,
0.03514171,
-0.007742377,
0.018802915,
0.02360515,
-0.0040776986,
-0.011081539,
0.023717154,
0.00039901942,
0.02854739,
0.009499462,
-0.02548124,
0.022009071,
-0.00904444,
-0.05569471,
-0.021225033,
0.023591148,
-0.015708765,
-0.01806088,
-0.014532708,
0.00013595975,
-0.011627566,
-0.045642223,
0.0010981784,
-0.004063698,
0.0063213077,
0.008295404,
0.04295409,
-0.016422799,
-0.01684282,
0.03348963,
0.021799061,
-0.008589419,
0.005687777,
-0.05561071,
-0.013503658,
-0.0052957577,
0.041162003,
-0.007966388,
-0.016520804,
-0.0073223566,
-0.009009439,
-0.015960777,
-0.012019585,
-0.025411237,
-0.007336357,
-0.007644372,
-0.013650665,
-0.0056947772,
-0.012453606,
-0.026461288,
-0.03575774,
-0.012817624,
-0.032845598,
-0.05608673,
0.041162003,
0.018522901,
0.015260743,
0.013188642,
0.032901604,
0.0043682125,
0.005869786,
-0.016926825,
-0.00677983
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 9,
"total_tokens": 9
}
}
headers:
CF-RAY:
- 939c172698e2d766-NRT
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 03 May 2025 01:47:27 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '33284'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '193'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-7c84bdfdfc-tg6kf
x-envoy-upstream-service-time:
- '82'
x-ratelimit-limit-requests:
- '5000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '4999'
x-ratelimit-remaining-tokens:
- '4999987'
x-ratelimit-reset-requests:
- 12ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_3c8398f41e61a12a22b4e7b12b9772e0
status:
code: 200
message: OK
version: 1
test_async_embeddings_with_batch_input.yaml 0000664 0000000 0000000 00000417741 15270700723 0047757 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": [
"This is the first test string for async embeddings",
"This is the second test string for async embeddings",
"This is the third test string for async embeddings"
],
"model": "text-embedding-3-small"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '209'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.00102203,
-0.03870587,
-0.0064009707,
-0.020090546,
-0.018015232,
0.0006766651,
0.048107296,
0.029454468,
0.013952116,
0.0060102865,
0.018965377,
-0.03618049,
-0.00659475,
-0.047907267,
-0.028029252,
0.0143771805,
-0.022240873,
-0.003856835,
-0.009220148,
-0.0035942951,
-0.00092435896,
-0.03533036,
-0.003381763,
0.05050766,
0.015202305,
-0.036955606,
-0.0030395235,
0.04015609,
0.016602518,
-0.024378696,
-0.020215565,
-0.04628202,
0.022990987,
-0.043356575,
0.008395024,
0.07651161,
-0.008920102,
0.0092263995,
-0.045156848,
-0.01655251,
0.0004289713,
-0.027729206,
-0.017627673,
0.0023081626,
-0.012633166,
0.041206248,
-0.016827552,
0.016865058,
0.015839903,
0.013864603,
-0.06641007,
-0.01127046,
-0.0022456532,
0.050882716,
-0.032129873,
-0.012789439,
-0.009395175,
0.03718064,
-0.02247841,
-0.0031301621,
0.050007585,
-0.017052587,
-0.039255954,
-0.028329296,
0.0042037624,
0.0073698675,
-0.01852781,
0.034905292,
0.0062196935,
0.030904686,
0.05155782,
-0.0003662665,
-0.021940827,
0.00797621,
-0.020403095,
-0.004372538,
0.003672432,
0.008926353,
-0.0040974966,
-0.039355967,
-0.031079713,
0.017452646,
-0.03475527,
-0.03765571,
-0.022190865,
0.014727234,
-0.0665601,
-0.010182794,
-0.0017721438,
0.012551904,
-0.035380367,
-0.0665601,
-0.047957275,
-0.032679956,
0.02827929,
0.008094978,
-0.024416203,
-0.048757393,
-0.023166014,
0.0028238657,
0.007994963,
0.034730267,
-0.034305204,
0.0053039296,
-0.0059008948,
-0.031179728,
0.0045944466,
-0.020678136,
-0.03700561,
-0.022453405,
-0.063259594,
-0.011751782,
-0.014552207,
0.0016627521,
0.048557363,
-0.0031582916,
-0.0171401,
-0.0048163556,
-0.011570505,
-0.03338006,
-0.013014474,
-0.00392247,
0.046857107,
0.009413928,
-0.04470678,
-0.058008797,
-0.03520534,
-0.066660106,
-0.0692105,
0.014764739,
0.020015536,
-0.026353996,
0.039556,
0.046857107,
-0.0639597,
-0.0063665905,
-0.07441129,
0.021715794,
-0.0024910027,
0.0063540884,
-0.0191154,
-0.069060475,
0.01463972,
-0.011776786,
-0.020053042,
-0.029004399,
-0.025828917,
0.032955,
-0.00014084167,
0.00074112805,
-0.036780577,
-0.034105174,
-0.042556453,
0.059709057,
-0.0046163253,
-0.027654193,
-0.030979699,
-0.022528417,
0.012183098,
0.0036005462,
-0.014164648,
0.0048163556,
0.027529174,
-0.010845395,
-0.009482688,
0.010551601,
0.013689576,
-0.015102291,
-0.024091154,
-0.06646008,
0.0004395198,
-0.039505992,
-0.06716019,
-0.006172811,
-0.016039932,
-0.004628827,
0.024041146,
-0.059459016,
-0.0006958087,
0.0035849188,
0.026454013,
0.045256864,
0.026429009,
-0.00995151,
-0.045681927,
0.049632527,
0.02135324,
0.049882565,
0.009926505,
-0.0026394627,
0.010082779,
0.03290499,
0.059258986,
-0.023866119,
0.026954088,
-0.019465452,
0.041156244,
-0.010095281,
0.034505233,
-0.018102745,
0.017440146,
0.044081684,
-0.012389379,
0.0027191625,
0.027604187,
-0.02116571,
-0.01754016,
-0.04160631,
-0.014789743,
0.02071564,
0.044931814,
0.00071807764,
-0.017465148,
-0.012064329,
-0.03970602,
0.009551449,
-0.019915521,
0.019440448,
0.036255497,
-0.041881353,
-0.016252466,
0.03543037,
0.04713215,
0.037930753,
0.0016705658,
-0.0055164616,
-0.012826946,
0.0049882564,
0.010214049,
-0.022778455,
0.001443969,
-0.03355509,
-0.008457533,
-0.03040461,
0.019002883,
-0.001310355,
-0.0008649749,
0.014864754,
-0.023353541,
0.016014928,
-0.035830434,
-0.052207917,
0.015314823,
-0.0008704445,
0.02182831,
0.01997803,
-0.009263905,
-0.033080015,
0.04648205,
-0.012495645,
-0.014002124,
0.040906202,
-0.007907449,
0.013402033,
-0.036930602,
0.004444424,
-0.030604642,
0.039931055,
0.015877407,
0.012076831,
0.0070448183,
0.05155782,
-0.017890213,
0.034780275,
0.0070448183,
-0.04213139,
0.017677682,
-0.0037880745,
0.013439538,
-0.03600546,
-0.017990228,
-0.01134547,
0.052057896,
-0.02815427,
-0.052908026,
0.019552965,
-0.030829675,
-0.019140404,
-0.013339523,
0.025528872,
-0.01985301,
-0.044356726,
-0.0016861933,
0.014052131,
-0.0092326505,
0.01207058,
0.031879835,
-0.044931814,
-0.002014368,
-0.0056602336,
-0.007969959,
-0.039781034,
0.05465829,
0.019627977,
0.011970566,
0.0071510845,
0.044281717,
-0.008251252,
0.019702988,
-0.002211273,
0.0421814,
-0.046257015,
0.03770572,
0.032529935,
-0.018765345,
0.05400819,
-0.027254133,
0.027579183,
0.034330208,
0.010070277,
-0.004531937,
0.007669913,
-0.029604489,
0.015139796,
-0.05690863,
0.025628887,
0.03660555,
-0.014452192,
0.030829675,
-0.045306873,
-0.02782922,
-0.02287847,
-0.0010861022,
-0.034355212,
0.0019159155,
-0.017465148,
0.012289364,
-0.04193136,
0.012789439,
0.03210487,
-0.020415597,
0.008463783,
0.041256256,
-0.018552814,
0.008826339,
-0.018940372,
0.006607252,
-0.04390666,
0.032980002,
0.013239508,
-0.05975906,
-0.0244037,
0.04165632,
-0.0125269,
0.0064509786,
0.04200637,
0.009776482,
0.009438932,
0.046006978,
0.017515156,
0.0054039448,
0.0129519645,
-0.008557548,
-0.010851646,
0.07051069,
-0.08031218,
-0.017202608,
0.0064447275,
-0.021328235,
-0.016239963,
0.03938097,
-0.016102443,
-0.01371458,
0.04998258,
-0.0048101046,
-0.0494575,
0.0020503108,
0.04405668,
-0.013339523,
-0.03205486,
-0.012295615,
0.033880137,
0.023728598,
0.0026988469,
-0.019990532,
0.024916278,
-0.033480078,
0.024628736,
0.05445826,
0.045331877,
0.029029403,
-0.04333157,
-0.053208068,
-0.050632678,
-0.017027583,
-0.0004465521,
-0.03455524,
-0.009620209,
0.0053508114,
-0.0003824799,
0.00810748,
-0.0120955845,
-0.013239508,
0.0021065695,
0.016765043,
0.045506902,
0.03568041,
-0.005425823,
0.020078044,
-0.024053648,
0.022715945,
-0.044406734,
-0.019240418,
0.0060759215,
0.010532848,
0.01819026,
0.015539857,
0.0019893642,
0.033455074,
0.0136645725,
0.013827097,
0.017752692,
0.032079864,
-0.031304747,
-0.006844788,
0.03565541,
0.019152904,
-0.047882263,
0.007076073,
0.074461296,
-0.05460828,
-0.05760874,
-0.044481747,
-0.0077261715,
0.014614716,
0.032479927,
0.043406583,
-0.0047163405,
-0.0046507055,
-0.042581458,
-0.040831193,
-0.016827552,
0.06290954,
0.023953633,
-0.033730116,
-0.04443174,
0.004569443,
0.04095621,
-0.040506143,
-0.003102033,
0.0059040203,
0.02479126,
-0.060109116,
-0.010401578,
0.00031645424,
-0.0019862386,
-0.022978485,
0.0025081928,
-0.009726475,
-0.0029020025,
-0.014002124,
-0.065309905,
0.0052851764,
-0.036055468,
0.00540707,
-0.042406432,
-0.006719769,
0.009488939,
0.057008646,
0.008788832,
-0.0092263995,
-0.05975906,
-0.054958336,
0.02432869,
0.057658743,
-0.007307358,
-0.028179273,
0.016264968,
0.049557514,
-0.017027583,
-0.025216324,
0.038930904,
-0.020428099,
0.03072966,
0.037155636,
-0.010464087,
0.010539099,
-0.01760267,
0.005622728,
-0.017102594,
-0.013889606,
0.0047257165,
-0.041106235,
-0.01345204,
-0.028504323,
0.14012125,
-0.031129722,
-0.029154422,
0.0018784099,
-0.020815657,
-0.024378696,
-0.00016272,
-0.03638052,
-0.013552056,
0.0349553,
-0.020153057,
0.0071573355,
-0.0751614,
0.015039781,
-0.038805887,
-0.0005387536,
0.021153208,
-0.0027707326,
0.021103201,
0.02432869,
-0.0049788803,
-0.01345204,
0.013039477,
-0.00036900127,
-0.011420482,
-0.00071612425,
-0.007532392,
0.0029973297,
-0.0171401,
-0.003963101,
0.011132939,
-0.0191154,
0.039405975,
-0.001443969,
-0.06485984,
-0.0018252769,
-0.017715186,
-0.0012962903,
-0.034180183,
-0.0059571536,
-0.011845547,
-0.0064759823,
-0.045156848,
-0.025753906,
-0.014389683,
-0.008882597,
-0.018365284,
0.035580397,
-0.037155636,
-0.036430527,
-0.007826187,
-0.008332513,
0.011564254,
0.03125474,
-0.002067501,
0.027879229,
0.010589106,
0.04628202,
-0.023291033,
-0.029554483,
0.033680107,
-0.0008266879,
0.037105627,
-0.0029613867,
0.028604338,
0.03052963,
-0.014764739,
0.009851494,
-0.015664876,
0.0036693064,
0.007088575,
0.04378164,
-0.026754057,
0.0011064179,
-0.019090395,
0.031504776,
0.016490001,
0.029554483,
0.036405522,
-0.050157607,
0.03673057,
0.009857745,
0.005135154,
0.03528035,
-0.0077886814,
-0.033155028,
0.00600091,
0.023953633,
0.030454619,
0.013227006,
-0.001651813,
-0.030604642,
0.04860737,
-0.053358093,
-0.028754361,
0.006150933,
-0.006982309,
0.016152449,
0.015539857,
-0.01695257,
0.05038264,
0.012864451,
-0.043806642,
-0.004878865,
0.011326718,
0.055808462,
0.007813685,
0.024553724,
-0.022565922,
0.010039022,
-0.011364223,
0.040731177,
-0.024828766,
-0.01985301,
0.012126839,
0.011989319,
0.01568988,
0.0066635106,
0.0076074037,
0.048207313,
0.021190714,
-0.025103807,
0.013314519,
0.0468071,
0.00040943708,
-0.017915217,
-0.015002275,
0.0029660747,
-0.018740343,
-0.00048249506,
-0.009026369,
-0.005750872,
0.009126384,
0.008951358,
-0.007888696,
0.015939917,
-0.04978255,
0.00629783,
0.018215263,
-0.02070314,
0.016277468,
-0.0060384157,
-0.013677075,
0.013277014,
0.020453101,
-0.008213745,
0.010926657,
-0.0025691397,
-0.034980305,
-0.02980452,
-0.016777545,
-0.010039022,
0.026754057,
0.013227006,
-0.030154573,
-0.0027144742,
-0.01272693,
0.02082816,
-0.0034255194,
-0.027204126,
-0.022328386,
0.011501744,
-0.0026066452,
-0.0061478075,
0.004641329,
0.018465301,
-0.018202761,
0.026353996,
-0.00890135,
0.01832778,
-0.045456894,
-0.01707759,
-0.0042881505,
-0.015039781,
-0.020215565,
0.020890668,
0.0151648,
-0.008463783,
0.009188893,
-0.00016838491,
0.053058047,
-0.038805887,
0.024166165,
-0.00280355,
-0.016677529,
0.018040236,
0.022865968,
0.04048114,
-0.012914458,
0.01872784,
-0.055558424,
-0.036580548,
-0.015127294,
0.023841117,
-0.0028082384,
0.0024394325,
0.009238902,
0.0010509406,
-0.041906357,
0.039606005,
-0.0064759823,
0.062009405,
0.0028598087,
-0.0050945226,
-0.025728902,
-0.04273148,
-0.05260798,
0.017265119,
0.01819026,
0.0060977996,
0.031729814,
0.011220451,
0.017727688,
-0.024566226,
0.04538188,
0.004919496,
0.016602518,
0.010039022,
-0.025903929,
-0.0045006825,
-0.008001214,
0.020003034,
0.01542734,
0.030679652,
0.009838992,
-0.010951661,
-0.057458714,
0.00909513,
0.028229281,
-0.0016908814,
-0.015839903,
0.006632256,
0.0019768623,
-0.0415313,
-0.048257317,
-0.034655254,
0.0041287513,
0.005860264,
-0.013702078,
-0.0087950835,
-0.07721171,
-0.0047444697,
0.0108016385,
-0.0052914275,
0.012289364,
0.0025925806,
0.031729814,
-0.030354604,
0.0069260504,
-0.041756332,
-0.009588954,
0.0044006673,
-0.024778757,
-0.03145477,
0.002156577,
0.015027279,
0.014302169,
0.009863996,
0.015477347,
-0.040856197,
0.042556453,
0.019865513,
-0.0014095887,
0.019803002,
-0.01859032,
-0.033830132,
0.008882597,
-0.015314823,
0.014539705,
-0.045506902,
-0.012508147,
0.022265878,
-0.0145272035,
-0.0024566227,
0.005963404,
0.0025691397,
-0.021215718,
-0.012295615,
0.042931512,
0.009182642,
0.0009915567,
-0.005222667,
-0.008482536,
0.035305355,
0.022178363,
-0.003137976,
-0.03638052,
0.0038693368,
0.010120285,
0.03553039,
-0.0066572595,
-0.020990683,
0.03355509,
-0.034530237,
0.015339826,
-0.022040842,
-0.006138431,
0.0027551053,
-0.02030308,
-0.010832893,
-0.031729814,
-0.019652981,
0.022315884,
-0.00044108252,
-0.0448568,
-0.053308085,
0.009876498,
0.019227916,
-0.013114489,
-0.0050788955,
-0.008601304,
-0.052407946,
-0.071510844,
-0.032604944,
0.004181884,
-0.023991138,
-0.008113731,
-0.0019393567,
-0.00086966314,
0.03673057,
0.0002406615,
0.01628997,
0.05215791,
-0.029554483,
-0.023553573,
-0.012208101,
0.0316548,
-0.036880594,
0.031929843,
-0.035555393,
-0.0020878166,
-0.021028189,
-0.022315884,
0.02551637,
0.039881047,
0.02189082,
-0.027404156,
-0.009326414,
0.0065509933,
0.0066510085,
-0.00968897,
-0.02269094,
-0.019690486,
-0.01774019,
0.019615475,
-0.0055289636,
-0.0047507207,
-0.004000607,
0.011889303,
-0.015377332,
0.023616081,
-0.031879835,
0.0008477848,
-0.034105174,
0.006157184,
-0.013126991,
0.05043265,
0.019502958,
0.018702837,
0.034505233,
0.0019237292,
-0.04848235,
0.017227612,
0.019928021,
0.016640024,
-0.018615324,
-0.011970566,
0.01740264,
-0.012414383,
0.011864299,
0.023153512,
0.028104262,
-0.021803306,
0.026729053,
-0.0030223334,
0.023753602,
0.015289819,
0.008782582,
-0.02030308,
0.045356877,
0.0106641175,
-0.030804671,
0.020178061,
-0.018815354,
0.032279894,
0.010101532,
-0.011770535,
0.011876801,
0.007351115,
0.05975906,
0.010420331,
0.02321602,
0.03528035,
0.020890668,
0.045156848,
0.026379,
-0.010007768,
0.0053445604,
-0.031354755,
-0.04410669,
-0.038930904,
0.026278986,
0.030804671,
-0.018902866,
-3.8555652e-05,
-0.00042154832,
0.0096514635,
-0.013677075,
0.0031504778,
-0.017452646,
0.028754361,
-0.016277468,
0.014839751,
-0.0051132753,
-0.027879229,
0.010757881,
-0.019602973,
-0.01443969,
0.013464542,
0.053208068,
0.00962646,
-0.029179426,
-0.009201395,
0.025753906,
0.00745113,
-0.0303296,
-0.032529935,
0.019127902,
0.015864907,
0.0382308,
-0.0023550447,
0.0090888785,
-0.029454468,
0.028654346,
-0.0013087923,
-0.013389531,
-0.041056227,
-0.009588954,
-0.011076679,
-0.01595242,
-0.016502503,
0.012476892,
0.008257503,
0.022303382,
0.018540312,
-0.061359305,
0.0048694885,
-0.006185313,
-0.0057414956,
0.002697284,
-0.04080619,
0.011676771,
0.012189348,
-0.03790575,
-0.0049351235,
-0.022103352,
-0.029504474,
0.0092326505,
-0.013026976,
0.030354604,
-0.008138734,
0.0030410863,
0.017877711,
0.0178027,
-0.0356054,
0.030354604,
0.021403246,
-0.03790575,
-0.016915066,
-0.012370626,
-0.025091305,
0.0005832916,
-0.007219845,
0.004181884,
0.0015244499,
0.007719921,
0.035830434,
0.0047632223,
-0.038455833,
0.021940827,
-0.020290578,
-0.016252466,
-0.014327173,
0.016377484,
0.017827705,
0.02380361,
0.020628128,
0.015464845,
0.036430527,
-0.0068322862,
0.026929084,
0.017440146,
0.040931206,
0.015139796,
-0.0250538,
-0.004331907,
-0.001250971,
0.018740343,
-0.021278227,
-0.010032771,
-0.028379304,
0.007088575,
0.0051445304,
0.041556302,
-0.01463972,
0.008788832,
-0.010832893,
-0.033055015,
0.028904384,
-0.014477195,
-0.009451433,
-0.0069197994,
0.048507355,
-0.0342802,
0.0089388555,
-0.0017252617,
0.004997633,
-0.019752996,
0.013589561,
0.008957609,
-0.010832893,
-0.018977879,
-0.018165255,
-0.021390744,
0.029779516,
0.014589713,
-0.012826946,
0.004510059,
-0.039480988,
-0.017977726,
-0.019940523,
-0.012170596,
-0.03923095,
0.035755422,
-0.018690335,
-0.009051372,
-0.027004095,
0.030479623,
0.0002170251,
0.00095092546,
-0.00095092546,
0.0040349867,
-0.02855433,
0.0049413745,
0.032154877,
-0.0032754967,
0.017427644,
-0.007826187,
-0.015552359,
-0.011051676,
0.0421814,
0.014302169,
-0.0029504474,
0.00850754,
-0.023303535,
-0.02202834,
-0.0054945834,
-0.019702988,
0.021978334,
0.016464997,
-0.010870399,
0.015852405,
-0.00890135,
0.005103899,
0.027479168,
-0.02340355,
0.01463972,
0.00823875,
0.008182491,
0.008663814,
0.017090091,
0.01113919,
0.027629191,
0.024953784,
0.008970111,
-0.026053952,
-0.002001866,
-0.002222212,
0.0034067666,
0.00046061672,
-0.0056164768,
0.005478956,
0.020353086,
0.0014697541,
0.047882263,
0.0062665753,
-0.0090826275,
-0.006969807,
0.01062036,
-0.009782733,
0.022440903,
-0.0037880745,
-0.028604338,
-0.03152978,
-0.0050413897,
-0.010389076,
-0.013702078,
-0.013101987,
-0.02254092,
0.021965832,
-0.0031145348,
-0.0058196327,
0.0058915187,
0.020215565,
-0.009326414,
-0.03975603,
-0.040006068,
0.017302625,
0.0038599605,
-0.0053508114,
0.026954088,
-0.015102291,
-0.028029252,
0.01892787,
-0.0061884387,
-0.04338158,
0.011414231,
-0.0035067818,
0.029579487,
-0.0033661355,
0.032604944,
-0.0171401,
-0.002953573,
0.004003732,
0.018477803,
-0.008126233,
0.0073761186,
0.007313609,
-0.012964467,
-0.017440146,
-0.03137976,
0.017327627,
-0.040781185,
-0.03858085,
-0.03152978,
0.0342802,
0.026328994,
0.019090395,
0.010720376,
-0.017090091,
-0.0051976633,
0.048632376,
0.024916278,
-0.0049726292,
0.01595242,
0.0068322862,
-0.0038162037,
0.005810256,
-0.0283543,
-0.005432074,
-0.040256105,
0.013101987,
0.0024503716,
0.0045350627,
-0.025466362,
0.027054103,
-0.0019643605,
0.02169079,
0.010101532,
0.006100925,
0.011858049,
0.033205036,
0.06250948,
0.00771367,
-0.007232347,
0.0027379151,
0.01814025,
-0.028579334,
-0.024416203,
0.013589561,
-0.023065997,
-0.02004054,
0.0025910179,
0.029779516,
0.017702686,
-0.0002750417,
-0.00032075177,
0.0039787283,
0.00045553784,
0.015114793,
0.006225944,
-0.0061540585,
-0.0047569713,
0.04095621,
-0.0019924897,
0.014414686,
-0.060159124,
-0.005769625,
-0.019552965,
0.011101684,
0.03895591,
0.024191169,
-0.012939462,
0.050607674,
-0.029779516,
-0.0032661203,
0.0015080412,
0.014139645,
-0.062359456,
0.005841511,
0.009920254,
-0.00073643983,
-0.013039477,
-0.0069197994,
-0.0037380669,
-0.010345319,
-0.0051257773,
-0.033655103,
0.008395024,
-0.00863881,
0.008144985,
-0.01852781,
0.00063447125,
0.010001517,
-0.019690486,
0.015002275,
0.03040461,
-0.015739888,
0.015564861,
0.022065846,
0.044681776,
-0.030354604,
0.017165104,
0.009970262,
-0.021253223,
0.0080762245,
0.009407677,
-0.029704506,
-0.02097818,
-0.005432074,
-0.0033505082,
0.049282473,
-0.020065542,
0.025128812,
-0.030104566,
-0.026253982,
0.009976513,
0.0074698827,
0.001363488,
-0.010095281,
-0.026253982,
0.029004399,
-0.023828615,
0.0006942459,
0.018215263,
0.021190714,
0.00035024842,
0.007932453,
-0.010757881,
-0.0071885902,
0.0133770285,
0.029179426,
-0.028529327,
-0.02880437,
0.0042568957,
-0.02221587,
-0.000244373,
-0.0047913515,
0.0025285084,
-0.023591077,
0.004016234,
-0.0067947805,
0.01964048,
0.03290499,
-0.011220451,
0.0224284,
0.013126991,
0.018777847,
-0.05790878,
0.034930296,
-0.0027222878,
0.05215791,
0.015677378,
-0.021990836,
0.026078954,
-0.020553118,
-0.010526597,
0.0013978683,
0.0036693064,
-0.0011947125,
-0.0046444545,
-0.026629038,
0.0061353054,
0.0015603929,
0.017152602,
-0.020428099,
-0.008313761,
-0.055358395,
-0.006500986,
0.010239053,
-0.028379304,
-0.0076386584,
0.028179273,
-0.005907146,
-0.011095433,
0.0063665905,
0.06410972,
-0.016114945,
0.017002579,
-0.021378241,
0.006469731,
0.015964922,
0.017827705,
0.012314368,
-0.0051914123,
0.0037411924,
0.041381277,
0.002798862,
0.015214807,
0.010507843,
-0.047307175,
0.012739432,
0.0073011075,
-0.0349553,
0.01173928,
-0.015127294,
0.033505082,
0.0044944314,
0.0044475496,
-6.95418e-05,
-0.0066572595,
-0.019290425,
-0.010239053,
-0.0032098617,
-0.05550842,
-0.00520704,
0.0244037,
-0.00093842356,
0.00336301,
0.0037005611,
-0.0021518888,
0.03488029,
0.031554785,
-0.016302472,
-0.012695676,
0.0077449246,
-0.0023316036,
-0.011889303,
0.012151843,
0.0126644205,
-0.05480831,
-0.024953784,
-0.001238469,
-0.025303837,
-0.007132332,
0.0283543,
-0.0054226974,
-0.0044850553,
0.009307662,
-0.015727386,
0.004306903,
0.008301259,
-0.01595242,
-0.026529023,
-0.038880896,
-0.007951206,
-0.023378545,
-0.024828766,
-0.046106994,
-0.056158517,
0.0080762245,
0.014289667,
-0.00033071422,
-0.019665483,
0.040306114,
-0.0105203455,
0.01365207,
0.057658743,
-0.02670405,
-0.0029863904,
-0.004272523,
-0.008757578,
0.03040461,
-0.00040513958,
0.010432832,
-0.004000607,
0.037430678,
-0.018465301,
-0.015814899,
-0.0042287665,
-0.012289364,
0.018465301,
0.01048909,
-0.0028738733,
0.025403854,
-0.025328841,
-0.030754665,
0.002686345,
0.012764436,
0.005650857,
-0.012670672,
-0.006072796,
-0.055308387,
-0.030654648,
-0.014927264,
-0.0059571536,
0.0032879987,
-0.0073761186,
-0.008207494,
0.027204126,
0.029229432,
-0.014427188,
-0.011951813,
-0.00043834772,
-0.0006270482,
0.06435976,
-0.014402185,
0.017490152,
-0.0015650811,
0.02519132,
-0.005728994,
0.010026521,
0.01200182,
0.056958638,
-0.0015978985,
-0.00982024,
-0.025578879,
0.0055227126,
-0.0068822936,
0.0055445908,
-0.009526445,
-0.018340282,
-0.025416354,
0.0087950835,
0.038005766,
-0.0010235928,
0.0036286754,
-0.03217988,
0.031479776,
0.008913852,
-0.023841117,
0.022365892,
0.017827705,
-0.013352025,
-0.025728902,
-0.0043819146,
-0.018227765,
0.011076679,
0.013477044,
-0.014414686,
-0.009370171,
-0.033080015,
-0.0030379607,
-0.0053195567,
0.0054570776,
0.007176088,
0.017965226,
-0.0038068274,
-0.001280663,
-0.011120437,
-0.009370171,
-0.033180032,
-0.0069260504,
-0.019440448,
-0.0421814,
0.0029879531,
-0.007994963,
0.014977272,
0.012733181,
0.0077386736,
-0.032204885,
-0.010157791,
-0.024366196,
0.014402185,
0.0046069487,
-0.020453101,
-0.010645364,
0.014064633,
-0.016852556,
0.018227765,
0.0050413897,
0.029604489,
-0.042956516,
-0.0021581398,
-0.0053695645,
-0.0150897885,
0.008445031,
0.002294098,
-0.026353996,
0.02735415,
-0.009788984,
0.009582703,
-0.025441358,
0.032529935,
0.0015846153,
0.033055015,
-0.0035442875,
-0.009751479,
0.036030464,
-0.0106578665,
0.015939917,
0.043731634,
-0.015714884,
-0.01826527,
0.011039174,
-0.008601304,
0.044406734,
-0.00026957213,
-0.0071885902,
0.0032286146,
0.027904231,
-0.048507355,
-0.013339523,
0.014864754,
0.00078683806,
0.00062900165,
-0.0012204977,
0.0010360946,
0.008695069,
-0.017102594,
-0.0035630404,
-0.02354107,
0.005141405,
0.01774019,
0.04495682,
-0.0031285994,
-0.01937794,
0.022490911,
0.033205036,
0.006982309,
0.018877864,
-0.047682233,
-0.023516066,
-0.011151691,
0.041381277,
-0.005810256,
-0.043606613,
-0.016715035,
-0.011570505,
-0.0013814595,
0.0031661051,
-0.033605095,
-0.03738067,
0.02202834,
1.6335485e-05,
-0.007807434,
-0.009601456,
-0.031104717,
-0.048057288,
-0.026103958,
-0.029104413,
-0.05550842,
0.01971549,
0.0021159458,
-0.013752086,
0.009326414,
0.014914762,
0.0031504778,
0.01002027,
-0.020353086,
-0.017977726
]
},
{
"object": "embedding",
"index": 1,
"embedding": [
0.0016487965,
-0.034404144,
-0.0073315105,
-0.038644362,
-0.01656731,
0.013063419,
0.03709554,
0.028488155,
0.014510678,
0.00030825668,
0.0036752766,
-0.039761543,
-0.016021414,
-0.028945185,
-0.039837714,
0.016706958,
-0.014840755,
-0.0061318087,
-0.013533143,
-0.0022502341,
-0.020947173,
-0.037933428,
0.002612049,
0.064238,
0.006811005,
-0.03422641,
-0.0093690995,
0.039786935,
0.01678313,
-0.022077052,
-0.01852238,
-0.04405254,
0.027091678,
-0.035242032,
0.0027977172,
0.071550466,
0.002629505,
0.015729424,
-0.035191253,
-0.002869128,
0.01273969,
-0.036435388,
-0.02625379,
0.0005324073,
0.0027881956,
0.033921726,
-0.009934038,
0.012155708,
0.018763589,
0.0025485728,
-0.060023174,
-0.014510678,
-0.0038879223,
0.04600761,
-0.025403209,
-0.0026326787,
-0.011895455,
0.038390454,
-0.018458903,
-0.02922448,
0.051111102,
-0.023054587,
-0.03704476,
-0.026076056,
-0.0031674665,
0.009165975,
-0.019779209,
0.045322064,
-0.004179913,
0.019474523,
0.051593523,
0.00618259,
-0.03120494,
0.009077108,
-0.007636197,
0.006811005,
0.014396421,
0.0050558858,
0.019525304,
-0.029529167,
-0.043290824,
0.018738199,
-0.040853336,
-0.025390513,
-0.024501845,
0.010968702,
-0.067487985,
-0.0113749495,
-0.008131312,
0.0009513508,
-0.036460776,
-0.051796645,
-0.041361146,
-0.03597836,
0.023702044,
0.01937296,
-0.018382732,
-0.05489429,
-0.028081907,
0.012676214,
0.01859855,
0.020883696,
-0.03275376,
0.019246008,
0.00484324,
-0.021696193,
0.0144091165,
-0.015932547,
-0.03915217,
-0.034531098,
-0.06830048,
-0.0065761427,
-0.0060397685,
0.01750676,
0.06901141,
-0.009711871,
0.000213439,
0.0027739136,
-0.012657171,
-0.028970575,
-0.014193296,
-0.022394432,
0.052710705,
0.016605396,
-0.038644362,
-0.053320076,
-0.04349395,
-0.073886395,
-0.06489815,
0.022953024,
0.020236239,
-0.019779209,
0.03620687,
0.050857197,
-0.061241917,
-0.0036943196,
-0.08013246,
0.016288014,
-0.0029326042,
-0.004271954,
-0.015742118,
-0.069062196,
0.009737262,
-0.012314399,
-0.019322181,
-0.020642487,
-0.020299716,
0.036740072,
-0.0005189186,
0.007223601,
-0.04996853,
-0.01862394,
-0.059109114,
0.056265377,
-0.03965998,
-0.025999885,
-0.03717171,
-0.005138405,
0.01214936,
0.0070585627,
-0.021683497,
-0.0019487218,
0.029630728,
-0.014523374,
0.0053510508,
0.011311473,
0.024870008,
-0.00805514,
-0.037933428,
-0.07469889,
0.0036974933,
-0.031001816,
-0.07058562,
-0.0048591094,
-0.005668432,
-0.0061921114,
0.013241152,
-0.057839587,
-0.013012638,
0.016211843,
0.016516529,
0.019322181,
0.035242032,
-0.005509741,
-0.03508969,
0.04506816,
0.013926696,
0.038949046,
0.021683497,
0.01089253,
0.02269912,
0.032296732,
0.07789809,
-0.018001873,
0.016351491,
-0.025733285,
0.029630728,
-0.01565325,
0.030620959,
-0.020528229,
0.017709883,
0.021175688,
0.010391068,
-0.0040561343,
0.03656234,
-0.009032675,
-0.01249848,
-0.04364629,
-0.0005070168,
0.03153502,
0.04593144,
0.020071201,
-0.017760664,
-0.00901998,
-0.03755257,
0.01734172,
-0.027447145,
0.0104101105,
0.030747911,
-0.044814255,
-0.011565379,
0.036283042,
0.04009162,
0.03018932,
-0.007877407,
0.000717282,
-0.015881766,
0.01787492,
0.01153364,
-0.033286963,
0.011013135,
-0.024082901,
-0.018154217,
-0.044331837,
0.028056517,
-0.011463816,
-0.0058810776,
0.02231826,
-0.031433456,
-0.0019201576,
-0.022394432,
-0.040269352,
0.021645412,
-0.0022454734,
0.010822706,
0.011209912,
-0.0039831367,
-0.039076,
0.062613,
-0.03417563,
-0.018560465,
0.033490088,
0.009216757,
0.004065656,
-0.0420213,
-0.0113686025,
-0.018852456,
0.044738084,
0.010397415,
0.007185515,
0.006211154,
0.040294744,
-0.018268473,
0.03529281,
-0.0064428425,
-0.047404088,
0.024438368,
-0.0059826397,
0.019411048,
-0.057991933,
-0.032245953,
-0.013875916,
0.044255663,
-0.009248494,
-0.060530983,
0.013939392,
-0.040777165,
-0.006950653,
-0.009788043,
0.028869014,
-0.014015563,
-0.050171655,
-0.007325163,
0.012733342,
0.008848594,
0.0074330727,
0.021086821,
-0.035394374,
0.025327036,
-0.0068363957,
0.0033071144,
-0.045702923,
0.04070099,
0.020782135,
-0.011927194,
0.0026263313,
0.046286907,
-0.01432025,
0.014142516,
-0.013609315,
0.036359213,
-0.04260528,
0.025225475,
0.030747911,
-0.023994034,
0.03272837,
-0.02823425,
0.035927575,
0.027878784,
0.013545839,
-0.0022073877,
-0.0010394241,
-0.038390454,
0.024044815,
-0.052050553,
0.015564385,
0.026939334,
-0.02349892,
0.027675658,
-0.057839587,
0.00055422727,
-0.0049606715,
0.0016051565,
-0.030443225,
0.009337361,
-0.004538554,
0.0041767396,
-0.035851404,
0.019385656,
0.038238112,
-0.021150297,
0.00856295,
0.040853336,
-0.016694263,
0.0065634474,
-0.014663021,
0.0026755254,
-0.03448032,
0.020782135,
0.0053986576,
-0.06682783,
-0.021683497,
0.0380096,
-0.032449074,
0.0038657056,
0.01758293,
0.0051479265,
0.021873927,
0.039177563,
0.014536069,
0.0098896045,
-0.0043925587,
-0.008766075,
-0.01753215,
0.05738256,
-0.07490201,
-0.0038847486,
-0.0013821961,
-0.0029786245,
-0.0117431125,
0.032372903,
-0.00074624305,
-0.015640557,
0.05494507,
-0.00426878,
-0.0355975,
-0.025568247,
0.047810335,
-0.010568801,
-0.034988128,
-0.024654187,
0.042960748,
0.015589775,
0.026025277,
-0.0256952,
0.037349444,
-0.028310422,
0.022127831,
0.049308375,
0.035318203,
0.037730303,
-0.044230275,
-0.053218514,
-0.039888497,
-0.01161616,
0.021099517,
-0.034429535,
-0.0057128654,
0.0026675907,
0.019525304,
0.00056493893,
-0.023295796,
0.0015392998,
-0.0029119744,
0.016453052,
0.041183412,
0.053624764,
0.0023105368,
0.026812382,
-0.009273885,
0.024666883,
-0.054741945,
-0.018700114,
0.0026993288,
0.0063761924,
0.014840755,
0.0069570006,
-0.007845668,
0.049562283,
0.02125186,
-0.00065459916,
0.027447145,
0.038415845,
-0.039177563,
-0.0057128654,
0.04004084,
0.026533086,
-0.03712093,
0.01509466,
0.06880829,
-0.043240044,
-0.04806424,
-0.03846663,
-0.017494064,
0.026101448,
0.0043290826,
0.03912678,
0.0038561842,
-0.0127016045,
-0.030290881,
-0.044788864,
-0.01809074,
0.051314227,
0.0131522855,
-0.035775233,
-0.047784947,
0.016935471,
0.031941265,
-0.036486167,
-0.024870008,
0.0067919623,
0.017913006,
-0.051593523,
-0.011114697,
-0.009235799,
-0.0006077854,
-0.026101448,
0.008766075,
-0.010124467,
-0.0041005677,
-0.029859243,
-0.06535518,
0.00059985084,
-0.026660038,
0.0021597806,
-0.03417563,
-0.018484294,
0.0026945681,
0.058296617,
-0.0017979657,
0.002323232,
-0.070077814,
-0.05012087,
0.0056843013,
0.07292155,
-0.0034277192,
-0.022864157,
0.031433456,
0.042681452,
-0.013063419,
0.0009743609,
0.044433396,
-0.029579947,
0.02074405,
0.032702982,
-0.0020375887,
0.023752825,
-0.021162992,
0.010340286,
-0.008467736,
-0.017494064,
0.015615165,
-0.045575973,
-0.016745044,
-0.035343595,
0.11943697,
-0.0291737,
-0.017671797,
5.63352e-05,
-0.02721863,
-0.018776285,
-0.0033610691,
-0.031357285,
-0.014091735,
0.025796762,
-0.017176682,
0.00730612,
-0.084753536,
0.008683556,
-0.032626808,
-0.0061381566,
0.009826128,
0.0057446035,
0.035267424,
0.04344317,
-0.0038307935,
-0.022978414,
0.01584368,
-0.000121695935,
-0.0071410816,
0.013901306,
-0.011755807,
0.008791465,
-0.023321187,
-0.020629792,
0.010968702,
-0.006109592,
0.035800625,
0.022394432,
-0.058245838,
0.004408428,
-0.017290939,
-0.006620576,
-0.03564828,
-0.005858861,
-0.01273969,
0.001544854,
-0.025200084,
-0.021404203,
-0.027015505,
-0.01910636,
-0.019322181,
0.033033058,
-0.03912678,
-0.027421754,
-0.01565325,
-0.0032230082,
0.015475518,
0.031839702,
-0.00853756,
0.030087758,
0.008061488,
0.03415024,
-0.021823145,
-0.028792841,
0.04265606,
0.006487276,
0.039863106,
-0.0031119247,
0.031966656,
0.033769384,
-0.03356626,
0.028869014,
-0.010219681,
-0.0068617864,
-0.009477009,
0.04539824,
-0.022216698,
-0.008290002,
-0.021201078,
0.031484235,
0.017163986,
0.030824082,
0.033286963,
-0.034581877,
0.03516586,
0.017392501,
0.0032912453,
0.041868955,
0.0066142287,
-0.025263561,
-0.0021153472,
0.020058505,
0.029097527,
0.013126895,
-0.0007851223,
-0.03574984,
0.033388525,
-0.043798637,
-0.029326042,
0.0035134123,
-0.024628798,
0.010936963,
0.02050284,
-0.006046116,
0.04156427,
0.023384662,
-0.05357398,
-0.013660096,
0.011121045,
0.041056458,
0.0021454983,
0.018141521,
-0.010365677,
0.013304628,
-0.017138597,
0.05357398,
-0.022559471,
-0.022673728,
0.010537063,
0.019246008,
0.024171768,
0.0037482744,
-0.00071172783,
0.044001758,
0.018573161,
-0.019601475,
0.016821215,
0.044661913,
0.014002868,
-0.016630786,
-0.026964724,
0.02047745,
-0.00033939976,
0.005773168,
-0.00915328,
-0.010194291,
-0.0019328528,
0.015031184,
-0.017722579,
0.016605396,
-0.034048676,
0.0101879435,
0.0107021015,
-0.023346577,
0.017468672,
0.00081567024,
-0.017367112,
0.0019709386,
0.006899872,
-0.0130761145,
0.014396421,
0.017595626,
-0.03765413,
-0.03755257,
-0.009546833,
-0.016072195,
0.04742948,
0.006014378,
-0.0256952,
-0.013012638,
-0.018116131,
0.026380744,
-0.018370036,
-0.043925587,
-0.030849474,
0.026583867,
0.0069823912,
-0.01407904,
0.004233868,
-0.003926008,
-0.033286963,
0.02250869,
-0.004284649,
0.013914001,
-0.05844896,
-0.02178506,
-0.007375944,
-0.009711871,
-0.030341662,
0.007871059,
0.0074711586,
-0.019626867,
-0.0068871765,
0.007915492,
0.05697631,
-0.035572108,
0.027828002,
-0.0018233563,
-0.0076425443,
0.0192714,
0.026837772,
0.040320136,
-0.0066967476,
0.0047035925,
-0.04417949,
-0.040447086,
-0.025453988,
0.015564385,
-0.011489207,
0.004713114,
0.009489704,
-0.0057604727,
-0.04115802,
0.047835726,
-0.011984322,
0.05794115,
-0.004303692,
-0.0117431125,
-0.028132688,
-0.04359551,
-0.027269412,
0.016745044,
0.0036022791,
0.013253848,
0.028361203,
0.0113749495,
0.019042885,
-0.019855382,
0.051238056,
0.0009513508,
0.020134676,
0.0008331262,
-0.03112877,
-0.011705027,
-0.0013631532,
0.021620022,
0.008645469,
0.041970517,
0.0016678394,
-0.0062778043,
-0.055960692,
-0.0017836835,
0.022864157,
-0.006963348,
-0.015450127,
0.012803166,
-0.0026072883,
-0.030849474,
-0.04115802,
-0.031941265,
0.0027358278,
0.006588838,
-0.0030309926,
-0.010765578,
-0.041056458,
-0.0060397685,
0.019842686,
0.005839818,
-0.00015998007,
0.00060937234,
0.03470883,
-0.03765413,
0.0051288838,
-0.030062368,
-0.0022470604,
0.0038307935,
-0.01905558,
-0.042783014,
0.011489207,
0.032017436,
0.011286083,
-0.00495115,
0.006525362,
-0.024209853,
0.037070148,
0.017430587,
0.0036340172,
0.034429535,
-0.014421811,
-0.033286963,
0.009204061,
-0.018433513,
0.018179607,
-0.041894346,
-0.01362201,
0.026964724,
-0.010314896,
0.011939889,
-0.0026342657,
0.0142567735,
-0.0129301185,
-0.003229356,
0.035826012,
0.0066967476,
-0.008518517,
-0.017913006,
-0.016046803,
0.034581877,
0.022292871,
-0.0014075866,
-0.033997897,
0.0082582645,
-0.0023137105,
0.04265606,
-0.0038307935,
-0.022369042,
0.023371967,
-0.026076056,
0.01798918,
-0.0034880217,
-0.0014702694,
-0.0022740378,
-0.026279181,
-0.012866642,
-0.0380096,
-0.020413972,
0.029351434,
-0.005395484,
-0.036435388,
-0.049689233,
0.0060207252,
0.026279181,
-0.012193793,
0.005535132,
-0.010683059,
-0.038415845,
-0.08389025,
-0.031103378,
0.007344206,
-0.013317324,
-0.0037641434,
0.014955012,
-0.0015734184,
0.037730303,
0.00064706133,
0.017151292,
0.06088645,
-0.040370915,
-0.042325985,
-0.016351491,
0.030062368,
-0.016770434,
0.028869014,
-0.024870008,
-9.4520154e-05,
-0.028107299,
-0.007731411,
0.03260142,
0.049816187,
0.017430587,
-0.052101333,
0.0033452,
0.0048591094,
0.00016434406,
-0.0045702923,
-0.0238163,
-0.018941322,
-0.01806535,
0.02403212,
-0.008708946,
-0.0069760433,
-0.007191863,
0.01934757,
-0.012860294,
0.029376823,
-0.023752825,
0.013406191,
-0.044839647,
-0.0063888878,
-0.015564385,
0.0500447,
0.02101065,
0.0061667208,
0.010105425,
0.0055383057,
-0.050730243,
0.017722579,
0.021912012,
0.015043879,
-0.023625873,
-0.0067030955,
0.0133808,
0.009546833,
0.00624924,
0.035876796,
0.027142458,
-0.012073189,
0.026482305,
-0.012022408,
0.01859855,
0.01753215,
0.009743609,
-0.020134676,
0.029986195,
0.0020407625,
-0.022013575,
0.019868076,
-0.024704969,
0.044712692,
0.0056557367,
-0.011317821,
0.0053193127,
0.016224537,
0.046109173,
0.016656177,
0.028437374,
0.03861897,
0.031890485,
0.021074126,
0.031027207,
-0.013469667,
0.00019499121,
-0.03448032,
-0.037730303,
-0.030976426,
0.021467678,
0.041437317,
-0.021543851,
0.001450433,
0.009254842,
0.014459897,
-0.009781695,
0.0022899068,
-0.02770105,
0.031890485,
-0.012162056,
0.035800625,
-0.0024327284,
-0.03618148,
0.004367168,
-0.021239163,
-0.017722579,
0.0038276198,
0.05045095,
0.01014351,
-0.034074068,
-0.01581829,
0.03257603,
-0.0029405388,
-0.017887617,
-0.022927633,
0.023219625,
0.0171259,
0.034277193,
-0.0076933256,
0.007839321,
-0.016935471,
0.03171275,
0.003449936,
-0.006595186,
-0.03618148,
0.011997017,
-0.015589775,
-0.0028643673,
-0.014447202,
0.025568247,
-0.0059064683,
0.025085827,
0.032423686,
-0.050806418,
0.0053351815,
-0.0045861616,
0.00040446295,
-0.0028056516,
-0.027548706,
0.02047745,
0.010733839,
-0.04062482,
0.0094452705,
-0.018166913,
-0.0131142,
0.0046083783,
-0.013101505,
0.01335541,
-0.019512609,
-0.00056057493,
0.019423742,
0.016021414,
-0.027497925,
0.03227134,
0.016643481,
-0.021607326,
-0.013926696,
-0.0059191636,
-0.018738199,
6.0649603e-05,
-0.027878784,
0.01164155,
0.0048622834,
0.007763149,
0.023828996,
0.01828117,
-0.037476398,
0.018166913,
-0.0061857635,
-0.017062426,
-0.032982275,
0.015208918,
0.008791465,
0.027980346,
0.024844617,
0.007820278,
0.033337742,
0.001459161,
0.03521664,
0.01640227,
0.03567367,
0.017836835,
-0.019703038,
0.012136665,
0.0056620846,
0.017354416,
-0.0046528117,
-0.013038028,
-0.012911076,
0.015361261,
0.003005602,
0.03552133,
-0.027751831,
0.004932107,
-0.0069252625,
-0.025619028,
0.018649332,
-0.024958875,
-0.00064666464,
-0.0033452,
0.04654081,
-0.03915217,
0.0052336194,
-0.0024882702,
0.00068554387,
-0.027320191,
0.020883696,
-0.006747529,
-0.015957937,
-0.013164981,
-0.0044465135,
-0.0013330019,
0.026304571,
0.0067538763,
-0.01683391,
-0.0019058754,
-0.028488155,
-0.0125556085,
-0.018116131,
-0.009077108,
-0.041894346,
0.05095876,
-0.024552627,
-0.014764584,
-0.034581877,
0.012104927,
-0.0022296044,
-0.001861442,
0.0009926104,
0.0028786494,
-0.02132803,
0.017138597,
0.023575092,
-0.0065634474,
0.02815808,
-0.0124096135,
-0.010810011,
-0.025631722,
0.043290824,
0.008664513,
-0.0052748793,
0.026736211,
-0.025428599,
-0.028107299,
-0.0071791676,
-0.021188384,
0.017633712,
0.029478386,
-0.019931553,
0.023537006,
-0.018763589,
-0.0047353306,
0.028970575,
-0.014866145,
0.01432025,
-0.003738753,
-0.000119414755,
0.011330516,
0.021645412,
0.01760832,
0.025098521,
0.03671468,
0.01611028,
-0.015513604,
0.0020915435,
0.001271906,
-0.005154274,
-0.014002868,
0.0017186203,
0.0016789477,
0.019664953,
-0.00519236,
0.038847484,
0.01437103,
-0.013748962,
-0.009895952,
0.012612738,
0.00014540036,
0.017024338,
-0.008962851,
-0.025149303,
-0.028792841,
-0.007261687,
-0.017722579,
-0.015589775,
-0.022749899,
-0.023270406,
0.02598719,
-0.00033344884,
-0.0092231035,
0.005344703,
0.022191308,
-0.0065634474,
-0.034505706,
-0.042783014,
0.020997955,
0.0065507526,
0.013304628,
0.015437432,
-0.03422641,
-0.026634648,
0.017138597,
-0.0052748793,
-0.04207208,
0.009102499,
0.004316387,
0.03521664,
0.0016583179,
0.02975768,
-0.016478444,
-0.0033452,
0.00011078595,
0.007052215,
-0.012028756,
0.01260639,
0.015234307,
-0.013545839,
-0.01825578,
-0.026609257,
0.017722579,
-0.036841635,
-0.0465662,
-0.02453993,
0.035115078,
0.026431523,
0.013748962,
0.0023422749,
-0.027370973,
-0.014193296,
0.054589603,
0.03470883,
-0.003070665,
0.024095597,
0.0076806303,
-0.00941988,
0.008569298,
-0.0122636175,
-0.0066840528,
-0.047404088,
0.014675717,
0.001014827,
-0.00041973693,
-0.02125186,
0.012784123,
0.0054240483,
0.019233314,
0.0089247655,
0.009718219,
0.0020185458,
0.019576086,
0.067589544,
-0.00072839035,
-0.010638625,
0.008442346,
0.022495994,
-0.018585855,
-0.033972505,
0.015742118,
-0.030747911,
-0.02127725,
-0.00034971465,
0.032474466,
0.013736268,
-0.010886182,
-0.008664513,
0.018052654,
0.002646961,
0.028310422,
0.011095654,
-0.0019122231,
-0.012003365,
0.027548706,
-0.002253408,
0.021556545,
-0.05479273,
0.0072489916,
-0.012790471,
0.015780203,
0.045118943,
0.030392444,
-0.021213774,
0.052253675,
-0.026329963,
0.008328089,
0.0053542242,
0.022826072,
-0.053624764,
0.0052653574,
0.0016115041,
0.0013250674,
-0.013533143,
-0.002627918,
-0.014840755,
-0.021543851,
-0.011006787,
-0.030595569,
0.01102583,
-0.0116669405,
0.008175746,
-0.016275318,
-0.0031642928,
0.031484235,
-0.0072362963,
0.016554615,
0.034911957,
-0.012600042,
-0.0009450032,
0.021556545,
0.034734223,
-0.029300652,
0.009934038,
0.012250923,
-0.028005736,
-0.00057208,
0.008651817,
-0.030849474,
-0.010340286,
-0.0050812764,
-0.010994093,
0.030773303,
-0.006398409,
0.017189378,
-0.018217694,
-0.042427547,
0.009165975,
0.01557708,
0.0047226353,
-0.017405197,
-0.03910139,
0.03163658,
-0.018776285,
0.0056969966,
0.026279181,
0.015208918,
0.005071755,
0.0053669196,
0.007102996,
-0.01753215,
0.012523871,
0.027853392,
-0.03305845,
-0.035368986,
0.006830048,
-0.029554557,
0.011279736,
-0.002013785,
0.0070839534,
-0.02084561,
-0.0015527885,
-0.0039545726,
0.0235497,
0.02456532,
-0.021835841,
0.021048736,
0.00968648,
0.020655183,
-0.06428878,
0.037349444,
0.0038212722,
0.055656005,
0.013330019,
-0.027624879,
0.04108185,
-0.024222549,
-0.012733342,
0.01241596,
0.001553582,
0.010670363,
-0.011209912,
-0.022851462,
0.0006696748,
-0.0029849722,
0.011559031,
-0.015488213,
-0.0024771618,
-0.052761488,
-0.017202072,
0.015158136,
-0.021556545,
0.00087676616,
0.023003805,
0.0035261074,
-0.021581937,
0.009165975,
0.05890599,
-0.00587473,
0.018928627,
-0.025466684,
0.007096648,
0.014815364,
0.0087787695,
0.010080034,
0.00880416,
0.015450127,
0.035394374,
0.010962354,
0.0015916678,
0.01731633,
-0.031484235,
0.0198046,
0.0026707647,
-0.031357285,
0.0062524136,
-0.016973559,
0.016745044,
-0.0032166606,
-0.00070974417,
0.002884997,
-0.0110004395,
-0.015780203,
-0.0012354072,
0.0015821464,
-0.04204669,
-0.0038530102,
0.0190048,
0.0024549451,
0.0040180488,
-0.006506319,
-0.019423742,
0.021823145,
0.027929565,
-0.017887617,
-0.0036276695,
0.023168843,
0.010359329,
-0.0023105368,
0.012143013,
0.03615609,
-0.054183356,
-0.0039513987,
-0.0009822955,
-0.02130264,
-0.025872933,
0.03521664,
0.0018027264,
-0.0015900809,
0.0111527825,
-0.01881437,
-0.00084502803,
0.0045353803,
-0.009603961,
-0.021772364,
-0.03701937,
-0.0020772615,
-0.023384662,
-0.0112226065,
-0.045169722,
-0.03816194,
-0.0061540254,
0.024793835,
-0.0025739633,
-0.027142458,
0.029046748,
-0.0042084777,
0.009661091,
0.060073953,
-0.016706958,
-0.005065407,
-0.0034721526,
-0.013279239,
0.026634648,
-0.0050463644,
0.0057604727,
-0.009788043,
0.0366639,
-0.036917806,
-0.0053669196,
-0.0095976135,
-0.008245569,
0.029808462,
0.02325771,
-0.019614171,
0.024400283,
-0.017252853,
-0.030417835,
0.016605396,
0.013583925,
0.004913064,
-0.014231383,
0.0044655567,
-0.0543357,
-0.026660038,
-0.014244078,
-0.0004978921,
0.0051193624,
-0.011425731,
-0.013291934,
0.021746974,
0.025580943,
-0.0033515478,
-0.016948167,
0.0013814026,
0.0024295547,
0.072566085,
-0.0012076363,
0.023486225,
-0.0060937232,
0.025047742,
-0.015183527,
0.0031754011,
0.0041005677,
0.060226295,
-0.0033578954,
-0.014358335,
-0.02919909,
0.009743609,
-0.005005105,
0.0016297535,
0.004065656,
-0.015615165,
-0.032702982,
0.01150825,
0.043468557,
-0.0120414505,
0.004300518,
-0.028564326,
0.03521664,
-0.0017503585,
-0.02772644,
0.021213774,
0.016414966,
-0.013164981,
-0.003770491,
-0.022280175,
-0.017786054,
0.007375944,
0.0028976924,
-0.0013829895,
-0.0138124395,
-0.02721863,
0.00389427,
-0.012003365,
-0.006963348,
0.0029437125,
0.0056843013,
-0.010441848,
-0.011082959,
0.0105561055,
-0.010080034,
-0.0267616,
-0.013723573,
-0.020375887,
-0.046286907,
-0.0066967476,
-0.000614133,
0.047454868,
0.0036657553,
0.0021089995,
-0.029986195,
0.0071664723,
-0.015615165,
0.02473036,
0.0071410816,
-0.019626867,
-0.0056589106,
0.008772423,
-0.023968644,
0.02823425,
-0.0045861616,
0.036308434,
-0.053777106,
-0.015120051,
-0.008829551,
-0.017151292,
0.0073505533,
0.012289008,
-0.0235497,
0.0286405,
0.0036308435,
0.017329026,
-0.037781082,
0.022737205,
-0.00071688526,
0.023955949,
0.0065634474,
-0.004497295,
0.035445157,
-0.0096674375,
0.0106322775,
0.03950764,
-0.015907157,
-0.015259698,
0.001443292,
0.0016805346,
0.037222493,
0.005579565,
-0.0031627058,
0.012117622,
0.034658052,
-0.053269297,
-0.020147372,
0.015145441,
0.0023771867,
0.0093754465,
0.0016535572,
-0.0011727243,
-0.004716288,
-0.024743054,
0.0003374161,
-0.035394374,
0.0049955836,
0.0133681055,
0.044204883,
-0.009997514,
-0.013482362,
0.014764584,
0.041056458,
0.0050178003,
0.0238163,
-0.03712093,
-0.023778215,
0.0004241009,
0.051771257,
-0.0050971457,
-0.03866975,
-0.00730612,
-0.017836835,
0.00049551175,
0.0013020573,
-0.033388525,
-0.03958381,
0.015234307,
0.0039006176,
-0.008131312,
-0.005754125,
-0.033312354,
-0.04996853,
-0.034861173,
-0.021581937,
-0.049308375,
0.010790968,
0.00396092,
-0.011552683,
0.011628855,
0.014916927,
0.0031801618,
0.006519014,
-0.02379091,
-0.010365677
]
},
{
"object": "embedding",
"index": 2,
"embedding": [
-0.0009395032,
-0.034558482,
0.00066574593,
-0.039433744,
-0.0077826413,
-0.0013172089,
0.03646288,
0.026077563,
0.015679548,
-0.015133619,
0.0016695226,
-0.034355346,
-0.015819203,
-0.032984182,
-0.04349646,
0.009794956,
-0.01129943,
-0.011673963,
-0.010740807,
-4.6568493e-05,
-0.01611121,
-0.02367802,
0.007268454,
0.049971413,
0.008309525,
-0.023830373,
-0.0013846563,
0.038595807,
0.012162758,
-0.027931176,
-0.029276952,
-0.0462134,
0.012657901,
-0.028819896,
-0.006262297,
0.073179685,
-0.0032438254,
0.015298667,
-0.040779516,
-0.010283751,
0.010252011,
-0.03425378,
-0.023970028,
-0.0027883567,
0.01228337,
0.041871373,
-0.011280387,
0.010639239,
0.013013389,
0.011185166,
-0.06408936,
0.0004681646,
-0.0012870559,
0.057385873,
-0.026382266,
-0.0038087969,
-0.011762834,
0.022560773,
-0.0074525457,
-0.02694089,
0.054643538,
-0.032374773,
-0.03877355,
-0.028058136,
-0.008493617,
0.021265782,
-0.011978666,
0.045096155,
-0.002393194,
0.0221545,
0.043699596,
0.016758706,
-0.02950548,
0.008468225,
-0.01693645,
0.015044748,
0.01016314,
-0.0027042457,
0.007382718,
-0.039129037,
-0.031587623,
0.014574996,
-0.047152903,
-0.01738081,
-0.024706395,
0.0038691028,
-0.058503117,
-0.015869986,
-0.006062335,
0.0045102504,
-0.048092406,
-0.06551131,
-0.052155126,
-0.029023033,
0.0108995065,
0.009007804,
-0.013051477,
-0.04837172,
-0.029099207,
0.0069637503,
0.010093312,
0.030444983,
-0.024947619,
0.016568266,
-0.004900652,
-0.022459205,
0.014549604,
-0.021989454,
-0.030191062,
-0.031841543,
-0.061651725,
-0.00019262197,
-0.00702723,
0.012524594,
0.063479945,
0.0052593136,
0.0005542593,
-0.0011815205,
-0.009090329,
-0.04105883,
-0.018383794,
-0.010594803,
0.063327596,
0.01468926,
-0.023639932,
-0.057538223,
-0.03557416,
-0.080238655,
-0.07150381,
0.021837102,
0.030775078,
-0.023360621,
0.04004315,
0.03646288,
-0.05235826,
-0.016644442,
-0.078105725,
0.028921464,
-0.009693388,
0.0010156791,
-0.013902108,
-0.06388622,
0.013419661,
-0.026661579,
-0.012321457,
-0.017304633,
-0.024934923,
0.029023033,
0.007293846,
0.010467843,
-0.05378021,
-0.022611557,
-0.06033134,
0.05916331,
-0.023970028,
-0.01854884,
-0.032933395,
0.0011513676,
0.019577216,
0.0054370575,
-0.021786317,
-0.008563445,
0.020491326,
-0.011724746,
0.0011077251,
0.019488344,
0.034863185,
-0.010975683,
-0.03681837,
-0.07536339,
0.012480157,
-0.0370469,
-0.08237158,
0.0068812263,
-0.009509296,
0.0010291686,
0.028921464,
-0.045019977,
-0.0003215656,
0.016504787,
0.0332381,
0.029099207,
0.014257596,
-0.0020408803,
-0.045223113,
0.04887956,
0.014092548,
0.031155959,
0.01655557,
0.02019932,
0.018536145,
0.03204468,
0.06292132,
-0.022522686,
0.025087275,
-0.03143527,
0.031993892,
-0.022141805,
0.039941583,
-0.010632891,
0.019488344,
0.04065256,
0.0033326973,
-0.0074906335,
0.039713055,
-0.009820348,
-0.006135337,
-0.051393364,
-0.0045673824,
0.026331482,
0.049590535,
0.008214305,
-0.0103345355,
-0.0017583945,
-0.040550992,
0.019869223,
-0.033949077,
0.005164094,
0.029835574,
-0.045477033,
-0.010512279,
0.026077563,
0.046898983,
0.027956568,
0.005865547,
-0.0039960626,
-0.014790827,
0.01924712,
0.021595879,
-0.039179824,
0.015666852,
-0.025201539,
-0.015971554,
-0.037808657,
0.02276391,
-0.005732239,
-0.008620577,
0.013508533,
-0.029860968,
-0.0027090067,
-0.018002912,
-0.032374773,
0.01585729,
0.0031311484,
0.012270674,
0.0124738095,
-0.00045983287,
-0.040754125,
0.040525597,
-0.022256069,
-0.015349451,
0.037554737,
-0.004849868,
0.007147842,
-0.04207451,
0.023487581,
-0.02539198,
0.03783405,
0.015311363,
0.005916331,
-0.0010259947,
0.042150684,
-0.018129872,
0.033441234,
-0.0024995229,
-0.040550992,
0.026864713,
-0.0054624495,
0.015501803,
-0.052256692,
-0.016390523,
-0.025772858,
0.043953516,
-0.008544401,
-0.04598487,
0.012854689,
-0.034634657,
-0.009852088,
-0.0103916675,
0.02272582,
-0.013990981,
-0.042506173,
-0.0009990156,
0.023779588,
0.003434265,
0.003431091,
0.034202997,
-0.028337449,
0.015387539,
-0.0064241705,
-0.008176217,
-0.05555765,
0.04270931,
0.02297974,
0.006887574,
0.0075350697,
0.039840017,
-0.016898362,
0.010150444,
-0.014422644,
0.034609266,
-0.04288705,
0.020415151,
0.03821493,
-0.017520465,
0.03991619,
-0.03643749,
0.022027541,
0.032400165,
0.0018377445,
-0.008963369,
0.014282988,
-0.03874816,
0.014346468,
-0.057436656,
0.0068812263,
0.036234353,
-0.020961078,
0.022383029,
-0.055506866,
-0.002523328,
-0.0094966,
0.0053259674,
-0.03194311,
-0.0065130424,
-0.018599624,
0.0055195815,
-0.039179824,
-0.0032104983,
0.032908004,
-0.028413624,
0.006205165,
0.048092406,
-0.02317018,
0.009071284,
0.0012005644,
-0.0011307365,
-0.03313653,
0.015374843,
0.010766199,
-0.074957125,
-0.011280387,
0.03950992,
-0.036234353,
-0.004269026,
0.027296377,
-0.005894113,
0.018218745,
0.06276897,
0.013064173,
0.009299812,
-0.0008784038,
0.0003806813,
-0.03067351,
0.062311918,
-0.082168445,
-0.021405438,
0.0030343414,
-0.01630165,
-0.015374843,
0.03389829,
-0.0024852399,
-0.017545857,
0.04143971,
-0.0075985496,
-0.034380738,
-0.021900581,
0.031359095,
-0.006919314,
-0.034609266,
-0.023195572,
0.029454695,
0.026915498,
0.010747155,
-0.029480087,
0.03207007,
-0.028794505,
0.029099207,
0.049184263,
0.04067795,
0.032374773,
-0.057944495,
-0.044969194,
-0.032552518,
-0.02539198,
0.010010787,
-0.049006518,
-0.0077762934,
0.0043452024,
0.020529415,
0.0016869796,
-0.015768418,
0.0026709188,
-0.006976446,
0.033009574,
0.029124599,
0.045350075,
-0.006176599,
0.020986471,
-0.0042658523,
0.019805744,
-0.024465172,
-0.02143083,
0.0018536145,
0.012207194,
0.015514499,
0.019158248,
-0.002331301,
0.043166365,
0.015412931,
0.008937976,
0.027626473,
0.034837794,
-0.041795198,
0.0039865407,
0.045273896,
0.020567503,
-0.057284303,
0.030343415,
0.07394144,
-0.047152903,
-0.045019977,
-0.041922156,
-0.016987234,
0.022040237,
0.01449882,
0.044740666,
-0.0013719604,
-0.014892396,
-0.035624947,
-0.039408352,
-0.010550367,
0.041109614,
0.021354655,
-0.029099207,
-0.042836268,
0.012962605,
0.02583634,
-0.037275426,
-0.011667614,
0.003564399,
0.02104995,
-0.06505425,
-0.013140349,
-0.006055987,
-0.0069320104,
-0.03605661,
0.0121944975,
-0.019488344,
0.007884209,
-0.031130565,
-0.07561731,
-0.005992507,
-0.015768418,
0.009839391,
-0.03336506,
-0.004608644,
-0.0009720367,
0.05611627,
-0.00090696977,
0.008823712,
-0.06505425,
-0.04603566,
0.008519009,
0.05520216,
-0.003646923,
-0.029251559,
0.035472594,
0.045400858,
-0.013394269,
-0.0013148284,
0.038341887,
-0.03029263,
0.02482066,
0.035980433,
-0.002491588,
0.011312126,
-0.027728042,
0.00956008,
-0.013406965,
-0.012257977,
0.02668697,
-0.05276453,
-0.011673963,
-0.036919937,
0.12665519,
-0.033034965,
-0.03194311,
-0.005992507,
-0.015082835,
-0.0069383583,
0.0012862624,
-0.04270931,
-0.014143332,
0.028845288,
-0.011604134,
-0.009744172,
-0.08871958,
0.0076302895,
-0.03311114,
0.004757822,
0.010518627,
0.003519963,
0.031663798,
0.033771332,
-0.0019155074,
-0.030571943,
0.019335993,
-0.00010632891,
-0.0045419903,
0.01839649,
-0.020618286,
0.014143332,
-0.02452865,
-0.022306854,
0.0066653946,
-0.016580962,
0.04387734,
0.009223636,
-0.05977272,
0.00015800555,
-0.018459968,
0.007147842,
-0.035447203,
-0.011566047,
-0.017241154,
0.007896906,
-0.033441234,
-0.017469682,
-0.031384487,
-0.025163451,
-0.02656001,
0.038519632,
-0.040500205,
-0.026610794,
-0.014143332,
-0.0008371418,
0.009363292,
0.040322464,
-0.013229221,
0.028591368,
0.019094769,
0.034736227,
-0.014029068,
-0.032146245,
0.034685444,
0.0086459685,
0.03821493,
-0.004767344,
0.034202997,
0.032984182,
-0.03631053,
0.017914042,
-0.017330026,
-0.004789562,
-0.016987234,
0.04314097,
-0.014282988,
-0.0017933085,
-0.008944324,
0.03250173,
0.011121687,
0.021151518,
0.04171902,
-0.031003606,
0.03653906,
0.013457749,
0.008119085,
0.041414317,
0.00087919727,
-0.015260579,
0.0074017616,
0.023309836,
0.026763145,
0.008220653,
0.0031597144,
-0.021925973,
0.03646288,
-0.047025945,
-0.028591368,
0.007255758,
-0.025696682,
0.023957333,
0.021202302,
-0.0019742264,
0.04314097,
0.027651865,
-0.050860133,
-0.008068301,
0.0093188565,
0.03783405,
-0.0013172089,
0.01738081,
-0.023398709,
0.003405699,
-0.022179894,
0.03811336,
-0.016987234,
-0.0061321626,
0.012619814,
0.011832662,
0.022497293,
0.006208339,
0.0011164536,
0.046289578,
0.030495767,
-0.02206563,
-0.0020773814,
0.035218675,
0.01411794,
-0.01494318,
-0.023563756,
0.010550367,
-0.006027421,
0.008468225,
-0.017291937,
-0.0103345355,
0.003678663,
0.020821422,
-0.0062369048,
0.016568266,
-0.025379283,
0.01187075,
0.01725385,
-0.022306854,
0.025493547,
-0.0052243997,
-0.018015608,
0.0041484144,
0.011680311,
-0.024604827,
0.017393505,
0.00076572684,
-0.044943802,
-0.028896071,
-0.008957021,
-0.013851324,
0.043318715,
0.008906237,
-0.018599624,
-0.014536908,
-0.00498635,
0.02077064,
-0.0039865407,
-0.032806437,
-0.026280697,
0.00956008,
0.009807652,
-0.009452164,
-0.0025011098,
0.01449882,
-0.03697072,
0.01744429,
0.0018615494,
0.014740043,
-0.057690576,
-0.024681004,
0.0044880323,
-0.0015028877,
-0.039408352,
0.006398779,
0.00898876,
-0.006138511,
-0.009249028,
0.0061575547,
0.061600942,
-0.04121118,
0.03041959,
-0.00037949104,
-0.005941723,
0.02149431,
0.026788538,
0.038798943,
-0.004411856,
0.018180657,
-0.042176075,
-0.027880393,
-0.018764673,
0.007274802,
-0.015565283,
0.001282295,
0.020986471,
-0.002320192,
-0.031790756,
0.045400858,
-0.012841993,
0.049590535,
-0.011115339,
-0.013381572,
-0.025785554,
-0.039586093,
-0.021151518,
0.010791591,
0.010252011,
0.005046656,
0.026991673,
0.003983367,
0.012911821,
-0.012511898,
0.049590535,
0.006059161,
0.024160467,
-0.0040151067,
-0.04263313,
-0.009801304,
-0.0057195434,
0.023284445,
0.011147079,
0.04669585,
0.005687803,
-0.016492091,
-0.04771153,
-0.003631053,
0.027499514,
0.00039913016,
-0.020097751,
0.008398397,
-0.0030184714,
-0.0272202,
-0.043648813,
-0.027981961,
0.00020948383,
0.01228337,
-0.002388433,
-0.016314346,
-0.043801162,
-0.015501803,
0.011559699,
-0.004907,
-0.008030213,
0.0010307557,
0.0243763,
-0.03257791,
-0.0019059854,
-0.036869153,
-0.0027661386,
-0.0053926213,
-0.025366588,
-0.037427776,
0.013153045,
0.040500205,
0.0067161783,
-0.015285972,
0.010550367,
-0.025899818,
0.03181615,
0.02386846,
-0.0003729447,
0.035193283,
-0.016885666,
-0.037529346,
0.009185548,
-0.022433814,
0.005859199,
-0.046518106,
-0.01570494,
0.02874372,
-0.014714652,
0.019170944,
-0.015603371,
0.018599624,
-0.016796794,
-0.0006637622,
0.04232843,
-0.0037262728,
-0.006033769,
-0.020123143,
-0.01782517,
0.040779516,
0.021722838,
0.004868912,
-0.0322986,
0.008722145,
0.002397955,
0.045908697,
-0.0018901154,
-0.022014845,
0.024338212,
-0.028845288,
0.013394269,
-0.007078014,
-0.002347171,
-0.003643749,
-0.043978907,
-0.010486887,
-0.023398709,
-0.02539198,
0.019234424,
-0.0021567312,
-0.04156667,
-0.043801162,
0.016415915,
0.029581655,
-0.0027201157,
0.001172792,
-0.014663868,
-0.037148464,
-0.0759728,
-0.02541737,
0.015260579,
-0.017609337,
-0.009636256,
0.018218745,
0.0031390833,
0.044816844,
-0.007522374,
0.023386013,
0.07170695,
-0.032425556,
-0.026102955,
-0.008912585,
0.043166365,
-0.021468919,
0.020453239,
-0.032146245,
-0.010436104,
-0.022103718,
-0.005043482,
0.033339668,
0.049260437,
0.012880081,
-0.05388178,
0.0027359857,
-0.0012926104,
0.0039897147,
-0.0025931557,
-0.017418897,
-0.02583634,
-0.0193106,
0.020085055,
0.0016211191,
-0.004960958,
-0.016669834,
0.02003427,
-0.0054338835,
0.027169418,
-0.034076035,
0.010271056,
-0.050403077,
0.010474191,
-0.021913277,
0.03783405,
0.020250103,
0.008246046,
0.02051672,
0.0027566168,
-0.051901206,
0.027956568,
0.024884138,
0.00921094,
-0.02579825,
-0.0034564831,
0.014016372,
0.0032025634,
0.014930484,
0.03504093,
0.027499514,
-0.02085951,
0.02077064,
-0.015095531,
0.011889794,
0.018980505,
0.005944897,
-0.017406201,
0.030241847,
0.008169869,
-0.030114887,
0.015387539,
-0.022675037,
0.04862564,
0.009014153,
-0.006982794,
0.002553481,
0.019970791,
0.053830996,
0.021253087,
0.017799778,
0.041998334,
0.02605217,
0.03590426,
0.025480852,
-0.011578742,
0.003491397,
-0.02586173,
-0.047660746,
-0.031333704,
0.016593657,
0.038087968,
-0.027626473,
0.0090966765,
0.003678663,
0.014168724,
-0.0042880704,
0.011470826,
-0.028515192,
0.02719481,
-0.008258741,
0.030343415,
0.0051831375,
-0.04570556,
0.004814954,
-0.019399472,
-0.009648952,
-0.006925662,
0.04296323,
0.011369258,
-0.02988636,
-0.02064368,
0.018917024,
0.00089427375,
-0.025049187,
-0.0243763,
0.025823642,
0.026585402,
0.043369498,
-0.0040690647,
-0.0020170752,
-0.022078326,
0.026356874,
-0.006982794,
0.0019948573,
-0.03532024,
0.017622033,
-0.02810892,
-0.0039357566,
-0.010093312,
0.020630984,
-0.0041801543,
0.0129245175,
0.024807964,
-0.057284303,
-0.009699736,
-0.00962356,
-0.0028216837,
0.0012648379,
-0.020719854,
0.026483834,
0.008791973,
-0.032019284,
0.01129943,
-0.0148797,
-0.01842188,
0.0062781665,
-0.012086581,
0.005929027,
-0.021380046,
-0.0002719719,
0.026153738,
0.023906548,
-0.02630609,
0.030597335,
0.015171708,
-0.018498056,
-0.016276259,
-0.014384556,
-0.01839649,
0.0064241705,
-0.020872207,
0.0055005373,
0.005481493,
0.0077953376,
0.028540583,
0.013330789,
-0.03953531,
0.01725385,
-0.008112737,
-0.010080616,
-0.022052934,
-0.0052370955,
0.008119085,
0.018625017,
0.029810183,
0.004643558,
0.028286664,
0.0071097543,
0.031790756,
0.021887885,
0.036386706,
0.020846814,
-0.026661579,
0.011128034,
0.00018667072,
0.021786317,
-0.017622033,
-0.0043325066,
-0.013305397,
0.01766012,
0.0041928506,
0.03339045,
-0.015476411,
0.010429755,
-0.0062718187,
-0.03656445,
0.02668697,
-0.029987928,
0.0022122762,
0.0061607286,
0.04410587,
-0.031155959,
0.0007411284,
-0.0013632319,
-0.0020567502,
-0.02899764,
0.022040237,
-0.0028486627,
-0.020212015,
0.0066146106,
-0.0033549152,
-0.0069637503,
0.0373516,
0.011877098,
-0.020313583,
0.002477305,
-0.034939364,
-0.029124599,
-0.016568266,
0.002424934,
-0.044435963,
0.052662965,
-0.019589912,
-0.019615304,
-0.027956568,
0.0039706705,
-0.012626162,
-0.0069954903,
0.006002029,
-0.0033200013,
-0.030368807,
0.012499201,
0.021405438,
-0.011972318,
0.03554877,
-0.014828916,
-0.02104995,
-0.02136735,
0.051291797,
0.0128673855,
0.005979811,
0.02656001,
-0.023792284,
-0.026102955,
-0.008525357,
-0.023652628,
0.014676563,
0.019424863,
-0.021253087,
0.019031288,
-0.030191062,
-0.0038595807,
0.03542181,
-0.011039163,
0.016923754,
-0.0028835766,
0.0039611487,
0.016263563,
0.012384938,
0.017368114,
0.018650409,
0.04321715,
0.0056687593,
-0.01206119,
0.002350345,
0.0053196196,
-0.0069700982,
-0.0015949337,
0.0029787966,
0.009014153,
0.023322532,
0.00047649635,
0.04311558,
0.016606353,
-0.022167198,
-0.0052720094,
0.010962986,
-0.0055830614,
0.025290411,
-0.0009807652,
-0.027321769,
-0.02760108,
-0.0041611106,
-0.011058207,
-0.012740426,
-0.034482308,
-0.021468919,
0.027245592,
0.01269599,
-0.019653391,
0.0046022963,
0.019869223,
-0.0123087615,
-0.050225332,
-0.041998334,
0.023843069,
0.0041833287,
0.009033197,
0.019361384,
-0.029530872,
-0.028058136,
0.023055917,
-0.0010521801,
-0.041160397,
0.018498056,
-0.0042563304,
0.038875118,
0.0061861207,
0.033517413,
-0.0077255093,
-0.0004225384,
0.0034088732,
0.009706084,
0.0002924045,
0.0064939987,
0.010175835,
-0.007465242,
-0.020846814,
-0.037681695,
0.02539198,
-0.027956568,
-0.043064795,
-0.03796101,
0.033822116,
0.014778132,
0.018079089,
0.007046274,
-0.023398709,
-0.016631747,
0.05172346,
0.020402456,
-0.018383794,
0.02821049,
0.00052847055,
-0.018053697,
0.008017518,
-0.0087031005,
-0.004964132,
-0.041084222,
0.01199771,
0.005862373,
-0.0015862052,
-0.02694089,
0.017076105,
0.013851324,
0.017164977,
0.0044531184,
0.016593657,
0.004814954,
0.023246357,
0.06657777,
0.0055068852,
-0.018053697,
0.009426772,
0.024135076,
-0.021100733,
-0.031333704,
0.011724746,
-0.030698903,
-0.02579825,
0.0012846754,
0.030495767,
0.019653391,
-0.020910295,
0.0048593897,
0.021037254,
-0.0075350697,
0.02630609,
0.009680692,
-0.00724941,
-0.013990981,
0.029327735,
0.008176217,
0.018942416,
-0.059112526,
-0.0031279745,
-0.012035798,
0.020808727,
0.036615234,
0.03364437,
-0.02393194,
0.053323157,
-0.022217982,
0.0017869605,
-0.00065066945,
0.021735534,
-0.05758901,
0.0041706325,
0.012162758,
0.0012973715,
-0.021760926,
-0.007700118,
-0.011096295,
-0.009693388,
-0.007992125,
-0.034304563,
0.015273275,
-0.010975683,
0.0029835575,
-0.012657901,
0.0020583372,
0.0284898,
-0.022878174,
0.01852345,
0.026737753,
-0.004840346,
3.5285924e-05,
0.030140279,
0.03422839,
-0.029530872,
0.003478701,
0.012937213,
-0.030698903,
0.0055481475,
-0.00054196006,
-0.02386846,
-0.008036561,
0.0025026968,
-0.009629908,
0.04171902,
-0.002323366,
0.024135076,
-0.012994345,
-0.0319685,
0.016035035,
0.00705897,
-0.0032565212,
-0.016225474,
-0.048219368,
0.039357565,
-0.0017409376,
0.0064939987,
0.02143083,
0.015247883,
-0.0015592262,
0.006046465,
0.0012386525,
-0.011908838,
0.024515955,
0.032400165,
-0.03219703,
-0.023627236,
0.0064844764,
-0.025912514,
0.012607117,
-0.0011926295,
-0.0016552396,
-0.020757943,
-0.00077128137,
-0.0051736156,
0.03247634,
0.015197099,
-0.02187519,
0.01797752,
0.011978666,
0.012169106,
-0.062413484,
0.035599556,
-0.002555068,
0.04634036,
0.008963369,
-0.024592131,
0.021443525,
-0.024262035,
-0.016657138,
0.008442833,
0.0044340743,
0.0028264446,
-0.0076937694,
-0.031866934,
0.006401953,
-0.0028788156,
0.005963941,
-0.019742263,
-0.0050910916,
-0.049996804,
-0.013686277,
0.02003427,
-0.019196335,
-0.006747918,
0.019094769,
-0.009541036,
-0.018828152,
0.014346468,
0.062210348,
-0.013153045,
0.017583946,
-0.027093241,
0.017291937,
0.022103718,
0.006951054,
0.019031288,
0.012035798,
0.0018552014,
0.040855695,
0.015019355,
0.006316255,
0.022916261,
-0.03425378,
0.01699993,
-0.0005455308,
-0.040601775,
-0.0014386143,
-0.020059664,
0.020783335,
0.0036850108,
0.004856216,
0.00028982564,
-0.0152351875,
-0.021773621,
-0.0028486627,
-0.008100041,
-0.048651032,
-0.0076747257,
0.00927442,
0.0032977832,
-0.0011228016,
0.0017504595,
0.0016393696,
0.018510753,
0.034431525,
-0.02162127,
-0.008906237,
0.02212911,
0.0076620295,
-0.016606353,
0.011680311,
0.021113431,
-0.050656997,
-0.01136291,
-0.0055798874,
-0.03168919,
-0.012378589,
0.027296377,
0.0022154502,
-0.0029184907,
0.011699354,
-0.0148797,
0.0031200394,
0.0061861207,
-0.0077382056,
-0.02289087,
-0.04093187,
-0.0015457367,
-0.011978666,
-0.011413694,
-0.04545164,
-0.044816844,
-0.003923061,
0.034583874,
-0.0042341123,
-0.017812474,
0.024985706,
0.001237859,
0.013978284,
0.04890495,
-0.014359164,
-0.0028216837,
-0.0017456985,
-0.021684749,
0.04578174,
-0.007198626,
0.012467462,
-0.009172852,
0.029302344,
-0.035244066,
-0.008957021,
0.000565765,
-0.017863257,
0.02181171,
0.020656375,
-0.010378972,
0.021062646,
-0.004411856,
-0.029200776,
0.013990981,
0.015743027,
0.0038151448,
-0.011477174,
-0.003545355,
-0.051393364,
-0.028134312,
-0.014143332,
-0.0014179833,
0.01602234,
-0.0027026588,
-0.01757125,
0.026509225,
0.030851254,
-0.011591438,
-0.016695226,
0.0030105365,
0.0038310147,
0.061245453,
-0.0016282606,
0.024363603,
0.0010529737,
0.029226167,
-0.00801117,
0.013241917,
0.007287498,
0.055252947,
0.0041579367,
-0.015400236,
-0.026102955,
0.017710906,
-0.009445816,
0.0037961008,
0.0026042648,
-0.020935686,
-0.028921464,
0.0053323153,
0.047889274,
-0.011972318,
0.005875069,
-0.020694463,
0.02656001,
0.0037802309,
-0.037503954,
0.025810946,
0.010467843,
-0.015285972,
-0.010702719,
-0.015882682,
-0.017723601,
0.0013894173,
0.007135146,
-0.0025011098,
-0.008791973,
-0.025277715,
0.0010926486,
-0.008512661,
-0.013076869,
8.616907e-06,
-0.0007288291,
-0.0077699455,
-0.010410711,
0.005592583,
-0.010245663,
-0.025912514,
4.8701022e-05,
-0.016911058,
-0.034431525,
-0.00476417,
-0.0052656615,
0.043801162,
0.006982794,
0.0010450386,
-0.02003427,
-0.0006847899,
-0.017799778,
0.015171708,
0.012581726,
-0.020300888,
-0.019196335,
0.013483141,
-0.025455458,
0.013051477,
0.00068240945,
0.031638406,
-0.043928124,
-0.013864021,
-0.013635493,
-0.010524975,
0.007065318,
0.0026978978,
-0.022205286,
0.025430067,
0.00444677,
0.015311363,
-0.02418586,
0.028667543,
0.0020805553,
0.019869223,
0.009268072,
-0.016504787,
0.039205216,
-0.00968704,
0.013076869,
0.03709768,
-0.023754196,
-0.014143332,
0.0020678593,
-0.00465308,
0.029048424,
-0.0016520657,
-0.0030517986,
0.008944324,
0.029353127,
-0.050250728,
-0.017774384,
0.011915186,
0.0042214165,
0.0074525457,
0.010302795,
0.0052656615,
-0.010144096,
-0.020148534,
-0.00449438,
-0.026102955,
0.0034279171,
0.02380498,
0.04915887,
-0.0064083007,
-0.013572013,
0.010347231,
0.042023726,
0.017291937,
0.011381955,
-0.04529929,
-0.0074588936,
0.0009871132,
0.049488965,
0.0014703543,
-0.04402969,
-0.013368877,
-0.0086459685,
0.0040214546,
0.0021122952,
-0.014536908,
-0.036894545,
0.020783335,
0.0018948764,
-0.0057258913,
-0.008296829,
-0.03539642,
-0.03938296,
-0.024655612,
-0.021151518,
-0.04915887,
0.0097187795,
-0.0132673085,
-0.008950672,
0.011394651,
0.015946163,
0.0054719714,
0.017241154,
-0.015197099,
-0.0041928506
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 27,
"total_tokens": 27
}
}
headers:
CF-RAY:
- 939c1719ce3bfd43-NRT
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 03 May 2025 01:47:25 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '99724'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '193'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-698696864c-sgwrg
x-envoy-upstream-service-time:
- '79'
x-ratelimit-limit-requests:
- '5000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '4999'
x-ratelimit-remaining-tokens:
- '4999962'
x-ratelimit-reset-requests:
- 12ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_cee192745cdb948fb51aeab7b7299d8c
status:
code: 200
message: OK
version: 1
test_async_embeddings_with_content.yaml 0000664 0000000 0000000 00000135614 15270700723 0047125 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for async embeddings",
"model": "text-embedding-3-small"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '83'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
-0.0012588563,
-0.029314144,
-0.004568109,
-0.021721158,
-0.025343766,
-0.0004159207,
0.04500728,
0.03663181,
0.009042029,
-0.0049231243,
0.026416058,
-0.030574812,
7.522572e-05,
-0.031241372,
-0.03683468,
0.0045789764,
-0.017837722,
-0.0065569207,
0.017272595,
-0.0049231243,
-0.008542109,
-0.047383714,
0.015185973,
0.042804737,
0.0033654028,
-0.019634536,
0.012171963,
0.041471615,
0.033994555,
-0.034690093,
0.006172924,
-0.038370665,
0.009599911,
-0.028618604,
-0.017069729,
0.06578656,
-0.010759146,
0.036747735,
-0.039819706,
-0.0077886074,
0.0027314464,
-0.03750124,
-0.04993403,
-0.0045898445,
0.013425386,
0.05135409,
-0.03257449,
-0.01773629,
0.018866543,
0.034516208,
-0.048398044,
0.012041549,
-0.0050209346,
0.047876388,
-0.032081816,
-0.007237971,
-0.029792327,
0.030429907,
-0.0102447355,
0.0064736004,
0.061787203,
-0.031212391,
-0.029256182,
-0.018881032,
0.006412016,
-0.00872324,
-0.022416698,
0.025285805,
-0.011730005,
-0.0064736004,
0.05193371,
0.023720838,
-0.009969417,
0.0034740812,
-0.0029632933,
0.021025617,
0.012063284,
0.016519092,
-0.016345207,
-0.034516208,
-0.030111117,
0.027531821,
-0.029256182,
-0.019040428,
-0.01775078,
-0.013179048,
-0.07807445,
-0.009136218,
-0.0018765109,
0.0011746306,
-0.020721318,
-0.028256342,
-0.07679929,
-0.029328635,
0.029343124,
0.011845929,
-0.001069575,
-0.04593467,
-0.03428436,
0.021721158,
0.01576559,
0.02543071,
-0.017576894,
0.008230565,
0.0015187784,
-0.016475622,
0.0012162906,
-0.00537595,
-0.04758658,
-0.003651589,
-0.05671555,
-0.014193378,
0.0036751358,
0.003187895,
0.057150263,
-0.022576094,
-0.00452826,
-0.013323952,
-0.008563845,
-0.021156032,
-0.018576734,
-0.007031482,
0.03628404,
-0.007491553,
-0.024590263,
-0.046166517,
-0.03553054,
-0.047064923,
-0.061787203,
0.0005922964,
0.02082275,
-0.028270833,
0.0557302,
0.039153147,
-0.06288847,
-0.011164878,
-0.077205025,
0.027010165,
-0.0033291767,
0.022981824,
-0.017910173,
-0.04660123,
0.03654487,
-0.022720998,
-0.045673843,
-0.010708429,
-0.021996476,
0.047905367,
0.005970058,
-0.008643542,
-0.011338763,
-0.02548867,
-0.04494932,
0.042456966,
-0.018953485,
-0.031734046,
-0.038370665,
3.5575144e-05,
0.010679448,
-0.0052346685,
-0.036515888,
0.019938834,
0.034139458,
-0.0284737,
0.0017578705,
0.03083564,
0.01005636,
-0.005129613,
-0.022735488,
-0.062830515,
0.004568109,
-0.03750124,
-0.054889757,
0.000167206,
-0.012012568,
-0.014867184,
0.028096948,
-0.06943815,
0.012164718,
-0.011186614,
-0.014722279,
0.024039626,
0.022416698,
0.00039848688,
-0.06074389,
0.06584452,
0.02246017,
0.06404771,
0.0010713863,
0.0025285804,
-0.007006124,
0.058599308,
0.056918416,
-0.008607317,
0.024213511,
-0.031212391,
0.042891677,
0.003068349,
0.031618122,
-0.01223717,
0.0075712507,
0.03990665,
-0.0050173122,
0.0057671918,
0.05199167,
-0.0251409,
-0.023633895,
-0.042312063,
-0.009969417,
0.0045572408,
0.042456966,
-0.019388199,
0.0028763507,
0.010643222,
-0.015953965,
0.007810343,
-0.034371305,
0.013505083,
0.037066527,
-0.018055078,
-0.030980544,
0.043326393,
0.054426063,
0.0402834,
-0.026256664,
-0.0015142502,
-0.016026419,
-0.0013657232,
0.017388519,
0.00015962117,
-0.004473921,
-0.023648385,
-0.0016011928,
-0.01677992,
0.03190793,
-0.015968457,
-0.001709871,
-0.0135558,
-0.02482211,
0.0091144815,
-0.015838042,
-0.034690093,
0.01391806,
-0.021953005,
-0.006654731,
0.023083258,
-0.001220819,
-0.028401246,
0.038167797,
-0.019069409,
-0.019344727,
0.02218485,
-0.014570129,
0.0020576413,
-0.04219614,
-0.023271633,
-0.030024175,
0.03929805,
0.0073176683,
0.005618665,
-0.012910975,
0.042341042,
-0.02146033,
0.007448082,
0.013968777,
-0.05158594,
0.033009205,
-0.008317508,
-0.006031642,
-0.047180846,
-0.00988972,
-0.0060026613,
0.057440072,
-0.036747735,
-0.057816826,
0.006129453,
-0.036370985,
-0.007364762,
-0.007926267,
0.0067597865,
0.004408714,
-0.046977982,
0.010983747,
0.0342264,
-0.011309782,
0.007940757,
0.0013113841,
-0.019518612,
-0.0016138719,
0.011940116,
-0.0052093104,
-0.05868625,
0.051209185,
0.029009845,
0.0051513487,
0.004386978,
0.033443917,
-0.010563525,
0.016533583,
-0.010208509,
0.05222352,
-0.04350028,
0.0322557,
0.02822736,
-0.018634696,
0.033617802,
-0.04865887,
0.040718116,
0.040399324,
0.001111235,
-0.028430227,
0.01275158,
-0.035646465,
0.023039786,
-0.046717152,
0.008795693,
0.02447434,
-0.015635176,
0.034371305,
-0.047702502,
-0.008998558,
-0.036399964,
0.011621326,
-0.045499958,
-0.0063830353,
-0.03118341,
-0.00072678574,
-0.035095826,
0.015301896,
0.029140258,
-0.0068902005,
0.028444719,
0.03663181,
-0.002318469,
0.023691857,
-0.026633414,
-0.00048769361,
-0.023648385,
0.0496732,
-0.0018620205,
-0.04121079,
-0.0017297954,
0.04100792,
-0.025532141,
0.005415799,
0.052803133,
0.027039146,
0.030951563,
0.031734046,
-0.017388519,
0.013447121,
-0.0066112597,
-0.0068865777,
0.003044802,
0.057845805,
-0.05767192,
-0.020243134,
-0.0077596265,
-0.010222999,
-0.019634536,
0.025749497,
-0.0053723278,
-0.009962172,
0.066655986,
0.013505083,
-0.031994876,
-0.007803098,
0.021851571,
-0.002628202,
-0.015562724,
-0.016982786,
0.049876068,
0.004289168,
0.009353574,
-0.02586542,
0.02182259,
-0.026705867,
0.03990665,
0.04590569,
0.054976698,
0.03153118,
-0.032284684,
-0.039182127,
-0.07488655,
-0.02143135,
0.005129613,
-0.014657072,
-0.01912737,
-0.026213191,
-0.011476423,
0.0125849405,
-0.031994876,
-0.025169881,
-0.00569474,
0.024300454,
0.027604273,
0.058077652,
-0.025720516,
0.009382554,
-0.0035429106,
-0.0051404806,
-0.045876708,
-0.010273716,
0.0016645883,
0.0022170362,
0.023097748,
0.02819838,
-0.0016274566,
0.025271313,
-0.0093898,
-0.005988171,
-0.0011338763,
0.044021934,
-0.05630982,
-0.0009980286,
0.019011447,
0.012758825,
-0.043703143,
0.010976503,
0.06729357,
-0.036747735,
-0.0584544,
-0.024445359,
-0.013512328,
0.024039626,
-0.010447602,
0.075929865,
0.0060859816,
0.018315906,
-0.06132351,
-0.043674164,
-0.018996956,
0.043413334,
0.038428627,
-0.021054598,
-0.022938354,
0.036689773,
0.019272275,
-0.029212711,
-0.018489791,
-0.0052165557,
-0.007237971,
-0.0584544,
-0.010527299,
-0.009462252,
-0.011222839,
-0.026024817,
0.0037566444,
-0.006346809,
-0.01291822,
-0.008143622,
-0.067931145,
0.009599911,
-0.029256182,
-0.009027539,
-0.027415898,
0.010143302,
0.0031208768,
0.06735153,
0.007861059,
0.019388199,
-0.050484665,
-0.06010631,
0.035878308,
0.06004835,
0.017374028,
-0.0028093325,
0.010947522,
0.045528937,
0.0018131153,
-0.008237811,
0.04636938,
-0.0013901758,
0.027357936,
0.037530217,
-0.035443597,
0.024010645,
-0.021532781,
-0.00030226135,
-0.022039948,
-0.012106756,
-0.021040108,
-0.039124165,
-0.036313023,
-0.00093463284,
0.14397693,
-0.043065563,
-0.019359218,
0.008773956,
-0.012505243,
-0.026503,
0.017794251,
-0.012222679,
-0.018533263,
0.034371305,
-0.047238808,
-0.01676543,
-0.05094836,
0.03950092,
-0.027560802,
-0.012824032,
0.0063721677,
-0.020170681,
0.021547273,
0.01776527,
-0.0010795372,
-0.041761424,
0.009650628,
-0.014033983,
0.0171132,
-0.014041228,
0.01191838,
-0.020243134,
-0.010831598,
-0.012592185,
-0.004285545,
-0.036168117,
0.054918736,
0.005593307,
-0.04184837,
-0.009230405,
-0.01914186,
-0.0036443437,
-0.041529577,
0.012512488,
0.013193538,
-0.01375142,
-0.057208225,
-0.034139458,
-0.0052708946,
-0.018084059,
-0.015910495,
0.028430227,
-0.026430547,
-0.027937554,
-0.00047275034,
-0.020735808,
0.017243614,
0.018402848,
-0.014772995,
0.03883436,
0.0044884114,
0.034719076,
-0.02112705,
-0.022836922,
0.043413334,
0.023488991,
0.015026578,
-0.020243134,
0.0152439345,
0.022720998,
-0.018996956,
0.028430227,
-0.017388519,
0.01225166,
0.013722439,
0.04500728,
-0.016895844,
-0.018156512,
-0.022228323,
0.021445839,
0.03686366,
0.06706172,
0.035008885,
-0.033067167,
0.03689264,
0.017808741,
-0.0019073031,
0.044050913,
-0.0050245575,
-0.05801969,
0.010317188,
0.021590743,
0.02143135,
0.014533903,
0.01982291,
-0.023517972,
0.018852051,
-0.034342322,
-0.037385315,
-0.017069729,
-0.010817108,
0.02279345,
0.0118241925,
-0.00887539,
0.054049313,
0.004546373,
-0.019170841,
-0.010679448,
0.032516528,
0.02882147,
0.0019471518,
0.019764949,
-0.038109835,
0.025995836,
-0.010715675,
0.048484985,
0.0021337161,
-0.03263245,
0.010578016,
0.011266311,
0.0018746996,
-0.008607317,
-0.005437535,
0.02987927,
0.006506204,
-0.035066847,
0.016519092,
0.04019646,
-0.014041228,
-0.009143462,
-0.030806659,
0.017939154,
-0.0146136,
-0.0031353673,
-0.007006124,
0.008795693,
0.0080277,
0.028096948,
-0.020909693,
0.014780241,
-0.03184997,
-0.00056014577,
0.019735968,
-0.024068607,
0.0015857967,
0.0045318827,
0.00562591,
0.0029614822,
0.025720516,
-0.015229444,
0.0052346685,
0.014910654,
-0.037153468,
-0.037877988,
-0.0160554,
-0.02754631,
0.039442956,
0.011382234,
-0.024126569,
-0.0106939385,
0.0001393572,
0.02315571,
0.0080277,
-0.010998238,
-0.010933031,
0.014316547,
0.0033961951,
-0.004571731,
-0.013425386,
0.0059773033,
-0.032313664,
0.003635287,
-0.010462092,
0.02586542,
-0.07088719,
-0.019837402,
-0.011650307,
-0.013381914,
-0.016649507,
0.0073973658,
0.00247243,
-0.013476102,
0.0129544465,
0.008216075,
0.043094546,
-0.043703143,
0.04636938,
-0.0017823231,
-0.008636298,
0.010027379,
0.012983427,
0.04384805,
-0.02047498,
0.023329595,
-0.039182127,
-0.029560482,
-0.016635016,
0.01743199,
-0.017475462,
-0.0052093104,
0.020706827,
-0.008360979,
-0.026314626,
0.036805697,
-0.0044232043,
0.03889232,
0.0016365132,
0.0021463952,
-0.01844632,
-0.046804097,
-0.028125929,
0.052542306,
-0.0029940854,
-0.0065170717,
0.035762385,
0.010911295,
0.02987927,
-0.018866543,
0.036428947,
0.007650948,
0.017837722,
0.008201584,
-0.025923382,
-0.004933992,
-0.02987927,
0.015881514,
0.029096788,
0.030024175,
-0.005339724,
-0.016707469,
-0.035095826,
0.011701024,
0.026387077,
-0.007455327,
-0.01409919,
0.0060461327,
-0.012548714,
-0.029966213,
-0.038022894,
-0.036660794,
0.0026734846,
-0.0030647265,
-0.0086145615,
-0.0077234004,
-0.042312063,
-0.010063605,
0.0073901205,
-0.013628251,
0.003169782,
-0.010483827,
0.00019460198,
-0.016649507,
-0.011259066,
-0.018736128,
0.00089478417,
0.001361195,
-0.010672203,
-0.040428307,
-0.011925626,
0.01712769,
0.009643382,
0.011483667,
-0.0012733467,
-0.03019806,
0.048484985,
0.02751733,
0.0006565977,
0.0149541255,
-0.011498158,
-0.022923864,
0.012700864,
-0.012027059,
0.022880392,
-0.041819386,
-0.036370985,
0.024054118,
-0.022445679,
-0.0124545265,
0.013635497,
0.02147482,
-0.007089444,
-0.012440036,
0.017953645,
0.015316387,
-0.0112445755,
-0.018562244,
-0.0052817627,
0.045470975,
0.024995996,
0.0036207966,
-0.023720838,
0.016519092,
0.002394544,
0.051701862,
-0.006810503,
-0.02214138,
0.017200142,
-0.034081496,
0.018576734,
-0.0155047625,
0.021909533,
-0.00032105364,
-0.026126249,
-0.010606997,
-0.015490272,
-0.01744648,
0.01673645,
-0.0028147665,
-0.043529257,
-0.057874784,
-0.0042638094,
0.037820026,
-0.028575132,
0.00652794,
-0.0021645082,
-0.044833396,
-0.0630044,
-0.018721638,
0.029140258,
-0.023648385,
-0.0044232043,
0.018518772,
-0.0029687274,
0.01543231,
0.00313899,
0.020214153,
0.038428627,
-0.041326713,
-0.035878308,
-0.029705387,
0.03683468,
-0.009882474,
0.024039626,
-0.01843183,
0.0031317447,
-0.0113749895,
-0.02714058,
0.008998558,
0.03156016,
0.012374829,
-0.036950603,
-0.0088246735,
0.0077234004,
0.008759466,
-0.010143302,
-0.007948002,
-0.018808581,
-0.0038218515,
0.012679128,
0.01257045,
-0.0077523813,
0.0023818647,
0.002454317,
-0.00063622056,
0.025981344,
-0.017939154,
-0.003948643,
-0.028415738,
-0.010672203,
-0.024923543,
0.054628927,
0.010447602,
0.017156672,
0.013693458,
-0.003807361,
-0.030893601,
0.012613921,
0.0013177237,
0.0074082334,
-0.023228163,
-0.00011943286,
0.026358096,
0.005850512,
0.027024657,
0.0057092304,
0.023691857,
-0.026894242,
0.014512167,
0.008527619,
-0.00301401,
0.0292272,
0.005165839,
-0.0052056876,
0.021025617,
-5.7905127e-05,
-0.02009823,
0.025937874,
-0.008578336,
0.061613318,
0.017895684,
-0.017968135,
0.007549515,
0.013816627,
0.035675444,
0.011295292,
0.019156352,
0.050745495,
0.015707629,
0.021300934,
0.017649347,
-0.023387557,
-0.010049115,
-0.03127035,
-0.052252498,
-0.031357296,
0.027749177,
0.043703143,
-0.03663181,
-0.0052455366,
0.014809222,
0.004223961,
-0.00049176905,
0.014983106,
-0.03083564,
0.045036264,
-0.013765911,
0.02822736,
-0.007585741,
-0.02583644,
-0.011215595,
-0.030140098,
-0.014577375,
0.008962332,
0.036805697,
0.0023365822,
-0.015359858,
0.00755676,
0.024923543,
-0.020953165,
-0.037414297,
-0.011505403,
0.011845929,
0.017692817,
0.037964933,
0.022213832,
-0.0044050915,
-0.0018837561,
0.04836906,
-0.015577215,
-0.00789004,
-0.04663021,
0.0025901648,
0.0047999555,
-0.019562082,
-0.0153743485,
0.011309782,
-0.016504603,
0.03118341,
0.0110562,
-0.0428627,
0.008071171,
6.022586e-05,
-0.008339244,
0.0013747797,
-0.035675444,
0.0030574813,
0.022373227,
-0.041036904,
-0.014475942,
-0.021866063,
-0.028908413,
0.02547418,
-0.02282243,
0.020417018,
-0.014910654,
0.0027785404,
0.028082456,
0.0051151225,
-0.021286445,
0.022039948,
0.04428276,
-0.0054592704,
-0.019054918,
-0.017475462,
-0.021909533,
0.0218081,
0.004785465,
0.034979902,
-0.0042203385,
0.0055462127,
0.030053155,
0.0023076013,
-0.040776078,
0.01912737,
-0.026560962,
-0.023083258,
-0.030748697,
0.023271633,
0.008549355,
0.017316066,
0.022054438,
0.016330717,
0.0055751936,
0.027604273,
0.021286445,
0.008933351,
0.027705707,
0.046977982,
-0.015330877,
0.007984228,
0.015591705,
0.012657393,
-0.013200783,
0.0046985224,
-0.008085661,
0.008752221,
0.0062055276,
0.036428947,
-0.0012008946,
0.016577054,
-0.015519253,
-0.036168117,
0.0041189054,
-0.002626391,
-0.020706827,
-0.0050318027,
0.0502818,
-0.02882147,
0.010346169,
-0.0019471518,
-0.020257624,
-0.0055860616,
0.004187735,
0.0048035784,
-0.022692017,
-0.0020413396,
-0.01612785,
-0.008491393,
0.029299654,
0.014287566,
-0.02985029,
0.008092906,
-0.060512044,
-0.028386757,
-0.02282243,
0.0048289364,
-0.023054278,
0.02415555,
-0.020561922,
-0.01205604,
-0.02543071,
0.026705867,
0.010947522,
-0.010317188,
-0.017808741,
-0.005165839,
-0.032806337,
0.01193287,
0.028676566,
-0.010353413,
0.014005003,
-0.0075929863,
-0.025952363,
-0.026169721,
0.045326073,
-0.0023039787,
0.015881514,
0.009628892,
-0.030893601,
-0.023851251,
-0.0017651158,
-0.0004333545,
0.030342964,
0.04494932,
-0.01777976,
0.015403329,
0.004571731,
0.010085341,
0.02511192,
-0.018924505,
0.022010967,
-0.0013892702,
0.0022061684,
0.0018122096,
0.023604915,
0.0018457188,
0.010338923,
0.011664798,
0.0064265067,
-0.03863149,
-0.00028822376,
0.010215755,
-0.013063124,
-0.0027332578,
-0.009462252,
0.010266471,
0.025416218,
0.008252301,
0.029415578,
0.0032023855,
-0.013294972,
0.014142661,
-0.0006253527,
0.027952043,
0.013968777,
-0.012258906,
-0.025242332,
-0.0147440145,
0.003050236,
-0.01343263,
0.006248999,
-0.0076002316,
-0.004633316,
0.021011127,
0.007520534,
0.008049435,
-0.0061040944,
0.025575612,
-0.0024995995,
-0.017649347,
-0.017808741,
0.028806979,
0.0019036805,
-0.016533583,
0.016794411,
-0.017997116,
-0.0153743485,
0.018562244,
-0.007216235,
-0.02854615,
0.01123733,
-0.007962492,
0.020953165,
0.0063612997,
0.025952363,
-0.013947041,
-0.0009142557,
0.0015830797,
0.032226723,
-0.012773315,
0.015707629,
0.030371945,
-0.009925946,
-0.02586542,
-0.025198862,
0.01875062,
-0.04500728,
-0.023706347,
-0.037617162,
0.032081816,
0.005821531,
0.025648065,
0.027386917,
-0.0136644775,
0.008715995,
0.028111437,
0.005158594,
-0.020547433,
0.013287726,
-0.006136698,
-0.037240412,
0.0160554,
-0.026343606,
0.004075434,
-0.04364518,
0.0040066047,
-0.01473677,
0.014925145,
-0.011541629,
0.015953965,
-0.011816948,
0.0036316644,
0.0055208546,
0.032980222,
-0.0036968715,
0.025633574,
0.10792474,
-0.0030701603,
0.002318469,
0.00044671286,
0.016692977,
-0.021924024,
-0.027126089,
-0.0036425323,
-0.01914186,
-0.025937874,
-0.0026535604,
0.032023855,
0.010259226,
-0.016229283,
0.0039341524,
0.008433431,
0.0010949332,
0.002121037,
-0.001087688,
-0.00042044895,
0.010201264,
0.025387237,
-0.0027332578,
0.016504603,
-0.053440712,
-0.009788287,
-0.025242332,
0.010882314,
0.014830957,
0.043790087,
-0.013773155,
0.03663181,
-0.03118341,
0.0101143215,
0.00050942926,
0.023373067,
-0.053759504,
0.008411696,
0.023561442,
-0.013215274,
0.005379573,
-0.009541949,
-0.010128812,
-0.017287085,
-0.009715835,
-0.04257289,
-0.0140847,
-0.020764789,
-0.0054665157,
-0.006690957,
0.0024271475,
0.027604273,
-0.028560642,
0.024532301,
0.042833716,
-0.030603793,
0.008752221,
0.02954599,
0.05129613,
-0.023271633,
0.017533423,
0.025691535,
-0.0402834,
0.023416538,
0.005202065,
-0.022634055,
-0.02543071,
-0.0071365377,
-0.00060678687,
0.03176303,
-0.015953965,
0.021735648,
-0.014635337,
-0.050687533,
-0.000110319736,
0.02080826,
0.01914186,
-0.012302377,
-0.025343766,
0.027357936,
-0.018518772,
0.0054013086,
0.033791687,
0.033646785,
-0.016287245,
0.0044340724,
0.002318469,
-0.001212668,
-0.0008449733,
0.04523913,
-0.035675444,
-0.021677686,
0.011838683,
-0.02882147,
0.002878162,
-0.00016143247,
0.0021898665,
-0.03376271,
0.012838523,
0.010447602,
0.013447121,
0.03054583,
-0.007839324,
0.016577054,
0.016171321,
0.015185973,
-0.054078292,
0.04126875,
0.014758505,
0.036457926,
0.011208349,
-0.028357776,
0.013606516,
-0.012353093,
-0.016939316,
0.012077775,
3.0763866e-05,
0.001561344,
0.0073973658,
-0.028270833,
0.0075277793,
0.0025847307,
0.0046079573,
-0.016359698,
0.0045173923,
-0.043877028,
0.0052093104,
-0.00045237318,
-0.014193378,
-0.021373387,
0.037762064,
-0.0061765467,
0.005745456,
-0.0018837561,
0.039703783,
0.008194339,
0.014367264,
-0.027923062,
-0.01373693,
0.02314122,
0.018996956,
0.024662714,
0.012222679,
-0.0046152025,
0.014381754,
-0.016997278,
0.010396885,
0.0035229863,
-0.03292226,
0.008744976,
-0.0056150425,
-0.041181806,
0.0016229284,
-0.029024335,
0.026198702,
0.0039595105,
0.020286605,
0.008252301,
0.004473921,
-0.039442956,
-0.011295292,
-0.002979595,
-0.03990665,
0.016533583,
0.024532301,
0.0045173923,
0.013577535,
0.016620526,
0.014055719,
0.02277896,
0.028415738,
-0.025735008,
-0.0045789764,
-0.0008984068,
-0.00048135404,
-0.024083098,
0.0006316923,
0.020764789,
-0.05674453,
-0.0098245125,
0.015403329,
-0.029705387,
-0.017634856,
0.036023214,
-0.002251451,
-0.00789004,
0.0067344285,
-0.016533583,
-0.004506524,
-0.00176421,
-0.009578176,
-0.00029682743,
-0.034835,
-0.0073720072,
-0.017707309,
-0.017953645,
-0.026285645,
-0.034168437,
0.0020141702,
0.036718756,
-0.0012244415,
-0.014120926,
0.011382234,
-0.002466996,
0.032052837,
0.05129613,
-0.020243134,
0.0147440145,
-0.013476102,
-0.019562082,
0.039471935,
-0.0047999555,
0.006321451,
0.0026734846,
0.055237528,
-0.008629052,
0.0076944195,
-0.004137018,
-0.0033454786,
0.015852533,
0.0052056876,
0.012193698,
0.012729845,
-0.033733726,
-0.047412694,
0.020895204,
0.024083098,
0.009512968,
-0.021648705,
0.0016174945,
-0.060859814,
-0.047035944,
-0.0221124,
-0.0013412706,
-0.0034106853,
-0.02046049,
-0.017301576,
0.019170841,
0.026372585,
9.8433055e-05,
-0.031936914,
-0.011215595,
0.015041068,
0.06004835,
-0.0091144815,
0.005531722,
-0.0069517847,
0.02175014,
-0.02918373,
-0.0032512906,
-0.00060905097,
0.046079572,
-0.009433271,
-0.020692337,
-0.027444879,
-0.0026426925,
-0.0058613797,
-0.019866383,
-0.0096651185,
-0.012766071,
-0.020214153,
0.002615523,
0.049702182,
0.008237811,
0.007679929,
-0.038080856,
0.013265991,
0.011193858,
-0.0069083134,
0.008049435,
0.005165839,
-0.0035084959,
-0.030111117,
-0.0058831153,
-0.0035247975,
0.012526979,
-0.010578016,
-0.014041228,
-0.0122444155,
-0.03721143,
-0.0057418337,
-0.0076002316,
0.0023836761,
0.0056440234,
0.0015993814,
-0.006495336,
-0.0028799733,
-0.0044123367,
-0.01576559,
-0.021315426,
0.01911288,
-0.022068929,
-0.037617162,
-0.001587608,
-0.0063794125,
0.017605875,
0.0054918737,
-0.019866383,
-0.041471615,
-0.007274197,
-0.032516528,
0.026416058,
0.020040268,
-0.011882154,
-0.0008101057,
0.009911455,
-0.017272595,
0.028053477,
-0.002573863,
0.05468689,
-0.03689264,
0.004408714,
-0.0013965154,
-0.021286445,
0.017852213,
0.019214313,
-0.04121079,
0.029908251,
0.003461402,
0.038515568,
-0.009353574,
0.029125769,
-0.0027459369,
0.02985029,
-0.0030339342,
-0.018678168,
0.040689133,
-0.006488091,
0.029676406,
0.03625506,
-0.009788287,
-0.019083899,
0.012744335,
-0.01090405,
0.044137858,
-0.005995416,
-0.016837882,
0.022025457,
0.012389319,
-0.046253458,
-0.018388359,
0.017316066,
-0.012171963,
0.00987523,
0.0040500755,
0.001626551,
-0.009440516,
-0.028879432,
-0.002937935,
-0.017316066,
-0.005951945,
0.011983587,
0.04094996,
-0.01975046,
-0.016649507,
0.013715194,
0.029343124,
-0.00313899,
0.013381914,
-0.041181806,
-0.0321108,
-0.011317028,
0.033414938,
-0.011230085,
-0.022605075,
-0.008049435,
-0.013483347,
-0.0008010492,
0.0010125189,
-0.0443697,
-0.034690093,
0.011990832,
0.0013385536,
0.0040283403,
-0.008629052,
-0.044137858,
-0.04828212,
-0.022213832,
-0.024677206,
-0.069206305,
0.018214474,
-0.0010704807,
0.0005184858,
0.009773796,
0.013519573,
0.018721638,
0.003521175,
-0.0237788,
-0.012831277
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 7,
"total_tokens": 7
}
}
headers:
CF-RAY:
- 939c1708fdf87961-NRT
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 03 May 2025 01:47:23 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '33338'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '89'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-6546dd5b5b-cgzc4
x-envoy-upstream-service-time:
- '27'
x-ratelimit-limit-requests:
- '5000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '4999'
x-ratelimit-remaining-tokens:
- '4999992'
x-ratelimit-reset-requests:
- 12ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_3db89a0fc1f707874dd19823da0aab4b
status:
code: 200
message: OK
version: 1
test_async_embeddings_with_dimensions.yaml 0000664 0000000 0000000 00000042422 15270700723 0047615 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for async embeddings with dimensions",
"model": "text-embedding-3-small",
"dimensions": 512
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '118'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
-0.0068461937,
-0.074672244,
0.063718334,
-0.030411024,
-0.033028822,
-0.014435025,
0.054880943,
0.032230485,
-0.00655378,
0.019104362,
0.017656216,
-0.054323968,
-0.025435349,
-0.047454566,
-0.036816277,
-0.0014435025,
-0.009347955,
-0.018111084,
0.041030746,
0.011631567,
-0.022483364,
-0.07307558,
0.04210757,
0.050536513,
0.0070411363,
-0.0164123,
0.028907182,
0.048717048,
0.105603114,
-0.01207715,
-0.0030169666,
-0.05068504,
-0.016180225,
-0.074003875,
-0.026177987,
0.048642784,
-0.038468644,
0.09891938,
-0.06360694,
0.009473275,
0.0039754338,
-0.03995392,
-0.07225867,
0.0047621657,
-0.006470233,
0.06654036,
-0.06921386,
-0.010619722,
0.018556666,
0.06479516,
-0.06746866,
0.03124649,
-0.026103724,
0.071404636,
-0.06861974,
0.015066267,
-0.017981121,
0.01111172,
-0.016560826,
0.015539699,
0.067691445,
-0.06245585,
-0.056440484,
-0.036370695,
0.020422544,
-0.0018670382,
-0.04285021,
0.04437262,
-0.01969847,
-0.01919719,
0.05476955,
0.0318963,
-0.017052824,
0.0070364946,
0.03417991,
0.034718323,
0.038431514,
0.014657817,
-0.044781066,
-0.04207044,
-0.028647259,
0.08146738,
-0.04110501,
-0.019457115,
-0.018835155,
-0.018825872,
-0.06590912,
-0.0058436324,
-0.017637651,
-0.010127725,
-0.034569796,
-0.063644074,
-0.102781095,
-0.030930871,
-0.011919339,
0.028795786,
0.03089374,
-0.07370681,
-0.059559565,
0.023615887,
0.01095391,
0.050833568,
-0.019902697,
0.021313708,
-0.039025623,
-0.043407187,
0.009436144,
-0.0020933107,
-0.05265303,
0.02874009,
-0.07084766,
-0.031766336,
0.0073660403,
0.026289383,
0.07040208,
-0.03492255,
-0.03211909,
-0.013386049,
0.00016433766,
-0.028108846,
-0.04151346,
-0.018593797,
0.05952243,
-0.002634044,
-0.033103086,
-0.0647209,
-0.04678619,
-0.09015625,
-0.09706278,
0.03033676,
0.03692767,
-0.0003791515,
0.07489504,
0.05670041,
-0.10627149,
-0.031747773,
-0.094760604,
0.051427677,
-0.0074635115,
0.019958396,
-0.024618449,
-0.018148215,
0.05673754,
-0.02552818,
-0.03950834,
0.038320117,
-0.057405915,
0.097953945,
0.020589637,
4.9823462e-05,
-0.037967365,
-0.05967096,
-0.027032021,
0.03317735,
-0.044558275,
-0.052170318,
-0.02630795,
0.022706155,
0.035720885,
-0.016709354,
-0.050647907,
0.005876123,
0.03507108,
-0.031135095,
0.015938867,
0.036147904,
-0.023244567,
-0.027459038,
-0.061861742,
-0.1181537,
0.004971033,
-0.05009093,
-0.059151113,
-0.02484124,
-0.006182461,
-0.007291776,
0.024729844,
-0.07723435,
0.004653091,
-0.05814855,
-0.049051236,
0.03653779,
0.025101162,
-0.0076445295,
-0.09505766,
0.10448916,
0.027737528,
0.047268905,
0.039248414,
0.014648533,
-0.023894375,
0.07612039,
0.06939951,
0.0065212897,
0.029909743,
-0.035126776,
0.06360694,
0.0072175125,
0.032898862,
-0.022947513,
-0.000543054,
0.05265303,
-0.0022418383,
0.011232399,
0.043332923,
-0.060599256,
-0.016087394,
-0.056774672,
-0.0318963,
-0.007858038,
0.041030746,
-0.020329714,
0.034885418,
-0.008818826,
-0.049199764,
0.024599882,
-0.04069656,
-0.007403172,
0.033325877,
-0.026976323,
-0.039842527,
0.056997463,
0.061081972,
0.04028811,
-0.0637926,
-0.01544687,
-0.018519534,
-0.02222344,
0.032898862,
0.033530105,
-0.008247923,
-0.02859156,
-0.031060832,
0.011937905,
0.041996177,
-0.021146616,
0.028907182,
-0.017637651,
-0.05361846,
-0.007853396,
-0.00586684,
-0.05502947,
0.02428426,
0.017730482,
0.0032026262,
0.028257374,
0.017396294,
-0.052021787,
0.030819476,
-0.039322678,
-0.04582076,
0.026734967,
-0.03497825,
-0.014147253,
-0.0569232,
-0.0018972079,
-0.06011654,
0.05792576,
0.0045904308,
0.018408138,
-0.003485757,
0.043184396,
-0.048457127,
0.0422561,
0.023764415,
-0.060933445,
0.03692767,
-0.00048387505,
-0.0021478483,
-0.07006789,
0.005138126,
-0.013432464,
0.030113969,
-0.056997463,
-0.075377755,
0.022873249,
-0.056626145,
-0.01794399,
0.018064668,
-0.008247923,
0.026456477,
-0.037503216,
0.020311147,
0.07556341,
-0.02796032,
0.011919339,
0.021109484,
-0.028535863,
-0.006563063,
-0.0066280435,
-0.010062744,
-0.073558286,
0.059373904,
0.04730604,
-0.02003266,
-0.01198432,
0.024488486,
-0.020923825,
0.037187595,
-0.04715751,
0.059559565,
-0.03395712,
0.043889903,
0.035126776,
-0.036816277,
0.074857906,
-0.06639183,
0.086146004,
0.07418953,
-0.027069153,
-0.019828433,
0.0077420007,
-0.060265068,
0.061081972,
-0.09030478,
-0.0061406875,
0.0440013,
-0.029724084,
0.032081958,
-0.06739439,
-0.015121966,
-0.068471216,
0.014379327,
-0.09386944,
-0.0003707388,
-0.05361846,
-0.0019088116,
-0.021889254,
-0.007964792,
-0.0065862704,
-0.024247129,
0.049236897,
0.047417432,
0.0064470256,
0.026734967,
-0.040362373,
-0.0121699795,
-0.036593486,
0.057591572,
0.012151414,
-0.09134447,
0.008011207,
0.033808593,
-0.01579034,
-0.005165975,
0.026883494,
0.018073952,
0.03542383,
0.08540336,
-0.04325866,
0.006669817,
-0.023448793,
-0.022242006,
0.011631567,
0.07199875,
-0.08815113,
-0.038282987,
-0.017080672,
-0.042404626,
-0.04288734,
0.011492322,
-0.03061525,
-0.019085795,
0.08065048,
-0.0023694793,
-0.047046114,
-0.011185984,
0.045226652,
0.015233361,
-0.0073567573,
-0.013822349,
0.037726007,
-0.0284616,
0.013376766,
-0.048048675,
0.015567548,
-0.039062757,
0.069770835,
0.049756743,
0.0699565,
0.022873249,
-0.018649496,
-0.055140868,
-0.072518595,
-0.03167351,
-0.019327153,
0.02337453,
0.0073242667,
-0.022149177,
-0.025026899,
0.00052419794,
-0.028071715,
-0.009501124,
0.0048039393,
0.022056347,
0.0063495543,
0.082952656,
-0.05339567,
0.011770812,
-0.00090683054,
-0.041624855,
-0.07797699,
0.013970876,
-0.035535228,
0.0015409738,
0.029594122,
0.07626892,
0.02437709,
0.03973113,
0.001357635,
-0.03670488,
-0.006029292,
0.04207044,
-0.07790272,
-0.024766976,
0.03198913,
0.010916778,
-0.06531501,
0.02809028,
0.14340338,
-0.083398245,
-0.022464799,
-0.042293232,
-0.012095716,
0.027013455,
-0.01997696,
0.0955775,
0.022984644,
-0.001954066,
-0.050759304,
-0.06368121,
-0.009635727,
0.09654293,
0.043927036,
-0.053841252,
-0.054101173,
0.044966727,
0.016143093,
-0.04370424,
-0.028610127,
-0.009533615,
0.013311786,
-0.08488352,
-0.030095402,
-0.009190145,
-0.029278502,
-0.01844527,
0.024135733,
0.0002032101,
-0.02396864,
0.023114607,
-0.09386944,
-0.008535695,
-0.05499234,
-0.024191432,
-0.04266455,
0.0033697197,
0.005917896,
0.11703974,
-0.015409738,
0.056106295,
-0.07292704,
-0.0690282,
0.0440013,
0.096394405,
0.023281699,
0.011566586,
0.003112117,
0.033845723,
0.011278814,
-0.023671584,
0.08176444,
0.045523707,
0.03417991,
0.053915516,
-0.041921914,
0.008535695,
-0.03492255,
-0.006985438,
-0.032731768,
0.00080703857,
-0.027718961,
-0.04619208,
-0.041699123,
0.021814989,
0.20793863,
-0.05228171,
-0.06100771,
0.060524993,
-0.03564662,
-0.05796289,
0.01672792,
-0.048382863,
-0.02053394,
0.031265058,
-0.038208723,
-0.0012369563,
-0.052950084,
0.067617185,
-0.025175426,
0.030299628,
0.035999376,
-0.0032815314,
0.029445594,
0.033344444,
-0.023578756,
-0.06356981,
-0.0011104759,
-0.028944314,
0.040659428,
-0.021517934,
0.04756596
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 9,
"total_tokens": 9
}
}
headers:
CF-RAY:
- 939c17136f99e37d-NRT
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 03 May 2025 01:47:24 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '11151'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '100'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-964f95c58-6whsj
x-envoy-upstream-service-time:
- '53'
x-ratelimit-limit-requests:
- '5000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '4999'
x-ratelimit-remaining-tokens:
- '4999987'
x-ratelimit-reset-requests:
- 12ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_25528908028913f5e0c09c82f660f73d
status:
code: 200
message: OK
version: 1
test_async_embeddings_with_encoding_format.yaml 0000664 0000000 0000000 00000025127 15270700723 0050606 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for embeddings with encoding format",
"model": "text-embedding-3-small",
"encoding_format": "base64"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '127'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": "DK6fO8qEirxr7OE8SQSPvXpWIry659e8mJ5BPUKZiTxZdqM76WvmPDaVLT0xwge86TEXvU+lObzFhka8XkUfvNgvd7yb1d08OC0NuzMvyTshVB07MPgsvc7umDzYWhU9SjeBPBQdz7wB2Yu8gYuCPbZ9ST1078a8c4rZvDwyrrxnsRs8BRj8vNv2nrz3bA88HFZZvMXnCT2xSeC8Pp/vOuVimzyN/1K8kc5OvXAk9bvH6AA8UgsePWdMrrxvgQ69+Z8BvEE0HD2w4Ei9FbEEPUY9Zzyd0qq7ZbROvA6Azjx0Ho+8vbKpPITGyLsC3bW7mAMvPTXHKL3QIYu6mNRmvNYnozx078a6l295vQyuHz1frra6bYhrvP/bPj1O17Q8KCSQvJKcUzzXjBA9m9XduwBFVrwJSDs7RTk9vSS6gb2m2Tm8UXfoPL+6/bxyggW9mnDwOxBS/Tx6u4+94JMfvIIqv7xvgQ69/d7xvH1XGb08lxu9H7y9vBvtwTtOdnG8G1IvvJU4Xb06ZCm7+NUmPJg5VLzP8kI8y4i0u35fbbta2xC6arKSvGUVkjwU56m7Y0eNvT7ON7xc3Ae9C39Xu5drT7w4yJ88kmKEPVtEKLwLf1c86ZYEvdP3Y7ujDug7jf/SvHuJFLxWED89LyqovB2FIb1i6fy8IbkKulupFb0O5bu8UXdovOqaLrzeXIO8XNwHPRAYLj36o6u9gYsCvQjfo72zRi083S07vbmCaj1KbaY6oWsBvfaeCjz9Q1+8PgTdvKtHcjwVUMG9qqQLPQhEkTwW7308dLkhvAJ88jtoUFi9v+UbPGIUG73BHDi9H/LivEI4xrypEFY9MWHEu2N9MjmyQgM9NQF4PDsuhDrC6jy7kwFBvBfoID0tLds6o9QYvRVMF7x3VSu8PcqNvPM4przCu/S5kmIEvfVvwjqrqLW892yPvZJiBDvwAQq9mDnUvBAYLj3/2z68HBwKPCMmzLyLMU49mNRmPCGKwjycaRM9wuo8uwJCo7ypENY8r9yePQbiVjvgyUQ8cOolvXIhQj0B2Qu9CRIWPbkd/bzvCGe8tBAIPYTGyLxgsuA8Bd6sPFrbEL1BNBy9RzYKvdPBvrxkSze8e172PKPUmLzAGA48OMgfO3ZRgTv3ByI9fiUevYWQI7xS3FU8izHOvIbDlbyxSeA8nAhQPZg51DyuDpq9KvIUvAt/17zHuTi93sx3PUc2iryjOQa77GzdvNHvjztJo0s8HByKPE3TCrzGVEs7xFf+uyW+q7zT9+M8c+scvVDUAbqHYlI9nAhQu2AXTrx+X+08aRqzO/k+Pr31CtU8dO9GOuEy3DyS/ZY8W6kVvP48Ar1MP9W8c1AKve5pqrymqnE9YnmIPO02uDc6ms66l9C8PAKnkLya0bO6ptWPPFUMlbxMBYY8z1ewO0ptJrqD+EO9c8B+O0nZ8LzellI8L4+VPFWnJ70zL0k9oaGmvCpXgrz0axi7KvKUPK6pLL0xwoe9DuW7O43JLT3C5pK89j3HN052cbxbDgO8saojvfY5HTuoRnu7UXdovQJCIz3uaao8JLoBvbkdfTwTtDc80/fjO7GqIz3rZIm8XHcaPUQ1kzvLUg89FB1PPSj1R71rh/Q8ljGAvSW+Kz1XeVY9GVXiujsDZryx5HI8n2oKu51x5zw4Z1y9MPgsvDD4rDyrR3K8njtCPNBb2rpu7Vi8AnzyOeH8Nj1SQUO9kv2WPH28Bj0Ae/u8XqqMPPrdertGA5g8cyXsvPXULz20Slc9RTm9u6Q9sLwyKx+8RDUTvQwTjTyvd7E7qj+evOkG+bwQs8C8ogo+PWvs4TzIhz29TnJHPeaVjTvb9h49rq3WPBVMl7x7iZS7OfsRvGrot7xPQMw8/QmQPW+BDr0PFIQ8sniovEmjy7yqpAu9OAJvPKaq8bu24ja8Q6HdPIstpDx2wfW8DK4fvf1DXzw3/sQ8tXkfvI4yxbzChc872L+CvJ0MejsNfKS8eIgdOkOdMzmOkwg9IbkKPbewOz1WEL88M5Q2vYbDFb371h29BagHPA4b4Twbt5w8AQ8xPKcIgrxWdSw5h5h3PIpjSbq85KS86ALPvEai1DwvYE09SaPLPIJZB72xD5G6ua2IvGJOarxREnu9jpOIPN3IzbyhBhS7Qc8uPWVPYT2V/g086WvmPBGBRbxmfqm8Hx2BvO1lAD3S87m862SJPAp7LTveMWW56WvmvJloHDyuSOk8V3lWvFupFb3q/5u9WrDyO7lIm7x6VqK8CBlzPQsaarzP8kI7gYuCvRkbE71+igu8aOtqu1cU6TsVTJe8EeYyvfOdEz1iTuo8OMgfvDyXm7vTIgI8wksAPcK79LyhPDm9nXFnvJPLG72SnNO7xecJPQB7+zr3QfG8o3NVvKmraL0A4Oi8fI0+vYKPrDzwAQq9ecJsvLmCajy3FSk9KvKUvC33tTuhBpS91CYsvY4yxTzFvGs9e4mUvOJhJL02lS28EFL9PIHBJ7xhSsC8V3lWPSSPY7uP/B88b4GOPDP5o7yyQoM8oDgPvJdrz7zT9+O87mmqu+T5A73tZQC9gfv2uuZq77xzUAo+VnWsvE48Ir0yKx89HriTu6M5Br3vMwW8H1dQvWCyYLwVTBc8x1j1vJPLm7yBi4K8ZuMWPZ0M+ryMmmW8+zuLPFfewzxOoY8842n4PFQ+kDxAZhe9MV2avAcVybyY1OY7jJrlPIdi0rwB2Qu9iv5bPD83zzt/xNo7yoQKvSosZD1g4Si9DhvhvMa1jjy5fsC8zb9QvFZ1rLxFOb07ExmlPNVZnrzA6cW9CH7gvJeal7wYUbi8jf9SvGgWCT3YlGQ7aIZ9u6zbJ7zZ+dG7wYGlPDJlbjyOMkW8ukzFPO8IZ7wCfPI8MC5SvCAhq7t1vcs84saRPB3qjrnWwrW8CnutPPY5nTpjfbK8elaiPPgLTL3QvJ08FB3PPK2lAj1GPWe8O8kWvePKOztiTmo8c1CKPGKzVz3dkig9wOlFvTpkKT2mD986TAkwvIrINj0W7/28eyQnvYT87brnmTc8mnBwO4GLAr371h08KixkvKVwojyMmuW8A+HfO9sw7rtBNBw8xFd+PDb6GjxREvu86WvmOwbi1jw+BF28tn1JvHBPkzlOcsc80/djPNSLmbtmGTy9brezOw+vFjw+BN08CneDvNhaFb3mlQ09NGK7PDf+xDyKme68HFbZPLUUMjw3YzI9mDnUvC33NT2oRvs8O574uiGO7Lsjhw+8723UvPaeirsCeMg801zRuxyM/jvdkig7EkugPBbv/bugct47D6+WvGJO6rsGER88C39XO/pC6Dybnzg7VUK6O/M4pjwlIxk8CH5gvCGKwjsKdwM9SQQPvf1D37yH/eS7toHzvJ4FHbysrN88KcNMvSMmzLv3QfG42fnRPLQQiDxInyG7+AvMvBKwjTtyIUK8pabHu+DJRLyCj6w88qTwvOT5AzyF9ZC8bekuPHZRAb16u4+8wksAvKBy3rjHgxO9TAWGvKOp+jmuSGk6Ov+7vO02uDu5SJs8l5qXvZxpEzzqNcG8CnstPKM5hrwMSTK7zb9QPKHXS71GotQ8jJY7vexs3bxDZ447wksAvJX+Dby5HX28JPAmPEZohbwX6KC8RZqAPKaq8Tv/QCw9nZyFvC/FOruLLaS70e8Pvd3IzbwI36M8+t36uzZfiDzEHS89RAbLPPMCATymD187ak0lOyYnQzt3HwY9gSYVu64OGr3ezPe5PQAzvdkoGrzezPc8YrPXPH6KC7yWMYA7850TvP+lmTySYoQ8ZRWSPOtos7zn/qQ8Rj1nu7mtCLxm4xY8fI2+vFGiBrzO7pi776N5OmgWibyV02+8BRh8unwoUTv3ojS9st2VvFILHjydnIU8lzWqu1faGby651c8Oy4EPNJYJ7wO5Tu76wPGvC8qKLylcKK6o9hCO/nZUDwRHFg83vcVvaejFD0GER89JIs5vHmMRzwXg7O8gWBkvIBYEDzkM1O8tErXu4JZh7y3sLu8PzMlPePKO7y85KQ6H431PBNT9DuEJww9KFq1OfM8UDxfrja7c4rZO0TQpbwFfem7H/JiPKYP3zxxU707qEb7u1d51rt8KFE8FlRrPaBy3rzvo/m8gFiQPLewO73k+QM9K1ssPFytPzxQ1AE8wrv0vNLzObyRzk48NstSvBdNjjyUNDO8vB50vc2FAb01x6g79wciPe0Ak7vVWR48CnstvCos5LwJrai99weivIuSkTxcTPy80YoiPMlRmDy0gPy7Ca0oPNVZnrxasPI89NCFO1JBw7w7A+a4ntbUvHhdfzzRiqK8d1UrPbdLzrxUE/K8rq1WPMGBJbyNLhs85ceIPSfxnTye1lS9axuquVES+7uuc4e8QTQcvGNHDTuzq5q8F02OvCG5irwD4V88hl6oPOH8trycaRO8kv2WO4L0GT1/xFq6QwKhPGJO6rwJ4828GfB0vFN0NT01LJa7c8D+O4zFA7wCp5A83CkRvW2IazrkM1M5o6n6uI1kwLy5gmo83S07Pdn5UTy5Hf27WRE2vGsXAD3kmMC88qTwPA9KqTtUPpC7MmVuPA6287sl9FC8/UPfPBO0t7x+igu9mnBwPKULNbvuaSo9q0fyO2fnQL2ZzYm8p6MUPWnkDT3Zw6w6Z+dAPbBFNj0ovyI9rHa6uhYanDz3pl68x4OTO5X+jbxJo0u9v0oJvdkomrtAO3k8MWHEvIQnjLwuXKM8H411uBmAgLxOdnE8njtCveGXybo1kYO8yh8dPSOHjzz93nG8OGfcvKgMLL1n50C8RmgFPC2SyDzellK6dFS0OhJPyjsZVWI8MWHEO5pwcLxmfim9/QkQvEo3AbzEghw9G+1BPHcfBrtDPHC8BNqCPdbCtTxREvu88aBGvXAkdTqYA687v+UbOuGXyby8SZI8URJ7vAEPMT3szSC89p6KvQPh3zyWZ6U8uHqWu9z6SDy05Wm9IvPZu/UKVTzdyM28pnTMvHMl7LvH6IC8zfV1PLOrGr2/H+s8sniou5X+Db25fkC8dYemPGIUm7wTtDe8LfOLPAkSlrzeXIO7v0oJPOtoszwtksg80r0UOgp7LTyabMa87NFKvAsa6jxBoGa8IIaYvB8dAT1aFeC8tID8uxhROL2pq2g8wuq8O1gNDLtOdvE8jPuoPBSCvDuSYoQ8elaiPF9N8zrAsyA9qavoPEbYebqcCFA825XbORu3HD2eoC87xYZGvYb5Oru7Gso8J5DavG5SxjyBJpU78m5LPIn6sTuBxdG8bIAXu/emXjya0TM7oaGmvPemXj3S87k7GbrPO95cg7wtksi8tRQyu+zNoDzTIoI8Ov+7vInEjDxnTC482cMsPD6f7zwghpg7v0oJvf3ecTyPNm+9QaBmvEBmlzwB2Ys8WA2MuhtSrzyxSeC8KPXHu1Z1LDykoh08LyooPTJlbrzxzw47nQx6O/vWHb1I1UY7MsaxPEo3Ab1LOys8PcoNPGJO6rzcxCO9VD4QPQtFiLxX3kM87NFKOwh+YDySN+a8A+FfuiqRUbz52VC7KFo1PfRrGDz1b8I8+m0GPGuH9LvgLrK7LyoovSfGfzzGtQ48IIaYvGYZPLy6sTI9rkhpO0w/1TplsKQ8kpzTPAbiVr0Ae3s7aBYJPEo3gbzZ+dG8VnGCvE48IjxeSck88zxQPXOKWTuD+EO71vhau0KZCTuuSGm8a+xhPDqaTj0ZVWI7txWpvNb4Wrx5J9o8WrDyulfewzxjRw297ZulvH+ONTypq2g8QGYXO/pthryvQYy7fMNjvJrRs7xPpTm6WtsQPci94ruE/O28xeuzPKYP3ztiTuo8Qc8uvCS6gTwLGmq8cIU4vBVMlzzoY5I8Pp/vvOH4DL2AWBC8PzOluTWRAzzvo/k8ybYFvKM5Bj3eMeU76v8bOyS6gbxxUz27786Xu6mr6LwE2gK8SzsrvD2bxTzZw6w6nGmTPFLcVT0TU3S8EbfqPIRh2zxmGTw88aBGvJ9qCrsyKx+8j2ENvbDgSDqbOku8IiIivMKFT722gXO8bSP+u/ShvTypdcO8Sm0mO4X1kLyv3B48l295O/TQBT0vKig8YxjFOzbLUj0TfpK8HSA0vKgMLDzlxwg8c4pZu70Xl7zraLM8ptk5vbQQiLyxD5G5hZAjPd4xZbvellK8kpzTPHdVqzw2X4i8rECVvFtEKDxwJHU6zSCUO3G4KrvrZIm6bYhrPD83T7xVQrq7eL7CvEABqjxfE6Q8EFL9PNz6yLzblds8ntZUOQtFCDxUPpA83jFlPP7XFL34OhQ9OfsRu4qZbrytpYK8RZqAvFeve7sST0q8ST7evGexG7yacHC7F4Mzvd0tuzxkSzc8+qfVOgu1/DzI7Cq9CH7gO1gNDD3qmi69723Uuo4yRTyxqiM9qRBWvNP34zwZgAA9mWicvB/y4jyHYlK81pPturJCg7veMWU8wBiOPDPKWz36p9U8UXfoPKbVj7ydcee8iv7bN80glDyeBZ08lgI4vMAYDr37Ows9BhGfvGqDSjpqTaU72JRkPZnNCbxi6fw7SzsrPNEltbxmfqk86pouPaQHC7uY/4S8X01zO8jsqjrvbdS7+HA5vB0gtDuAXLq8ciFCPTRekTtg4ag8LyooPGGrA72VOF09imPJO6DTIbwhVJ29hGFbO4HF0Tv1CtU8CxrqO4X1ELxs5YQ8cLSAunwo0bw0XhE9+DqUvGCy4Drb9p485JjAvDpkqbsvYE08TW4dPWKvrbwHerY88QW0vBm2Jby1FDI7/jwCO9BbWrxV3Uw9XbFpvI3/Uru35uA7cbgqPRvtQTr2PUc8CRIWvRxW2Tsqx/Y8nQz6OwYRnzxk5sk8ISl/POEyXD0PSqm63yqIu/RrmLjTXFG9h2JSO3UiObyhawG9hfWQvJLS+DxJPt48v0qJPFF3aDzqNUE8jcmtPFtEqLzWXci7Y+Ifu9wpkbzun888MPisux5TJjwCfPI8gcGnvJbMEjuhBpQ8P5iSPEBml7sZ8PQ8e7+5PIz7qLwBdB69ee0KPOlr5jzOJD69oHLeuydWizxaek28VHjfvJc1qjuuqay79aXnPGtRzzzVvou8t7C7OrnjLTlLcVA8blLGu5EzvLwARda7blLGvKIKvrt9W0O9THV6vH76f7zyCV48yL3iu2kas7ttiOs8aLVFu1FzPj3raLM8coKFvJGYqTuM+6i8dx+GOgh+YD296M68ST5eOgWoB7sSSyA9mAMvu52cBTwIRJG8oaEmvMjsqryvEsQ738WaPGpNpTxygoW8dLmhvHiIHTzQkX88iV+fvP3e8Tq7ew08nZyFvCcrbb3YvwK97TY4PIb5ujvQW1q83sz3u+/OFz1dsWk89aVnvIGLAr3sMg68fMPjPIFgZDzwAQq7WaxIuoGLgrkBdB48xlChvOH4jLyBJhU8pqrxPIfHv7v63fq8KSg6vdtbjLsahKq8C7X8OjD4rLx3Vau8axcAvUGgZruMxQM976N5uzP5Izx6uw+9qRBWu3QeDzyXNSq81PAGPW1OHDx/xNq8HeoOvW1OnLzrZIm8kpzTPCpXgjwhVJ28NZGDO3bwPb2s2ye7Hu44vBZU67yz4T+7hyiDPGLp/LuYOdQ7paZHPF17RLyMmmW8Hx0BO3nCbLzmMCC9w0+qvIBcurxpf6A8e+6BvHRUtDwG4ta8fVtDvPY9x7zn/iQ9U3ALPYD3TDvTknY6F02OuiIiorxbDgM9HPFrPP1D3zwn8R296jVBPKaq8TuurVY7KPXHPLOrmjx1vUu8eYxHPH/EWjwwLtI8kC8SvEx1ejw0XhE8yh+dujto0zwR4gi94JMfPT7ON7ymqvE8XbHpPE528Ty546282JRkPByMfjw0/U09xFd+vJrRM7tFOb080CGLPKl1Q70kKva86GOSPOc0SjulcCK8RgMYPDvJFrrkzuW8Ps63vCgkkDwWGhy9mJ5BO1qwcjwvZPc8DRe3vIz7qLyKme48/g26PBjsSjq5rQg82PWnuofHP7ww9AK6EFJ9PPg6lLyaNiG8uR39vBlV4rwEdZW7ogq+PCqR0bw2lS2962gzPZ2cBT2abMa8brezNy3zi7xfeJG9J/EdvBeDMzuAXDq9/d5xPN9grTshVB29ylnsui0tW7o1kYM81fQwPMDpxby54y08"
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 9,
"total_tokens": 9
}
}
headers:
CF-RAY:
- 939c1836de294a26-NRT
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 03 May 2025 01:48:10 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '8414'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '82'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-698696864c-zvnz4
x-envoy-upstream-service-time:
- '52'
x-ratelimit-limit-requests:
- '5000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '4999'
x-ratelimit-remaining-tokens:
- '4999987'
x-ratelimit-reset-requests:
- 12ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_f9b3fad2c1ee8d52c777edfa84b4cfff
status:
code: 200
message: OK
version: 1
test_chat_completion_404.yaml 0000664 0000000 0000000 00000004023 15270700723 0044566 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "this-model-does-not-exist"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '103'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"error": {
"message": "The model `this-model-does-not-exist` does not exist or you do not have access to it.",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1225a16c283d93-SIN
Connection:
- keep-alive
Content-Type:
- application/json; charset=utf-8
Date:
- Mon, 11 Nov 2024 23:43:52 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
alt-svc:
- h3=":443"; ma=86400
content-length:
- '231'
openai-organization: test_openai_org_id
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
vary:
- Origin
x-request-id:
- req_c3e0f92d7b5426d1a4a17bb3d39953ea
status:
code: 404
message: Not Found
version: 1
test_chat_completion_extra_params.yaml 0000664 0000000 0000000 00000006551 15270700723 0046755 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"max_tokens": 50,
"response_format": {
"type": "text"
},
"seed": 42,
"stream": false,
"temperature": 0.5,
"service_tier": "default"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '220'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.7
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-AbMH70fQA9lMPIClvBPyBSjqJBm9F",
"object": "chat.completion",
"created": 1733467125,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test. How can I assist you further?",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 12,
"total_tokens": 24,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"service_tier": "default",
"system_fingerprint": "fp_0705bf87c0"
}
headers:
CF-RAY:
- 8eda465e8fe9e58c-KUL
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Fri, 06 Dec 2024 06:38:46 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '825'
openai-organization: test_openai_org_id
openai-processing-ms:
- '558'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9998'
x-ratelimit-remaining-tokens:
- '199943'
x-ratelimit-reset-requests:
- 12.967s
x-ratelimit-reset-tokens:
- 16ms
x-request-id:
- req_22ff608d47a299f0780f52360631eabb
status:
code: 200
message: OK
version: 1
test_chat_completion_handle_stop_sequences_as_string.yaml 0000664 0000000 0000000 00000006713 15270700723 0052713 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"stop": "stop"
}
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '105'
Content-Type:
- application/json
Host:
- api.openai.com
User-Agent:
- OpenAI/Python 1.109.1
X-Stainless-Arch:
- x64
X-Stainless-Async:
- 'false'
X-Stainless-Lang:
- python
X-Stainless-OS:
- Linux
X-Stainless-Package-Version:
- 1.109.1
X-Stainless-Runtime:
- CPython
X-Stainless-Runtime-Version:
- 3.12.12
authorization:
- Bearer test_openai_api_key
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-Clubs1bbZwGUeDKpnPUWDMEhSbquh",
"object": "chat.completion",
"created": 1765535060,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test. How can I assist you further?",
"refusal": null,
"annotations": []
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 12,
"total_tokens": 24,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"service_tier": "default",
"system_fingerprint": "fp_11f3029f6b"
}
headers:
CF-RAY:
- 9acc82e96fde4bf3-MXP
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Fri, 12 Dec 2025 10:24:20 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '852'
openai-organization: test_openai_org_id
openai-processing-ms:
- '500'
openai-project:
- proj_Pf1eM5R55Z35wBy4rt8PxAGq
openai-version:
- '2020-10-01'
x-envoy-upstream-service-time:
- '826'
x-openai-proxy-wasm:
- v0.1
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '10000000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '9999993'
x-ratelimit-reset-requests:
- 6ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_993163a7581641b7b9aee6e03ef4ca3a
status:
code: 200
message: OK
version: 1
test_chat_completion_handles_not_given.yaml 0000664 0000000 0000000 00000006712 15270700723 0047754 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"stream": false
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '106'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.109.1
x-stainless-arch:
- x64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.109.1
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.10.12
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-CZDvsSHdMnAgYuQ8J81NMgOK2wfam",
"object": "chat.completion",
"created": 1762511072,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test. How can I assist you today?",
"refusal": null,
"annotations": []
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 12,
"total_tokens": 24,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"service_tier": "default",
"system_fingerprint": "fp_560af6e559"
}
headers:
CF-RAY:
- 99ac1f128834ed5e-MXP
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Fri, 07 Nov 2025 10:24:32 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '850'
openai-organization: test_openai_org_id
openai-processing-ms:
- '512'
openai-project:
- proj_Pf1eM5R55Z35wBy4rt8PxAGq
openai-version:
- '2020-10-01'
x-envoy-upstream-service-time:
- '797'
x-openai-proxy-wasm:
- v0.1
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '10000000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '9999993'
x-ratelimit-reset-requests:
- 6ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_9eac1833161f4ac89019c12f24002ef4
status:
code: 200
message: OK
version: 1
test_chat_completion_metrics.yaml 0000664 0000000 0000000 00000006304 15270700723 0045731 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"stream": false
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '106'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASYMQRl3A3DXL9FWCK9tnGRcKIO7q",
"object": "chat.completion",
"created": 1731368630,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"service_tier": "default",
"usage": {
"prompt_tokens": 12,
"completion_tokens": 5,
"total_tokens": 17,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e122593ff368bc8-SIN
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 11 Nov 2024 23:43:50 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '765'
openai-organization: test_openai_org_id
openai-processing-ms:
- '287'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '199977'
x-ratelimit-reset-requests:
- 8.64s
x-ratelimit-reset-tokens:
- 6ms
x-request-id:
- req_58cff97afd0e7c0bba910ccf0b044a6f
status:
code: 200
message: OK
version: 1
test_chat_completion_multiple_choices.yaml 0000664 0000000 0000000 00000007014 15270700723 0047612 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"n": 2,
"stream": false
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '114'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASYMUBq69UHDarAz2fsd0O50rv0r1",
"object": "chat.completion",
"created": 1731368634,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test. How can I assist you further?",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
},
{
"index": 1,
"message": {
"role": "assistant",
"content": "This is a test. How can I assist you further?",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 24,
"total_tokens": 36,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1225a91a253e53-SIN
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 11 Nov 2024 23:43:54 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '1030'
openai-organization: test_openai_org_id
openai-processing-ms:
- '399'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9997'
x-ratelimit-remaining-tokens:
- '199962'
x-ratelimit-reset-requests:
- 22.564s
x-ratelimit-reset-tokens:
- 11ms
x-request-id:
- req_01290a92a1a3d787c7a00bb3836da597
status:
code: 200
message: OK
version: 1
test_chat_completion_multiple_choices_streaming.yaml 0000664 0000000 0000000 00000102574 15270700723 0051672 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
}
],
"model": "gpt-4o-mini",
"n": 2,
"stream": true,
"stream_options": {
"include_usage": true
}
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '254'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"I'm"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":"I'm"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" unable"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" unable"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" provide"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" provide"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" real"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" real"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"-time"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":"-time"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" updates"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" updates"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" as"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" To"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" my"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" get"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" capabilities"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" the"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" do"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" latest"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" not"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" include"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" information"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" accessing"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" live"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" Seattle"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" data"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" San"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" However"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" Francisco"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" you"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" I"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" can"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" recommend"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" easily"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" checking"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" check"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" the"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" reliable"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" current"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" website"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" or"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" Seattle"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" using"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" San"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" Francisco"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" app"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" using"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" You"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" can"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" also"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" website"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" ask"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" app"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" voice"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" or"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" assistant"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" service"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" or"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" search"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" Would"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" online"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" you"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" like"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" the"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" some"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" current"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" tips"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" on"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":" conditions"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" where"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" find"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" this"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":" information"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{"content":"?"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[{"index":1,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null}
data: {"id":"chatcmpl-ASYMaNc7XmbGRUNREnmvhyyISBHsv","object":"chat.completion.chunk","created":1731368640,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_0ba0d124f1","choices":[],"usage":{"prompt_tokens":26,"completion_tokens":104,"total_tokens":130,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}}
data: [DONE]
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1225d0fa1481e4-SIN
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Mon, 11 Nov 2024 23:44:00 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization: test_openai_org_id
openai-processing-ms:
- '176'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9993'
x-ratelimit-remaining-tokens:
- '199945'
x-ratelimit-reset-requests:
- 59.369s
x-ratelimit-reset-tokens:
- 16ms
x-request-id:
- req_892a6021b1acc00254d8ff80adcd82fb
status:
code: 200
message: OK
version: 1
test_chat_completion_multiple_tools_streaming_no_content.yaml 0000664 0000000 0000000 00000022105 15270700723 0053632 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
}
],
"model": "gpt-4o-mini",
"stream": true,
"stream_options": {
"include_usage": true
},
"tool_choice": "auto",
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. Boston, MA"
}
},
"required": [
"location"
],
"additionalProperties": false
}
}
}
]
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '602'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_j7L00WV19wwQCvKOIVZewXZm","type":"function","function":{"name":"get_current_weather","arguments":""}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"lo"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"catio"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n\": \"S"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"eatt"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"le, W"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"A\"}"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_sAIOI3dvcd1YMsEqD8DI3l8B","type":"function","function":{"name":"get_current_weather","arguments":""}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"lo"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"catio"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"n\": \"S"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"an F"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"ranci"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"sco, C"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"A\"}"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null}
data: {"id":"chatcmpl-ASYMdbuQwnGMCODejEnbp2ufs6WgR","object":"chat.completion.chunk","created":1731368643,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","choices":[],"usage":{"prompt_tokens":75,"completion_tokens":51,"total_tokens":126,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}}
data: [DONE]
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1225e40bed40c8-SIN
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Mon, 11 Nov 2024 23:44:04 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization: test_openai_org_id
openai-processing-ms:
- '1225'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9991'
x-ratelimit-remaining-tokens:
- '199961'
x-ratelimit-reset-requests:
- 1m13.588s
x-ratelimit-reset-tokens:
- 11ms
x-request-id:
- req_102cd878d03c1cec0c12b95f928d03ee
status:
code: 200
message: OK
version: 1
test_chat_completion_multiple_tools_streaming_with_content.yaml 0000664 0000000 0000000 00000022104 15270700723 0054170 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
}
],
"model": "gpt-4o-mini",
"stream": true,
"stream_options": {
"include_usage": true
},
"tool_choice": "auto",
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. Boston, MA"
}
},
"required": [
"location"
],
"additionalProperties": false
}
}
}
]
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '602'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_fHCjJqt9Pysde6vcJcvbXGBx","type":"function","function":{"name":"get_current_weather","arguments":""}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"lo"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"catio"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n\": \"S"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"eatt"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"le, W"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"A\"}"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_3J9foSw3CUb48lrqIXoTky6U","type":"function","function":{"name":"get_current_weather","arguments":""}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"lo"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"catio"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"n\": \"S"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"an F"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"ranci"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"sco, C"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"A\"}"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null}
data: {"id":"chatcmpl-ASYMbACebDoWcuraMEWQhU48q4dAp","object":"chat.completion.chunk","created":1731368641,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"fp_9b78b61c52","choices":[],"usage":{"prompt_tokens":75,"completion_tokens":51,"total_tokens":126,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}}
data: [DONE]
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1225d8af0c3d93-SIN
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Mon, 11 Nov 2024 23:44:03 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization: test_openai_org_id
openai-processing-ms:
- '1399'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9992'
x-ratelimit-remaining-tokens:
- '199961'
x-ratelimit-reset-requests:
- 1m6.779s
x-ratelimit-reset-tokens:
- 11ms
x-request-id:
- req_d745d48bf030ac78e4790ee49848d05f
status:
code: 200
message: OK
version: 1
test_chat_completion_n_1_is_not_reported.yaml 0000664 0000000 0000000 00000006700 15270700723 0050217 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"n": 1
}
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '97'
Content-Type:
- application/json
Host:
- api.openai.com
User-Agent:
- OpenAI/Python 1.109.1
X-Stainless-Arch:
- x64
X-Stainless-Async:
- 'false'
X-Stainless-Lang:
- python
X-Stainless-OS:
- Linux
X-Stainless-Package-Version:
- 1.109.1
X-Stainless-Runtime:
- CPython
X-Stainless-Runtime-Version:
- 3.12.12
authorization:
- Bearer test_openai_api_key
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ClubqNLub25QPdqxjOslny04PLCYZ",
"object": "chat.completion",
"created": 1765535058,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test. How can I assist you today?",
"refusal": null,
"annotations": []
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 12,
"total_tokens": 24,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"service_tier": "default",
"system_fingerprint": "fp_11f3029f6b"
}
headers:
CF-RAY:
- 9acc82ddddd4edba-MXP
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Fri, 12 Dec 2025 10:24:19 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '850'
openai-organization: test_openai_org_id
openai-processing-ms:
- '405'
openai-project:
- proj_Pf1eM5R55Z35wBy4rt8PxAGq
openai-version:
- '2020-10-01'
x-envoy-upstream-service-time:
- '529'
x-openai-proxy-wasm:
- v0.1
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '10000000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '9999993'
x-ratelimit-reset-requests:
- 6ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_2b15771f24a4465fb5fc43b797f39e04
status:
code: 200
message: OK
version: 1
test_chat_completion_no_content.yaml 0000664 0000000 0000000 00000006237 15270700723 0046436 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"stream": false
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '106'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASYMQRl3A3DXL9FWCK9tnGRcKIO7q",
"object": "chat.completion",
"created": 1731368630,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 5,
"total_tokens": 17,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e122593ff368bc8-SIN
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 11 Nov 2024 23:43:50 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '765'
openai-organization: test_openai_org_id
openai-processing-ms:
- '287'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '199977'
x-ratelimit-reset-requests:
- 8.64s
x-ratelimit-reset-tokens:
- 6ms
x-request-id:
- req_58cff97afd0e7c0bba910ccf0b044a6f
status:
code: 200
message: OK
version: 1
test_chat_completion_streaming.yaml 0000664 0000000 0000000 00000010726 15270700723 0046257 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4",
"stream": true,
"stream_options": {
"include_usage": true
}
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '142'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-ASYMZ4oSykiIFK4lXLReDiKyAjsQl","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMZ4oSykiIFK4lXLReDiKyAjsQl","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\"This"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMZ4oSykiIFK4lXLReDiKyAjsQl","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMZ4oSykiIFK4lXLReDiKyAjsQl","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMZ4oSykiIFK4lXLReDiKyAjsQl","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" test"},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMZ4oSykiIFK4lXLReDiKyAjsQl","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".\""},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-ASYMZ4oSykiIFK4lXLReDiKyAjsQl","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null}
data: {"id":"chatcmpl-ASYMZ4oSykiIFK4lXLReDiKyAjsQl","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":12,"completion_tokens":5,"total_tokens":17,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}}
data: [DONE]
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1225c87b273e53-SIN
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Mon, 11 Nov 2024 23:43:59 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization: test_openai_org_id
openai-processing-ms:
- '207'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '10000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '9978'
x-ratelimit-reset-requests:
- 8.64s
x-ratelimit-reset-tokens:
- 132ms
x-request-id:
- req_c367cf360ee88481fb7cd6c5d45bf9dc
status:
code: 200
message: OK
version: 1
test_chat_completion_streaming_not_complete.yaml 0000664 0000000 0000000 00000007574 15270700723 0051036 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4",
"stream": true
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '99'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-ASYMZbRqo8Bkz53FVzaTj7W7feOn4","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMZbRqo8Bkz53FVzaTj7W7feOn4","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"This"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMZbRqo8Bkz53FVzaTj7W7feOn4","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMZbRqo8Bkz53FVzaTj7W7feOn4","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMZbRqo8Bkz53FVzaTj7W7feOn4","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" test"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMZbRqo8Bkz53FVzaTj7W7feOn4","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-ASYMZbRqo8Bkz53FVzaTj7W7feOn4","object":"chat.completion.chunk","created":1731368639,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
data: [DONE]
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1225ccb98e823b-SIN
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Mon, 11 Nov 2024 23:43:59 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization: test_openai_org_id
openai-processing-ms:
- '205'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '10000'
x-ratelimit-remaining-requests:
- '9998'
x-ratelimit-remaining-tokens:
- '9978'
x-ratelimit-reset-requests:
- 16.601s
x-ratelimit-reset-tokens:
- 132ms
x-request-id:
- req_d13225164a822ec3ebab5591ed0b6d6a
status:
code: 200
message: OK
version: 1
test_chat_completion_tool_calls_no_content.yaml 0000664 0000000 0000000 00000021763 15270700723 0050652 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
}
],
"model": "gpt-4o-mini",
"tool_choice": "auto",
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. Boston, MA"
}
},
"required": [
"location"
],
"additionalProperties": false
}
}
}
]
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '543'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASYMW6w3m9qqpHUVhYTbQbw61zMqA",
"object": "chat.completion",
"created": 1731368636,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_eqbDFUdPqay2WjsSzZEiAn0U",
"type": "function",
"function": {
"name": "get_current_weather",
"arguments": "{\"location\": \"Seattle, WA\"}"
}
},
{
"id": "call_tn3sgasg6GaftTdancBYJNJN",
"type": "function",
"function": {
"name": "get_current_weather",
"arguments": "{\"location\": \"San Francisco, CA\"}"
}
}
],
"refusal": null
},
"logprobs": null,
"finish_reason": "tool_calls"
}
],
"usage": {
"prompt_tokens": 75,
"completion_tokens": 51,
"total_tokens": 126,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1225ba6a3440b0-SIN
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 11 Nov 2024 23:43:57 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '1308'
openai-organization: test_openai_org_id
openai-processing-ms:
- '761'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9994'
x-ratelimit-remaining-tokens:
- '199961'
x-ratelimit-reset-requests:
- 45.694s
x-ratelimit-reset-tokens:
- 11ms
x-request-id:
- req_f98710550c77b43865572fc1a7a0bc53
status:
code: 200
message: OK
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
},
{
"role": "assistant",
"tool_calls": [
{
"id": "call_eqbDFUdPqay2WjsSzZEiAn0U",
"function": {
"arguments": "{\"location\": \"Seattle, WA\"}",
"name": "get_current_weather"
},
"type": "function"
},
{
"id": "call_tn3sgasg6GaftTdancBYJNJN",
"function": {
"arguments": "{\"location\": \"San Francisco, CA\"}",
"name": "get_current_weather"
},
"type": "function"
}
]
},
{
"role": "tool",
"content": "50 degrees and raining",
"tool_call_id": "call_eqbDFUdPqay2WjsSzZEiAn0U"
},
{
"role": "tool",
"content": "70 degrees and sunny",
"tool_call_id": "call_tn3sgasg6GaftTdancBYJNJN"
}
],
"model": "gpt-4o-mini"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '746'
content-type:
- application/json
cookie:
- test_cookie
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASYMYObbcUyZ77rbvypWmcZPIVSf1",
"object": "chat.completion",
"created": 1731368638,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Today, the weather in Seattle is 50 degrees and raining, while San Francisco is enjoying 70 degrees and sunny weather.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 99,
"completion_tokens": 25,
"total_tokens": 124,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1225c12f6340b0-SIN
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 11 Nov 2024 23:43:58 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '870'
openai-organization: test_openai_org_id
openai-processing-ms:
- '722'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9993'
x-ratelimit-remaining-tokens:
- '199948'
x-ratelimit-reset-requests:
- 53.254s
x-ratelimit-reset-tokens:
- 15ms
x-request-id:
- req_2bb3d10a2a75f5d64a24aef595a0d8dd
status:
code: 200
message: OK
version: 1
test_chat_completion_tool_calls_with_content.yaml 0000664 0000000 0000000 00000021750 15270700723 0051205 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
}
],
"model": "gpt-4o-mini",
"tool_choice": "auto",
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. Boston, MA"
}
},
"required": [
"location"
],
"additionalProperties": false
}
}
}
]
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '543'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASYMU9Ntix7ePttk0MSuerJstef6U",
"object": "chat.completion",
"created": 1731368634,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_JpNb8OiAkbIbHzDggfpdDHpi",
"type": "function",
"function": {
"name": "get_current_weather",
"arguments": "{\"location\": \"Seattle, WA\"}"
}
},
{
"id": "call_vaFQc3zK6hHTRZKXRI5Eo2cJ",
"type": "function",
"function": {
"name": "get_current_weather",
"arguments": "{\"location\": \"San Francisco, CA\"}"
}
}
],
"refusal": null
},
"logprobs": null,
"finish_reason": "tool_calls"
}
],
"usage": {
"prompt_tokens": 75,
"completion_tokens": 51,
"total_tokens": 126,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1225ae3ea281e4-SIN
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 11 Nov 2024 23:43:55 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '1308'
openai-organization: test_openai_org_id
openai-processing-ms:
- '748'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9996'
x-ratelimit-remaining-tokens:
- '199961'
x-ratelimit-reset-requests:
- 30.375s
x-ratelimit-reset-tokens:
- 11ms
x-request-id:
- req_a0c3b432eb349a35b6d8dde6e01451e4
status:
code: 200
message: OK
- request:
body: |-
{
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "What's the weather in Seattle and San Francisco today?"
},
{
"role": "assistant",
"tool_calls": [
{
"id": "call_JpNb8OiAkbIbHzDggfpdDHpi",
"function": {
"arguments": "{\"location\": \"Seattle, WA\"}",
"name": "get_current_weather"
},
"type": "function"
},
{
"id": "call_vaFQc3zK6hHTRZKXRI5Eo2cJ",
"function": {
"arguments": "{\"location\": \"San Francisco, CA\"}",
"name": "get_current_weather"
},
"type": "function"
}
]
},
{
"role": "tool",
"content": "50 degrees and raining",
"tool_call_id": "call_JpNb8OiAkbIbHzDggfpdDHpi"
},
{
"role": "tool",
"content": "70 degrees and sunny",
"tool_call_id": "call_vaFQc3zK6hHTRZKXRI5Eo2cJ"
}
],
"model": "gpt-4o-mini"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '746'
content-type:
- application/json
cookie:
- test_cookie
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASYMVzdmBGDbUoHFmt6R16tdtZUzR",
"object": "chat.completion",
"created": 1731368635,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Today, the weather in Seattle is 50 degrees and raining, while in San Francisco, it's 70 degrees and sunny.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 99,
"completion_tokens": 25,
"total_tokens": 124,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_9b78b61c52"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e1225b4cbf581e4-SIN
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 11 Nov 2024 23:43:56 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '859'
openai-organization: test_openai_org_id
openai-processing-ms:
- '531'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9995'
x-ratelimit-remaining-tokens:
- '199947'
x-ratelimit-reset-requests:
- 37.973s
x-ratelimit-reset-tokens:
- 15ms
x-request-id:
- req_22b79d2dddb920f55e33727d06724978
status:
code: 200
message: OK
version: 1
test_chat_completion_with_content.yaml 0000664 0000000 0000000 00000006237 15270700723 0046775 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"stream": false
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '106'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASYMQRl3A3DXL9FWCK9tnGRcKIO7q",
"object": "chat.completion",
"created": 1731368630,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 5,
"total_tokens": 17,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e122593ff368bc8-SIN
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 11 Nov 2024 23:43:50 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '765'
openai-organization: test_openai_org_id
openai-processing-ms:
- '287'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '199977'
x-ratelimit-reset-requests:
- 8.64s
x-ratelimit-reset-tokens:
- 6ms
x-request-id:
- req_58cff97afd0e7c0bba910ccf0b044a6f
status:
code: 200
message: OK
version: 1
test_chat_completion_with_content_span_unsampled.yaml 0000664 0000000 0000000 00000006237 15270700723 0052066 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"stream": false
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '106'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASYMQRl3A3DXL9FWCK9tnGRcKIO7q",
"object": "chat.completion",
"created": 1731368630,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 5,
"total_tokens": 17,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e122593ff368bc8-SIN
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 11 Nov 2024 23:43:50 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '765'
openai-organization: test_openai_org_id
openai-processing-ms:
- '287'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '199977'
x-ratelimit-reset-requests:
- 8.64s
x-ratelimit-reset-tokens:
- 6ms
x-request-id:
- req_58cff97afd0e7c0bba910ccf0b044a6f
status:
code: 200
message: OK
version: 1
test_chat_completion_with_context_manager_streaming.yaml 0000664 0000000 0000000 00000017037 15270700723 0052552 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"stream": true,
"stream_options": {
"include_usage": true
}
}
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '148'
Content-Type:
- application/json
Host:
- api.openai.com
User-Agent:
- OpenAI/Python 1.109.1
X-Stainless-Arch:
- x64
X-Stainless-Async:
- 'false'
X-Stainless-Lang:
- python
X-Stainless-OS:
- Linux
X-Stainless-Package-Version:
- 1.109.1
X-Stainless-Runtime:
- CPython
X-Stainless-Runtime-Version:
- 3.12.12
authorization:
- Bearer test_openai_api_key
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"yKkTGHRZw"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":"This"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bFd3AyW"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"LqISoMXL"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"mUrlylOKo"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" test"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"nGqQio"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"gUhadpfoFR"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" How"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"atLjmXM"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" can"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Ac67p8z"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" I"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"tl4DibKXq"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" assist"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"p5ei"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" you"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"97qAT5t"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" further"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ZK4"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":"?"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"5iGjeBvFWd"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"SdS98"}
data: {"id":"chatcmpl-CnMGGNmSdY4yYxO9NmV7cSVxXZ5ci","object":"chat.completion.chunk","created":1765879680,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[],"usage":{"prompt_tokens":12,"completion_tokens":12,"total_tokens":24,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"parVcHlnsA"}
data: [DONE]
headers:
CF-RAY:
- 9aed607a4c274be7-MXP
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Tue, 16 Dec 2025 10:08:00 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
openai-organization: test_openai_org_id
openai-processing-ms:
- '274'
openai-project:
- proj_Pf1eM5R55Z35wBy4rt8PxAGq
openai-version:
- '2020-10-01'
x-envoy-upstream-service-time:
- '618'
x-openai-proxy-wasm:
- v0.1
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '10000000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '9999993'
x-ratelimit-reset-requests:
- 6ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_50a8341c02184cbd8b364182eb40ed38
status:
code: 200
message: OK
version: 1
test_chat_completion_with_raw_response.yaml 0000664 0000000 0000000 00000006263 15270700723 0050031 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '90'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.54.3
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.3
x-stainless-raw-response:
- 'true'
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |-
{
"id": "chatcmpl-ASYMQRl3A3DXL9FWCK9tnGRcKIO7q",
"object": "chat.completion",
"created": 1731368630,
"model": "gpt-4o-mini-2024-07-18",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 5,
"total_tokens": 17,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "fp_0ba0d124f1"
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8e122593ff368bc8-SIN
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 11 Nov 2024 23:43:50 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
content-length:
- '765'
openai-organization: test_openai_org_id
openai-processing-ms:
- '287'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '199977'
x-ratelimit-reset-requests:
- 8.64s
x-ratelimit-reset-tokens:
- 6ms
x-request-id:
- req_58cff97afd0e7c0bba910ccf0b044a6f
status:
code: 200
message: OK
version: 1 test_chat_completion_with_raw_response_streaming.yaml 0000664 0000000 0000000 00000017131 15270700723 0052076 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "gpt-4o-mini",
"stream": true,
"stream_options": {
"include_usage": true
}
}
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '148'
Content-Type:
- application/json
Host:
- api.openai.com
User-Agent:
- AsyncOpenAI/Python 1.109.1
X-Stainless-Arch:
- x64
X-Stainless-Async:
- async:asyncio
X-Stainless-Lang:
- python
X-Stainless-OS:
- Linux
X-Stainless-Package-Version:
- 1.109.1
X-Stainless-Raw-Response:
- 'true'
X-Stainless-Runtime:
- CPython
X-Stainless-Runtime-Version:
- 3.12.12
authorization:
- Bearer test_openai_api_key
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: |+
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"v3JkrR4kf"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":"This"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"c2Yj6Tq"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"vYP94Gjb"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"axQhTg4rR"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" test"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Sd4wYC"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ZufRh78gtk"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" How"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Si8PiPK"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" can"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"DtALgOW"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" I"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"xYwawpnRk"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" assist"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Swpx"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" you"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"L6Pd0pV"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":" today"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Viytd"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{"content":"?"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"LqmsdvgjP8"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"vbpp9"}
data: {"id":"chatcmpl-CnMM0oFYQitzT43PYAvCrmNt6GIKs","object":"chat.completion.chunk","created":1765880036,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_644f11dd4d","choices":[],"usage":{"prompt_tokens":12,"completion_tokens":12,"total_tokens":24,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"xEbQODa0Ga"}
data: [DONE]
headers:
CF-RAY:
- 9aed6932dfb8ed9e-MXP
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Tue, 16 Dec 2025 10:13:56 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
openai-organization: test_openai_org_id
openai-processing-ms:
- '228'
openai-project:
- proj_Pf1eM5R55Z35wBy4rt8PxAGq
openai-version:
- '2020-10-01'
x-envoy-upstream-service-time:
- '241'
x-openai-proxy-wasm:
- v0.1
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '10000000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '9999993'
x-ratelimit-reset-requests:
- 6ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_279d1848f0cf450dbffc9d7776f157f7
status:
code: 200
message: OK
version: 1
test_embeddings_model_not_found.yaml 0000664 0000000 0000000 00000003646 15270700723 0046375 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for embeddings with bad model",
"model": "non-existent-embedding-model"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '98'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"error": {
"message": "The model `non-existent-embedding-model` does not exist or you do not have access to it.",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}
headers:
CF-RAY:
- 939c18494d21ebf9-NRT
Connection:
- keep-alive
Content-Type:
- application/json; charset=utf-8
Date:
- Sat, 03 May 2025 01:48:13 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '234'
openai-organization: test_openai_org_id
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
vary:
- Origin
x-request-id:
- req_e843ad138683a94b77b77e73be3b1fd5
status:
code: 404
message: Not Found
version: 1
test_embeddings_no_content.yaml 0000664 0000000 0000000 00000135535 15270700723 0045373 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for embeddings",
"model": "text-embedding-3-small"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '77'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.009139273,
-0.010902632,
0.025990667,
-0.040262204,
-0.022861907,
-0.034992713,
0.03507505,
0.0278295,
-0.00016617251,
0.020652562,
0.019897819,
-0.01844322,
-0.021901323,
-0.026402347,
-0.017372854,
0.012364092,
-0.02548293,
0.0061957687,
-0.00823358,
0.0140313925,
0.01568497,
-0.04215593,
0.008261025,
0.030875925,
0.015341904,
-0.0027994171,
0.016110372,
0.038231257,
0.052969363,
-0.021791542,
0.006576572,
-0.02944877,
-0.01250818,
-0.025976945,
-0.017688474,
0.033702787,
-0.020734899,
0.04487301,
-0.037545122,
0.016329933,
-0.002789125,
0.0055164983,
-0.052914474,
0.007821901,
0.0002815284,
0.05113053,
-0.058623087,
-0.028103953,
-0.034059577,
0.04748031,
-0.06208119,
0.022916798,
-0.0033843443,
0.0040516076,
-0.01912935,
0.012391537,
-0.033098992,
0.0040104394,
-0.0055267904,
-0.013729494,
0.045065127,
-0.009653872,
-0.012096501,
-0.014161757,
-0.00014548135,
-0.009544091,
-0.026306288,
0.044900455,
0.0027479574,
-0.016563218,
0.05310659,
0.023602929,
-0.02950366,
0.015204677,
0.017455189,
0.01370891,
-0.0046931403,
0.016014313,
-0.021585701,
-0.045888484,
-0.03392235,
0.026731689,
-0.014655772,
0.00055062067,
-0.024138112,
-0.009859712,
-0.0834885,
-0.018058985,
-0.021695483,
-0.04550425,
-0.016165262,
-0.050526734,
-0.064770825,
-0.019705702,
0.014257816,
0.008658982,
0.008446281,
-0.048193887,
-0.030821033,
0.015890809,
-0.0040516076,
0.017400298,
-0.009736208,
0.0017959496,
0.00082035613,
-0.023836214,
0.016233874,
-0.015781028,
-0.05398484,
-0.015287013,
-0.047041185,
-0.010127303,
0.015698692,
0.011924968,
0.05977579,
0.00095200766,
0.0030241252,
-0.04388498,
-0.029256653,
-0.026169062,
-0.023685265,
-0.021969935,
0.040371988,
-0.036310088,
-0.021654315,
-0.029723223,
-0.018333437,
-0.02647096,
-0.03669432,
-0.012226866,
-0.0021441614,
-0.02142103,
0.038176365,
0.050746296,
-0.04888002,
-0.02293052,
-0.07893258,
0.022916798,
-0.013070808,
0.05387506,
0.0013971356,
-0.021544535,
0.018841175,
-0.023575483,
-0.023575483,
-0.013331538,
-0.03293432,
0.049868047,
0.03090337,
-0.01579475,
0.0020858403,
-0.00090912444,
-0.05124031,
-0.00536898,
-0.049593594,
-0.037847023,
-0.025675047,
-0.009207887,
0.03611797,
-0.012521903,
-0.01866278,
0.024892855,
0.029256653,
-0.012117085,
-0.0025181032,
0.016480882,
0.017276796,
-0.005972776,
-0.013441319,
-0.04621783,
0.0026227382,
-0.0237676,
-0.026772857,
0.00026115886,
-0.02417928,
-0.021105409,
-0.0013096537,
-0.07898748,
0.023355922,
-0.023328476,
-0.01136234,
0.026100447,
-0.020213438,
0.0069162073,
-0.05096586,
0.06070893,
0.018374605,
0.06361812,
0.0063878857,
0.0045730677,
-0.00599336,
0.037270673,
0.06367302,
0.005561097,
-0.0002618021,
-0.0263749,
0.053655494,
-0.012281757,
0.048962355,
-0.015451685,
0.0015146356,
0.047233302,
-0.02568877,
0.021503367,
0.026663076,
-0.013441319,
-0.02835096,
-0.024563514,
-0.03529461,
0.00028109955,
0.04824878,
-0.024892855,
-0.005139126,
0.0031013151,
-0.020460445,
0.03340089,
-0.03891739,
-0.0073827766,
0.03518483,
-0.0066074478,
-0.03976819,
0.05513754,
0.074212,
0.023012856,
-0.06773492,
-0.0040687607,
0.0011432669,
-0.028625412,
0.027788332,
-0.010703654,
-0.007547448,
-0.026004389,
0.013098253,
-0.01620643,
0.017496357,
-0.02835096,
0.0010240515,
-0.005530221,
-0.030519135,
0.017345408,
-0.04575126,
-0.008796208,
0.034361474,
-0.013407012,
0.000549763,
0.018058985,
0.011822049,
-0.027280595,
0.023204973,
0.008789347,
0.0027908406,
0.021064242,
-0.0042608776,
-0.024892855,
-0.025400594,
-0.014504823,
-0.04528469,
0.037270673,
0.028378405,
0.0033105852,
-0.0022625192,
0.017866869,
-0.030244684,
-0.020981906,
0.0120141655,
-0.034581035,
0.027472712,
0.010429201,
0.0066143093,
-0.0672409,
-0.015534021,
-0.014587159,
0.04591593,
-0.0134207355,
-0.05294192,
0.037407897,
-0.03438892,
-0.024975192,
-0.010806574,
0.00012007304,
-0.0034478116,
-0.042210817,
0.024453731,
0.047754765,
-0.028433295,
-0.0054856227,
-0.013695188,
-0.018827453,
-0.045833595,
-0.011657377,
-0.0018628475,
-0.061367616,
0.060379583,
0.010298836,
-0.021764096,
0.020295775,
0.016590664,
0.011369201,
0.022999132,
-0.026896361,
0.0466844,
-0.013503071,
0.043171402,
0.06850339,
-0.037270673,
0.040564105,
-0.028213734,
0.038807604,
0.037654907,
-0.0016973182,
-0.029091982,
0.0065422654,
-0.015067451,
0.0341968,
-0.052475348,
0.00019458265,
0.03641987,
-0.0064976667,
0.025455484,
-0.027692273,
-0.02246395,
-0.03252264,
0.015698692,
-0.035514176,
-0.0026964974,
-0.013571684,
-0.020858401,
0.011664238,
-0.003955549,
0.0023843076,
-0.0007435952,
0.036310088,
0.028899865,
0.008899127,
-0.03216585,
-0.037188336,
-0.03899972,
0.011684822,
0.021023074,
-0.0021355848,
-0.031315047,
-0.008905989,
0.037407897,
-0.012967888,
-0.01141037,
0.052036226,
0.015534021,
0.03408702,
0.041140452,
-0.015122342,
0.005128834,
-0.010209639,
-0.009907741,
0.0028491616,
0.05867798,
-0.042814616,
-0.005760075,
0.0014074276,
0.010092997,
-0.028007895,
0.0126179615,
0.0017547817,
-0.015959423,
0.046355054,
0.029750668,
-0.030601472,
-0.0089746015,
0.031342495,
0.010031245,
-0.0054341624,
-0.022436505,
0.023589207,
0.01724935,
0.009763653,
-0.020309497,
0.012391537,
-0.015328181,
0.045120016,
0.040152423,
0.03987797,
0.017633583,
-0.028049061,
-0.029146872,
-0.06268499,
-0.011959274,
0.0052557685,
0.020776067,
-0.017276796,
-0.034004685,
0.0016930299,
0.030189792,
-0.024165556,
-0.019993877,
-0.014449933,
0.04295184,
0.023726432,
0.053490825,
-0.017551247,
0.00079291087,
0.005945331,
-0.03913695,
-0.063288786,
0.00025022365,
-0.010442924,
0.01084088,
0.025345704,
0.029311543,
0.0076023387,
0.021077964,
-0.018360883,
-0.006528543,
-0.027898112,
0.04528469,
-0.027376654,
0.006171754,
0.028570522,
0.019582197,
-0.038395926,
0.002845731,
0.038478263,
-0.02412439,
-0.037106,
-0.055110093,
0.010484092,
0.013146282,
-0.019637087,
0.09089872,
0.0073004407,
0.012055333,
-0.0591171,
-0.03919184,
-0.0010060405,
0.03362045,
0.03002512,
-0.039329067,
-0.031973734,
0.059501335,
0.028625412,
-0.0118014645,
-0.017674752,
0.008315915,
0.0012830662,
-0.033538114,
-0.037106,
-0.010017522,
-0.03002512,
-0.01652205,
0.020776067,
-0.026800303,
-0.041195344,
-0.009564675,
-0.06400236,
-0.0040687607,
-0.04127768,
0.012467012,
-0.041305125,
-0.011684822,
0.011293727,
0.055027757,
0.010936938,
0.0018302562,
-0.050307173,
-0.044790674,
0.05686659,
0.060214914,
-0.005121973,
-0.018937234,
-0.0073827766,
0.052228343,
-0.025139865,
-0.003272848,
0.04278717,
-0.013153144,
0.009482339,
0.01334526,
-0.038341038,
0.009146135,
-0.03356556,
-0.02089957,
-0.031095486,
0.0017582123,
-0.033373445,
-0.031424828,
-0.022134608,
-0.009530368,
0.1397513,
-0.028103953,
-0.007046572,
0.018786285,
-0.01501256,
-0.029366435,
-0.0012676283,
-0.02777461,
-0.01646716,
0.04017987,
-0.03183651,
0.0068819006,
-0.031452276,
0.036831547,
-0.026155338,
-0.017345408,
0.008631536,
-0.012384676,
0.025222199,
0.02490658,
0.017921759,
-0.041963812,
0.011911245,
-0.034800597,
0.006765258,
-0.003784016,
0.00599336,
-0.038588043,
0.006446207,
0.01939008,
-0.0044701477,
-0.028460741,
0.068338715,
-0.007904236,
-0.028268624,
0.02756877,
-0.016837671,
0.0052248924,
-0.056262795,
0.011444676,
0.0023054024,
-0.017221905,
-0.056153014,
-0.042183373,
-0.004497593,
-0.028103953,
-0.014806721,
0.028543077,
0.0011792887,
-0.01974687,
0.0030978844,
-0.013139421,
0.024632126,
0.015671248,
-0.0061957687,
0.035569064,
-0.0033311693,
0.035514176,
-0.008350222,
-0.0023774463,
0.039411403,
0.032193296,
-0.007437667,
-0.01912935,
0.010724238,
0.00515971,
-0.015643802,
0.029531106,
-0.020350665,
0.019938985,
0.021242635,
0.026745412,
-0.0025558404,
-0.035349503,
6.362799e-05,
0.009894018,
0.028954756,
0.06888762,
0.04451622,
-0.048660457,
0.036337532,
0.010257668,
0.0057189073,
0.04701374,
-0.024330229,
-0.04992294,
-0.009647011,
0.012288618,
0.019650811,
-0.003955549,
0.017949203,
-0.012755187,
0.028213734,
-0.028323514,
-0.024220448,
-0.008405113,
-0.0006243798,
0.015040006,
0.00083879597,
-0.0061202943,
0.034169357,
0.015822196,
-0.019938985,
-0.015808472,
0.023150083,
0.040097535,
0.003814892,
0.026443513,
-0.03466337,
0.024193002,
-0.020158548,
0.04248527,
-0.0026073002,
-0.02011738,
0.024590958,
0.003674235,
-2.9401814e-05,
-0.021352418,
0.01146526,
0.021983659,
0.0053929947,
-0.034937825,
0.035020158,
0.024810521,
-0.0031802203,
-0.011334895,
-0.033071544,
-0.0008688142,
-0.008315915,
0.02518103,
0.0028011324,
0.011026136,
-0.0042334325,
0.024879133,
-0.016686723,
-0.011746574,
-0.02365782,
-0.011842633,
0.008960879,
-0.022052271,
0.03809403,
0.015245846,
0.00990088,
-0.008885405,
0.012041611,
-0.020048767,
0.0038046,
0.025084972,
-0.04967593,
-0.013887305,
-0.020885848,
-0.027404098,
0.03628264,
0.015259568,
-0.045668922,
0.0041922643,
-0.018415773,
0.03101315,
0.012117085,
-0.009461756,
-0.011746574,
0.0055096373,
0.006401608,
-0.0011741428,
-0.010278252,
0.017070955,
-0.028597968,
0.004446133,
-0.008357083,
0.0148341665,
-0.058074184,
-0.021517089,
-0.0046142354,
-0.0020000737,
-0.044159435,
-0.008947156,
0.020611394,
-0.0017350554,
-0.0200076,
0.0016432853,
0.020048767,
-0.07437667,
0.027637383,
-0.012192559,
0.011931829,
-0.0014357305,
-0.015053729,
0.037243225,
-0.030656362,
0.014024531,
-0.035925854,
-0.029091982,
-0.0066074478,
0.002830293,
-0.007259273,
-0.018854897,
0.021242635,
-0.018539278,
-0.036255196,
0.016178984,
0.010388033,
0.03798425,
0.0038835052,
-0.0004200412,
-0.017674752,
-0.06103827,
-0.012446428,
0.04012498,
0.002454636,
-0.0018988693,
0.044461332,
0.004446133,
0.02997023,
-0.010230223,
-0.0030995996,
0.008336499,
0.017606137,
-0.017921759,
-0.040783666,
0.00859723,
-0.034745708,
0.0010823727,
0.035047606,
0.03315388,
0.0020858403,
-0.0045318995,
-0.00786993,
0.019980153,
0.017811978,
-0.0031716435,
-0.013674604,
0.013894166,
-0.0051837247,
-0.0076435064,
-0.012727742,
-0.026910083,
-0.015973145,
-0.00813066,
0.0021870446,
-0.00823358,
-0.023753878,
-0.010641902,
-0.009345113,
-0.017606137,
-0.01579475,
0.010271391,
0.0029778113,
-0.0010017522,
-0.020240884,
0.015781028,
0.0053072283,
-0.001751351,
0.0025524097,
-0.038533155,
-0.018703949,
-0.012837524,
0.029613443,
0.024604682,
-0.0013456757,
-0.03960352,
0.046382498,
0.046739288,
-0.0054959147,
0.014202925,
-0.019513585,
-0.010285113,
0.0115956245,
-0.0051151114,
0.005540513,
-0.029640887,
-0.022834461,
0.034251694,
-0.030683808,
-0.0043020453,
0.022326725,
0.03529461,
0.017729642,
0.0026175922,
0.01771592,
0.01803154,
-0.03180906,
-0.030299574,
-0.0020618257,
0.03685899,
0.02704731,
0.0053346734,
-0.025675047,
0.024110666,
0.0048166444,
0.047343083,
-0.028460741,
-0.017180737,
0.014449933,
-0.052036226,
0.026800303,
-0.01302964,
0.027760886,
0.010868325,
-0.035486728,
-0.0063501485,
-0.011746574,
-0.021379862,
0.004600513,
-0.008041463,
-0.057360604,
-0.032220744,
0.002293395,
0.030985706,
-0.024042053,
0.01626132,
-0.0001327236,
-0.037490234,
-0.065758854,
-0.009338251,
0.029119426,
-0.026512127,
0.018758839,
0.034416363,
0.005633141,
0.020323219,
-0.027513878,
0.025661323,
0.029311543,
-0.03496527,
-0.019664533,
-0.0026278843,
0.028296068,
-0.019321468,
0.03845082,
-0.003574746,
-0.018209934,
0.0010077559,
-0.01741402,
0.004418688,
0.06394747,
0.020199716,
-0.05618046,
-0.0066108783,
0.004374089,
-0.0054993453,
-0.0014357305,
-0.00489898,
-0.007478835,
-0.0019657672,
0.018168766,
0.01793548,
0.014367597,
-0.018319715,
0.00070457143,
0.01313256,
0.045476805,
-0.0014623181,
0.01771592,
-0.0060997102,
-0.019376358,
-0.02725315,
0.054588635,
7.231184e-05,
0.01704351,
0.00396241,
0.01803154,
-0.013057086,
0.018058985,
0.0063981777,
0.012762048,
-0.009598982,
-0.007938543,
0.029997677,
0.02527709,
0.02069373,
-0.0014460224,
0.024865411,
-0.032248188,
0.007938543,
0.010456647,
-0.002313979,
0.0023997454,
0.009365697,
-0.01985665,
0.024165556,
-0.015671248,
-0.01959592,
0.008542339,
-0.014340151,
0.03913695,
0.014889057,
-0.04237549,
-0.004617666,
0.007732704,
0.03721578,
0.028735194,
0.020460445,
0.059226885,
0.02527709,
-0.008048324,
0.030244684,
-0.011794603,
0.006223214,
-0.024247892,
-0.05269491,
-0.035129942,
0.019376358,
0.043610528,
-0.035733737,
-0.008247303,
0.020597672,
-0.013770662,
-0.009111828,
0.02548293,
-0.026196506,
0.041552134,
-0.0020412416,
0.035898406,
0.01417548,
-0.017427744,
-0.01276891,
-0.04325374,
-0.0017942343,
0.021091687,
0.019842926,
0.002444344,
-0.0023774463,
0.0072455504,
0.015314459,
0.0008164967,
-0.025894608,
-0.023108914,
0.00020927015,
-0.0076435064,
0.046629507,
0.016343655,
-0.009166718,
0.00064367725,
0.056482356,
0.011677961,
-0.016275043,
-0.056427468,
-0.00084823027,
0.003996717,
-0.013866721,
-0.0062781046,
0.014985115,
-0.016727889,
0.037353005,
0.019170519,
-0.04435155,
0.006092849,
0.0042505856,
0.00823358,
0.020035043,
-0.043802645,
-0.0033843443,
0.014600881,
-0.022505118,
-0.014449933,
-0.012638545,
-0.02501636,
0.012988472,
-0.038972277,
0.025222199,
-0.0035009868,
-0.019047014,
0.013009056,
0.031068042,
-0.021077964,
0.01568497,
0.015547743,
-0.011959274,
-0.0030429938,
-0.014312706,
-0.0033791985,
0.043116514,
-0.011554457,
0.01292672,
-0.025057528,
0.011506428,
0.031232713,
-0.0023208403,
-0.023314754,
0.024398841,
-0.023081468,
0.009269639,
-0.040866002,
0.011527012,
-0.0020360956,
0.013461903,
0.021860154,
0.03329111,
0.009557814,
0.028062785,
0.007883653,
-0.012700297,
0.04481812,
0.05884265,
-0.01646716,
-0.0012058764,
0.021132855,
0.0073827766,
0.017290518,
-0.02423417,
-0.0048818267,
0.02006249,
-0.013166866,
0.016398547,
0.009962631,
0.021187745,
-0.00025794262,
-0.03814892,
0.0045113154,
0.012679713,
-0.00072901486,
-0.015341904,
0.04251272,
-0.012954165,
0.02136614,
-0.0132148955,
-0.014806721,
-0.013461903,
-0.0022625192,
0.004075622,
-0.01777081,
0.007458251,
-0.003459819,
-0.0074719735,
0.0460806,
-0.0019468985,
-0.019760592,
0.023644097,
-0.045202352,
-0.00095972663,
0.008411974,
0.006885331,
-0.00656628,
0.0089746015,
-0.03216585,
0.0010231938,
-0.00025880028,
0.021077964,
0.029229209,
-0.011451537,
-0.010216501,
-0.00531409,
-0.047919434,
-0.008617814,
0.026237674,
-0.014545991,
0.01838833,
-0.011273143,
-0.017125847,
-0.024700738,
0.046821624,
-0.006182046,
0.017496357,
-0.00014944805,
-0.017619861,
-0.019170519,
0.002674198,
0.0016707305,
0.018209934,
0.039164394,
-0.015108619,
0.015822196,
0.015149787,
0.0055988343,
0.018827453,
-0.031781618,
0.01292672,
-0.0027445266,
-0.010436063,
-0.0033912056,
0.029668333,
-7.520646e-05,
0.017866869,
0.010971245,
0.01443621,
-0.04767243,
-0.008535477,
0.005310659,
4.4457847e-06,
-0.012583654,
-0.024083221,
0.0026724827,
0.021640591,
0.03002512,
0.027061032,
-0.0030086872,
-0.026964974,
0.013057086,
-0.0037497096,
0.018594168,
0.024028331,
-0.010202778,
-0.027404098,
-0.017510079,
0.026868915,
-0.012803216,
0.014463655,
-0.011677961,
-0.0066314624,
0.0111565,
0.019101905,
0.0052523375,
-0.024275338,
0.015918255,
-0.0062986887,
-0.003428943,
-0.006765258,
0.027733441,
-0.0022590884,
-0.027925558,
0.02809023,
-0.011053581,
0.022326725,
0.0014322998,
-0.0012358946,
-0.023232417,
-0.0018662781,
0.015081174,
0.018223656,
0.008103215,
-0.0029246362,
-0.011575041,
-0.0060070828,
-0.0052146004,
0.030354464,
-0.019623365,
0.027911836,
0.02282074,
-0.012851246,
-0.01871767,
-0.009125551,
0.0011844347,
-0.049868047,
0.001081515,
-0.021324972,
0.02944877,
0.006562849,
0.027074754,
0.052667465,
-0.023589207,
0.02089957,
0.019115629,
-0.0075817546,
-0.011430954,
0.0034495268,
0.009132412,
-0.03935651,
0.014134312,
-0.0330441,
-0.021448476,
-0.048138995,
-0.016865116,
-0.009612705,
0.015108619,
-0.017839422,
-5.7034693e-05,
-0.013393289,
0.00021763238,
0.0087756235,
0.015822196,
0.005019053,
0.015341904,
0.09150252,
0.005862995,
-0.02240906,
0.017400298,
0.013400151,
0.006947083,
-0.028378405,
0.010923216,
-0.018594168,
-0.009619566,
-0.0073621925,
0.020103658,
0.012377815,
-0.022834461,
-0.0048063523,
0.012940443,
-0.012631684,
-0.03147972,
-0.010648763,
0.005019053,
0.0030206945,
-0.009269639,
-0.0023620082,
0.024385119,
-0.022642344,
-0.013804968,
-0.031781618,
0.00865212,
0.026416069,
0.03235797,
-0.013118837,
0.030162347,
-0.010923216,
0.030601472,
0.0076640905,
0.03257753,
-0.042210817,
0.029640887,
0.0041305125,
-0.016425991,
0.013688327,
-0.008123798,
0.001618413,
-0.004096206,
-0.017510079,
-0.027349208,
-0.0063501485,
-0.036035635,
0.0048509506,
-0.010470369,
-0.008350222,
0.036557093,
-0.03482804,
0.026251396,
0.040866002,
-0.035623956,
-0.00063381414,
0.0057291994,
0.0426225,
-0.018909788,
0.012700297,
0.032220744,
-0.035678845,
0.035706293,
0.008295332,
-0.015287013,
-0.02835096,
0.008062047,
0.0027599647,
0.034334026,
0.009194165,
0.023753878,
-0.009461756,
-0.043445855,
0.0015909678,
0.021915045,
0.022422783,
-0.005880148,
-0.03268731,
0.028460741,
-0.02512614,
0.0033791985,
0.021077964,
0.042128485,
-0.0021750373,
-0.0071426304,
0.0081649665,
-0.023081468,
0.0010043252,
0.042128485,
-0.021613147,
-0.009351974,
0.021105409,
-0.0099969385,
-0.0005875002,
0.00792482,
-0.008487448,
-0.03743534,
0.037929356,
0.016727889,
0.007897375,
0.011616209,
-0.03384001,
0.031177823,
0.008068908,
-0.0072249663,
-0.07843857,
0.01062818,
0.016110372,
0.014045115,
0.013516794,
-0.02131125,
0.02089957,
0.008535477,
-0.0060688346,
0.016672999,
-0.02058395,
0.0041579576,
0.0014194349,
-0.043802645,
0.003346607,
0.006583433,
0.019541029,
0.008055186,
0.027170813,
-0.02652585,
0.013324677,
0.012226866,
0.0026656215,
-0.015136064,
0.042183373,
-2.0181918e-05,
0.010497814,
-0.00022813877,
0.041140452,
0.0092765,
0.008261025,
-0.0271022,
-0.010669347,
0.025976945,
0.04012498,
0.009077522,
0.014093144,
-0.008329638,
0.0292841,
-0.013756939,
0.00891285,
0.004061899,
-0.052200895,
0.005029345,
-9.938188e-05,
-0.043034177,
-0.017962927,
-0.019691978,
0.03356556,
-0.007863069,
0.016563218,
0.024426287,
0.0035575926,
-0.0356514,
-0.0010875186,
-0.0071700756,
-0.02287563,
0.023849936,
0.005231754,
-0.0010720807,
0.01626132,
-0.018072708,
-0.008487448,
0.0035678847,
0.0099832155,
0.0008722449,
0.01573986,
0.0011527012,
-0.012693436,
-0.0420187,
0.012906136,
0.02475563,
-0.04372031,
-0.0063192723,
0.019362636,
-0.026964974,
-0.028268624,
0.0036399283,
-0.00044941623,
0.024028331,
0.020185994,
-0.019664533,
-0.006947083,
-0.018594168,
0.009743069,
-0.019637087,
-0.014847889,
-0.015067451,
-0.0192803,
-0.004528469,
-0.046355054,
-0.024138112,
-0.0066143093,
0.013276648,
-0.0023517162,
0.0027016434,
0.026786579,
-0.013063947,
0.019513585,
0.04185403,
-0.013242341,
0.003137337,
-0.021599425,
-0.031534612,
0.059226885,
-0.0101890545,
-0.0010300551,
0.008713872,
0.049868047,
-0.0036262057,
0.009104967,
-0.01443621,
-0.0034014976,
-0.004195695,
0.00037780125,
0.0041236514,
0.02434395,
-0.031232713,
-0.034992713,
0.0022899644,
0.028625412,
-0.023671541,
0.0058389804,
0.016371101,
-0.035102494,
-0.04048177,
-0.03987797,
0.006394747,
-0.020336943,
-0.0014400188,
-5.0548606e-05,
0.037133444,
0.018580444,
0.009935186,
-0.034635928,
-0.007520003,
0.03326366,
0.04575126,
-0.01829227,
-0.0124121215,
-0.01073796,
0.0056194183,
-0.018580444,
-0.019184241,
0.007760149,
0.029750668,
-0.005670878,
-0.02397344,
-0.034004685,
-0.004209418,
-0.0007864784,
0.0048166444,
-0.015410516,
-0.039548628,
-0.036557093,
0.01245329,
0.046986297,
0.00013529659,
0.03397724,
-0.034471255,
0.015959423,
0.011972997,
-0.024151834,
0.02704731,
0.015245846,
-0.023698987,
-0.016220152,
0.001084088,
-0.014381319,
0.030821033,
0.0033912056,
-0.0136128515,
-0.009729347,
-0.043610528,
0.017510079,
-0.00792482,
-0.0111565,
0.00349241,
2.2205471e-05,
0.001196442,
0.008144382,
0.0054753306,
-0.0017539241,
-0.008837376,
0.020981906,
-0.021434752,
-0.028131397,
0.0033534684,
-0.012693436,
0.0055370824,
-0.0067995647,
0.0031064611,
-0.046053156,
-0.004315768,
-0.03831359,
0.03438892,
0.034279138,
-0.028954756,
0.0023568622,
0.021750374,
-0.008315915,
0.037407897,
-0.0023997454,
0.04643739,
-0.039164394,
0.012933581,
0.004885257,
-0.0020892709,
0.012494457,
0.01829227,
-0.028625412,
0.03554162,
-0.017688474,
0.041826587,
-0.016700445,
0.0068613165,
-0.0056743086,
0.02799417,
0.007197521,
-0.031891398,
0.034581035,
-0.011293727,
0.019678256,
0.03384001,
0.014669495,
-0.014669495,
0.0009983216,
0.011492705,
0.04092089,
-0.005972776,
-0.017153291,
0.013887305,
0.023232417,
-0.049401477,
-0.027760886,
0.03444381,
-0.0069127763,
0.009612705,
0.019980153,
0.003814892,
-0.0068235793,
-0.010957522,
-0.0022076287,
-0.030683808,
-0.014340151,
0.01974687,
0.04794688,
-0.03326366,
-0.017002342,
0.010051829,
0.026896361,
-0.0045318995,
0.005300367,
-0.029531106,
-0.0134207355,
-0.017866869,
0.030080011,
-0.025428038,
-0.0020343803,
-0.009372558,
-0.01417548,
-0.008768762,
0.008020879,
-0.043994762,
-0.029201763,
0.026169062,
0.028131397,
-0.00552336,
0.0025627017,
-0.036721766,
-0.057195935,
-0.015616356,
-0.0072249663,
-0.054588635,
0.008473726,
-0.0015763874,
-0.030080011,
0.005049929,
0.017235627,
0.026814025,
0.010758544,
-0.011300588,
-0.0041133594
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 6,
"total_tokens": 6
}
}
headers:
CF-RAY:
- 939c18244b2cd496-NRT
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 03 May 2025 01:48:08 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '33312'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '170'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-687976cc6-vxtlt
x-envoy-upstream-service-time:
- '145'
x-ratelimit-limit-requests:
- '5000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '4999'
x-ratelimit-remaining-tokens:
- '4999993'
x-ratelimit-reset-requests:
- 12ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_cadfd4b7a8dfbacbbdc0756d743a4434
status:
code: 200
message: OK
version: 1
test_embeddings_token_metrics.yaml 0000664 0000000 0000000 00000135567 15270700723 0046100 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for embeddings token metrics",
"model": "text-embedding-3-small"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '91'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.011905322,
-0.013637613,
0.031408645,
-0.03914042,
-0.009457374,
-0.021697115,
0.015797962,
0.024265453,
0.03734793,
0.007664887,
0.022218809,
-0.00943062,
-0.04120044,
-0.024920914,
0.019717352,
0.015209383,
-0.03485985,
-0.02204491,
-0.0012699567,
0.020091902,
0.00094724225,
-0.0041802395,
0.017095506,
0.03635805,
0.017563693,
0.016252771,
0.02680704,
0.006440913,
0.042698637,
-0.0053373296,
0.027355487,
-0.010928818,
-0.0054409998,
-0.03603701,
-0.030472273,
0.032398526,
-0.016854726,
0.040772382,
-0.014058981,
-0.0058891214,
-0.020359438,
0.0094439965,
-0.06046298,
0.004524691,
-0.029535899,
0.041173685,
-0.007210077,
-0.03726767,
-0.01708213,
0.030793315,
-0.07389326,
0.0140456045,
-0.008795223,
0.0047755055,
-0.010768296,
0.0030365258,
-0.011838438,
-0.005203562,
-0.021335943,
-0.029188104,
0.0333349,
-0.015904974,
0.015436788,
-0.016627321,
0.0039026714,
-0.001693833,
-0.00785885,
0.03544843,
-0.005240348,
-0.03362919,
0.06977321,
0.031328388,
-0.013396831,
0.00069600984,
0.001989794,
-0.014085734,
-0.00065253535,
-0.0016018677,
-0.0037622154,
-0.042778898,
-0.052490428,
0.002847579,
-0.0075578727,
-0.016881479,
-0.02010528,
-0.007109751,
-0.07608704,
-0.041334208,
-0.0010433878,
-0.045106456,
-0.0458288,
-0.03151566,
-0.049868584,
-0.021295812,
0.022058288,
-0.0196906,
0.027449124,
-0.039568473,
-0.033281393,
0.007852161,
-0.010119524,
0.014928471,
-0.01791149,
0.03515414,
0.0006128231,
-0.008915614,
0.025201827,
-0.001780782,
-0.039648734,
-0.02340934,
-0.050510667,
0.004614984,
-0.015490295,
0.022927778,
0.06297781,
0.014580675,
0.011397005,
-0.030632794,
-0.0057185674,
-0.003160261,
-0.02787718,
-0.013008905,
0.041601744,
-0.014446908,
-0.022218809,
-0.03780274,
-0.026044564,
-0.05211588,
-0.044945933,
-0.0049728127,
-0.011256549,
-0.017309535,
0.047594532,
0.034271274,
-0.011343498,
-0.04740726,
-0.03242528,
0.037749235,
-0.03734793,
0.04211006,
-0.0065613035,
-0.010514138,
0.03764222,
0.0029729863,
-0.049065977,
-0.026914053,
-0.044277094,
0.040852644,
0.012707927,
-0.0008072042,
0.015557179,
-0.013711185,
-0.029535899,
0.0020984802,
-0.05331979,
-0.03900665,
-0.0066783503,
-0.0030699677,
0.020814247,
-0.051527303,
-0.015583932,
0.018058633,
0.018219156,
0.00096145505,
0.009544322,
0.02390428,
0.0036919874,
-0.008567818,
-0.021269059,
-0.037829496,
0.00048323566,
-0.060837533,
-1.2658287e-05,
-0.043527998,
-0.04537399,
-0.032906845,
-0.020386191,
-0.069024116,
0.0276364,
-0.0013686104,
-0.01840643,
-0.00694923,
0.0054610646,
0.025201827,
-0.056663983,
0.055700853,
0.010774985,
0.06773994,
0.03186346,
0.03023149,
-0.02841225,
0.061319094,
0.07260909,
0.0028024325,
0.012192923,
-0.021295812,
0.044357356,
0.0142328795,
0.028010948,
0.0005919219,
-0.0049560918,
0.03764222,
-0.008541065,
-0.00024600708,
0.020881131,
-0.011330121,
-0.040290818,
-0.055861376,
-0.02961616,
0.015289644,
0.03574272,
0.0055981767,
0.016105626,
0.019503325,
-0.03370945,
0.034565564,
-0.056342937,
0.0076916404,
0.048798442,
-0.008086255,
-0.008888861,
0.046149842,
0.072234534,
-0.006076396,
-0.057306066,
0.017884737,
0.0012699567,
-0.012975463,
0.014901717,
-0.028331991,
-0.00084106415,
0.006009512,
-0.016613944,
-0.010801738,
-0.010841869,
-0.03734793,
-0.012427015,
1.1698138e-05,
-0.0021118568,
-0.0057586976,
-0.0374817,
-0.008260153,
0.034137506,
-0.007297026,
-0.009156397,
-0.006547927,
-0.0003235505,
0.001728947,
0.027315356,
0.019489948,
-0.00868821,
0.0043708584,
-0.02659301,
-0.008574507,
-0.0112899905,
-0.020626973,
-0.019209037,
0.07207402,
0.020814247,
0.005323953,
-0.00015090664,
0.0024228666,
-0.042457856,
-0.015062238,
0.002914463,
-0.04823662,
-0.014286386,
0.004347449,
-0.031702936,
-0.044972688,
0.017764345,
-0.009711532,
0.055700853,
-0.0056282743,
-0.048049342,
0.034431797,
-0.02324882,
0.0037388061,
-0.0010433878,
-0.020841,
0.018928124,
-0.03330815,
0.025482738,
0.057894643,
-0.036679093,
-0.017042,
0.02352973,
0.0042738765,
-0.0054945066,
0.01617251,
-0.0027639742,
-0.058750756,
0.07533795,
0.011223107,
-0.043795533,
0.008019371,
0.034592316,
-0.0038625412,
-0.01985112,
-0.030177984,
0.021202175,
-0.018834487,
-0.010554268,
0.015396657,
-0.017242651,
0.03991627,
-7.832723e-05,
0.031141112,
0.005216939,
0.004293942,
-0.027181588,
0.0050196312,
-0.007919045,
0.060248952,
-0.059285827,
0.015610686,
0.072288044,
-0.008828665,
0.03384322,
-0.027663153,
-0.040718876,
-0.06345938,
0.00876847,
-0.041066673,
0.009156397,
-0.0138583295,
-0.010855245,
0.021362696,
0.017563693,
0.0060061677,
0.008735028,
0.03528791,
0.051928606,
-0.0003787297,
-0.027529385,
-0.010353616,
0.0040063416,
0.009203215,
0.009370425,
0.021777375,
-0.017135637,
-0.025763651,
0.026753532,
-0.022192055,
0.0040598484,
0.03255905,
0.009149708,
0.021763999,
0.025469363,
-0.023931034,
-0.0031435401,
-0.013329947,
-0.0012816614,
-0.015490295,
0.03801677,
-0.057092037,
-0.010808427,
-0.005534637,
0.008507623,
-0.024546366,
-0.003875918,
0.0020884476,
0.015182629,
0.034244522,
0.04505295,
-0.044812165,
-0.019222412,
0.032238007,
-0.008005994,
-0.041093424,
-0.025817158,
0.032933597,
0.004484561,
-0.005193529,
-0.025081437,
0.006828839,
0.025402479,
0.03801677,
0.029963955,
0.012620979,
0.051848345,
-0.03386997,
-0.04074563,
-0.028653033,
0.011891945,
0.0010241587,
0.028439004,
-0.023302326,
-0.020626973,
0.040718876,
-0.0023476225,
-0.013885083,
-0.013162738,
-0.026004434,
0.0314354,
0.047755055,
0.024171816,
-0.037080396,
0.011825061,
0.010788362,
-0.045427497,
-0.03825755,
0.012968775,
-0.01096226,
0.013370078,
0.050029106,
0.026338853,
0.0030816724,
0.0048457333,
0.027582891,
-0.0036217594,
-0.03694663,
0.023583239,
-0.04475866,
0.030124476,
0.023757137,
0.025964303,
-0.003178654,
0.0037488388,
0.048744936,
-0.0666698,
-0.03060604,
-0.022245562,
0.015369904,
-0.0031218028,
-0.04098641,
0.06383393,
-0.015851468,
0.00380569,
-0.05628943,
-0.03210424,
-0.008895549,
0.056556966,
0.031783197,
-0.0333349,
-0.036144022,
0.032478787,
0.023984542,
-0.0099121835,
0.023061544,
0.017349666,
-0.01617251,
-0.024840655,
-0.037829496,
-0.030204738,
-0.027582891,
-0.00041676988,
-0.026633142,
0.024171816,
-0.044143327,
-0.0030532468,
-0.06469004,
0.010708101,
-0.01902176,
-0.024225323,
-0.05741308,
0.0030632794,
0.011035832,
0.046417378,
0.010086082,
0.0079391105,
-0.05671749,
-0.033147626,
0.06335236,
0.045935813,
-0.021844259,
-0.025656637,
0.0043976116,
0.057306066,
-0.009189839,
0.018393053,
-0.009490816,
-0.02006515,
0.008447427,
0.022927778,
-0.04098641,
0.018352922,
-0.049306758,
-0.016359786,
-0.014874964,
-0.013436962,
-0.044116575,
-0.03186346,
-0.028305236,
-0.009417243,
0.12659772,
-0.012513964,
-0.03135514,
0.0014764606,
-0.017617201,
-0.016453423,
-0.0036585454,
-0.014420154,
-0.015329774,
0.019075269,
-0.036465064,
-0.0026653206,
-0.009497504,
0.028198224,
-0.018607082,
-2.2116079e-05,
0.014580675,
-0.021804128,
0.0583227,
0.025161697,
0.031114358,
-0.022967907,
0.008413985,
-0.039648734,
0.017322913,
-0.0333349,
-0.0048992406,
-0.028840307,
-0.0020784151,
0.016988494,
-0.0039528343,
-0.001956352,
0.06447601,
-0.022272315,
0.0031318353,
0.016747711,
-0.023917658,
0.011363563,
-0.031114358,
0.013269752,
-0.0018209122,
-0.012212987,
-0.06656279,
-0.03400374,
-0.0018928124,
-0.035555445,
-0.029428884,
0.014473661,
0.006588057,
-0.020533336,
0.02390428,
-0.023342457,
0.032532293,
0.0061733774,
0.01083518,
0.056342937,
-0.019155528,
0.02287427,
-0.014968601,
-0.008213335,
0.018259285,
0.0028559396,
0.003128491,
-0.0014630838,
0.008072878,
0.016226018,
-0.012306625,
0.03590324,
-0.012567472,
0.0040096855,
0.013925213,
0.036304545,
-0.019503325,
-0.021536592,
0.010841869,
-0.0018075355,
0.03164943,
0.07640809,
0.019102022,
-0.056235924,
0.03528791,
0.03172969,
0.025924172,
0.04815636,
-0.011356874,
-0.035020374,
-0.018540198,
0.001641162,
0.022954531,
-0.020707233,
0.023944411,
-0.014714442,
0.011497331,
-0.015329774,
-0.012507277,
-0.010594399,
0.008654768,
0.0062068193,
-0.01009277,
-0.040959656,
0.05703853,
-0.005484474,
0.00583227,
-0.012741369,
0.022553228,
0.05024313,
0.022526475,
0.037107147,
-0.037214164,
-0.008521,
0.007323779,
0.027114704,
0.0039260807,
-0.007082998,
0.02655288,
0.009484127,
-0.009698155,
-0.01878098,
0.009470751,
0.035394922,
0.035769474,
-0.01931605,
0.04946728,
0.023797266,
0.0020048427,
-0.003768904,
-0.055914883,
-0.0055847997,
-0.031248126,
0.015570556,
-0.015062238,
-0.008547753,
0.021282434,
-0.0035114011,
-0.0118852565,
-0.0140456045,
-0.04235084,
-0.019102022,
-0.013791446,
-0.029883696,
0.048316877,
0.0032104237,
-0.017857982,
0.017055377,
0.024599873,
-0.039969776,
0.030044217,
0.022365952,
-0.053801354,
-0.009785105,
-0.00019772533,
-0.031194618,
0.06485056,
0.008574507,
-0.03180995,
0.032238007,
-0.012212987,
0.02605794,
0.00827353,
-0.023502978,
-0.0314354,
0.017470056,
0.006671662,
-0.014941848,
-0.0058055166,
-0.0013853314,
-0.038658854,
0.0014689361,
0.015945105,
-0.013490468,
-0.051634315,
-0.013543976,
0.020198917,
-0.02407818,
-0.00860126,
-0.004765473,
0.024894161,
-0.004400956,
-0.0007323779,
0.009417243,
0.046979204,
-0.050323393,
0.030873576,
0.009029317,
0.019663846,
-0.01389846,
0.018767603,
-0.009791792,
-0.009250034,
0.02010528,
-0.014594052,
-0.037374683,
-0.024720263,
-0.027368864,
-0.018995008,
-0.03271957,
0.011985582,
-0.010955571,
-0.036331296,
-0.005083171,
-0.0015667537,
0.0537746,
0.021081783,
0.017296158,
-0.02340934,
-0.041708756,
-0.0042504673,
0.03590324,
-0.015035485,
-0.024024671,
0.042163566,
0.006531206,
0.036117267,
-0.003681955,
0.021456333,
0.0065245177,
0.024840655,
-0.01890137,
-0.038284305,
0.0020733988,
0.014981978,
-0.0039561787,
0.0120123355,
0.03924743,
0.015891599,
-0.020519959,
0.009357048,
0.009604518,
-0.016292902,
-0.0122598065,
-0.013383455,
0.009163084,
-0.013176114,
-0.0019847776,
-0.014928471,
-0.019744107,
-0.014072358,
-0.023957787,
0.025964303,
0.01071479,
-0.012607602,
-0.015276267,
0.0019981544,
-0.015904974,
-0.023663498,
0.013844953,
0.018232532,
-0.010708101,
-0.0149552245,
-0.00060906087,
-0.00639075,
0.021536592,
-0.0019948103,
-0.03606376,
-0.0024563086,
-0.019476572,
0.035207648,
0.007490989,
-0.007123128,
-0.023543108,
0.033361655,
0.036919873,
-0.022031534,
0.036304545,
-0.029589407,
-0.022392707,
0.010400436,
0.0013134312,
0.023128428,
-0.028224977,
-0.03750845,
0.042243827,
-0.031328388,
0.0024211947,
0.038899634,
0.018299416,
0.013283129,
-0.0062436056,
0.036144022,
-0.015704323,
-0.022981284,
-0.036224283,
0.0061566564,
0.004310663,
0.021897767,
-0.0114170695,
-0.018219156,
0.020626973,
-0.018553574,
0.050055858,
-0.03271957,
-0.022740502,
-0.011751489,
-0.05422941,
0.043956053,
-0.009089513,
0.0010174703,
0.0007934094,
-0.04462489,
-0.009938938,
-0.011637786,
3.1874326e-05,
-0.0034127475,
0.012674486,
-0.04165525,
-0.06046298,
0.0032438657,
0.046551146,
-0.03914042,
-0.014981978,
-0.00023890068,
-0.023837397,
-0.029482393,
-0.014687689,
0.04877169,
-0.031248126,
0.013129296,
0.037454944,
-0.0011604344,
-0.0142328795,
-0.059499856,
0.033227887,
0.01567757,
-0.04491918,
-0.021830883,
-0.0015316397,
0.042083304,
-0.018005127,
0.015731078,
0.0058055166,
-0.0019647125,
0.010433878,
-0.007210077,
0.02287427,
0.06731188,
0.021737244,
-0.03189021,
0.00036911515,
-0.006026233,
0.0051065804,
0.013497157,
0.0045681656,
0.017978374,
-0.006511141,
0.02006515,
0.00785885,
0.012025713,
0.0058088605,
-0.0026736811,
0.004625017,
0.01583809,
0.0027689906,
0.026071317,
-0.013497157,
-0.005424279,
-0.010667971,
0.05901829,
-0.013309882,
0.012674486,
-0.0096312715,
0.0157177,
-0.010293421,
0.015771206,
0.0060462984,
0.0067820204,
-0.013022282,
0.01886124,
0.022860894,
0.04235084,
0.0045146584,
-0.0009840283,
0.041039918,
-0.022927778,
0.01104252,
0.0031552447,
-0.026245214,
-0.018219156,
0.020025019,
-0.03584973,
0.016573813,
-0.027582891,
-0.007437482,
0.028331991,
-0.008173204,
0.041842524,
0.004574854,
-0.050938725,
0.012079219,
0.013296505,
-0.0011412053,
0.0102867335,
0.014660936,
0.04235084,
0.017697461,
0.02726185,
0.032452036,
0.0041969605,
0.032692816,
-0.018352922,
-0.0450797,
-0.030766562,
0.0060362658,
0.04826337,
-0.034672577,
0.0031134423,
0.042671885,
-0.007718394,
-0.004942715,
0.028947322,
-0.01302897,
0.04430385,
-0.005257069,
0.02886706,
0.00010732764,
-0.016720958,
-0.0044644955,
-0.034779593,
-0.004367514,
0.0051801526,
0.003474615,
-0.014888341,
-0.0029713141,
0.0005814713,
0.036893122,
0.00022364281,
0.024706887,
-0.010982325,
0.013329947,
-0.001204745,
0.031141112,
0.032987107,
-0.0154234115,
0.01120973,
0.053507064,
-0.001834289,
0.0032689471,
-0.051500548,
0.02018554,
-0.0083136605,
-0.004350793,
-0.010647906,
0.0026502719,
-0.0027556138,
0.038765866,
-0.0022071663,
-0.048076097,
0.005240348,
0.028519265,
0.013283129,
0.008514311,
-0.031034097,
0.0075913146,
0.0045949193,
0.013283129,
0.0026803694,
-0.012727993,
-0.018165648,
-0.018152272,
-0.02870654,
0.008982498,
0.0012582521,
-0.024666756,
-0.00031017375,
0.029937202,
0.0016419981,
0.024439352,
-0.0014229534,
0.018433183,
-0.004434398,
-0.016025366,
0.004645082,
0.036919873,
-0.025001176,
0.03606376,
-0.01670758,
-0.0038625412,
0.051393535,
-0.011718047,
-0.037454944,
0.01654706,
-0.00736391,
0.00024684315,
-0.01583809,
-0.015517049,
-0.0031569167,
0.017068753,
-0.003912704,
0.033762958,
-0.007959176,
0.03437829,
0.021402827,
-0.024292206,
0.035715964,
0.050189625,
-0.018874617,
-0.0024161784,
0.020841,
-0.0074843005,
0.012808253,
-0.013249687,
-0.016346408,
0.012654421,
0.00044101526,
0.030097723,
0.022526475,
0.040611863,
-0.005136678,
-0.056663983,
0.009256722,
0.013831576,
-0.0057252557,
-0.003108426,
0.0276364,
-0.007905669,
0.032452036,
0.009470751,
-0.003631792,
-0.029027583,
0.0048992406,
0.021750621,
-0.007109751,
0.0037053642,
0.012881826,
0.003788969,
0.0032973727,
0.010781674,
-0.025616506,
0.0028492513,
-0.054443438,
-0.014834833,
0.015690947,
0.02469351,
-0.038284305,
0.013644301,
-0.0095041925,
0.00039754077,
-0.0006475191,
0.032746322,
0.027034445,
-0.011504019,
0.0049661244,
-0.0100392625,
-0.048611168,
-0.0024880785,
0.01961034,
-0.01795162,
0.024225323,
0.008320348,
-0.02253985,
-0.020613596,
0.038846128,
0.007718394,
0.008380544,
0.0017590447,
-0.011590968,
-0.009089513,
-0.0038290992,
0.011122781,
0.026713401,
0.04272539,
-0.02518845,
-0.0033793056,
0.025857288,
0.019677224,
0.01633303,
-0.032157745,
0.01787136,
0.009524258,
-0.005203562,
-0.017831229,
0.03504713,
-0.014473661,
0.008367167,
0.0054443437,
0.01919566,
-0.040023282,
-0.016011989,
-0.0024546366,
0.010206472,
-0.014487037,
-0.020814247,
0.0031435401,
0.025964303,
0.016801218,
0.02204491,
0.0046551144,
-0.035341416,
0.003474615,
0.009109578,
0.004641738,
0.0038558529,
0.0034077312,
-0.035421677,
-0.024252078,
0.0151424995,
-0.021777375,
-0.0060061677,
-0.0011035831,
0.011891945,
0.0037588712,
0.02332908,
0.01617251,
-0.028546019,
0.035020374,
0.011825061,
0.0033408473,
-0.0030983933,
0.033736203,
0.0014814768,
-0.03485985,
0.037668973,
-0.020974768,
0.028840307,
-0.005818893,
-0.01985112,
-0.02192452,
-0.0015868188,
0.020533336,
0.022165302,
0.019810991,
-0.017215898,
-0.0003948236,
-0.0006859773,
-0.027275225,
-0.008694898,
0.013089165,
0.0072033885,
0.0008803584,
-0.0122598065,
-0.03341516,
-0.00014045605,
0.0102265375,
-0.025576377,
0.00024349894,
-0.028171469,
0.020506583,
0.018580329,
0.0439293,
0.047219984,
-0.02825173,
0.029776681,
0.026954183,
-0.012507277,
-0.001030011,
0.0011378612,
-0.0050162873,
-0.027342109,
0.029321872,
-0.031997226,
-0.032906845,
-0.041708756,
-0.034271274,
2.2534103e-07,
0.015530425,
-0.014553921,
-0.018299416,
-0.007470924,
0.01654706,
0.010059328,
0.018727472,
0.012661109,
0.021001523,
0.097168826,
0.0116043445,
-0.00052838225,
0.020239048,
-0.0047755055,
0.0104138125,
-0.018754225,
0.009229968,
-0.018847864,
0.009738286,
-0.008413985,
0.035582196,
0.023342457,
-0.024961045,
-0.015824715,
0.00992556,
-0.01340352,
-0.0040431274,
0.0037087083,
-0.007912357,
0.027743412,
-0.02117542,
0.009209903,
0.031087603,
-0.02245959,
-0.01567757,
-0.009524258,
0.00901594,
0.007631445,
0.03879262,
-0.016560437,
0.024586497,
-0.008046125,
0.035796225,
0.023770513,
0.02249972,
-0.044143327,
0.050029106,
0.013844953,
-0.019102022,
0.02639236,
-0.018540198,
-0.0080661895,
-0.024385845,
-0.025830535,
-0.03221125,
-0.0032037355,
-0.035475183,
0.003595006,
-0.0075846263,
-0.006267015,
0.022740502,
-0.03531466,
0.0045447564,
0.036786105,
0.01848669,
0.012433704,
0.024747018,
0.03499362,
-0.028599525,
0.030873576,
0.016801218,
-0.016774464,
0.015690947,
0.0028074489,
-0.025616506,
-0.018580329,
-0.011550837,
0.009765039,
0.015517049,
0.002563323,
0.021523217,
-0.010674659,
-0.045186717,
0.002183757,
0.007337156,
0.020158786,
-0.0071298163,
-0.013791446,
0.01348378,
-0.052276403,
-0.0023609991,
-0.001395364,
0.031408645,
-0.02382402,
0.0042972863,
0.031087603,
-0.02200478,
-0.012159481,
0.037615467,
-0.030579288,
-0.004802259,
-0.0005802172,
-0.00492265,
-0.011530772,
0.009370425,
-0.015169253,
-0.020158786,
0.016761089,
0.019209037,
0.0038290992,
0.0017590447,
-0.021456333,
0.030097723,
0.024653379,
-0.01302897,
-0.046925694,
0.019102022,
0.009343671,
0.0061232145,
0.033976987,
-0.022272315,
0.033227887,
0.0017256028,
0.0036451689,
0.018152272,
-0.006634876,
0.02324882,
-0.015249513,
-0.014540545,
0.018887993,
0.021349318,
0.008527689,
-0.01617251,
0.026873924,
-0.004434398,
0.0042738765,
0.009979067,
-0.020158786,
0.008427363,
0.043447737,
0.013477092,
0.0004401792,
-0.004738719,
0.008480869,
0.014620805,
0.005534637,
-0.01472782,
-0.015864845,
0.011356874,
0.02068048,
0.01124986,
-0.0191154,
-0.007678264,
0.032532293,
-0.004344105,
0.0021018244,
0.020466452,
-0.020921262,
-0.0051600877,
-0.0138583295,
-0.030846823,
0.0046919007,
0.008714963,
0.047353752,
-0.027475877,
0.0076247565,
0.013470403,
-0.018045258,
-0.011062586,
-0.013002217,
-0.01480808,
-0.029883696,
-0.0014430187,
0.012353444,
-0.0011646147,
0.012005648,
0.007149881,
-0.0020717266,
0.02419857,
0.023048168,
-0.01298884,
0.022860894,
0.0013309882,
-0.005798828,
-0.011998959,
0.005818893,
0.017550318,
-0.06324535,
-0.015624063,
0.003508057,
-0.0009773399,
-0.031488907,
-0.010193096,
0.009711532,
-0.015316397,
0.028091209,
-0.03590324,
0.0059259073,
0.0055981767,
0.010253292,
-0.044196837,
-0.0150488615,
0.010614464,
-0.008099631,
0.0040063416,
-0.03234502,
-0.029642913,
-0.013778069,
0.00872834,
-0.0020550056,
0.018607082,
0.013303194,
-0.0129821515,
0.017964996,
0.07153895,
-0.03780274,
-0.012413639,
-0.024506235,
-0.012707927,
0.038765866,
-0.011564214,
0.01344365,
0.009851988,
0.034726083,
-0.021295812,
-0.009457374,
-0.015169253,
0.017149014,
-0.0037856249,
-0.009785105,
0.015811337,
0.01319618,
-0.03764222,
-0.037214164,
-0.020359438,
0.016319655,
-0.01298884,
0.012079219,
-0.0023760481,
-0.041494727,
-0.016854726,
-0.036893122,
0.0138182,
-0.014058981,
-0.010400436,
-0.01923579,
0.026124824,
0.023476224,
0.002533225,
-0.00959783,
-0.016560437,
0.0120725315,
0.052142635,
-0.01195214,
0.0039595226,
0.0016787841,
0.020626973,
-0.011303367,
-0.024666756,
-0.0012699567,
-0.011096028,
-0.00068848545,
-0.038284305,
-0.040772382,
0.0027539418,
0.006738546,
0.0031702935,
-0.023141805,
-0.03172969,
-0.055112276,
0.023436094,
0.038846128,
-0.003128491,
0.026847169,
-0.017470056,
0.012808253,
0.0025800439,
-0.025295464,
0.025148321,
-0.0038090341,
-0.048129603,
-0.0024847344,
-0.013022282,
-0.0046551144,
0.028813554,
0.025469363,
-0.014634182,
-0.004344105,
-0.057680614,
0.028492512,
0.009671402,
-0.017122261,
0.02064035,
-0.0075578727,
-0.0035682523,
0.018714096,
0.0033124217,
0.029642913,
-0.0058222376,
0.012714616,
-0.022365952,
-0.034351535,
-0.0059794146,
-0.03151566,
0.01939631,
0.008648079,
-0.018433183,
-0.029642913,
-0.008286906,
-0.033495422,
0.030472273,
0.007504366,
-0.03694663,
-0.0011269925,
0.00802606,
-0.00034863196,
0.022700371,
-0.007036179,
0.04288591,
-0.06527862,
0.00562493,
0.0018894682,
-0.0048490777,
0.0059994794,
0.013356701,
-0.03833781,
0.009664713,
-0.012065843,
0.020533336,
-0.01096226,
0.0018058635,
-0.022058288,
0.0154234115,
0.025870666,
-0.028519265,
0.03769573,
-0.008969122,
0.014326517,
0.026138201,
0.023074921,
0.0028241698,
0.01484821,
0.0242387,
0.026445866,
0.0072702724,
-0.030686302,
0.012132727,
-0.0006951738,
-0.053346545,
-0.02552287,
0.033976987,
-0.011430447,
-0.017068753,
-0.0035883174,
0.003282324,
-0.016573813,
-0.03330815,
0.0046919007,
-0.016399914,
0.008494247,
0.013463715,
0.049734816,
-0.030766562,
-0.017898113,
0.039568473,
0.020546712,
-0.012928644,
-0.003875918,
-0.050564177,
-0.0018008471,
-0.005430967,
0.03855184,
-0.02010528,
-0.0020834312,
-0.0042638443,
-0.0078120315,
-0.016346408,
-0.002847579,
-0.025924172,
-0.0050564175,
0.0016010316,
0.0076581985,
-0.016185887,
-0.010500762,
-0.0229144,
-0.043822285,
-0.008220023,
-0.017630577,
-0.041949537,
0.03809703,
0.018005127,
-0.009892118,
0.005574767,
0.036224283,
0.010801738,
0.009423932,
-0.008293595,
-0.00019061891
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}
headers:
CF-RAY:
- 939c184b69e9db4c-NRT
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 03 May 2025 01:48:14 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '33317'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '113'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-8496694fc7-rgktz
x-envoy-upstream-service-time:
- '65'
x-ratelimit-limit-requests:
- '5000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '4999'
x-ratelimit-remaining-tokens:
- '4999989'
x-ratelimit-reset-requests:
- 12ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_5c609a3f38e3e7a89eab47e70560bc9d
status:
code: 200
message: OK
version: 1
test_embeddings_with_batch_input.yaml 0000664 0000000 0000000 00000417457 15270700723 0046566 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": [
"This is the first test string for embeddings",
"This is the second test string for embeddings",
"This is the third test string for embeddings"
],
"model": "text-embedding-3-small"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '191'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.008279107,
-0.026522232,
0.01812191,
-0.03011025,
-0.021976603,
-0.029407192,
0.043710772,
0.0180613,
0.019746214,
0.028534431,
0.021612952,
-0.029213244,
-0.012018644,
-0.052608084,
-0.009485213,
0.017018836,
-0.014982394,
0.018618898,
-0.034280106,
0.024243357,
0.015758181,
-0.027298018,
-0.02469186,
0.036001384,
0.016643064,
-0.02304331,
-0.0034667999,
0.032049716,
0.028970812,
-0.026134338,
-0.01343082,
-0.038983315,
0.011891366,
-0.042765282,
0.011327708,
0.0631297,
-0.01257018,
0.0090427715,
-0.04882612,
0.000837911,
-0.007788178,
0.016303657,
-0.025891904,
0.01242472,
-0.025479767,
0.042862255,
-0.023273623,
0.008206376,
-0.030837549,
0.024473669,
-0.06652377,
-0.011927731,
-0.01054586,
0.0048577627,
-0.02492217,
0.0016894588,
-0.015115732,
0.026134338,
-0.033528563,
-0.019055279,
0.032146692,
0.0062790294,
-0.01669155,
-0.034934677,
0.0015296043,
0.008667,
-0.02094626,
0.059638657,
0.033480074,
0.027491966,
0.050377693,
-0.008327593,
-0.037310526,
0.0108792065,
-0.0040971274,
-0.018897695,
-0.011242856,
0.0061699343,
0.000960643,
-0.05076559,
-0.03134666,
0.011061031,
-0.017200662,
-0.03495892,
-0.026934369,
0.020558367,
-0.071226984,
-0.011818636,
-0.018170396,
-0.016558213,
-0.030498141,
-0.08422142,
-0.027394993,
-0.0187886,
0.011115579,
-0.004381987,
-0.017164296,
-0.053771764,
-0.024000922,
-0.003315279,
-0.010885267,
0.03098301,
-0.031831525,
0.004339561,
-0.0044880514,
-0.034910433,
0.008879129,
-0.014388432,
-0.046110865,
-0.036074113,
-0.060414445,
-0.0052183825,
-0.0060668997,
0.0051032263,
0.060559902,
0.026764665,
-0.008982164,
-0.01900679,
-0.021225058,
-0.037892368,
-0.022776634,
-0.01899467,
0.05721432,
-0.015358166,
-0.045989648,
-0.054256633,
-0.024897927,
-0.051008023,
-0.03988032,
-0.0017561282,
0.0015379379,
-0.015333923,
0.032680046,
0.05900833,
-0.045189615,
-0.022509957,
-0.06889962,
0.024400938,
-0.00917005,
0.029673869,
-0.013576279,
-0.052705057,
0.0030440565,
-0.013649009,
-0.0010151905,
-0.029019298,
-0.04080157,
0.044583533,
0.021297788,
-0.010994362,
-0.03459527,
-0.019479537,
-0.034910433,
0.0163279,
-0.03032844,
-0.03386797,
-0.023710003,
-0.026885882,
0.033261884,
-0.004227435,
-0.0046759374,
0.0068063224,
0.025479767,
0.0051183784,
-0.007618475,
0.0028592008,
0.018594654,
-0.0059972005,
-0.017588556,
-0.06686318,
0.002897081,
-0.0430562,
-0.040995516,
-0.008024551,
-0.028922325,
-0.01444904,
-0.012824736,
-0.06967541,
0.0135884015,
-0.0022061453,
0.031758796,
0.045965403,
4.7054364e-06,
0.0011197401,
-0.03381948,
0.04768668,
0.012436842,
0.041213706,
0.012000461,
0.009770073,
0.011139822,
0.022594808,
0.057553727,
-0.020364419,
0.013067169,
-0.009279145,
0.037698418,
-0.019176494,
0.044365343,
-0.01669155,
0.015249071,
0.031516362,
-0.041116733,
0.014436918,
0.0041062185,
-0.016667308,
-0.021697804,
-0.024279721,
-0.037431743,
0.022485713,
0.043686528,
-0.0038183287,
-0.019321956,
-0.019249225,
-0.035274085,
0.029285975,
-0.0114610465,
0.005424451,
0.033480074,
-0.035007406,
-0.0050971657,
0.034061916,
0.06361457,
0.029067785,
-0.027128316,
-0.0076730223,
-0.0104973735,
-0.00961249,
0.013842956,
-0.024461547,
0.01047919,
-0.02824351,
0.009697342,
-0.039904565,
-0.0048426106,
-0.003278914,
0.004506234,
0.015649086,
-0.02174629,
0.021382641,
-0.051832296,
-0.03129817,
0.02463125,
0.0059699267,
0.028655646,
0.014424797,
-0.00026156308,
-0.026740422,
0.025285821,
0.0232615,
-0.0074851364,
0.034280106,
0.010897389,
0.00073411915,
-0.02406153,
0.014509649,
-0.041553114,
0.04790487,
0.043444093,
0.0163279,
0.016461238,
0.033964943,
-0.020388663,
0.02094626,
0.0041304617,
-0.030376926,
0.006172965,
0.0020046225,
0.023297865,
-0.05944471,
-0.010945875,
-0.02375849,
0.046183594,
-0.013612645,
-0.06225694,
0.04746849,
-0.027104072,
-0.03498316,
-0.011091336,
0.023334231,
-0.035734706,
-0.054693013,
0.009964019,
0.03006176,
-0.017176418,
0.007048756,
0.023734245,
-0.04196525,
-0.035128623,
-0.03141939,
0.0015189978,
-0.028922325,
0.060996283,
0.009503395,
-0.010927693,
0.02101899,
0.01777038,
0.013321725,
0.026667692,
-0.010933754,
0.0445108,
-0.022812998,
0.053432357,
0.063808516,
-0.032049716,
0.057311293,
-0.0111277,
0.023576664,
0.032195177,
0.0070669386,
-0.009685221,
-0.008242741,
-0.024740346,
0.027055586,
-0.06031747,
0.023637272,
0.049747366,
0.0005147925,
0.009248841,
-0.023600908,
-0.03755296,
-0.010727685,
0.0023637272,
-0.022837242,
0.018824967,
0.00016676777,
0.0001857079,
-0.0142672155,
-0.0017682498,
0.015370288,
-0.010448887,
0.009509456,
0.035371058,
-0.015649086,
-0.03966213,
-0.029189002,
-0.009654917,
-0.026473746,
0.0046244203,
0.010394339,
-0.05483847,
-0.028049564,
0.055032417,
0.0099094715,
-0.011679237,
0.060414445,
-0.010873145,
0.014667231,
0.04817155,
0.024073653,
0.005672945,
0.013964173,
-0.019540146,
-0.006394185,
0.069820866,
-0.074911974,
-0.002051594,
0.01899467,
-0.012558059,
-0.021297788,
0.0341104,
-0.004094097,
-0.020025013,
0.033092182,
0.0053032343,
-0.054983933,
0.01415812,
0.05028072,
-0.0067881397,
-0.03149212,
-0.023006946,
0.021709926,
0.021297788,
-0.0007530593,
-0.012085313,
0.018594654,
-0.022412984,
0.04201374,
0.046571486,
0.038983315,
0.0200735,
-0.027758643,
-0.050523154,
-0.028073806,
-0.0017440064,
0.0016591547,
-0.003769842,
0.0032910355,
0.0068245046,
0.008436688,
0.015709694,
0.0050032227,
-0.011024666,
0.0038728763,
0.02247359,
0.03980759,
0.023794854,
-0.007618475,
0.01408539,
-0.020182595,
-0.00013324375,
-0.07025725,
-0.012776249,
-0.014061146,
0.011570142,
0.026788909,
0.021055356,
0.00722452,
0.024400938,
0.008485175,
0.021964481,
-0.012861101,
0.03243761,
-0.012164104,
-0.0095337,
0.049892828,
0.027928347,
-0.05740827,
-0.0019273468,
0.053432357,
-0.036074113,
-0.038692396,
-0.06725107,
0.010145845,
-0.002500096,
0.019249225,
0.05697189,
-0.0028864746,
-0.008151828,
-0.044413827,
-0.03779539,
0.009697342,
0.05575972,
0.01393993,
-0.053868737,
-0.041044,
0.005324447,
0.051735323,
-0.02780713,
-0.001719763,
0.013030804,
0.034571026,
-0.03689839,
-0.03619533,
-0.004721394,
-0.015249071,
-0.0041728877,
0.015940007,
-0.023734245,
-0.03828026,
-0.017115809,
-0.06836627,
0.0020925046,
-0.051783808,
0.032534584,
-0.051056508,
-0.015515748,
0.00772757,
0.035831682,
0.0048001846,
-0.028801108,
-0.045189615,
-0.052608084,
0.04455929,
0.04591692,
-0.023128161,
-0.045092642,
0.0032698226,
0.044244125,
-0.041650087,
-0.019418929,
0.015564235,
-0.03481346,
0.009485213,
0.013370211,
-0.012151983,
-0.015333923,
-0.02686164,
-0.009012468,
-0.023382718,
-0.00077957544,
0.0047850325,
-0.03452254,
-0.0068911742,
-0.03692263,
0.14332673,
-0.02831624,
-0.020922016,
0.019661361,
-0.021394761,
-0.035007406,
-0.016776403,
-0.046765435,
-0.012012583,
0.045335077,
-0.0074002845,
0.02030381,
-0.06308121,
0.011242856,
-0.032534584,
0.0005250202,
0.02167356,
0.0014258124,
0.0063456986,
0.033989187,
0.0027546515,
-0.01857041,
0.014485406,
-0.012630789,
-0.028049564,
0.005136561,
-0.014218728,
-0.0068729916,
-0.0017500673,
0.026934369,
0.021952359,
-0.008151828,
0.048074577,
-0.008254862,
-0.054353606,
0.021346275,
-0.019952282,
0.013770226,
-0.054983933,
-0.005815375,
-0.021334153,
-0.015976371,
-0.05032921,
-0.032534584,
-0.019443171,
-0.01552787,
-0.02065534,
0.040171243,
-0.018982548,
-0.033795238,
-0.0029455677,
-0.0012568665,
0.020037133,
0.045989648,
0.0068002613,
0.027176803,
0.0076305964,
0.042668305,
-0.0073639196,
-0.022061454,
0.035661977,
-0.00048145792,
0.021115964,
-0.00040948545,
0.020170473,
0.018582532,
-0.005809314,
0.014364189,
-0.013891444,
0.013333846,
0.017685529,
0.035589248,
-0.016000615,
-0.014933907,
0.006709349,
0.022316009,
0.0131035345,
0.040195484,
0.040947028,
-0.057117347,
0.03200123,
-0.0010348883,
0.012333808,
0.040219728,
-0.033043694,
-0.029892059,
-0.009976141,
0.016146075,
0.03251034,
-0.0048517017,
0.004969888,
-0.022909971,
0.056826428,
-0.045407806,
-0.019491658,
0.018049179,
-0.0029728415,
0.007309372,
0.007994247,
-0.013042926,
0.0375772,
0.013273237,
-0.044098664,
-0.0052456562,
0.0065275235,
0.06540857,
0.011315587,
0.035734706,
-0.02267966,
0.011418621,
-0.012836857,
0.045092642,
-0.019964404,
-0.0032849747,
0.023152405,
-0.004166827,
0.017637042,
0.00037671902,
0.02247359,
0.036510494,
0.0218069,
-0.022703903,
0.03495892,
0.029867815,
0.01242472,
-0.012158043,
-0.017879475,
-0.014533892,
-0.005394147,
0.020970503,
0.008242741,
-0.011582264,
-0.0047910935,
-0.004203192,
0.0010280699,
0.0048698843,
-0.04169857,
-0.0077154483,
0.0043244087,
-0.030013274,
0.04126219,
0.0035001347,
-0.020970503,
0.019249225,
0.01032767,
-0.0071457294,
0.008145767,
0.0048517017,
-0.04152887,
-0.013952051,
-0.012776249,
-0.001288686,
0.025843417,
0.019176494,
-0.044074424,
0.0022773603,
-0.0388621,
0.025091873,
-0.0067578354,
-0.02926173,
-0.026061608,
0.0095276395,
0.0060487175,
-0.0029849634,
0.004948675,
0.025019145,
-0.004500173,
0.044098664,
-0.009060955,
0.012158043,
-0.026279798,
-0.012412598,
-0.0032273969,
-0.0036728685,
-0.03481346,
0.016655186,
0.03481346,
-0.0013955082,
-0.013636888,
-0.011436803,
0.032098204,
-0.06327516,
0.004421382,
-0.0127156405,
0.0044547166,
0.01864314,
0.0012083797,
0.03408616,
-0.011879245,
0.011303465,
-0.05372328,
-0.03503165,
-0.007970003,
0.0095276395,
0.011103457,
-0.0052941428,
0.007842726,
-0.0023516056,
-0.05149289,
0.017115809,
0.014170242,
0.06565101,
-0.008279107,
-0.0018227973,
-0.018934062,
-0.045335077,
-0.046426028,
0.011303465,
0.01170348,
0.0066426797,
0.043007713,
0.004660785,
0.012309564,
-0.016182441,
0.035783194,
0.0075881705,
0.02065534,
-0.011600446,
-0.045238104,
0.0106913205,
0.004806245,
0.010854963,
0.01661882,
0.020425027,
0.014182364,
0.0047850325,
-0.03503165,
0.015370288,
0.01790372,
-0.00094170286,
-0.009248841,
0.014364189,
0.0003873255,
-0.026910126,
-0.029989032,
-0.018073423,
-0.01870375,
0.0051395916,
-2.2325668e-05,
-0.00044206245,
-0.062450886,
0.0023879707,
-0.012485328,
-0.003963789,
0.0028834443,
0.016073346,
0.0284617,
-0.020182595,
0.014291459,
-0.019370442,
-0.0039001498,
0.0072730067,
-0.01857041,
-0.02521309,
-0.0036061993,
-0.009709464,
0.032486096,
0.024352452,
0.02029169,
-0.05561426,
0.04334712,
0.043298636,
-0.017746137,
0.027855616,
-0.01762492,
-0.023079675,
0.007951821,
-0.002939507,
-0.003963789,
-0.032607313,
-0.008757913,
0.035783194,
-0.009363997,
0.0033849787,
0.0100125065,
0.019200739,
-0.008200315,
-0.00241979,
0.050959535,
0.008545783,
-0.006945722,
-0.014412675,
-0.0049153403,
0.025649471,
0.026255555,
0.0050304965,
-0.038595423,
0.0015833942,
0.013806592,
0.023140283,
-0.032316394,
-0.022946337,
0.023855463,
-0.049747366,
0.026764665,
-0.011533777,
-0.00053865707,
0.01640063,
-0.030498141,
-0.0038062069,
-0.024461547,
-0.027055586,
0.008400323,
-0.007600292,
-0.050814074,
-0.03646201,
0.009812498,
0.009224597,
-0.0026197976,
-0.004736546,
-0.0090427715,
-0.038304504,
-0.0715179,
-0.023794854,
0.00278041,
-0.022437226,
0.008345775,
0.0062366035,
0.009109441,
0.045625996,
-0.022631174,
0.026013121,
0.042644065,
-0.025479767,
-0.010515556,
0.002247056,
0.022885729,
-0.048341252,
0.04514113,
-0.029576894,
-0.011442864,
-0.0016818829,
-0.00946097,
0.027516209,
0.06899659,
0.025188847,
-0.0436138,
-0.014885421,
0.0068245046,
0.0021879629,
-0.005836588,
-0.029819328,
-0.010988302,
-0.015297558,
0.034255862,
-0.009182171,
0.021976603,
-0.025964634,
0.0065941927,
-0.011248917,
0.042813767,
-0.014400554,
0.01914013,
-0.017661285,
-0.007242703,
-0.010139784,
0.044753235,
0.016994594,
0.019321956,
0.024897927,
0.017649163,
-0.03524984,
0.023673637,
0.024146384,
0.021370519,
-0.00932157,
-0.019309834,
0.018909818,
0.002810714,
0.0020955352,
0.019043157,
0.036098357,
-0.026958613,
0.01921286,
-0.0046698763,
0.026594961,
-0.013927808,
0.012727762,
-0.018400708,
0.047153328,
0.00089548895,
-0.028510187,
1.6880384e-05,
-0.019152252,
0.006921478,
0.015139976,
-0.023431204,
0.0073760413,
-0.008679122,
0.06361457,
0.021843264,
0.021964481,
0.042886496,
0.026279798,
0.019491658,
0.031467877,
0.0043183477,
0.0053547514,
-0.021964481,
-0.042353142,
-0.04695938,
0.01900679,
0.032825503,
-0.011491351,
-0.01047919,
0.0008265469,
-0.003388009,
-0.020667462,
0.003554682,
-0.008321532,
0.024825197,
0.003524378,
0.019176494,
0.0133944545,
-0.018909818,
0.012448964,
-0.02926173,
0.0056365803,
0.02521309,
0.037431743,
0.010994362,
-0.016133953,
-0.00772757,
0.022049332,
0.020315932,
-0.011903488,
-0.04295923,
0.0008242741,
0.0017015806,
0.04247436,
-0.0032273969,
0.00020720494,
-0.03076482,
0.024667615,
0.02442518,
-0.018606776,
-0.051541377,
-0.021697804,
-0.0061941775,
-0.0053699035,
-0.012055009,
0.006921478,
0.008709426,
0.025988879,
0.024752466,
-0.06405095,
0.012727762,
-0.0028213207,
0.0076366575,
0.013406576,
-0.04126219,
0.007939699,
0.008436688,
-0.018909818,
-0.007854847,
-0.017527947,
-0.014121755,
-0.0030092066,
-0.033577047,
0.040001538,
0.0013818713,
-0.015152098,
-0.0010947391,
0.039953053,
-0.039080292,
0.029310217,
-0.002348575,
-0.044825967,
-0.010151905,
-0.006472976,
-0.00874579,
0.014655109,
-0.018812845,
-0.014097512,
-0.027467722,
0.01812191,
0.041165218,
0.0028637464,
-0.025673714,
0.019673483,
-0.018691627,
0.00938824,
-0.020400785,
0.00917005,
0.008588209,
0.019988647,
0.008012429,
0.035201352,
0.03735901,
-0.015261193,
0.022534199,
-0.0014083874,
0.059250765,
0.007236642,
-0.02795259,
-0.015043003,
0.0022985733,
0.015721817,
-0.0013197478,
-0.034619514,
-0.031661823,
0.015333923,
-0.010988302,
0.029964788,
-0.010703442,
0.016776403,
0.005597185,
-0.031831525,
0.035201352,
0.0038607544,
0.002297058,
-0.022412984,
0.04516537,
-0.024752466,
0.013842956,
-0.011279222,
0.01408539,
-0.026134338,
0.010436765,
0.013758104,
-0.0047698803,
-0.023516055,
-0.0045759333,
-0.028340483,
0.035055894,
0.0041304617,
0.0034031612,
0.025697958,
-0.019188616,
0.0061517516,
0.0011894397,
-0.011582264,
-0.015467261,
0.02463125,
-0.019964404,
0.004239557,
-0.011642871,
0.0187886,
0.013042926,
0.006776018,
0.008994285,
0.005485059,
-0.034692243,
-0.009382179,
0.03922575,
-0.010339792,
0.0197947,
-0.003981971,
-0.004297135,
-0.00017529083,
0.040777326,
0.018679505,
-0.002231904,
-0.00028978387,
-0.0069881473,
-0.026667692,
-0.006624497,
-0.021722047,
0.010897389,
0.0063032727,
-0.009048833,
0.008394262,
0.0014008115,
0.005639611,
0.014412675,
-0.041625842,
0.005721432,
0.004075914,
0.003915302,
0.002441003,
0.01574606,
0.018364342,
0.034255862,
0.0023894857,
0.012315625,
-0.031686068,
-0.018982548,
-0.0037365074,
0.012921709,
-0.0070608775,
-0.019297712,
-0.003221336,
0.014703596,
0.014376311,
0.054305118,
0.00014489194,
-0.02269178,
-0.009545822,
0.017540067,
-0.022352375,
0.0381348,
0.0022288735,
-0.026110094,
-0.0403167,
0.016303657,
-0.0170552,
-0.0100125065,
-0.020715948,
-0.021419005,
0.0147520825,
0.0026197976,
-0.00086215435,
-0.0013205053,
0.015333923,
0.0020455332,
-0.0304739,
-0.028413214,
0.015212706,
0.00816395,
-0.019685606,
0.03857118,
-0.0107822325,
-0.0040062144,
0.009951898,
-0.0021425067,
-0.038886342,
-0.0007083606,
0.006166904,
0.029625382,
-0.0070002694,
0.0070608775,
-0.020328054,
-0.00097503746,
-0.0012068646,
0.016206684,
-0.020206837,
0.01740673,
-0.00035096047,
-0.012533816,
-0.006969965,
-0.018279491,
-0.0070669386,
-0.046426028,
-0.017673407,
-0.02722529,
0.026837396,
0.032898236,
0.02347969,
0.024970656,
-0.024607006,
0.0059699267,
0.041383408,
0.019418929,
-0.0015909702,
0.007685144,
0.0147520825,
-0.004736546,
0.003112241,
-0.04349258,
-0.024534276,
-0.049795855,
-0.0022000845,
0.015855156,
0.00019413626,
-0.024461547,
0.011006484,
-0.0013818713,
0.013152021,
0.01914013,
-0.006191147,
0.028922325,
0.02434033,
0.040243972,
0.019394685,
-0.024049409,
0.015612721,
0.016000615,
-0.013709618,
-0.025334308,
0.017697651,
-0.016546091,
0.003257701,
0.0018152213,
0.017067323,
0.02787986,
-0.0019894703,
-0.0069760256,
0.009600369,
0.0030758758,
-0.007569988,
0.0040728836,
-0.0031304234,
-0.0053547514,
0.014994516,
-0.0059578046,
0.018109787,
-0.043735016,
0.004991101,
-0.026619205,
0.0111701265,
0.04101976,
0.014570257,
-0.009115502,
0.0478079,
-0.015200584,
0.012533816,
0.005918409,
0.016352143,
-0.046983626,
0.030861793,
-0.008588209,
0.0016652156,
-0.004212283,
-8.101637e-05,
0.0028258662,
0.0021197784,
-0.0076366575,
-0.03006176,
0.0100125065,
-0.018097665,
0.0166067,
-0.020194715,
-0.0019697726,
0.012388355,
-0.025261577,
0.018885575,
0.031613335,
-0.02030381,
0.011855002,
-0.0069881473,
0.03316491,
-0.03350432,
0.0132005075,
0.007309372,
-0.01777038,
0.016012738,
0.019891674,
-0.020328054,
-0.027710157,
0.007848786,
-9.943564e-05,
0.052995976,
-0.00047009383,
0.029334461,
-0.029916301,
-0.0065032803,
0.008897312,
0.005169896,
0.0018000692,
0.0064669154,
-0.032970965,
0.022146307,
-0.030934522,
0.0027531362,
0.0058244662,
0.034207378,
0.010897389,
0.0034425566,
-0.003597108,
-0.026570719,
0.02130991,
0.026716178,
-0.01812191,
-0.022291766,
-0.0035334693,
-0.00028580645,
-0.009770073,
-0.0041213706,
-0.0015879398,
-0.026449502,
0.01835222,
0.0023758488,
0.014097512,
0.0183401,
-0.029504165,
0.032922477,
-0.004463808,
-0.0052698995,
-0.0686087,
0.01148529,
-0.0055850632,
0.034183133,
0.015661208,
-0.016449118,
0.0332134,
-0.0078063607,
-0.0027546515,
0.0058274968,
-0.013539915,
0.009073076,
-0.003575895,
-0.032898236,
0.008618513,
0.0020864438,
0.026182825,
3.4589397e-05,
0.014497527,
-0.046038132,
0.0018167365,
0.0190674,
-0.019346198,
-0.0035668039,
0.029601138,
-0.011539837,
-0.011551959,
0.0016667307,
0.061917532,
-0.020994747,
0.012897465,
-0.02095838,
0.005569911,
0.016182441,
0.03437708,
-6.794769e-05,
-0.008109403,
-0.00050645886,
0.05808708,
0.008139707,
0.011133761,
0.015733939,
-0.052414138,
0.016594578,
0.012382294,
-0.03857118,
-0.0067881397,
-0.003894089,
0.048220035,
-0.005833558,
4.6166548e-05,
0.0147520825,
-0.0016167288,
-0.012533816,
-0.000402667,
-0.0058214357,
-0.039977293,
-0.008806399,
0.013236873,
-0.0079821255,
0.0036152906,
-0.030643603,
-0.023431204,
0.025843417,
0.023031188,
-0.0040274276,
0.002348575,
0.0085276,
-0.018473437,
-0.025746444,
0.033189155,
0.016449118,
-0.04494718,
-0.01972197,
-0.005930531,
-0.019928038,
-0.0066426797,
-0.006363881,
0.0027031342,
0.027758643,
0.018073423,
-0.02448579,
0.00556082,
-0.010533738,
-0.0038304504,
-0.049941313,
-0.022909971,
-0.013152021,
-0.025552498,
-0.015661208,
-0.06720258,
-0.038959075,
-0.004797154,
-0.0072487635,
8.158458e-05,
-0.0027137408,
0.050135262,
-0.036098357,
0.0042728917,
0.0388621,
-0.021637196,
-0.0180613,
-0.0068911742,
-0.026279798,
0.039540913,
0.00061365997,
0.013745983,
6.4218852e-06,
0.035080135,
-0.014776326,
-0.026958613,
-0.018218882,
-0.0069942083,
0.0017788563,
0.016982472,
-0.0067699575,
0.02838897,
-0.022619052,
-0.031031497,
-0.0166067,
0.0145581355,
-0.02145537,
0.013152021,
0.002572826,
-0.02867989,
-0.025673714,
-0.022449348,
-0.005715371,
-0.014788447,
0.0013932354,
0.010030689,
0.04196525,
0.020194715,
-0.01589152,
-0.012533816,
0.010733746,
0.020255323,
0.048317008,
-0.015515748,
0.004585025,
-0.0021758412,
0.01321263,
0.0045213858,
-0.0021940237,
0.018000692,
0.04327439,
0.0031789101,
-0.0082669845,
-0.02766167,
0.006254786,
0.00018381389,
0.025843417,
-0.01777038,
-0.035201352,
-0.0416016,
0.013830835,
0.039904565,
-0.0030016305,
0.021964481,
-0.023528177,
0.03689839,
0.0003109968,
-0.035831682,
0.03272853,
0.021649318,
-0.038037825,
-0.015115732,
-0.0012303503,
-0.027491966,
0.020825043,
0.024328208,
-0.02304331,
-0.0038122677,
-0.036437765,
0.016812768,
-0.004348652,
-0.0008530631,
0.012655032,
0.016521847,
-0.0010917087,
0.006624497,
-0.0015349075,
0.0021122023,
-0.025722202,
-0.0069093565,
-0.015709694,
-0.032970965,
0.0051517133,
-0.020982625,
-0.0047850325,
0.0006629043,
0.03944394,
-0.033358857,
-0.0098185595,
-0.034280106,
0.020134108,
0.021928117,
-0.03944394,
-0.01784311,
0.019249225,
-0.012267138,
0.01892194,
0.0034122523,
0.026594961,
-0.042789523,
0.0070002694,
-0.0039031804,
0.0030667845,
0.0038122677,
-0.0020061377,
-0.01610971,
0.04421988,
-0.026279798,
0.0020622006,
-0.03408616,
0.014994516,
0.0023197862,
0.04058338,
0.010091297,
-0.025334308,
0.025649471,
-0.017115809,
0.0031364842,
0.044850208,
-0.002137961,
-0.0018773449,
0.008909433,
0.012024704,
0.0437835,
-0.0010454947,
-0.0071457294,
-0.0060153827,
0.037237797,
-0.05207473,
-0.0083639575,
0.020970503,
-0.0018030996,
0.002203115,
0.019188616,
0.0015833942,
0.01147923,
0.005360812,
-0.0009765527,
-0.025528254,
0.004448656,
0.024388816,
0.05076559,
-0.009200354,
-0.017661285,
0.02766167,
0.035855923,
0.004560781,
0.009636734,
-0.04043792,
-0.016727915,
-0.024291843,
0.033358857,
-0.020388663,
-0.023952436,
-0.016243048,
-0.015636966,
-0.0023091796,
0.01581879,
-0.022425104,
-0.025261577,
0.036292303,
0.018364342,
-0.011085275,
0.00397288,
-0.026449502,
-0.05207473,
-0.019661361,
-0.006782079,
-0.03524984,
0.011939853,
0.0010318578,
-0.03798934,
-0.0005863862,
0.016049102,
0.008479114,
0.003127393,
-0.0129095875,
-0.010388278
]
},
{
"object": "embedding",
"index": 1,
"embedding": [
0.011355308,
-0.023255175,
0.017673438,
-0.057228275,
-0.019777419,
-0.00010336192,
0.030841883,
0.020161087,
0.014047165,
0.020755151,
0.0024505188,
-0.03626273,
-0.032030012,
-0.027401255,
-0.025012618,
0.017797202,
-0.009115187,
0.008737708,
-0.036609266,
0.02429479,
-0.009628806,
-0.028416116,
-0.009721628,
0.05871344,
0.015136285,
-0.017475417,
-0.009238951,
0.035866685,
0.031931,
-0.026881449,
-0.010625103,
-0.038539976,
0.018737804,
-0.032673582,
-0.00047610298,
0.050297517,
0.0007019715,
0.014591726,
-0.04066871,
0.019245235,
0.011231544,
0.00046836777,
-0.032723088,
0.013613993,
-0.005160941,
0.033242896,
-0.012846659,
-0.00043394603,
-0.017698191,
0.009430784,
-0.060347117,
-0.009238951,
-0.011120157,
0.0013250437,
-0.0180076,
0.013514983,
-0.01728977,
0.02772304,
-0.027128976,
-0.04985197,
0.03901028,
-0.002838827,
-0.010915947,
-0.031584464,
-0.011107781,
0.011380061,
-0.024864102,
0.068119474,
0.023626465,
0.0105694095,
0.046634115,
-0.00057008595,
-0.050248012,
0.015606587,
0.007295863,
0.0034065924,
0.0035458263,
0.0012198447,
0.029703258,
-0.041163765,
-0.04502519,
0.014381327,
-0.02653491,
-0.016101642,
-0.032079518,
0.012586756,
-0.06490162,
-0.018873945,
-0.017920965,
-0.033440918,
-0.033589434,
-0.07554529,
-0.022648733,
-0.026064608,
0.004876285,
0.014851629,
-0.015086779,
-0.06460459,
-0.028762653,
0.007147346,
-0.0006613616,
0.019356623,
-0.03529737,
0.023824487,
0.003217853,
-0.023725476,
0.021621495,
-0.008607756,
-0.059505526,
-0.041361786,
-0.074901715,
-0.0003007068,
0.0035798613,
0.018750181,
0.090990975,
0.015519952,
0.010142425,
-0.009393655,
-0.017859083,
-0.03366369,
-0.020631388,
-0.04049544,
0.06643628,
-0.0022277443,
-0.034629047,
-0.046634115,
-0.033985477,
-0.055050038,
-0.036114212,
0.0055167614,
-0.0010883459,
-0.0054734442,
0.028762653,
0.055693608,
-0.0455945,
-0.01790859,
-0.0729215,
0.016188275,
-0.009758757,
0.01576748,
-0.012797154,
-0.049901474,
-0.0022757028,
-0.016906105,
-0.0053156456,
-0.016188275,
-0.02725274,
0.048861858,
0.014703113,
-0.003391122,
-0.047104415,
-0.0007240169,
-0.05460449,
0.013118939,
-0.074753195,
-0.028663643,
-0.028218094,
-0.0056374306,
0.027029965,
0.0005051101,
-0.015346683,
-0.0042729373,
0.030965647,
0.0065285284,
0.0065718456,
0.004786556,
0.029232956,
0.0068441257,
-0.03730234,
-0.0784661,
0.007370121,
-0.01865117,
-0.04594104,
-0.0033787456,
-0.019963065,
-0.016497685,
-0.018156117,
-0.057723332,
-0.0076485886,
0.011800856,
0.020086829,
0.018069481,
0.0064233295,
0.0048793787,
-0.022896262,
0.04448063,
0.007178287,
0.027203234,
0.0230324,
0.019715536,
0.03190625,
0.027599277,
0.08470379,
-0.018626418,
0.006689421,
-0.021250205,
0.026336888,
-0.025742823,
0.034158748,
-0.024406176,
0.015346683,
0.009121375,
-0.01504965,
0.0058602053,
0.015210543,
0.00038966187,
-0.01623778,
-0.028663643,
-0.01841602,
0.036312234,
0.049084634,
0.016126394,
-0.024047263,
-0.014195682,
-0.03802017,
0.040718216,
-0.019703161,
-0.0071225935,
0.029851774,
-0.034505285,
-0.0033013932,
0.0405697,
0.056238167,
0.01841602,
-0.036757782,
-0.0035427322,
-0.005847829,
0.0056374306,
0.019727914,
-0.032945864,
0.021089314,
-0.0159655,
0.0018069482,
-0.057327285,
0.01246918,
-0.016485307,
-0.0072896746,
0.029802268,
-0.03173298,
0.0083973585,
-0.031361688,
-0.018762557,
0.03321814,
0.0061139204,
0.013514983,
0.005816888,
0.0034530037,
-0.030470591,
0.045173705,
-0.0038242943,
-0.01641105,
0.028193342,
0.023218047,
-0.016386297,
-0.030074548,
-0.01114491,
-0.026658673,
0.058861956,
0.03366369,
0.014505091,
0.010031038,
0.023020025,
-0.021819517,
0.019715536,
-0.006448082,
-0.040346924,
0.0102104945,
-0.0023329433,
0.027277492,
-0.08410972,
-0.029183451,
-0.027277492,
0.03757462,
0.010755055,
-0.06604024,
0.036708277,
-0.03757462,
-0.018428396,
-0.0031018245,
0.02653491,
-0.02151011,
-0.055842124,
0.00065788074,
0.02483935,
0.0040563513,
0.0030909951,
0.012203088,
-0.03264883,
-0.0047246744,
-0.030148806,
0.017203137,
-0.041535053,
0.043985575,
0.010717926,
-0.035594404,
0.010179554,
0.026039856,
0.0075681424,
0.021225452,
-0.026460651,
0.031881496,
-0.028069578,
0.038787503,
0.058465913,
-0.03913404,
0.03366369,
-0.0084530525,
0.037079565,
0.020445742,
0.014307069,
-0.01009292,
-0.021114066,
-0.03722808,
0.034876574,
-0.053911414,
0.011974126,
0.036733028,
-0.007846611,
0.004876285,
-0.035965696,
-0.0012894617,
0.0037995416,
0.0026098643,
-0.013923402,
0.02534678,
0.01518579,
-0.01504965,
-0.007382497,
0.00630266,
0.025185887,
-0.010204307,
0.011274861,
0.03289636,
-0.0054610674,
-0.035173606,
-0.020581882,
-0.016151147,
-0.014665984,
-0.012617696,
0.00315133,
-0.05707976,
-0.023737853,
0.054356962,
-0.018019976,
-0.011763727,
0.030841883,
-0.017821955,
0.027648782,
0.033416163,
0.016299663,
0.015247672,
-0.007821858,
-0.01681947,
-0.015420942,
0.055297565,
-0.065495685,
0.013069433,
0.013366465,
0.010977829,
-0.018205622,
0.030767623,
0.008781025,
-0.019245235,
0.0382677,
0.012122642,
-0.031980507,
-0.019789794,
0.059951074,
-0.0039728107,
-0.032203283,
-0.032673582,
0.031386442,
0.012073137,
0.026856696,
-0.023416068,
0.0332924,
-0.020705646,
0.04460439,
0.037624124,
0.028812159,
0.032772593,
-0.034505285,
-0.053713392,
-0.021770012,
-0.0002639645,
0.026584415,
-0.0028512033,
0.006547093,
0.00079518097,
0.037723135,
0.007988939,
-0.0049969545,
0.00513,
-0.004257467,
0.017809577,
0.030718118,
0.04586678,
0.004504994,
0.021101689,
0.0055105733,
0.00096690294,
-0.07742649,
-0.012481556,
-0.0148145,
0.0052475757,
0.026411146,
0.0064913994,
0.001663073,
0.047203425,
0.01660907,
0.0032611701,
0.0026748402,
0.038911268,
-0.020099204,
-0.0040996685,
0.05133713,
0.035495393,
-0.039802365,
0.007141158,
0.0474262,
-0.021411099,
-0.027178481,
-0.059753053,
-0.008019879,
0.009467914,
-0.017005116,
0.05316883,
0.006256249,
-0.016361544,
-0.029034935,
-0.04321824,
0.007821858,
0.04594104,
0.004885567,
-0.050223257,
-0.05178268,
0.027525019,
0.047624223,
-0.027426008,
-0.030841883,
0.017066997,
0.028663643,
-0.023873994,
-0.036138963,
-0.01773532,
-0.0063862004,
-0.013589241,
0.026015103,
-0.023465574,
-0.034505285,
-0.03730234,
-0.06485211,
-0.005965404,
-0.031386442,
0.027227987,
-0.039554838,
-0.027500266,
0.0031776298,
0.041262776,
-0.010445646,
-0.008657262,
-0.064307556,
-0.051485647,
0.021584367,
0.06742639,
-0.011318179,
-0.041559808,
0.026584415,
0.0378469,
-0.037401352,
0.011899867,
0.026188372,
-0.042153873,
0.0010365199,
0.007920869,
0.001974029,
0.01032807,
-0.03455479,
-0.0037129072,
-0.00798275,
-0.0064171413,
0.016943233,
-0.035866685,
-0.0123268515,
-0.04059445,
0.11425853,
-0.021770012,
-0.0054270327,
0.015643716,
-0.020136334,
-0.026163619,
-0.015408565,
-0.03299537,
-0.012908541,
0.03655976,
-0.0061912728,
0.019121472,
-0.0756443,
0.0050371774,
-0.02636164,
-0.004610193,
0.01349023,
0.011540953,
0.029208204,
0.05143614,
0.006064415,
-0.028143836,
0.014901134,
-0.008910977,
-0.016906105,
0.022141304,
-0.013341713,
-0.0005952254,
-0.009517419,
0.0018193246,
0.021163572,
0.008292159,
0.046015296,
0.021955658,
-0.049109384,
0.028069578,
-0.01654719,
0.00930702,
-0.051287625,
-0.0027537395,
-0.021906152,
-0.0061201085,
-0.02388637,
-0.027178481,
-0.030792376,
-0.025544802,
-0.02530965,
0.033589434,
-0.027525019,
-0.017549675,
-0.010544657,
0.0037593185,
0.022277443,
0.037351847,
0.0023809017,
0.031980507,
0.0019956876,
0.028317105,
-0.004604005,
-0.019517515,
0.03995088,
0.0062500606,
0.029109193,
-0.0009204916,
0.019319493,
0.020680893,
-0.034752812,
0.03381221,
-0.009665935,
-0.0033416164,
-0.003428251,
0.030445838,
-0.012500121,
-0.023502702,
0.0059344633,
0.025421038,
0.014529844,
0.03792116,
0.04012415,
-0.040074646,
0.02789631,
0.011813233,
0.009084246,
0.043713294,
-0.010018662,
-0.017760072,
-0.02415865,
0.013514983,
0.03319339,
-0.005789041,
0.0081127025,
-0.032203283,
0.040643957,
-0.027500266,
-0.025173511,
0.010018662,
-0.02530965,
7.019715e-05,
0.013514983,
-0.0054208445,
0.03438152,
0.024468059,
-0.060347117,
-0.016683329,
0.00693076,
0.04638659,
0.0041677384,
0.021596743,
-0.0048422497,
0.015037274,
-0.019109096,
0.061535247,
-0.018118987,
-0.014034789,
0.015408565,
-0.0033075814,
0.026906202,
-0.007512449,
0.013576864,
0.034431025,
0.018750181,
-0.0149135105,
0.039183546,
0.026856696,
0.03054485,
-0.016312039,
-0.028911171,
0.011695658,
0.013948155,
0.031064657,
0.008094138,
-0.014492715,
-0.019170977,
0.0037995416,
-0.012797154,
0.006992642,
-0.025421038,
-0.003536544,
-0.011602835,
-0.03173298,
0.04311923,
0.009319397,
-0.025544802,
-0.0008764008,
-0.007939433,
-0.017586803,
0.012531062,
0.030025043,
-0.042203378,
-0.020817032,
-0.008422111,
-0.007821858,
0.048564825,
0.008162208,
-0.040544946,
-0.0091894455,
-0.045000434,
0.02990128,
-0.02215368,
-0.048168782,
-0.031584464,
0.024925984,
0.0141214235,
-0.009325585,
0.008242654,
4.425998e-05,
-0.023490326,
0.03658451,
-0.008570627,
0.0045235585,
-0.04368854,
-0.018601665,
-0.0027831334,
0.001021823,
-0.047203425,
-0.0012639355,
0.024616575,
-0.014925887,
-0.032599326,
-0.0010867988,
0.037723135,
-0.055198554,
0.010427081,
-0.010352823,
0.012135019,
0.017809577,
0.010773619,
0.032228034,
-0.004579252,
-0.005795229,
-0.042153873,
-0.041337032,
-0.024319543,
0.0024365953,
-0.0046504163,
0.00013991086,
0.010148613,
-0.013750133,
-0.051683668,
0.03027257,
0.0037840712,
0.063862,
-0.017017491,
-0.009703064,
-0.023119036,
-0.043713294,
-0.014257563,
0.0127228955,
-0.00046295312,
0.012698143,
0.03693105,
0.0035922376,
0.014096671,
-0.007413438,
0.04183209,
0.005671466,
0.027153729,
-0.021250205,
-0.0451242,
0.0011417189,
0.004681357,
0.013143691,
0.004678263,
0.036807287,
0.003186912,
0.0075310133,
-0.03502509,
0.0020838692,
0.017586803,
-0.011225356,
-0.014109047,
0.019455634,
-0.003295205,
-0.016200652,
-0.021869024,
-0.016052136,
-0.015953125,
0.0069802655,
0.0138367675,
-0.0011393984,
-0.012432051,
-0.0008578363,
-0.0039604343,
0.005321834,
-0.0130446805,
0.013552112,
0.032772593,
-0.030866636,
0.0074010617,
-0.004712298,
0.0059746867,
0.0072896746,
-0.005925181,
-0.03576767,
0.0034344392,
0.01532193,
0.029703258,
0.0064233295,
0.009034741,
-0.0314607,
0.033341907,
0.038416214,
-0.012821906,
0.04002514,
-0.015631339,
-0.024331918,
0.0084344875,
-0.008514934,
0.0015377623,
-0.03037158,
-0.009795886,
0.036435995,
-0.009220386,
0.015841737,
0.0022942673,
0.033317152,
0.0018812063,
0.005504385,
0.044455875,
0.0069369483,
-0.015161037,
-0.03000029,
-0.015581834,
0.022995273,
0.026906202,
0.0031714416,
-0.03574292,
0.011169663,
0.00036935692,
0.03393597,
-0.026039856,
-0.021151194,
0.02184427,
-0.032772593,
0.03108941,
0.0036077083,
0.003499415,
0.00533421,
-0.033886466,
-0.0037129072,
-0.03618847,
-0.031237926,
0.01790859,
-0.012159771,
-0.039183546,
-0.029133946,
0.004050163,
0.016893728,
-0.005368245,
0.010117672,
-0.009505043,
-0.021683378,
-0.08782263,
-0.023391316,
0.00798275,
-0.01196175,
0.014925887,
0.03319339,
0.008768649,
0.040965743,
-0.021794764,
0.027822051,
0.05133713,
-0.042747937,
-0.03257457,
-0.0053775273,
0.02238883,
-0.024171026,
0.038911268,
-0.013193197,
-0.012896164,
-0.014566973,
0.0051764115,
0.035049845,
0.076188855,
0.02052,
-0.066881835,
-0.0018889415,
-0.0006025739,
-0.011027334,
0.0010504433,
-0.026584415,
-0.01759918,
-0.019529892,
0.041337032,
-0.013255078,
0.015433318,
-0.02745076,
0.014901134,
-0.0032766405,
0.04604005,
-0.005953028,
0.030297322,
-0.03173298,
-0.018972956,
-0.011404813,
0.048812352,
0.020755151,
0.004684451,
-0.003926399,
0.017574428,
-0.03626273,
0.021559615,
0.024109144,
0.022574475,
-0.01518579,
-0.015161037,
0.016732834,
0.027153729,
-0.00456997,
0.035272617,
0.034133993,
-0.014839252,
0.017376406,
-0.01060035,
0.020606635,
-0.0065347166,
0.017797202,
-0.019170977,
0.030520096,
-0.0071164053,
-0.0154952,
0.00018245458,
-0.02707947,
0.024319543,
0.004467865,
-0.02201754,
-0.0024721774,
0.0068069967,
0.051584657,
0.027401255,
0.0237131,
0.04703016,
0.037450857,
-0.004526653,
0.037351847,
0.0013289114,
0.0045173704,
-0.03163397,
-0.034728058,
-0.035619155,
0.017883835,
0.04457964,
-0.015383812,
-0.009610241,
0.014591726,
-0.0024443306,
-0.011986502,
0.002357696,
-0.016831845,
0.0287379,
0.012772401,
0.047178674,
0.01919573,
-0.026213124,
0.0018007599,
-0.029331967,
-0.0038181061,
0.016052136,
0.03591619,
0.014604102,
-0.022772497,
-0.019554645,
0.029307215,
0.007147346,
0.00135057,
-0.03366369,
0.011479071,
0.0013095733,
0.036807287,
-0.006206743,
-0.0019848582,
-0.01960415,
0.027178481,
0.02898543,
-0.011936997,
-0.043886565,
0.00506193,
-0.012821906,
0.009424596,
-0.012834283,
0.021584367,
-0.0077723525,
0.022116551,
0.03829245,
-0.05123812,
0.009610241,
0.0025541708,
0.0127600245,
0.0053094574,
-0.019542268,
0.017821955,
0.0083787935,
-0.020532377,
0.012747648,
-0.009814451,
0.007233981,
-0.011813233,
-0.032153778,
0.017487792,
-0.0076052714,
-0.018341761,
0.004016128,
0.037079565,
-0.026782436,
0.030767623,
-0.0072463574,
-0.020074451,
-0.003743848,
-0.0025510767,
-0.0060303803,
0.017364029,
-0.039158795,
-0.0067079854,
-0.021274958,
0.013774886,
0.023527455,
0.01627491,
-0.029851774,
0.01654719,
0.0007742958,
0.011782292,
-0.04002514,
0.0074629434,
-0.0024551598,
0.034505285,
0.018193245,
0.023700723,
0.03646075,
-0.00394187,
0.030940894,
-0.0019647467,
0.051931195,
0.01586649,
-0.021633873,
0.0019678408,
0.009591677,
0.011355308,
0.024963113,
-0.038044922,
-0.012667201,
0.01773532,
-0.008781025,
0.021411099,
-0.024826972,
0.009808263,
0.0072216047,
-0.025569554,
0.021213077,
-0.012407298,
0.015111532,
-0.014665984,
0.03767363,
-0.031188421,
0.005331116,
-0.0105879735,
0.0045235585,
-0.031980507,
0.012630072,
-0.00436576,
-0.01019193,
-0.010408516,
0.008354041,
-0.0049072257,
0.031262677,
-0.006206743,
-0.0019477293,
0.013873897,
-0.006547093,
0.015532329,
0.000527929,
-0.008576816,
-0.017821955,
0.043267746,
-0.031262677,
-0.0023344904,
-0.021213077,
0.0009057947,
0.010389952,
0.0029703258,
0.011324367,
8.890672e-05,
-0.029109193,
0.0051825996,
0.027178481,
-0.01759918,
0.02626263,
-0.01131199,
-0.0019121472,
-0.01896058,
0.040520195,
0.013428348,
-0.0040718215,
0.023812111,
-0.01199269,
-0.028935924,
-0.0068998192,
-0.018849192,
0.0074010617,
0.024641328,
-0.021386346,
0.0180076,
-0.01012386,
-0.00366959,
0.019257613,
-0.027574524,
0.0044152653,
-0.009121375,
-0.009467914,
0.011157286,
0.02725274,
0.023836864,
0.03366369,
0.023750229,
0.022463089,
-0.017364029,
-0.00686269,
-0.0022880791,
0.00023166994,
-0.025012618,
-0.014071918,
-0.009703064,
0.01100877,
0.008304535,
0.03858948,
0.0074938843,
-0.031163668,
-0.013787262,
0.016101642,
-0.007005018,
0.026683426,
-0.0024072016,
-0.021856647,
-0.035049845,
0.012110266,
-0.026683426,
-0.012883788,
-0.0230324,
-0.025148759,
0.01660907,
0.0072896746,
-0.005442503,
1.4648579e-05,
0.018675923,
-5.967604e-06,
-0.027426008,
-0.03183199,
0.018985333,
0.005980875,
0.0025588118,
0.023490326,
-0.037252836,
0.0006895952,
0.0036108023,
0.0019291647,
-0.034802318,
-0.004328631,
0.013750133,
0.03794591,
0.0035891435,
0.004356478,
-0.020445742,
-0.0012855941,
-0.0020529283,
0.004771086,
-0.023638843,
0.023106659,
0.0084159225,
-0.018019976,
-0.010241436,
-0.009121375,
-0.0105879735,
-0.04247566,
-0.029109193,
-0.018626418,
0.032129023,
0.030718118,
0.0151981665,
0.01777245,
-0.034431025,
-0.004251279,
0.053762898,
0.026881449,
-0.0029950785,
0.014591726,
0.011825609,
-0.012413486,
0.008836719,
-0.019084344,
-0.026757684,
-0.05306982,
-0.0051114354,
0.007964186,
-0.0043874187,
-0.019864053,
-0.008335477,
0.005748818,
0.011670905,
0.014975392,
-0.00477418,
0.014938263,
0.0062129316,
0.04725293,
0.011714222,
-0.02863889,
0.020321978,
0.02330468,
-0.00082689535,
-0.040099397,
0.0239235,
-0.025693318,
-0.00066909683,
0.0024164838,
0.02151011,
0.018886322,
-0.0123825455,
-0.01678234,
0.032327045,
0.0011943185,
0.012407298,
0.0043131607,
0.0003534997,
-0.008849096,
0.0041522677,
-0.0055229496,
0.027326997,
-0.037327092,
0.017302148,
-0.018911075,
0.016262533,
0.051733173,
0.019393751,
-0.015643716,
0.046015296,
-0.00927608,
0.022141304,
0.0088119665,
0.02571807,
-0.03722808,
0.026411146,
-0.01719076,
0.0044833357,
-0.007308239,
0.006048945,
-0.008762461,
-0.009734005,
-0.018898698,
-0.023935875,
0.016287286,
-0.022141304,
0.012982799,
-0.01660907,
-0.009424596,
0.042525165,
-0.008533498,
0.019554645,
0.034505285,
-0.018539783,
-0.008156019,
-0.0063862004,
0.020123957,
-0.030198311,
0.008496369,
0.01919573,
-0.0314607,
0.0054796324,
0.014938263,
-0.021361593,
-0.012920917,
0.0065037757,
-0.008960483,
0.034950834,
0.01773532,
0.016559565,
-0.015606587,
-0.031856745,
0.0087562725,
0.014319445,
0.004802027,
-0.0028326388,
-0.045445982,
0.026831942,
-0.023997758,
0.010662232,
0.017586803,
0.023255175,
0.017017491,
0.0019090531,
0.017141255,
-0.03792116,
0.022710616,
0.021794764,
-0.026609167,
-0.030495344,
0.005550796,
-0.010798371,
0.005609584,
0.0039325873,
6.5265944e-05,
-0.014183305,
0.014740242,
0.0048670024,
0.016262533,
0.010557033,
-0.04294596,
0.024678456,
-0.0043905126,
-0.004802027,
-0.07534726,
0.0159655,
0.0011958656,
0.038416214,
0.01896058,
-0.020445742,
0.054109436,
-0.011219168,
-0.003499415,
0.015643716,
-0.01681947,
0.023131412,
-0.014294692,
-0.035990447,
-0.00070622587,
0.0033106755,
0.02082941,
0.004288408,
0.021522485,
-0.03985187,
-0.012277346,
0.022166057,
-0.010699361,
0.005442503,
0.0223517,
0.0033663693,
-0.020062076,
0.003774789,
0.05326784,
-0.010903571,
0.014356574,
-0.028242847,
0.0051454706,
0.014703113,
0.02092842,
-0.0040285042,
0.008626321,
0.010136236,
0.05207971,
0.015816985,
-0.003815012,
0.015903618,
-0.036064707,
0.023440821,
0.007233981,
-0.036733028,
-0.0151981665,
-0.008929541,
0.023948252,
-0.0145174675,
-0.0023468668,
0.017722944,
-0.010420892,
-0.007970374,
0.008583004,
-0.0004180888,
-0.017859083,
-0.007512449,
0.007691906,
-0.0046658865,
-0.00013207895,
-0.040544946,
-0.044629145,
0.012896164,
0.022005163,
-0.002801698,
0.014170929,
0.02789631,
-0.0021395627,
-0.016497685,
0.030718118,
0.04712917,
-0.045396477,
0.011163474,
-0.0016862787,
-0.014034789,
-0.026460651,
0.00547035,
0.010451834,
0.03037158,
0.018576913,
-0.023168541,
-0.0017976658,
-0.018911075,
0.0049969545,
-0.040049892,
-0.02320567,
-0.008979048,
-0.026287382,
0.0006609748,
-0.061832283,
-0.022227937,
-0.01956702,
0.0050340835,
-0.004016128,
-0.017339276,
0.029109193,
-0.028787406,
-0.00025081463,
0.04294596,
-0.013638746,
-0.021089314,
-0.006410953,
-0.032624077,
0.03655976,
-0.005959216,
0.010495151,
-0.0047834623,
0.030569602,
-0.039703354,
-0.009065682,
-0.022772497,
-0.0014843893,
0.013539735,
0.028663643,
-0.026906202,
0.030074548,
-0.016386297,
-0.027797299,
0.0016445084,
0.015297177,
-0.018725429,
0.010253812,
0.016114017,
-0.027326997,
-0.021807142,
-0.017623933,
0.0028481092,
-0.009498854,
-0.0019554645,
0.0011231544,
0.035396382,
0.015532329,
-0.0032487938,
-0.018329386,
0.01196175,
0.022401206,
0.06302041,
0.0004919602,
0.010427081,
-0.01066842,
0.021547237,
-0.004495712,
-0.010031038,
0.0040377867,
0.047797494,
-0.0022246502,
-0.014703113,
-0.031881496,
0.009560736,
-0.0013567582,
0.026237877,
-0.0034406274,
-0.0314607,
-0.04574302,
0.016163522,
0.04514895,
-0.014591726,
0.021794764,
-0.022463089,
0.04641134,
-0.0152352955,
-0.040619206,
0.03264883,
0.022376454,
-0.03794591,
0.014084294,
-0.018391266,
-0.032104272,
0.015074403,
0.01386152,
-0.0071287816,
-0.009399843,
-0.03373795,
0.026336888,
-0.012258782,
-0.005052648,
0.008242654,
0.0059468397,
-0.0076857177,
-0.00630266,
0.021373969,
-0.0001493865,
-0.017351653,
-0.015309554,
-0.016472932,
-0.037624124,
-0.009102811,
-0.012958046,
0.03591619,
-0.006435706,
0.02853988,
-0.03190625,
0.01318082,
-0.023589337,
0.031064657,
0.023564585,
-0.03175773,
-0.014963016,
0.008787214,
-0.017450664,
0.027178481,
-0.011342932,
0.031015152,
-0.054356962,
-0.013824391,
-0.00927608,
0.003289017,
0.0065965983,
0.012896164,
-0.015099156,
0.040718216,
-0.008125079,
0.01532193,
-0.052921303,
0.0037995416,
-0.0013575316,
0.027871557,
0.024307165,
-0.0173269,
0.02061901,
-0.018576913,
0.0013722286,
0.0364855,
-0.0027475513,
-0.0042203376,
-0.0052723284,
0.026708178,
0.035074595,
-0.0026500875,
-0.004436924,
0.008471617,
0.04514895,
-0.053564873,
-0.020024946,
0.02106456,
-0.0038738,
0.009628806,
0.018762557,
0.0013258173,
-0.0058137937,
-0.008162208,
0.0038057298,
-0.042723186,
0.0021612213,
0.012388733,
0.044827167,
-0.0134035945,
-0.0161759,
0.013601617,
0.040792473,
0.003326146,
0.02096555,
-0.029604247,
-0.023799734,
-0.0083973585,
0.046163812,
-0.019826924,
-0.019703161,
-0.009498854,
-0.02521064,
-0.0021302805,
0.013552112,
-0.023997758,
-0.029232956,
0.028564632,
0.021274958,
-0.010303318,
0.0040006577,
-0.029975537,
-0.05891146,
-0.02972801,
-0.0013304584,
-0.030223064,
0.0037314717,
0.0016816376,
-0.03846572,
0.0036169905,
0.013230326,
0.009251327,
0.0034901327,
-0.017302148,
0.0038521413
]
},
{
"object": "embedding",
"index": 2,
"embedding": [
0.0073202015,
-0.023429625,
0.028185267,
-0.057266884,
-0.008801671,
-0.019284,
0.031098407,
0.017565994,
0.017765183,
1.2607371e-05,
-5.276373e-05,
-0.028533848,
-0.03067513,
-0.034185838,
-0.029529793,
0.0055492856,
-0.006591916,
0.004830337,
-0.033015605,
0.02773709,
-0.0014666858,
-0.014827143,
-0.0040989392,
0.03821942,
0.01434162,
-0.00487391,
0.0010255129,
0.032592326,
0.025745198,
-0.03291601,
-0.02057873,
-0.04028601,
-0.002259552,
-0.026790941,
-0.011272862,
0.05437864,
-0.008067161,
0.015810639,
-0.044244893,
0.009243622,
0.00926852,
0.00500774,
-0.03436013,
0.0071583604,
0.0069155986,
0.04207871,
-0.013806298,
-0.00062363327,
-0.024736803,
0.018325403,
-0.063342154,
0.007768377,
-0.009349441,
0.013507515,
-0.018350301,
0.012760555,
-0.019022565,
0.010681518,
-0.013482616,
-0.045614317,
0.04499185,
-0.014565707,
-0.01525042,
-0.033239692,
-0.017852329,
0.024139237,
-0.014627954,
0.06772432,
0.023952497,
0.0137440525,
0.038518205,
0.010762439,
-0.04578861,
0.0141050825,
-0.0034484623,
0.013731603,
-0.00038378927,
-0.0064051766,
0.0147897955,
-0.05437864,
-0.030027766,
0.008702076,
-0.0367504,
-0.0054528033,
-0.030973915,
0.0060970555,
-0.053681478,
-0.021574676,
-0.019358696,
-0.024935992,
-0.049224623,
-0.08948573,
-0.035679758,
-0.017516198,
-0.009685573,
0.002125722,
-0.008036038,
-0.0569681,
-0.031496786,
0.0036196406,
-0.006146853,
0.031671077,
-0.022471027,
0.018051518,
-0.004151849,
-0.022856956,
0.021338139,
-0.016445555,
-0.04792989,
-0.040111717,
-0.06468668,
0.008633605,
-0.0016137435,
0.013843646,
0.08097039,
0.03179557,
0.011272862,
-0.013495065,
-0.012113191,
-0.046585366,
-0.024201483,
-0.024811499,
0.078380935,
-0.0011787952,
-0.018449895,
-0.05288472,
-0.023678612,
-0.06413891,
-0.047158033,
0.0021132724,
0.013258529,
-0.0127045335,
0.03291601,
0.041281953,
-0.03358827,
-0.034185838,
-0.07185749,
0.034111142,
-0.017304558,
0.021387937,
-0.008347271,
-0.04581351,
0.0018938532,
-0.035231583,
0.0007286744,
-0.008683402,
-0.03331439,
0.039987225,
0.02738851,
0.0008800115,
-0.053034116,
-0.003747246,
-0.055274993,
0.016955977,
-0.057665262,
-0.023678612,
-0.025035588,
0.003379991,
0.039065976,
-0.0021910807,
-0.01652025,
-0.011011425,
0.01947074,
0.009119129,
0.0016759901,
0.015374913,
0.04247709,
0.0023233548,
-0.03533118,
-0.080621816,
0.021101601,
-0.029704083,
-0.06045391,
0.01185798,
-0.024811499,
-0.005253614,
-0.0029209224,
-0.043672223,
0.01010885,
0.012972194,
0.03747246,
0.028259963,
-0.017702937,
0.008073386,
-0.035405874,
0.049224623,
0.006691511,
0.019620132,
0.015374913,
0.032243744,
0.022657767,
0.027986078,
0.06339195,
-0.022533273,
0.014715099,
-0.025794996,
0.025272125,
-0.03358827,
0.048427865,
-0.011472051,
0.013370573,
0.034609117,
-0.023579016,
0.0009943896,
0.021325689,
-0.00039098653,
-0.008421967,
-0.036700603,
-0.020777918,
0.02903182,
0.052038167,
0.0042296574,
-0.013270978,
-0.006100168,
-0.0368002,
0.041854624,
-0.02738851,
-0.011721037,
0.02644236,
-0.034086246,
-0.0028508948,
0.028733036,
0.06448749,
0.012872599,
-0.019719727,
-0.010009255,
-0.0052193785,
0.007855522,
0.030426145,
-0.03946435,
0.02591949,
-0.018449895,
0.0037534707,
-0.049523406,
0.0014153323,
-0.0088950405,
-0.013034441,
0.017092919,
-0.029280806,
0.0027232892,
-0.025160082,
-0.007513166,
0.026168477,
0.010955404,
0.014715099,
0.008577583,
0.00920005,
-0.035679758,
0.016607396,
0.012088292,
-0.01037651,
0.03341398,
0.0050388635,
-0.0116774645,
-0.030251853,
0.03194496,
-0.03398665,
0.048029486,
0.03734797,
0.005919653,
2.349445e-06,
0.026143577,
-0.021898359,
0.01487694,
-0.0034795858,
-0.03142209,
0.013445268,
-0.0014192228,
0.02298145,
-0.07444695,
-0.0085340105,
-0.043124452,
0.039763138,
0.0095797535,
-0.049622998,
0.033239692,
-0.02701503,
-0.02187346,
-0.0064425245,
0.018250708,
-0.02552111,
-0.050021376,
0.009249846,
0.03933986,
-0.006025472,
3.6229474e-05,
0.026840739,
-0.026367664,
-0.01927155,
-0.02920611,
0.0034515746,
-0.0532831,
0.044618372,
0.015175724,
-0.012250134,
0.016893731,
0.016433105,
0.0034235637,
0.015225521,
-0.030027766,
0.030251853,
-0.026940335,
0.034061346,
0.07195708,
-0.028334659,
0.04299996,
-0.018225808,
0.019769523,
0.029903272,
-0.0021288341,
-0.01766559,
-0.0014534584,
-0.036601007,
0.025247226,
-0.06045391,
0.0011289979,
0.049324214,
-0.005278513,
-0.0028026537,
-0.03341398,
-0.004892584,
-0.0015048118,
0.009299644,
-0.018761128,
0.0032835088,
0.00076018675,
-0.012075843,
-0.010837135,
-0.021661822,
0.01599738,
-0.019234203,
0.008851469,
0.040659487,
-0.01856194,
-0.03271682,
-0.00086834026,
-0.018412547,
-0.011353782,
-0.014827143,
0.01203227,
-0.06787371,
-0.010525902,
0.056320734,
-0.022271838,
-0.021562226,
0.043448135,
-0.027264016,
0.026915435,
0.064636886,
0.016632294,
0.012741881,
-0.003821942,
-0.0071023386,
-0.033239692,
0.061151072,
-0.073351406,
-0.009585978,
0.01782743,
-0.004883247,
-0.023193087,
0.03139719,
0.0056426553,
-0.023641264,
0.024749253,
0.0062371106,
-0.029654287,
-0.013706704,
0.041555837,
0.0035511693,
-0.031023711,
-0.03251763,
0.019010115,
0.024226382,
0.0078243995,
-0.029131414,
0.02517253,
-0.022159794,
0.049000535,
0.03732307,
0.034185838,
0.022969,
-0.04979729,
-0.041032966,
-0.014055285,
-0.013868545,
0.013320775,
-0.019047463,
0.003361317,
0.0030843196,
0.038119826,
0.009349441,
0.0012387076,
0.008527786,
-0.011777059,
0.038742293,
0.017889677,
0.03562996,
-0.008384619,
0.011372456,
0.009585978,
-0.0075754127,
-0.038319014,
-0.015760843,
-0.018238258,
0.013582211,
0.027338712,
0.023653712,
0.004624923,
0.04058479,
0.011210615,
0.0127107585,
0.0008387731,
0.036127932,
-0.026741145,
0.0077995006,
0.058910195,
0.028384455,
-0.06299357,
0.025770098,
0.0533329,
-0.025234777,
-0.022620419,
-0.061649047,
-0.0067537576,
0.0069342726,
-0.0032523854,
0.061101276,
-0.00044272904,
-0.018810926,
-0.035530366,
-0.037771244,
0.0165327,
0.03104861,
0.017105369,
-0.04302486,
-0.043448135,
0.022807159,
0.042402394,
-0.027039928,
-0.01487694,
0.0099221105,
0.030949015,
-0.041456245,
-0.037746347,
-0.016034728,
-0.016607396,
-0.025160082,
0.027861584,
-0.034434825,
-0.018499693,
-0.040186413,
-0.07668783,
-0.012225235,
-0.019321349,
0.0368002,
-0.037596952,
-0.011061223,
2.1300013e-05,
0.03879209,
-0.008004914,
-0.0011507842,
-0.054478236,
-0.046535566,
0.025944388,
0.04576371,
-0.008951063,
-0.044369385,
0.029131414,
0.042178303,
-0.038169622,
0.0066043655,
0.017877227,
-0.04205381,
0.005564847,
0.014889389,
0.000404603,
-0.006081494,
-0.040759083,
-0.0032088128,
-0.019184407,
-0.00036103034,
0.030924117,
-0.045713913,
-0.009673123,
-0.045091446,
0.13116606,
-0.029455097,
-0.024836399,
0.009691797,
-0.0072828536,
-0.0137814,
-0.0123684015,
-0.047456816,
-0.013196282,
0.044742864,
-0.0011212172,
-0.0032679471,
-0.08022343,
0.003812605,
-0.026243173,
0.010301814,
0.014254474,
0.008795447,
0.02278226,
0.040086817,
0.004413285,
-0.036451615,
0.020167902,
-0.0074695935,
-0.016072076,
0.02885753,
-0.026417462,
0.0072828536,
-0.010289365,
0.0020634753,
0.01765314,
-0.005592858,
0.05771506,
0.0035636185,
-0.04633638,
0.024911094,
-0.017864779,
0.023230435,
-0.05218756,
-0.01048233,
-0.027413407,
-0.00019957821,
-0.037148777,
-0.021587126,
-0.036874894,
-0.034634016,
-0.036625907,
0.039763138,
-0.028832631,
-0.020317294,
-0.007867971,
0.0056053074,
0.016395757,
0.05036996,
-0.0067039602,
0.02828486,
0.0183752,
0.031496786,
0.0045346655,
-0.026691347,
0.030226955,
0.009312093,
0.026716245,
-0.0034858102,
0.022856956,
0.023242885,
-0.039290063,
0.019557886,
-0.020777918,
-0.0017102257,
-0.011254188,
0.030202057,
-0.0017397929,
-0.018499693,
0.018786028,
0.024313526,
0.007145911,
0.026616652,
0.0495732,
-0.03582915,
0.0312727,
0.006100168,
0.016470453,
0.0440706,
-0.018910522,
-0.0048241126,
-0.010911832,
0.0174664,
0.032044556,
-0.009866088,
0.012424424,
-0.014976535,
0.04501675,
-0.034808304,
-0.026517058,
0.015872886,
-0.027089726,
0.016744338,
0.015337565,
0.001167902,
0.03585405,
0.031098407,
-0.056868505,
-0.012430648,
0.0067724315,
0.04339834,
-0.0019140834,
0.022720013,
-0.021437733,
0.0057764854,
-0.023566568,
0.040111717,
-0.011777059,
0.008229002,
0.016022278,
-0.009112904,
0.022931652,
-0.0014915845,
0.01691863,
0.03697449,
0.032990705,
-0.019632582,
0.017914575,
0.016582498,
0.02848405,
-0.015474508,
-0.027139522,
-0.0037441337,
0.0071583604,
0.03341398,
-0.0020588066,
-0.012293706,
-0.009175151,
0.010532127,
0.0011803514,
0.0033519801,
-0.013656907,
-0.0028944674,
-0.002061919,
-0.028334659,
0.052436545,
0.0031310045,
-0.024848849,
0.0059165405,
-0.0012822802,
-0.029479995,
0.015935132,
0.007369999,
-0.053133707,
-0.011179492,
-0.007867971,
-0.008863918,
0.043473035,
0.011727261,
-0.030749826,
-0.012306156,
-0.027811786,
0.023989845,
-0.0036507638,
-0.033936854,
-0.026193375,
0.0051540197,
0.020491585,
-0.003076539,
-0.000659036,
0.021201197,
-0.029828576,
0.029529793,
0.0016152996,
0.0056239814,
-0.04280077,
-0.02169917,
0.012175437,
0.008969737,
-0.058760803,
-0.0014627954,
0.026218273,
0.001261272,
-0.036725502,
-0.003868627,
0.04392121,
-0.06100168,
0.01598493,
-0.007351325,
0.013134035,
0.021350589,
0.008814121,
0.03154658,
-0.0005909538,
0.0130593395,
-0.03789574,
-0.027064826,
-0.016619846,
-0.008540235,
-0.006473648,
-0.004453745,
0.023280233,
-0.010370285,
-0.04150604,
0.026790941,
0.0020307957,
0.05071854,
-0.022259388,
-0.012380851,
-0.017565994,
-0.039837833,
-0.0053998935,
0.00872075,
0.005393669,
0.0047867643,
0.03640182,
-0.003793931,
0.006118842,
-0.001232483,
0.039962325,
0.013283427,
0.032243744,
-0.028733036,
-0.059457965,
0.004830337,
-0.0022081987,
0.012847701,
0.009324542,
0.0440955,
0.0072330562,
-0.0052287155,
-0.023728408,
0.0015087023,
0.019732175,
0.0013904338,
-0.01765314,
0.015474508,
-0.0042825667,
-0.011882878,
-0.023753308,
-0.010189771,
-0.020665875,
0.0099221105,
0.013644458,
-0.009063107,
-0.01543716,
-0.011801958,
-0.013333225,
-0.0068844752,
-0.022695115,
0.013818748,
0.020541383,
-0.022670217,
-0.0023700397,
-0.015412262,
0.0013017323,
-0.0029785004,
-0.012654737,
-0.030475942,
0.005592858,
0.023628814,
0.020628527,
-0.00463426,
0.013644458,
-0.035032395,
0.029579591,
0.044369385,
-0.013569761,
0.04148114,
-0.018487245,
-0.030002868,
0.008646054,
-0.012206561,
-0.009691797,
-0.035206683,
-0.014615505,
0.04028601,
-0.012405749,
0.026193375,
-0.013856096,
0.03729817,
-0.0018876286,
0.009803842,
0.051341005,
-0.0040584793,
-0.013955691,
-0.034783408,
-0.014889389,
0.03087432,
0.022844506,
0.014316721,
-0.033214793,
0.01212564,
0.0063865026,
0.03876719,
-0.027811786,
-0.02351677,
0.018437447,
-0.039016176,
0.026043983,
0.0018098203,
0.0032617224,
0.005546173,
-0.05751587,
-5.8988393e-05,
-0.01577329,
-0.03562996,
0.0046747206,
-0.007818175,
-0.047506616,
-0.024039641,
0.017491298,
0.020354642,
0.005337647,
0.00528785,
-0.01579819,
-0.020479135,
-0.07828134,
-0.018275606,
0.018611737,
-0.015574102,
0.005054425,
0.035530366,
0.014192227,
0.051390804,
-0.032318443,
0.037173677,
0.06573242,
-0.029529793,
-0.013644458,
0.0034360131,
0.03640182,
-0.028782833,
0.028309759,
-0.02147508,
-0.025595807,
-0.0064425245,
0.009492609,
0.03709898,
0.07828134,
0.013432819,
-0.06886965,
-0.0015149269,
-0.008229002,
-0.0036725502,
0.003107662,
-0.018288055,
-0.025770098,
-0.018972768,
0.03328949,
-0.0005602195,
0.018898072,
-0.037173677,
0.015872886,
0.004743192,
0.0440457,
-0.02074057,
0.026766043,
-0.035804253,
0.00069288263,
-0.019831771,
0.034036446,
0.019844221,
0.005346984,
0.007500717,
0.016893731,
-0.03931496,
0.03254253,
0.025570909,
0.010731316,
-0.014640403,
-0.012380851,
0.016308613,
0.021898359,
0.0073824483,
0.033662967,
0.032691922,
-0.023031246,
0.010793563,
-0.015325116,
0.010183546,
-0.0044008354,
0.012287482,
-0.015872886,
0.03142209,
0.00021066588,
-0.026392564,
-0.00532831,
-0.023043696,
0.028957125,
0.00799869,
-0.015847988,
-0.0036756624,
0.012206561,
0.057217088,
0.032741718,
0.013295877,
0.054677423,
0.03182047,
0.012611164,
0.03236824,
0.0010978746,
0.0072455057,
-0.019632582,
-0.04797969,
-0.038094927,
0.012119415,
0.04135665,
-0.022844506,
-0.0014262255,
0.008851469,
-0.0013865433,
-0.005695565,
0.015673697,
-0.019520538,
0.0220353,
0.014192227,
0.040360704,
0.028932225,
-0.041032966,
0.0035418323,
-0.030550638,
0.006296245,
0.0015997379,
0.025284573,
0.012038494,
-0.017192515,
-0.024052091,
0.015847988,
0.00900086,
-0.007519391,
-0.032169048,
0.013843646,
0.012299931,
0.047904994,
-0.004422622,
-0.011353782,
-0.025321921,
0.020665875,
0.013905893,
-0.0035324953,
-0.045166142,
0.010830911,
-0.024935992,
0.0057266885,
-0.0070463168,
0.016756788,
-0.004951718,
0.0081978785,
0.026417462,
-0.059258774,
-0.0069902944,
-0.0042203204,
0.009953233,
0.010507228,
-0.010681518,
0.024139237,
0.0054808143,
-0.011515623,
0.015947582,
-0.008614931,
0.00097104715,
-0.008110734,
-0.03234334,
0.00762521,
-0.009592203,
-0.01948319,
0.010681518,
0.046610262,
-0.026218273,
0.025446415,
-0.006635489,
-0.019869119,
-0.010830911,
-0.013183832,
-0.00679733,
0.023217987,
-0.030998813,
-0.011409804,
-0.023292683,
0.014578157,
0.029828576,
0.008116959,
-0.031297598,
0.012573816,
-0.0044661947,
0.020317294,
-0.027911382,
-0.016022278,
-0.0044599697,
0.019943815,
0.023292683,
0.021636922,
0.028010976,
0.0053812196,
0.028085671,
0.003482698,
0.05273533,
0.01765314,
-0.029355502,
0.0013204062,
0.0029395963,
0.018238258,
0.006853352,
-0.023877801,
-0.010830911,
0.02222204,
-0.009336992,
0.018624187,
-0.0062184366,
0.015387363,
0.011988698,
-0.03936476,
0.030550638,
-0.018138662,
0.016682092,
-0.006205987,
0.037248373,
-0.019246653,
0.0024634097,
-0.006859577,
0.00091658137,
-0.03251763,
0.01451591,
0.0038188298,
-0.014179778,
0.01203227,
0.008764323,
-0.011347557,
0.045489825,
0.0024805276,
-0.005919653,
0.020827716,
-0.016308613,
-0.0065358942,
0.004901921,
0.0061810887,
-0.022197142,
0.043074656,
-0.022060199,
-0.009878538,
-0.014939187,
-0.009318318,
-3.4940775e-05,
-0.004285679,
0.017341906,
-0.0067350836,
-0.041207258,
0.0014340064,
0.024139237,
-0.02295655,
0.037596952,
-0.013868545,
-0.014939187,
-0.013121586,
0.0495732,
0.017976822,
0.007662558,
0.024375774,
-0.009505058,
-0.027836686,
-0.009940784,
-0.01801417,
0.0032897335,
0.010494779,
-0.02318064,
0.0113164345,
-0.022010403,
-0.003688112,
0.025819896,
-0.021275893,
0.009175151,
-0.008036038,
-0.003295958,
0.01561145,
0.01673189,
0.02554601,
0.02666645,
0.03142209,
0.006965396,
-0.011341332,
-0.010227119,
0.005063762,
-4.043598e-05,
-0.008353495,
-0.012187887,
0.002071256,
0.0155118555,
0.014964086,
0.042352594,
0.011540522,
-0.041954216,
-0.006946722,
0.014939187,
-0.016209017,
0.03787084,
0.0073575494,
-0.027463205,
-0.03331439,
0.016582498,
-0.018449895,
-0.010413858,
-0.038468406,
-0.021997953,
0.017964372,
0.0202177,
-0.019346246,
-0.0006831566,
0.013246079,
-0.005346984,
-0.04631148,
-0.029529793,
0.020504035,
0.00634293,
-0.0038748516,
0.028434252,
-0.030251853,
-0.001873623,
0.012262583,
0.006215324,
-0.03560506,
0.008658504,
0.002015234,
0.042178303,
0.008415742,
0.009162702,
-0.010357836,
0.0046155863,
-0.000157659,
0.0042825667,
-0.007830624,
0.01450346,
0.0030267416,
-0.0075816372,
-0.01432917,
-0.022570621,
-0.0007391785,
-0.028957125,
-0.022670217,
-0.03689979,
0.028882429,
0.016682092,
0.01947074,
0.023404727,
-0.03012736,
-0.0063398173,
0.049672797,
0.010139973,
-0.01968238,
0.021114051,
0.0053034113,
-0.026043983,
0.006909374,
-0.0137440525,
-0.022060199,
-0.044568576,
-0.008135633,
0.01618412,
-0.004276342,
-0.02721422,
-0.0031387855,
0.013333225,
0.0062371106,
0.0078492975,
0.0055959704,
0.018462345,
0.011789508,
0.047481716,
0.018985217,
-0.0367504,
0.020889964,
0.024276178,
-0.005760924,
-0.035032395,
0.01654515,
-0.024487818,
-0.0071396865,
0.0018985217,
0.017715385,
0.029504895,
-0.024562513,
0.0005314305,
0.03508219,
-0.008807896,
0.0081978785,
0.004933044,
-0.0072143823,
-0.013980589,
0.0058885296,
0.007152136,
0.022010403,
-0.04187952,
0.0051166713,
-0.01673189,
0.020055858,
0.041779928,
0.026168477,
-0.019856669,
0.048004586,
-0.006492322,
0.017678037,
0.0011173267,
0.02240878,
-0.042925265,
0.025433965,
-0.003501372,
0.0044879806,
-0.017964372,
-0.001242598,
-0.0053625456,
0.0021039355,
-0.013308326,
-0.025844794,
0.021275893,
-0.021935707,
0.007681232,
-0.014615505,
-0.0045222165,
0.03697449,
-0.02920611,
0.023466973,
0.02479905,
-0.010332937,
-0.0070587657,
0.006090831,
0.021748966,
-0.030600434,
0.0016542037,
0.017503748,
-0.030550638,
0.012194111,
0.003295958,
-0.011745936,
-0.008415742,
0.014266924,
-0.0071023386,
0.04541513,
0.020491585,
0.023217987,
-0.009274745,
-0.017976822,
0.015399812,
0.0049174824,
-0.0026236947,
-0.0031278923,
-0.056519926,
0.03543077,
-0.0033333062,
0.008795447,
0.012679635,
0.02128834,
0.0074446946,
0.0045595644,
0.008054712,
-0.0312478,
0.034310333,
0.02900692,
-0.025160082,
-0.0151383765,
0.0038561777,
-0.0065358942,
0.0067662066,
0.0040709283,
-0.009193825,
-0.01765314,
0.014266924,
0.0041580736,
0.026840739,
0.0001181713,
-0.041854624,
0.021226095,
-0.0001826549,
-0.01304689,
-0.07384938,
0.013582211,
-0.0057640364,
0.029181212,
0.011721037,
-0.018487245,
0.031920064,
-0.0120073715,
-0.009791392,
0.012667186,
-0.011403579,
0.012604939,
-0.00826635,
-0.04541513,
0.005356321,
0.0029022484,
0.014578157,
0.00038378927,
0.019918917,
-0.036650807,
-0.008073386,
0.029828576,
-0.009075556,
-0.0032337115,
0.018424997,
-0.0130593395,
-0.014926738,
0.01175216,
0.057416275,
-0.018312953,
0.012947296,
-0.030749826,
0.0155118555,
0.02626807,
0.021786314,
0.008558909,
0.014204677,
-0.0054185675,
0.059109382,
0.02151243,
0.0020930422,
0.022894304,
-0.038468406,
0.021599574,
0.0020339082,
-0.047207832,
-0.022919202,
-0.013196282,
0.032094352,
-0.0047992137,
0.0029178099,
0.015088579,
-0.01432917,
-0.018661534,
0.008770548,
-0.011528073,
-0.027363611,
-0.013681806,
-0.0037161228,
-0.006215324,
-0.0062277736,
-0.029504895,
-0.016420657,
0.008926164,
0.027687293,
-0.008515337,
0.005947664,
0.026342766,
-0.0020603628,
-0.034285434,
0.03179557,
0.02738851,
-0.0404354,
0.0003981838,
-0.0072828536,
-0.028782833,
-0.01232483,
-0.005957001,
0.010513453,
0.026591754,
0.019147057,
-0.019234203,
0.0042701177,
-0.019645032,
0.0065358942,
-0.041954216,
-0.02699013,
-0.00717081,
-0.0127107585,
0.00045984684,
-0.065383844,
-0.028309759,
-0.01506368,
0.019557886,
-0.008646054,
-0.006162415,
0.026143577,
-0.02187346,
0.0039962325,
0.029778779,
-0.008154307,
-0.015648799,
-0.0061157295,
-0.039987225,
0.06030452,
-0.008764323,
0.017130267,
-0.003566731,
0.02242123,
-0.03565486,
-0.01543716,
-0.009754044,
-0.0137689505,
0.004581351,
0.024052091,
-0.013532413,
0.024002293,
-0.0013001761,
-0.027761988,
-0.0018051518,
0.019918917,
-0.020927312,
0.013843646,
0.0063180313,
-0.0247866,
-0.025471313,
-0.019433392,
0.0012005816,
0.0041954215,
0.0069965194,
-0.003840616,
0.041680332,
0.021188747,
-0.010874483,
-0.017329456,
0.014615505,
0.022570621,
0.04753151,
-0.0017942586,
0.012306156,
0.00025365496,
0.026367664,
0.0025458864,
0.0030656457,
0.0102769155,
0.041306853,
0.00698407,
-0.016333511,
-0.028085671,
0.019246653,
-0.0033021828,
0.026965233,
-0.0031699087,
-0.037547156,
-0.04302486,
0.010295589,
0.050793234,
-0.016868832,
0.023354929,
-0.011920227,
0.033762563,
-0.0067537576,
-0.05091773,
0.037696548,
0.014204677,
-0.040858675,
0.0029442648,
-0.01304689,
-0.029679185,
0.008932389,
0.017105369,
-0.011739711,
-0.002286007,
-0.028185267,
0.020603629,
-0.0070774397,
-0.015711045,
0.0040242434,
-0.0012309267,
-0.005091773,
-0.0037752572,
0.016209017,
0.0010994308,
-0.015661247,
0.002334248,
-0.012748106,
-0.022508375,
-0.0056613293,
-0.016283713,
0.03182047,
-0.0026236947,
0.024052091,
-0.020180352,
0.0012402638,
-0.0247866,
0.020267498,
0.0312229,
-0.03530628,
-0.029878374,
0.014204677,
-0.021275893,
0.0085215615,
-0.0027372949,
0.027438307,
-0.04282567,
-0.011708587,
-0.014528359,
0.0113102095,
0.0027092837,
0.0010978746,
-0.0116587905,
0.039065976,
-0.007805725,
0.013980589,
-0.03510709,
0.013432819,
0.0025972398,
0.024462918,
0.025969287,
-0.032816414,
0.028882429,
-0.01893542,
0.0057578115,
0.03620263,
-0.01046988,
-1.8467306e-05,
-0.0067848805,
0.019781973,
0.025160082,
-0.007874196,
-0.0032119253,
0.0044070603,
0.035206683,
-0.05086793,
-0.01543716,
0.017391704,
-0.002295344,
0.00984119,
0.027338712,
0.010793563,
-0.012299931,
-0.0037503585,
-0.0023295796,
-0.030525738,
7.839183e-05,
0.027886482,
0.05198837,
-0.010501004,
-0.013681806,
0.009903436,
0.04150604,
0.016893731,
0.0039246487,
-0.039215367,
-0.0030080676,
-0.007482043,
0.044717968,
-0.013109136,
-0.027164422,
-0.015885336,
-0.010407633,
0.001722675,
0.013719154,
-0.0021288341,
-0.02793628,
0.033712767,
0.017055571,
-0.0064238505,
0.0005473812,
-0.030650232,
-0.04536533,
-0.018275606,
-0.0013242967,
-0.029604489,
0.002899136,
-0.019844221,
-0.034833204,
0.0035418323,
0.015549203,
0.011534297,
0.016582498,
-0.008664728,
0.011291536
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 24,
"total_tokens": 24
}
}
headers:
CF-RAY:
- 939c182f4cd37365-NRT
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 03 May 2025 01:48:10 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '99595'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '241'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-cfdbfb9c8-hwbng
x-envoy-upstream-service-time:
- '87'
x-ratelimit-limit-requests:
- '5000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '4999'
x-ratelimit-remaining-tokens:
- '4999967'
x-ratelimit-reset-requests:
- 12ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_5196e0fdd3335f673750fd441d67c9df
status:
code: 200
message: OK
version: 1
test_embeddings_with_content.yaml 0000664 0000000 0000000 00000135520 15270700723 0045724 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for embeddings",
"model": "text-embedding-3-small"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '77'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.009180067,
-0.010902188,
0.026030775,
-0.040260565,
-0.022860976,
-0.035018735,
0.035101064,
0.027800921,
-0.00014118728,
0.020624276,
0.019938173,
-0.018442467,
-0.021955319,
-0.02640127,
-0.017372146,
0.012363588,
-0.025468169,
0.006246974,
-0.008157773,
0.013982793,
0.01568433,
-0.04215421,
0.008274411,
0.030874666,
0.015341279,
-0.002785581,
0.016109714,
0.03825714,
0.052912317,
-0.02176321,
0.0065557207,
-0.029420126,
-0.012507671,
-0.026030775,
-0.017687753,
0.033728857,
-0.020734053,
0.044898625,
-0.03757104,
0.016288102,
-0.0027169706,
0.0055128434,
-0.05293976,
0.007835304,
0.0002523575,
0.05115589,
-0.0586207,
-0.028102808,
-0.03408563,
0.047478374,
-0.062078662,
0.022929586,
-0.0034185117,
0.004120053,
-0.01919718,
0.012397894,
-0.0330702,
0.0039794017,
-0.0054819686,
-0.013722074,
0.045090735,
-0.00966034,
-0.012082286,
-0.014161181,
-0.00014526102,
-0.009571146,
-0.02626405,
0.044898625,
0.0027872962,
-0.016589988,
0.053076982,
0.023560802,
-0.029502459,
0.01521778,
0.017481923,
0.013680908,
-0.004703241,
0.015917607,
-0.021557378,
-0.045886617,
-0.033975855,
0.0267306,
-0.014655175,
0.00055745925,
-0.024109684,
-0.0098661715,
-0.0834851,
-0.01805825,
-0.021694599,
-0.0455024,
-0.016192047,
-0.050552122,
-0.06465841,
-0.019691177,
0.014243512,
0.008720378,
0.008445936,
-0.048246812,
-0.030847222,
0.01587644,
-0.0040720254,
0.017385868,
-0.009742673,
0.0018250358,
0.00080617185,
-0.023739187,
0.016260657,
-0.015711775,
-0.053955194,
-0.015300113,
-0.046956938,
-0.010133752,
0.015725497,
0.011903899,
0.059828244,
0.0009811283,
0.003096043,
-0.043910637,
-0.029228017,
-0.026195439,
-0.023643134,
-0.021955319,
0.040397786,
-0.03630861,
-0.021625988,
-0.029749457,
-0.01833269,
-0.026442437,
-0.036747713,
-0.01224009,
-0.002156081,
-0.021433879,
0.038202252,
0.050771672,
-0.04882314,
-0.022929586,
-0.07898426,
0.022929586,
-0.013111441,
0.053900305,
0.0014133736,
-0.021529933,
0.01885413,
-0.02354708,
-0.023588246,
-0.0133653,
-0.032932978,
0.049920905,
0.030929554,
-0.015766663,
0.0021029077,
-0.00094510784,
-0.051265668,
-0.0053687613,
-0.04956413,
-0.03784548,
-0.025646556,
-0.009159484,
0.036143944,
-0.012562559,
-0.018675743,
0.024823232,
0.029228017,
-0.012150897,
-0.0025248616,
0.016466489,
0.017276092,
-0.005941658,
-0.013420189,
-0.046215944,
0.0026054787,
-0.02375291,
-0.026799211,
0.00025943297,
-0.024178294,
-0.021090828,
-0.001303597,
-0.07892937,
0.02335497,
-0.023327526,
-0.011361877,
0.026085662,
-0.020198893,
0.0069433693,
-0.050936338,
0.060706455,
0.01833269,
0.06356065,
0.0063739032,
0.0045831725,
-0.005962241,
0.037296597,
0.06367043,
0.0055608703,
-0.00023348967,
-0.026373826,
0.05365331,
-0.0123087,
0.04896036,
-0.015409889,
0.0015600283,
0.04723138,
-0.025715167,
0.021475045,
0.026689434,
-0.013495659,
-0.028322361,
-0.0246174,
-0.035238285,
0.00021505063,
0.048246812,
-0.024960453,
-0.005138917,
0.0031080497,
-0.020473335,
0.033372086,
-0.038888358,
-0.0073756147,
0.03526573,
-0.006596887,
-0.039739124,
0.05510785,
0.07426386,
0.022998195,
-0.067732155,
-0.0040514423,
0.001194678,
-0.028596802,
0.0277872,
-0.010751245,
-0.0075471406,
-0.026017053,
0.013097719,
-0.016178325,
0.017454479,
-0.028404694,
0.001035159,
-0.005444233,
-0.030490449,
0.017317258,
-0.045749396,
-0.00880271,
0.034360074,
-0.013420189,
0.00054245075,
0.018113138,
0.011800984,
-0.027306927,
0.023245193,
0.0087341005,
0.0027426996,
0.021049662,
-0.0043224534,
-0.024823232,
-0.025358392,
-0.01449051,
-0.0452554,
0.037296597,
0.02837725,
0.003288152,
-0.0022349828,
0.017948473,
-0.030270895,
-0.020981051,
0.012013676,
-0.034579627,
0.02745787,
0.01038761,
0.0066311923,
-0.06718327,
-0.015505943,
-0.014614008,
0.04591406,
-0.013406467,
-0.052967206,
0.037406374,
-0.034387518,
-0.025056507,
-0.010812994,
8.597737e-05,
-0.0034373796,
-0.042126767,
0.02448018,
0.047725372,
-0.028432136,
-0.0054991213,
-0.013680908,
-0.018826686,
-0.045859173,
-0.011684346,
-0.0018644868,
-0.061420005,
0.060377125,
0.010346443,
-0.021776931,
0.020294948,
0.016548822,
0.011389322,
0.022943309,
-0.02686782,
0.04665505,
-0.013461354,
0.043197088,
0.06850059,
-0.037269153,
0.04056245,
-0.028267473,
0.0389158,
0.03765337,
-0.0017023948,
-0.029090798,
0.0065282765,
-0.015066837,
0.03419541,
-0.05247321,
0.00021890996,
0.03644583,
-0.00648368,
0.025495613,
-0.027718589,
-0.022463035,
-0.03249387,
0.015629442,
-0.035567615,
-0.0027564217,
-0.013612297,
-0.02084383,
0.011650041,
-0.0039519574,
0.0023756342,
-0.00072555465,
0.036281165,
0.028926132,
0.008871321,
-0.03216454,
-0.03718682,
-0.038998134,
0.011691207,
0.021090828,
-0.0021526504,
-0.03128633,
-0.008878182,
0.037433818,
-0.0130016655,
-0.011409905,
0.052006662,
0.015519666,
0.03408563,
0.041111335,
-0.015162892,
0.005138917,
-0.010161196,
-0.009893616,
0.0027941572,
0.058675587,
-0.04273054,
-0.005770132,
0.0013936481,
0.010099446,
-0.027951865,
0.0126311695,
0.0017547102,
-0.015972493,
0.04638061,
0.029804345,
-0.030682558,
-0.008919348,
0.03136866,
0.010065141,
-0.0053893444,
-0.022408146,
0.023643134,
0.017248647,
0.009708367,
-0.02030867,
0.012363588,
-0.015313835,
0.045173068,
0.040150788,
0.039876346,
0.017715197,
-0.028020475,
-0.029145686,
-0.06273732,
-0.011945065,
0.005241832,
0.020816386,
-0.01726237,
-0.0340033,
0.001676666,
0.030216007,
-0.024137128,
-0.020034228,
-0.014449344,
0.042977534,
0.023698023,
0.053488646,
-0.017577976,
0.0007933074,
0.005975963,
-0.039135356,
-0.063341096,
0.00026114823,
-0.010442498,
0.010874744,
0.02534467,
0.02931035,
0.007574585,
0.021077106,
-0.018291524,
-0.0065797344,
-0.027910698,
0.0452554,
-0.027361816,
0.0060960315,
0.028596802,
0.019595122,
-0.03839436,
0.0028593373,
0.038531583,
-0.024068518,
-0.037104487,
-0.055135295,
0.01045622,
0.013118302,
-0.019622566,
0.09089502,
0.0072864215,
0.012116591,
-0.059114695,
-0.039245132,
-0.0010445929,
0.033646524,
0.030023897,
-0.039272577,
-0.031944986,
0.059498914,
0.028624246,
-0.011814706,
-0.017687753,
0.008343021,
0.0012812987,
-0.03348186,
-0.03718682,
-0.010030836,
-0.030051341,
-0.016548822,
0.020788942,
-0.02678549,
-0.041193668,
-0.009516259,
-0.06399975,
-0.0040274286,
-0.041275997,
0.012480226,
-0.04130344,
-0.011629458,
0.011293267,
0.05510785,
0.010957076,
0.0018867851,
-0.05027768,
-0.044816293,
0.056864273,
0.06021246,
-0.00509432,
-0.018977629,
-0.007382476,
0.052226212,
-0.025193729,
-0.0032435553,
0.042757984,
-0.013097719,
0.009481953,
0.013344717,
-0.038339473,
0.009159484,
-0.03361908,
-0.02091244,
-0.031039331,
0.0018010222,
-0.033372086,
-0.031396106,
-0.022188593,
-0.009468231,
0.13974561,
-0.028130252,
-0.007053146,
0.018744353,
-0.014998226,
-0.029365238,
-0.0012984512,
-0.0277872,
-0.016466489,
0.040123343,
-0.031835213,
0.006909064,
-0.031450994,
0.036830045,
-0.026181716,
-0.01733098,
0.008638046,
-0.012391033,
0.025193729,
0.024891842,
0.017975917,
-0.041989546,
0.011883316,
-0.03479918,
0.0067409687,
-0.0037529871,
0.0059931157,
-0.038613915,
0.0064596664,
0.019361846,
-0.00443223,
-0.02845958,
0.06833593,
-0.007890193,
-0.028267473,
0.027567647,
-0.016836984,
0.0052624154,
-0.056260504,
0.011437349,
0.002281295,
-0.017248647,
-0.05609584,
-0.0422091,
-0.004487118,
-0.028075363,
-0.014764952,
0.028514469,
0.0011363593,
-0.01971862,
0.003070314,
-0.013145747,
0.024603678,
0.01568433,
-0.0062092384,
0.03554017,
-0.0033567622,
0.035485283,
-0.008349882,
-0.002373919,
0.03943724,
0.032191984,
-0.007437364,
-0.019101126,
0.010716939,
0.005169791,
-0.015670609,
0.029584792,
-0.020322392,
0.019951895,
0.021214327,
0.026771767,
-0.002593472,
-0.035320617,
7.6007425e-05,
0.009969086,
0.02898102,
0.068829924,
0.044486962,
-0.048658475,
0.03630861,
0.010270973,
0.0056980914,
0.047011826,
-0.024301793,
-0.050030682,
-0.00966034,
0.012246951,
0.01965001,
-0.003989693,
0.017975917,
-0.012692918,
0.028240029,
-0.028349806,
-0.024233183,
-0.008425353,
-0.00061148993,
0.014970783,
0.0008327584,
-0.0061028926,
0.034167964,
0.015835274,
-0.01992445,
-0.015766663,
0.023121694,
0.0400959,
0.0038147366,
0.026428714,
-0.034634516,
0.02421946,
-0.020198893,
0.042456098,
-0.0026380687,
-0.020157726,
0.024644844,
0.003691238,
-6.051649e-05,
-0.02136527,
0.011451071,
0.021982763,
0.005379053,
-0.034908958,
0.03499129,
0.024795787,
-0.003161223,
-0.0113687385,
-0.033042755,
-0.00087821274,
-0.00833616,
0.025221173,
0.0028078794,
0.011066853,
-0.0042263987,
0.024905564,
-0.016713487,
-0.01177354,
-0.023711745,
-0.011855872,
0.008967375,
-0.022065096,
0.037982702,
0.015258946,
0.009914199,
-0.008871321,
0.012027398,
-0.020020505,
0.0038215977,
0.025029063,
-0.049728796,
-0.013921044,
-0.02084383,
-0.027402982,
0.036281165,
0.015245224,
-0.045694508,
0.0041063307,
-0.0184013,
0.031039331,
0.01210973,
-0.009475092,
-0.0117460955,
0.005451094,
0.0063876254,
-0.0011560847,
-0.010277834,
0.017083982,
-0.028624246,
0.00443223,
-0.008377326,
0.014792396,
-0.05801693,
-0.021529933,
-0.0046140472,
-0.0020017074,
-0.044157635,
-0.00893307,
0.02056939,
-0.0017469915,
-0.01997934,
0.0016157742,
0.020020505,
-0.07437364,
0.027649978,
-0.01217148,
0.011903899,
-0.0013970786,
-0.015053115,
0.03724171,
-0.03062767,
0.014078848,
-0.035896946,
-0.029090798,
-0.0065797344,
0.0028884965,
-0.007231533,
-0.01885413,
0.021241771,
-0.018552244,
-0.03625372,
0.016178325,
0.010394471,
0.037927814,
0.0039004995,
-0.00042624192,
-0.017660309,
-0.060980897,
-0.012473365,
0.040150788,
0.0024356681,
-0.0019039378,
0.044486962,
0.0044116466,
0.029969009,
-0.010229806,
-0.0029468155,
0.00833616,
0.017591698,
-0.017893584,
-0.04080945,
0.008562574,
-0.034744292,
0.0010617455,
0.035046175,
0.03315253,
0.0021029077,
-0.0045557288,
-0.0078558875,
0.020006783,
0.017811252,
-0.0031543619,
-0.013674047,
0.013914183,
-0.0051286253,
-0.0076569174,
-0.012686057,
-0.026908986,
-0.015999937,
-0.008130329,
0.0021989623,
-0.008171495,
-0.023711745,
-0.010662052,
-0.009344732,
-0.017591698,
-0.015821552,
0.010312138,
0.0030017036,
-0.0009596876,
-0.020281225,
0.015794108,
0.00529329,
-0.0016852422,
0.0026106245,
-0.03850414,
-0.018730631,
-0.012830139,
0.029584792,
0.024603678,
-0.0013413327,
-0.039601907,
0.046408053,
0.046792272,
-0.005543718,
0.014202347,
-0.019567678,
-0.010277834,
0.011595152,
-0.005087459,
0.0055197044,
-0.029694568,
-0.022874698,
0.034250297,
-0.030682558,
-0.004295009,
0.02229837,
0.035293173,
0.01772892,
0.0026620824,
0.017715197,
0.018044528,
-0.031780325,
-0.03029834,
-0.002077179,
0.03685749,
0.027046207,
0.0053138733,
-0.025728889,
0.024109684,
0.0047649904,
0.047313713,
-0.02845958,
-0.017193759,
0.014504232,
-0.052088995,
0.026826655,
-0.013077136,
0.027746033,
0.0108678825,
-0.03545784,
-0.0063293064,
-0.0117460955,
-0.021406434,
0.004593464,
-0.008054857,
-0.057413157,
-0.03221943,
0.002296732,
0.030956998,
-0.023999907,
0.016288102,
-9.664414e-05,
-0.037461262,
-0.06581107,
-0.009289844,
0.029118242,
-0.026538491,
0.018730631,
0.034414962,
0.0056603556,
0.020363558,
-0.027512759,
0.025660278,
0.02931035,
-0.034963846,
-0.01965001,
-0.0026123398,
0.028294917,
-0.019375568,
0.038476694,
-0.0035643086,
-0.01825036,
0.0010171487,
-0.017413313,
0.004387633,
0.06399975,
0.02024006,
-0.05617817,
-0.0066140397,
0.0043670502,
-0.005502552,
-0.0014468211,
-0.004915933,
-0.0074716695,
-0.001984555,
0.018222915,
0.017975917,
0.014367011,
-0.018277803,
0.0007041139,
0.013118302,
0.045474954,
-0.0015102858,
0.017715197,
-0.00608574,
-0.019375568,
-0.027279483,
0.0546413,
8.511974e-05,
0.01707026,
0.003941666,
0.018071972,
-0.013090858,
0.01805825,
0.0063876254,
0.012775251,
-0.00959859,
-0.007972525,
0.030023897,
0.025303503,
0.020637998,
-0.0013936481,
0.024891842,
-0.03230176,
0.007924498,
0.01045622,
-0.0023190305,
0.0024116545,
0.009324149,
-0.019883284,
0.024205739,
-0.015643165,
-0.019608844,
0.008541991,
-0.014325845,
0.03910791,
0.014847284,
-0.042373765,
-0.0046209083,
0.0077323886,
0.03718682,
0.028706579,
0.02044589,
0.05922447,
0.025276061,
-0.007993108,
0.03024345,
-0.011828428,
0.0062092384,
-0.02427435,
-0.052747652,
-0.035128508,
0.01932068,
0.04360875,
-0.03578717,
-0.0082263835,
0.020583112,
-0.013783824,
-0.009070291,
0.025495613,
-0.026222883,
0.041522995,
-0.0020565959,
0.03592439,
0.014174903,
-0.01739959,
-0.012727223,
-0.043197088,
-0.0017821543,
0.021145716,
0.019800954,
0.0024493902,
-0.0023378984,
0.007231533,
0.015313835,
0.0008353313,
-0.02586611,
-0.023121694,
0.00018063824,
-0.007602029,
0.046600163,
0.016384156,
-0.009166345,
0.000625212,
0.056480058,
0.011691207,
-0.016233213,
-0.056480058,
-0.00079287856,
0.0040342896,
-0.013866155,
-0.006270988,
0.014984504,
-0.01672721,
0.037351485,
0.019169737,
-0.04440463,
0.006092601,
0.0042435513,
0.008246967,
0.020061672,
-0.04380086,
-0.0033670538,
0.014600286,
-0.022490479,
-0.014463066,
-0.012644892,
-0.025015341,
0.012994804,
-0.03897069,
0.025262339,
-0.003512851,
-0.019087404,
0.013022249,
0.031066775,
-0.021077106,
0.015711775,
0.015519666,
-0.011972509,
-0.0030463005,
-0.014353289,
-0.003327603,
0.0431422,
-0.01158143,
0.012926194,
-0.025056507,
0.011485375,
0.031258885,
-0.0023121694,
-0.023272637,
0.024370404,
-0.023066806,
0.009269261,
-0.040836893,
0.011560847,
-0.0020222906,
0.013447632,
0.021872986,
0.03320742,
0.009557424,
0.028075363,
0.00786961,
-0.012672335,
0.044816293,
0.058840252,
-0.016466489,
-0.0011938204,
0.021118272,
0.0073550316,
0.01726237,
-0.024246905,
-0.004922794,
0.020061672,
-0.013173191,
0.016384156,
0.009948503,
0.021200605,
-0.00026114823,
-0.038147364,
0.0044905487,
0.012692918,
-0.0007036851,
-0.015341279,
0.04253843,
-0.012953638,
0.021310382,
-0.01323494,
-0.01481984,
-0.01343391,
-0.002303593,
0.0040994696,
-0.017742641,
0.0074785305,
-0.0034648236,
-0.007492252,
0.046078723,
-0.0019176599,
-0.019814676,
0.023643134,
-0.045145623,
-0.0009288129,
0.008391048,
0.006885051,
-0.006590026,
0.008946792,
-0.03216454,
0.0009785554,
-0.00023391849,
0.021118272,
0.029228017,
-0.011430488,
-0.010229806,
-0.005279568,
-0.04797237,
-0.008590018,
0.026236605,
-0.014517955,
0.018387578,
-0.0112383785,
-0.01713887,
-0.024727177,
0.046874605,
-0.006181794,
0.017523088,
-0.00013861438,
-0.017591698,
-0.019210903,
0.0026689435,
0.0016860998,
0.01819547,
0.0391628,
-0.015108003,
0.015821552,
0.015204058,
0.0056088977,
0.01885413,
-0.03180777,
0.012885028,
-0.0027272622,
-0.010435637,
-0.0033996438,
0.029694568,
-9.374964e-05,
0.017879862,
0.01098452,
0.0144219,
-0.047725372,
-0.008514547,
0.0053070122,
-3.5511228e-05,
-0.0126311695,
-0.02408224,
0.0026689435,
0.021667155,
0.029996453,
0.027032485,
-0.0030188563,
-0.026963875,
0.013063414,
-0.0037392653,
0.018565966,
0.024027351,
-0.010195501,
-0.027361816,
-0.017495645,
0.026881542,
-0.012802695,
0.014463066,
-0.01164318,
-0.00661747,
0.011156046,
0.019059962,
0.0052486933,
-0.024260627,
0.015917607,
-0.006322446,
-0.0034288033,
-0.006782135,
0.02773231,
-0.0022315523,
-0.02792442,
0.028089086,
-0.011087436,
0.022325814,
0.0014150889,
-0.0012469934,
-0.023272637,
-0.0018696326,
0.015080559,
0.018222915,
0.00813719,
-0.002891927,
-0.011540264,
-0.005982824,
-0.00522811,
0.030380672,
-0.01965001,
0.027938142,
0.02281981,
-0.012850722,
-0.018730631,
-0.0091114575,
0.0011955356,
-0.049866017,
0.0010454506,
-0.02129666,
0.029475015,
0.0065488596,
0.027073652,
0.052720208,
-0.02361569,
0.020871274,
0.01912857,
-0.0075540016,
-0.011451071,
0.0034476712,
0.009152623,
-0.039382353,
0.014120014,
-0.033042755,
-0.021461323,
-0.048082147,
-0.016891873,
-0.009632896,
0.015094281,
-0.017852418,
-5.697877e-05,
-0.013372161,
0.00020132856,
0.00880271,
0.015821552,
0.005042862,
0.015355001,
0.09149879,
0.00588677,
-0.022408146,
0.017372146,
0.0133858835,
0.0069468,
-0.028349806,
0.010888466,
-0.018607132,
-0.009578007,
-0.0073138652,
0.020102838,
0.012397894,
-0.022792365,
-0.0048027257,
0.01296736,
-0.012651752,
-0.031450994,
-0.010682635,
0.005022279,
0.0030308631,
-0.009234956,
-0.0023567663,
0.02441157,
-0.02269631,
-0.013763241,
-0.03180777,
0.008658629,
0.02640127,
0.032329205,
-0.013159469,
0.030188562,
-0.010950215,
0.030600226,
0.0076569174,
0.03254876,
-0.042181656,
0.029667124,
0.0041303444,
-0.016439045,
0.013674047,
-0.008109746,
0.0016354996,
-0.0041063307,
-0.01753681,
-0.027334372,
-0.0063498896,
-0.036034167,
0.004857614,
-0.01045622,
-0.008315577,
0.036555607,
-0.03479918,
0.026277771,
0.040864337,
-0.03559506,
-0.00064536626,
0.0057255356,
0.042620763,
-0.01892274,
0.012699779,
0.032246873,
-0.035622504,
0.035759725,
0.008288133,
-0.015300113,
-0.02837725,
0.008068579,
0.0027547064,
0.034305185,
0.009214372,
0.023711745,
-0.009433926,
-0.043498974,
0.0015445909,
0.021927875,
0.022408146,
-0.005900492,
-0.03268598,
0.02845958,
-0.025097674,
0.0034065049,
0.021077106,
0.04207188,
-0.002156081,
-0.0071697836,
0.008157773,
-0.023080528,
0.0010017114,
0.042099323,
-0.021612266,
-0.009324149,
0.021090828,
-0.010044558,
-0.00061792217,
0.007910776,
-0.0084802415,
-0.037433818,
0.037927814,
0.016768374,
0.007890193,
0.011629458,
-0.03381119,
0.031176552,
0.008061718,
-0.007231533,
-0.07838049,
0.010565997,
0.016123436,
0.014065126,
0.013543687,
-0.021282937,
0.020926163,
0.008562574,
-0.006092601,
0.016686043,
-0.020610556,
0.0041852323,
0.0014022244,
-0.043828305,
0.0033721996,
0.006538568,
0.019553956,
0.008061718,
0.027210873,
-0.02652477,
0.01329669,
0.01224009,
0.0026535061,
-0.015121725,
0.04215421,
-4.9018894e-05,
0.010483664,
-0.00023649137,
0.041111335,
0.009296705,
0.008212661,
-0.02712854,
-0.010689496,
0.025975887,
0.0400959,
0.009090874,
0.014051404,
-0.008322438,
0.029282905,
-0.013783824,
0.008898765,
0.004089178,
-0.052253656,
0.005042862,
-6.351819e-05,
-0.04300498,
-0.017962195,
-0.019663732,
0.03356419,
-0.007828443,
0.016548822,
0.024397848,
0.0035368646,
-0.035677392,
-0.0010634607,
-0.0071766446,
-0.022847254,
0.023848964,
0.005286429,
-0.0010754676,
0.01627438,
-0.018044528,
-0.008493964,
0.0035437257,
0.009996531,
0.0009133755,
0.01573922,
0.0011475084,
-0.012699779,
-0.04207188,
0.012926194,
0.024740899,
-0.04366364,
-0.006339598,
0.019361846,
-0.026895264,
-0.028267473,
0.003612336,
-0.0004463962,
0.023999907,
0.020171449,
-0.019636288,
-0.0069845356,
-0.018538522,
0.0097358115,
-0.019608844,
-0.014874728,
-0.015066837,
-0.01925207,
-0.0045214235,
-0.04638061,
-0.024192017,
-0.0066003175,
0.0132555235,
-0.0023207457,
0.0027306927,
0.02678549,
-0.013090858,
0.019526511,
0.04182488,
-0.013228079,
0.0031920974,
-0.021584822,
-0.031533327,
0.059169583,
-0.010161196,
-0.0010145758,
0.008747823,
0.049866017,
-0.0036500716,
0.00912518,
-0.014435622,
-0.003413366,
-0.004216107,
0.00039022148,
0.0040720254,
0.024260627,
-0.031203996,
-0.03499129,
0.0022864405,
0.028596802,
-0.023670578,
0.0058318814,
0.016329268,
-0.035101064,
-0.040452674,
-0.0398489,
0.006384195,
-0.020349836,
-0.0014313839,
-6.828876e-05,
0.0370496,
0.018579688,
0.00992792,
-0.03466196,
-0.0075402795,
0.033289753,
0.045749396,
-0.018277803,
-0.012459643,
-0.010758106,
0.005663786,
-0.018552244,
-0.019183459,
0.007773555,
0.029749457,
-0.005663786,
-0.023972463,
-0.0340033,
-0.004209246,
-0.0007405632,
0.0048541836,
-0.015409889,
-0.03954702,
-0.03661049,
0.012487087,
0.04703927,
0.00016144877,
0.03394841,
-0.03446985,
0.015986215,
0.011986231,
-0.024164572,
0.027032485,
0.01521778,
-0.023711745,
-0.016192047,
0.0010900473,
-0.014408178,
0.030764889,
0.0033996438,
-0.013577992,
-0.009694645,
-0.04360875,
0.017509367,
-0.007924498,
-0.011128602,
0.0034974136,
-2.6733924e-05,
0.00119039,
0.008164634,
0.0054751076,
-0.001759856,
-0.0088575985,
0.020981051,
-0.021420157,
-0.02818514,
0.003380776,
-0.01270664,
0.0054819686,
-0.0067787045,
0.0030874666,
-0.04599639,
-0.004312162,
-0.038339473,
0.034360074,
0.03427774,
-0.028953576,
0.0023704884,
0.02176321,
-0.00833616,
0.03737893,
-0.0023773494,
0.046408053,
-0.03921769,
0.012939916,
0.0048919194,
-0.0020788943,
0.012493948,
0.018305246,
-0.028624246,
0.03559506,
-0.017660309,
0.041852325,
-0.016713487,
0.0068953424,
-0.0056843692,
0.028020475,
0.007238394,
-0.031862658,
0.03446985,
-0.011293267,
0.019677455,
0.03381119,
0.014668897,
-0.014655175,
0.0010068571,
0.011526542,
0.040919226,
-0.0059519494,
-0.01713887,
0.013900461,
0.023190305,
-0.049399465,
-0.027746033,
0.034414962,
-0.006922786,
0.009612313,
0.019910729,
0.0038353198,
-0.0068507455,
-0.010970798,
-0.0022195454,
-0.030655114,
-0.014367011,
0.01977351,
0.047999814,
-0.033234864,
-0.016987927,
0.010065141,
0.026854098,
-0.004524854,
0.0053035817,
-0.029529903,
-0.013440771,
-0.017893584,
0.030133674,
-0.025427002,
-0.002044589,
-0.0093584545,
-0.014174903,
-0.008775266,
0.00800683,
-0.04399297,
-0.02917313,
0.02614055,
0.028130252,
-0.005516274,
0.0025454448,
-0.03672027,
-0.05724849,
-0.01561572,
-0.007238394,
-0.05458641,
0.008466519,
-0.001535157,
-0.030051341,
0.0050394316,
0.017207481,
0.026812933,
0.010764967,
-0.011306989,
-0.004133775
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 6,
"total_tokens": 6
}
}
headers:
CF-RAY:
- 939c181e8dcae38c-NRT
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 03 May 2025 01:48:07 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '33302'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '70'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-8985dd5b9-nwnh2
x-envoy-upstream-service-time:
- '38'
x-ratelimit-limit-requests:
- '5000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '4999'
x-ratelimit-remaining-tokens:
- '4999993'
x-ratelimit-reset-requests:
- 12ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_9d3ac02ffd35831e5cb85c4a96414d5c
status:
code: 200
message: OK
version: 1
test_embeddings_with_dimensions.yaml 0000664 0000000 0000000 00000042342 15270700723 0046421 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for embeddings with dimensions",
"model": "text-embedding-3-small",
"dimensions": 512
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '112'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.009219426,
-0.06619997,
0.10735908,
-0.06785497,
-0.023044067,
-0.05842867,
0.028836563,
0.020453632,
-0.026479987,
0.045620415,
0.019949937,
-0.04285009,
-0.052600194,
-0.03561846,
-0.02048961,
0.0022486404,
-0.011153256,
0.00040644174,
0.026695859,
0.055478454,
0.0013019628,
-0.06281801,
0.03466504,
0.025778413,
0.00886414,
0.008463882,
0.029628085,
0.03363966,
0.12095886,
0.00993899,
-0.0019608145,
-0.03283015,
-0.056701712,
-0.07433105,
-0.023026077,
0.00888213,
-0.05925617,
0.097932786,
-0.06360954,
0.041303024,
0.006008367,
0.009336354,
-0.07670562,
0.018088063,
-0.027613303,
0.07238823,
-0.1020343,
-0.02194673,
-0.046447914,
0.080015615,
-0.090953,
0.03831683,
-0.037129547,
0.023673685,
-0.043173894,
0.045188677,
-0.0196801,
-0.021353088,
-0.011863826,
0.005823978,
0.03243439,
-0.027631292,
-0.033981454,
-0.03624808,
0.02194673,
-7.420513e-05,
-0.046591826,
0.05310389,
0.0037979535,
-0.030509552,
0.046411935,
0.016496025,
-0.040511504,
0.02378162,
0.06983377,
0.03954009,
0.022270534,
0.0070742224,
-0.057457257,
-0.03871259,
-0.03871259,
0.07908018,
-0.031444985,
0.0007465486,
-0.03590629,
-0.010541625,
-0.06299791,
-0.018960536,
-0.036949657,
-0.06933008,
-0.03795705,
-0.077641055,
-0.07605801,
-0.01731453,
-0.038208894,
0.012340538,
0.04835476,
-0.07972779,
-0.05968791,
0.022702273,
-0.0067009483,
0.03849672,
-0.018088063,
0.027289499,
-0.048246827,
-0.04572835,
0.031660855,
0.0027051142,
-0.06468888,
0.018285943,
-0.04245433,
-0.028350856,
0.028656673,
0.04198661,
0.077209316,
-0.0017258314,
-0.036733788,
-0.046016175,
-0.015119857,
-0.026174173,
-0.04839074,
-0.030563518,
0.0676391,
-0.046879653,
-0.03914433,
-0.043713566,
-0.018672708,
-0.061450843,
-0.0623503,
0.022108631,
0.009363338,
0.015344721,
0.054902803,
0.07483475,
-0.086131915,
-0.03669781,
-0.09750105,
0.047023565,
-0.021658903,
0.040151723,
-0.0035663436,
0.014508227,
0.021694882,
-0.028045041,
-0.015209803,
0.045368567,
-0.071164966,
0.095702134,
0.059364103,
-0.0047536255,
-0.020939339,
-0.03813694,
-0.028152976,
-0.02829689,
-0.07886431,
-0.052384324,
0.011764886,
0.025454609,
0.06130693,
-0.02826091,
-0.038640637,
-0.00405205,
0.031444985,
0.00036512298,
-0.0018360148,
0.013671733,
-0.007402524,
-0.03914433,
-0.054435086,
-0.09325561,
0.016361106,
-0.039468136,
-0.015398689,
-0.03583433,
-0.018456839,
-0.009408311,
-0.013590782,
-0.08239018,
0.017062683,
-0.073755406,
-0.051592804,
0.040259656,
-0.030707432,
-0.0026084227,
-0.08332562,
0.09347148,
0.01772828,
0.022090642,
0.03957607,
0.023547761,
-0.025724445,
0.04781509,
0.063501604,
0.031301074,
0.0039666016,
-0.03095928,
0.062710084,
-0.006395133,
0.036176126,
-0.031319063,
-0.019949937,
0.061198995,
-0.042490307,
0.031301074,
0.007807279,
-0.05000976,
-0.013275973,
-0.042958025,
-0.052096497,
-0.02072347,
0.03094129,
-0.031624876,
0.037849113,
-0.013222005,
-0.057241388,
0.051772695,
-0.04982987,
-0.043713566,
0.011216218,
-0.024501184,
-0.045620415,
0.061163016,
0.07102106,
0.015830427,
-0.11405104,
-0.012394506,
0.0016268913,
-0.05691758,
0.05058541,
0.026911728,
-0.005765514,
-0.02624613,
-0.035150744,
0.016244177,
0.027199553,
-0.030095803,
0.034593083,
-0.0066739647,
-0.06609204,
-0.0045647398,
-0.039504115,
-0.011656951,
0.05371552,
0.029196346,
0.0097501045,
0.0029704538,
0.03524069,
-0.049218237,
-0.003806948,
-0.011522033,
-0.014463254,
0.017134639,
-0.029592106,
-0.046088133,
-0.0350608,
0.022648305,
-0.06371747,
0.06569628,
0.019536188,
0.025922326,
0.007501464,
0.01045168,
-0.0573853,
0.017053688,
0.020273741,
-0.03220053,
0.031534933,
0.016837819,
0.0138336355,
-0.09181648,
0.0041712276,
-0.021461023,
0.0024285316,
-0.028656673,
-0.06371747,
0.0537515,
-0.042886067,
-0.043029983,
0.019338306,
-0.025274716,
0.022054665,
-0.034359224,
0.019158415,
0.10095496,
-0.04759922,
-0.0014987187,
0.00030693942,
-0.022612328,
-0.045404546,
-0.035798352,
-0.0023903046,
-0.068394646,
0.048966393,
0.02790113,
-0.051161066,
-0.0026713847,
0.008405417,
0.015425673,
0.042130526,
-0.06889834,
0.05101715,
0.00563959,
0.05346367,
0.076561704,
-0.05555041,
0.08023149,
-0.033891506,
0.08447692,
0.065408446,
-0.023943523,
-0.021245154,
-0.0110813,
-0.037669223,
0.07476279,
-0.09174453,
-0.013455864,
0.055190627,
-0.028764607,
0.0074474965,
-0.01628915,
-0.034719005,
-0.07195649,
0.015146841,
-0.07785692,
0.013590782,
-0.027163574,
-0.027163574,
0.034934875,
-0.029124388,
-0.029088411,
-0.023313902,
0.05080128,
0.022450425,
0.023205968,
-0.0357264,
-0.0573853,
-0.055118673,
0.0025994282,
0.0075284475,
0.011504044,
-0.07015758,
0.011620973,
0.02192874,
0.015470645,
-0.022702273,
0.032506343,
-0.007496967,
0.024663087,
0.10275387,
-0.040187698,
0.015020917,
-0.024699066,
-0.017422466,
0.006525554,
0.062782034,
-0.055622365,
-0.018097058,
0.005509169,
-0.013473853,
-0.048894435,
0.002963708,
-0.022648305,
-0.024681076,
0.053247802,
0.012160647,
-0.052420303,
-0.0006239977,
0.048678566,
0.03383754,
0.0033797063,
-0.013590782,
0.011513039,
-0.021712871,
0.01632513,
-0.051340956,
-0.00074542424,
-0.031696834,
0.08181453,
0.054794867,
0.040763352,
0.006970785,
-0.008675254,
-0.04857063,
-0.059543997,
-0.026012272,
-0.011755891,
0.06191856,
0.005770011,
-0.018564774,
-0.0004266795,
0.015785456,
-0.01496695,
0.0067549157,
0.0075104586,
0.045764327,
-0.009291382,
0.056881607,
-0.03648194,
0.004758123,
0.0017753015,
-0.074187145,
-0.11354734,
0.02703765,
-0.043569654,
0.007501464,
0.031067215,
0.07505062,
0.03667982,
0.03831683,
-0.00451527,
-0.042886067,
-0.021425044,
0.029088411,
-0.045980196,
-0.029789986,
0.05000976,
0.006633489,
-0.049434107,
0.019014502,
0.12124669,
-0.06472486,
0.01423839,
-0.07274801,
0.016972737,
0.0042544273,
-0.036553897,
0.11405104,
0.022936132,
-0.008257007,
-0.03358569,
-0.05983182,
0.020741459,
0.080015615,
0.033999443,
-0.06947399,
-0.0598678,
0.060803235,
0.031409007,
-0.014796053,
-0.02705564,
0.007483475,
0.0360502,
-0.054219216,
-0.06324975,
-0.004740134,
-0.0598678,
-0.0031683343,
0.045872264,
-0.023817599,
-0.048714545,
0.011683935,
-0.092320174,
-0.03565444,
-0.073431596,
0.003550603,
-0.051916607,
-0.015884396,
0.020633524,
0.094263,
-0.01946423,
0.040871285,
-0.07220834,
-0.064509,
0.06594812,
0.0931117,
-0.0027613302,
0.0025184772,
-0.034503136,
0.04770715,
-0.019410264,
-0.025544554,
0.05058541,
0.039863896,
0.01147706,
0.024789011,
-0.042130526,
-0.017008714,
-0.051880628,
-0.027991075,
-0.05367954,
0.013482847,
-0.03910835,
-0.034161344,
-0.021802817,
0.017089667,
0.18838209,
-0.040691394,
-0.026983684,
0.06587616,
-0.036985636,
-0.06623595,
0.0040992713,
-0.07433105,
-0.018375888,
0.025274716,
-0.018960536,
0.021604937,
-0.039252266,
0.06296193,
-0.020075861,
0.039216287,
0.03563645,
0.01627116,
0.024483196,
0.044361178,
-0.009264398,
-0.057241388,
-0.0061297934,
-0.0537515,
0.03910835,
0.0044208267,
0.04123107
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}
headers:
CF-RAY:
- 939c182bfc0e6d5f-NRT
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 03 May 2025 01:48:09 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '11121'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '90'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-687976cc6-wtrv5
x-envoy-upstream-service-time:
- '43'
x-ratelimit-limit-requests:
- '5000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '4999'
x-ratelimit-remaining-tokens:
- '4999988'
x-ratelimit-reset-requests:
- 12ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_a3d50a6faea5e691c607f0a4902c56ab
status:
code: 200
message: OK
version: 1
test_embeddings_with_encoding_format.yaml 0000664 0000000 0000000 00000025127 15270700723 0047411 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for embeddings with encoding format",
"model": "text-embedding-3-small",
"encoding_format": "base64"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '127'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.26.0
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.9.2
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": "DK6fO8qEirxr7OE8SQSPvXpWIry659e8mJ5BPUKZiTxZdqM76WvmPDaVLT0xwge86TEXvU+lObzFhka8XkUfvNgvd7yb1d08OC0NuzMvyTshVB07MPgsvc7umDzYWhU9SjeBPBQdz7wB2Yu8gYuCPbZ9ST1078a8c4rZvDwyrrxnsRs8BRj8vNv2nrz3bA88HFZZvMXnCT2xSeC8Pp/vOuVimzyN/1K8kc5OvXAk9bvH6AA8UgsePWdMrrxvgQ69+Z8BvEE0HD2w4Ei9FbEEPUY9Zzyd0qq7ZbROvA6Azjx0Ho+8vbKpPITGyLsC3bW7mAMvPTXHKL3QIYu6mNRmvNYnozx078a6l295vQyuHz1frra6bYhrvP/bPj1O17Q8KCSQvJKcUzzXjBA9m9XduwBFVrwJSDs7RTk9vSS6gb2m2Tm8UXfoPL+6/bxyggW9mnDwOxBS/Tx6u4+94JMfvIIqv7xvgQ69/d7xvH1XGb08lxu9H7y9vBvtwTtOdnG8G1IvvJU4Xb06ZCm7+NUmPJg5VLzP8kI8y4i0u35fbbta2xC6arKSvGUVkjwU56m7Y0eNvT7ON7xc3Ae9C39Xu5drT7w4yJ88kmKEPVtEKLwLf1c86ZYEvdP3Y7ujDug7jf/SvHuJFLxWED89LyqovB2FIb1i6fy8IbkKulupFb0O5bu8UXdovOqaLrzeXIO8XNwHPRAYLj36o6u9gYsCvQjfo72zRi083S07vbmCaj1KbaY6oWsBvfaeCjz9Q1+8PgTdvKtHcjwVUMG9qqQLPQhEkTwW7308dLkhvAJ88jtoUFi9v+UbPGIUG73BHDi9H/LivEI4xrypEFY9MWHEu2N9MjmyQgM9NQF4PDsuhDrC6jy7kwFBvBfoID0tLds6o9QYvRVMF7x3VSu8PcqNvPM4przCu/S5kmIEvfVvwjqrqLW892yPvZJiBDvwAQq9mDnUvBAYLj3/2z68HBwKPCMmzLyLMU49mNRmPCGKwjycaRM9wuo8uwJCo7ypENY8r9yePQbiVjvgyUQ8cOolvXIhQj0B2Qu9CRIWPbkd/bzvCGe8tBAIPYTGyLxgsuA8Bd6sPFrbEL1BNBy9RzYKvdPBvrxkSze8e172PKPUmLzAGA48OMgfO3ZRgTv3ByI9fiUevYWQI7xS3FU8izHOvIbDlbyxSeA8nAhQPZg51DyuDpq9KvIUvAt/17zHuTi93sx3PUc2iryjOQa77GzdvNHvjztJo0s8HByKPE3TCrzGVEs7xFf+uyW+q7zT9+M8c+scvVDUAbqHYlI9nAhQu2AXTrx+X+08aRqzO/k+Pr31CtU8dO9GOuEy3DyS/ZY8W6kVvP48Ar1MP9W8c1AKve5pqrymqnE9YnmIPO02uDc6ms66l9C8PAKnkLya0bO6ptWPPFUMlbxMBYY8z1ewO0ptJrqD+EO9c8B+O0nZ8LzellI8L4+VPFWnJ70zL0k9oaGmvCpXgrz0axi7KvKUPK6pLL0xwoe9DuW7O43JLT3C5pK89j3HN052cbxbDgO8saojvfY5HTuoRnu7UXdovQJCIz3uaao8JLoBvbkdfTwTtDc80/fjO7GqIz3rZIm8XHcaPUQ1kzvLUg89FB1PPSj1R71rh/Q8ljGAvSW+Kz1XeVY9GVXiujsDZryx5HI8n2oKu51x5zw4Z1y9MPgsvDD4rDyrR3K8njtCPNBb2rpu7Vi8AnzyOeH8Nj1SQUO9kv2WPH28Bj0Ae/u8XqqMPPrdertGA5g8cyXsvPXULz20Slc9RTm9u6Q9sLwyKx+8RDUTvQwTjTyvd7E7qj+evOkG+bwQs8C8ogo+PWvs4TzIhz29TnJHPeaVjTvb9h49rq3WPBVMl7x7iZS7OfsRvGrot7xPQMw8/QmQPW+BDr0PFIQ8sniovEmjy7yqpAu9OAJvPKaq8bu24ja8Q6HdPIstpDx2wfW8DK4fvf1DXzw3/sQ8tXkfvI4yxbzChc872L+CvJ0MejsNfKS8eIgdOkOdMzmOkwg9IbkKPbewOz1WEL88M5Q2vYbDFb371h29BagHPA4b4Twbt5w8AQ8xPKcIgrxWdSw5h5h3PIpjSbq85KS86ALPvEai1DwvYE09SaPLPIJZB72xD5G6ua2IvGJOarxREnu9jpOIPN3IzbyhBhS7Qc8uPWVPYT2V/g086WvmPBGBRbxmfqm8Hx2BvO1lAD3S87m862SJPAp7LTveMWW56WvmvJloHDyuSOk8V3lWvFupFb3q/5u9WrDyO7lIm7x6VqK8CBlzPQsaarzP8kI7gYuCvRkbE71+igu8aOtqu1cU6TsVTJe8EeYyvfOdEz1iTuo8OMgfvDyXm7vTIgI8wksAPcK79LyhPDm9nXFnvJPLG72SnNO7xecJPQB7+zr3QfG8o3NVvKmraL0A4Oi8fI0+vYKPrDzwAQq9ecJsvLmCajy3FSk9KvKUvC33tTuhBpS91CYsvY4yxTzFvGs9e4mUvOJhJL02lS28EFL9PIHBJ7xhSsC8V3lWPSSPY7uP/B88b4GOPDP5o7yyQoM8oDgPvJdrz7zT9+O87mmqu+T5A73tZQC9gfv2uuZq77xzUAo+VnWsvE48Ir0yKx89HriTu6M5Br3vMwW8H1dQvWCyYLwVTBc8x1j1vJPLm7yBi4K8ZuMWPZ0M+ryMmmW8+zuLPFfewzxOoY8842n4PFQ+kDxAZhe9MV2avAcVybyY1OY7jJrlPIdi0rwB2Qu9iv5bPD83zzt/xNo7yoQKvSosZD1g4Si9DhvhvMa1jjy5fsC8zb9QvFZ1rLxFOb07ExmlPNVZnrzA6cW9CH7gvJeal7wYUbi8jf9SvGgWCT3YlGQ7aIZ9u6zbJ7zZ+dG7wYGlPDJlbjyOMkW8ukzFPO8IZ7wCfPI8MC5SvCAhq7t1vcs84saRPB3qjrnWwrW8CnutPPY5nTpjfbK8elaiPPgLTL3QvJ08FB3PPK2lAj1GPWe8O8kWvePKOztiTmo8c1CKPGKzVz3dkig9wOlFvTpkKT2mD986TAkwvIrINj0W7/28eyQnvYT87brnmTc8mnBwO4GLAr371h08KixkvKVwojyMmuW8A+HfO9sw7rtBNBw8xFd+PDb6GjxREvu86WvmOwbi1jw+BF28tn1JvHBPkzlOcsc80/djPNSLmbtmGTy9brezOw+vFjw+BN08CneDvNhaFb3mlQ09NGK7PDf+xDyKme68HFbZPLUUMjw3YzI9mDnUvC33NT2oRvs8O574uiGO7Lsjhw+8723UvPaeirsCeMg801zRuxyM/jvdkig7EkugPBbv/bugct47D6+WvGJO6rsGER88C39XO/pC6Dybnzg7VUK6O/M4pjwlIxk8CH5gvCGKwjsKdwM9SQQPvf1D37yH/eS7toHzvJ4FHbysrN88KcNMvSMmzLv3QfG42fnRPLQQiDxInyG7+AvMvBKwjTtyIUK8pabHu+DJRLyCj6w88qTwvOT5AzyF9ZC8bekuPHZRAb16u4+8wksAvKBy3rjHgxO9TAWGvKOp+jmuSGk6Ov+7vO02uDu5SJs8l5qXvZxpEzzqNcG8CnstPKM5hrwMSTK7zb9QPKHXS71GotQ8jJY7vexs3bxDZ447wksAvJX+Dby5HX28JPAmPEZohbwX6KC8RZqAPKaq8Tv/QCw9nZyFvC/FOruLLaS70e8Pvd3IzbwI36M8+t36uzZfiDzEHS89RAbLPPMCATymD187ak0lOyYnQzt3HwY9gSYVu64OGr3ezPe5PQAzvdkoGrzezPc8YrPXPH6KC7yWMYA7850TvP+lmTySYoQ8ZRWSPOtos7zn/qQ8Rj1nu7mtCLxm4xY8fI2+vFGiBrzO7pi776N5OmgWibyV02+8BRh8unwoUTv3ojS9st2VvFILHjydnIU8lzWqu1faGby651c8Oy4EPNJYJ7wO5Tu76wPGvC8qKLylcKK6o9hCO/nZUDwRHFg83vcVvaejFD0GER89JIs5vHmMRzwXg7O8gWBkvIBYEDzkM1O8tErXu4JZh7y3sLu8PzMlPePKO7y85KQ6H431PBNT9DuEJww9KFq1OfM8UDxfrja7c4rZO0TQpbwFfem7H/JiPKYP3zxxU707qEb7u1d51rt8KFE8FlRrPaBy3rzvo/m8gFiQPLewO73k+QM9K1ssPFytPzxQ1AE8wrv0vNLzObyRzk48NstSvBdNjjyUNDO8vB50vc2FAb01x6g79wciPe0Ak7vVWR48CnstvCos5LwJrai99weivIuSkTxcTPy80YoiPMlRmDy0gPy7Ca0oPNVZnrxasPI89NCFO1JBw7w7A+a4ntbUvHhdfzzRiqK8d1UrPbdLzrxUE/K8rq1WPMGBJbyNLhs85ceIPSfxnTye1lS9axuquVES+7uuc4e8QTQcvGNHDTuzq5q8F02OvCG5irwD4V88hl6oPOH8trycaRO8kv2WO4L0GT1/xFq6QwKhPGJO6rwJ4828GfB0vFN0NT01LJa7c8D+O4zFA7wCp5A83CkRvW2IazrkM1M5o6n6uI1kwLy5gmo83S07Pdn5UTy5Hf27WRE2vGsXAD3kmMC88qTwPA9KqTtUPpC7MmVuPA6287sl9FC8/UPfPBO0t7x+igu9mnBwPKULNbvuaSo9q0fyO2fnQL2ZzYm8p6MUPWnkDT3Zw6w6Z+dAPbBFNj0ovyI9rHa6uhYanDz3pl68x4OTO5X+jbxJo0u9v0oJvdkomrtAO3k8MWHEvIQnjLwuXKM8H411uBmAgLxOdnE8njtCveGXybo1kYO8yh8dPSOHjzz93nG8OGfcvKgMLL1n50C8RmgFPC2SyDzellK6dFS0OhJPyjsZVWI8MWHEO5pwcLxmfim9/QkQvEo3AbzEghw9G+1BPHcfBrtDPHC8BNqCPdbCtTxREvu88aBGvXAkdTqYA687v+UbOuGXyby8SZI8URJ7vAEPMT3szSC89p6KvQPh3zyWZ6U8uHqWu9z6SDy05Wm9IvPZu/UKVTzdyM28pnTMvHMl7LvH6IC8zfV1PLOrGr2/H+s8sniou5X+Db25fkC8dYemPGIUm7wTtDe8LfOLPAkSlrzeXIO7v0oJPOtoszwtksg80r0UOgp7LTyabMa87NFKvAsa6jxBoGa8IIaYvB8dAT1aFeC8tID8uxhROL2pq2g8wuq8O1gNDLtOdvE8jPuoPBSCvDuSYoQ8elaiPF9N8zrAsyA9qavoPEbYebqcCFA825XbORu3HD2eoC87xYZGvYb5Oru7Gso8J5DavG5SxjyBJpU78m5LPIn6sTuBxdG8bIAXu/emXjya0TM7oaGmvPemXj3S87k7GbrPO95cg7wtksi8tRQyu+zNoDzTIoI8Ov+7vInEjDxnTC482cMsPD6f7zwghpg7v0oJvf3ecTyPNm+9QaBmvEBmlzwB2Ys8WA2MuhtSrzyxSeC8KPXHu1Z1LDykoh08LyooPTJlbrzxzw47nQx6O/vWHb1I1UY7MsaxPEo3Ab1LOys8PcoNPGJO6rzcxCO9VD4QPQtFiLxX3kM87NFKOwh+YDySN+a8A+FfuiqRUbz52VC7KFo1PfRrGDz1b8I8+m0GPGuH9LvgLrK7LyoovSfGfzzGtQ48IIaYvGYZPLy6sTI9rkhpO0w/1TplsKQ8kpzTPAbiVr0Ae3s7aBYJPEo3gbzZ+dG8VnGCvE48IjxeSck88zxQPXOKWTuD+EO71vhau0KZCTuuSGm8a+xhPDqaTj0ZVWI7txWpvNb4Wrx5J9o8WrDyulfewzxjRw297ZulvH+ONTypq2g8QGYXO/pthryvQYy7fMNjvJrRs7xPpTm6WtsQPci94ruE/O28xeuzPKYP3ztiTuo8Qc8uvCS6gTwLGmq8cIU4vBVMlzzoY5I8Pp/vvOH4DL2AWBC8PzOluTWRAzzvo/k8ybYFvKM5Bj3eMeU76v8bOyS6gbxxUz27786Xu6mr6LwE2gK8SzsrvD2bxTzZw6w6nGmTPFLcVT0TU3S8EbfqPIRh2zxmGTw88aBGvJ9qCrsyKx+8j2ENvbDgSDqbOku8IiIivMKFT722gXO8bSP+u/ShvTypdcO8Sm0mO4X1kLyv3B48l295O/TQBT0vKig8YxjFOzbLUj0TfpK8HSA0vKgMLDzlxwg8c4pZu70Xl7zraLM8ptk5vbQQiLyxD5G5hZAjPd4xZbvellK8kpzTPHdVqzw2X4i8rECVvFtEKDxwJHU6zSCUO3G4KrvrZIm6bYhrPD83T7xVQrq7eL7CvEABqjxfE6Q8EFL9PNz6yLzblds8ntZUOQtFCDxUPpA83jFlPP7XFL34OhQ9OfsRu4qZbrytpYK8RZqAvFeve7sST0q8ST7evGexG7yacHC7F4Mzvd0tuzxkSzc8+qfVOgu1/DzI7Cq9CH7gO1gNDD3qmi69723Uuo4yRTyxqiM9qRBWvNP34zwZgAA9mWicvB/y4jyHYlK81pPturJCg7veMWU8wBiOPDPKWz36p9U8UXfoPKbVj7ydcee8iv7bN80glDyeBZ08lgI4vMAYDr37Ows9BhGfvGqDSjpqTaU72JRkPZnNCbxi6fw7SzsrPNEltbxmfqk86pouPaQHC7uY/4S8X01zO8jsqjrvbdS7+HA5vB0gtDuAXLq8ciFCPTRekTtg4ag8LyooPGGrA72VOF09imPJO6DTIbwhVJ29hGFbO4HF0Tv1CtU8CxrqO4X1ELxs5YQ8cLSAunwo0bw0XhE9+DqUvGCy4Drb9p485JjAvDpkqbsvYE08TW4dPWKvrbwHerY88QW0vBm2Jby1FDI7/jwCO9BbWrxV3Uw9XbFpvI3/Uru35uA7cbgqPRvtQTr2PUc8CRIWvRxW2Tsqx/Y8nQz6OwYRnzxk5sk8ISl/POEyXD0PSqm63yqIu/RrmLjTXFG9h2JSO3UiObyhawG9hfWQvJLS+DxJPt48v0qJPFF3aDzqNUE8jcmtPFtEqLzWXci7Y+Ifu9wpkbzun888MPisux5TJjwCfPI8gcGnvJbMEjuhBpQ8P5iSPEBml7sZ8PQ8e7+5PIz7qLwBdB69ee0KPOlr5jzOJD69oHLeuydWizxaek28VHjfvJc1qjuuqay79aXnPGtRzzzVvou8t7C7OrnjLTlLcVA8blLGu5EzvLwARda7blLGvKIKvrt9W0O9THV6vH76f7zyCV48yL3iu2kas7ttiOs8aLVFu1FzPj3raLM8coKFvJGYqTuM+6i8dx+GOgh+YD296M68ST5eOgWoB7sSSyA9mAMvu52cBTwIRJG8oaEmvMjsqryvEsQ738WaPGpNpTxygoW8dLmhvHiIHTzQkX88iV+fvP3e8Tq7ew08nZyFvCcrbb3YvwK97TY4PIb5ujvQW1q83sz3u+/OFz1dsWk89aVnvIGLAr3sMg68fMPjPIFgZDzwAQq7WaxIuoGLgrkBdB48xlChvOH4jLyBJhU8pqrxPIfHv7v63fq8KSg6vdtbjLsahKq8C7X8OjD4rLx3Vau8axcAvUGgZruMxQM976N5uzP5Izx6uw+9qRBWu3QeDzyXNSq81PAGPW1OHDx/xNq8HeoOvW1OnLzrZIm8kpzTPCpXgjwhVJ28NZGDO3bwPb2s2ye7Hu44vBZU67yz4T+7hyiDPGLp/LuYOdQ7paZHPF17RLyMmmW8Hx0BO3nCbLzmMCC9w0+qvIBcurxpf6A8e+6BvHRUtDwG4ta8fVtDvPY9x7zn/iQ9U3ALPYD3TDvTknY6F02OuiIiorxbDgM9HPFrPP1D3zwn8R296jVBPKaq8TuurVY7KPXHPLOrmjx1vUu8eYxHPH/EWjwwLtI8kC8SvEx1ejw0XhE8yh+dujto0zwR4gi94JMfPT7ON7ymqvE8XbHpPE528Ty546282JRkPByMfjw0/U09xFd+vJrRM7tFOb080CGLPKl1Q70kKva86GOSPOc0SjulcCK8RgMYPDvJFrrkzuW8Ps63vCgkkDwWGhy9mJ5BO1qwcjwvZPc8DRe3vIz7qLyKme48/g26PBjsSjq5rQg82PWnuofHP7ww9AK6EFJ9PPg6lLyaNiG8uR39vBlV4rwEdZW7ogq+PCqR0bw2lS2962gzPZ2cBT2abMa8brezNy3zi7xfeJG9J/EdvBeDMzuAXDq9/d5xPN9grTshVB29ylnsui0tW7o1kYM81fQwPMDpxby54y08"
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 9,
"total_tokens": 9
}
}
headers:
CF-RAY:
- 939c1836de294a26-NRT
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 03 May 2025 01:48:10 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '8414'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '82'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-698696864c-zvnz4
x-envoy-upstream-service-time:
- '52'
x-ratelimit-limit-requests:
- '5000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '4999'
x-ratelimit-remaining-tokens:
- '4999987'
x-ratelimit-reset-requests:
- 12ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_f9b3fad2c1ee8d52c777edfa84b4cfff
status:
code: 200
message: OK
version: 1
test_embeddings_with_not_given_values.yaml 0000664 0000000 0000000 00000025427 15270700723 0047625 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "This is a test for embeddings with encoding format",
"model": "text-embedding-3-small",
"encoding_format": "base64"
}
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
authorization:
- Bearer test_openai_api_key
connection:
- keep-alive
content-length:
- '127'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.109.1
x-stainless-arch:
- x64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.109.1
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.10.12
method: POST
uri: https://api.openai.com/v1/embeddings
response:
body:
string: |-
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": "DK6fO8qEirxr7OE8SQSPvXpWIry659e8mJ5BPUKZiTxZdqM76WvmPDaVLT0xwge86TEXvU+lObzFhka8XkUfvNgvd7yb1d08OC0NuzMvyTshVB07MPgsvc7umDzYWhU9SjeBPBQdz7wB2Yu8gYuCPbZ9ST1078a8c4rZvDwyrrxnsRs8BRj8vNv2nrz3bA88HFZZvMXnCT2xSeC8Pp/vOuVimzyN/1K8kc5OvXAk9bvH6AA8UgsePWdMrrxvgQ69+Z8BvEE0HD2w4Ei9FbEEPUY9Zzyd0qq7ZbROvA6Azjx0Ho+8vbKpPITGyLsC3bW7mAMvPTXHKL3QIYu6mNRmvNYnozx078a6l295vQyuHz1frra6bYhrvP/bPj1O17Q8KCSQvJKcUzzXjBA9m9XduwBFVrwJSDs7RTk9vSS6gb2m2Tm8UXfoPL+6/bxyggW9mnDwOxBS/Tx6u4+94JMfvIIqv7xvgQ69/d7xvH1XGb08lxu9H7y9vBvtwTtOdnG8G1IvvJU4Xb06ZCm7+NUmPJg5VLzP8kI8y4i0u35fbbta2xC6arKSvGUVkjwU56m7Y0eNvT7ON7xc3Ae9C39Xu5drT7w4yJ88kmKEPVtEKLwLf1c86ZYEvdP3Y7ujDug7jf/SvHuJFLxWED89LyqovB2FIb1i6fy8IbkKulupFb0O5bu8UXdovOqaLrzeXIO8XNwHPRAYLj36o6u9gYsCvQjfo72zRi083S07vbmCaj1KbaY6oWsBvfaeCjz9Q1+8PgTdvKtHcjwVUMG9qqQLPQhEkTwW7308dLkhvAJ88jtoUFi9v+UbPGIUG73BHDi9H/LivEI4xrypEFY9MWHEu2N9MjmyQgM9NQF4PDsuhDrC6jy7kwFBvBfoID0tLds6o9QYvRVMF7x3VSu8PcqNvPM4przCu/S5kmIEvfVvwjqrqLW892yPvZJiBDvwAQq9mDnUvBAYLj3/2z68HBwKPCMmzLyLMU49mNRmPCGKwjycaRM9wuo8uwJCo7ypENY8r9yePQbiVjvgyUQ8cOolvXIhQj0B2Qu9CRIWPbkd/bzvCGe8tBAIPYTGyLxgsuA8Bd6sPFrbEL1BNBy9RzYKvdPBvrxkSze8e172PKPUmLzAGA48OMgfO3ZRgTv3ByI9fiUevYWQI7xS3FU8izHOvIbDlbyxSeA8nAhQPZg51DyuDpq9KvIUvAt/17zHuTi93sx3PUc2iryjOQa77GzdvNHvjztJo0s8HByKPE3TCrzGVEs7xFf+uyW+q7zT9+M8c+scvVDUAbqHYlI9nAhQu2AXTrx+X+08aRqzO/k+Pr31CtU8dO9GOuEy3DyS/ZY8W6kVvP48Ar1MP9W8c1AKve5pqrymqnE9YnmIPO02uDc6ms66l9C8PAKnkLya0bO6ptWPPFUMlbxMBYY8z1ewO0ptJrqD+EO9c8B+O0nZ8LzellI8L4+VPFWnJ70zL0k9oaGmvCpXgrz0axi7KvKUPK6pLL0xwoe9DuW7O43JLT3C5pK89j3HN052cbxbDgO8saojvfY5HTuoRnu7UXdovQJCIz3uaao8JLoBvbkdfTwTtDc80/fjO7GqIz3rZIm8XHcaPUQ1kzvLUg89FB1PPSj1R71rh/Q8ljGAvSW+Kz1XeVY9GVXiujsDZryx5HI8n2oKu51x5zw4Z1y9MPgsvDD4rDyrR3K8njtCPNBb2rpu7Vi8AnzyOeH8Nj1SQUO9kv2WPH28Bj0Ae/u8XqqMPPrdertGA5g8cyXsvPXULz20Slc9RTm9u6Q9sLwyKx+8RDUTvQwTjTyvd7E7qj+evOkG+bwQs8C8ogo+PWvs4TzIhz29TnJHPeaVjTvb9h49rq3WPBVMl7x7iZS7OfsRvGrot7xPQMw8/QmQPW+BDr0PFIQ8sniovEmjy7yqpAu9OAJvPKaq8bu24ja8Q6HdPIstpDx2wfW8DK4fvf1DXzw3/sQ8tXkfvI4yxbzChc872L+CvJ0MejsNfKS8eIgdOkOdMzmOkwg9IbkKPbewOz1WEL88M5Q2vYbDFb371h29BagHPA4b4Twbt5w8AQ8xPKcIgrxWdSw5h5h3PIpjSbq85KS86ALPvEai1DwvYE09SaPLPIJZB72xD5G6ua2IvGJOarxREnu9jpOIPN3IzbyhBhS7Qc8uPWVPYT2V/g086WvmPBGBRbxmfqm8Hx2BvO1lAD3S87m862SJPAp7LTveMWW56WvmvJloHDyuSOk8V3lWvFupFb3q/5u9WrDyO7lIm7x6VqK8CBlzPQsaarzP8kI7gYuCvRkbE71+igu8aOtqu1cU6TsVTJe8EeYyvfOdEz1iTuo8OMgfvDyXm7vTIgI8wksAPcK79LyhPDm9nXFnvJPLG72SnNO7xecJPQB7+zr3QfG8o3NVvKmraL0A4Oi8fI0+vYKPrDzwAQq9ecJsvLmCajy3FSk9KvKUvC33tTuhBpS91CYsvY4yxTzFvGs9e4mUvOJhJL02lS28EFL9PIHBJ7xhSsC8V3lWPSSPY7uP/B88b4GOPDP5o7yyQoM8oDgPvJdrz7zT9+O87mmqu+T5A73tZQC9gfv2uuZq77xzUAo+VnWsvE48Ir0yKx89HriTu6M5Br3vMwW8H1dQvWCyYLwVTBc8x1j1vJPLm7yBi4K8ZuMWPZ0M+ryMmmW8+zuLPFfewzxOoY8842n4PFQ+kDxAZhe9MV2avAcVybyY1OY7jJrlPIdi0rwB2Qu9iv5bPD83zzt/xNo7yoQKvSosZD1g4Si9DhvhvMa1jjy5fsC8zb9QvFZ1rLxFOb07ExmlPNVZnrzA6cW9CH7gvJeal7wYUbi8jf9SvGgWCT3YlGQ7aIZ9u6zbJ7zZ+dG7wYGlPDJlbjyOMkW8ukzFPO8IZ7wCfPI8MC5SvCAhq7t1vcs84saRPB3qjrnWwrW8CnutPPY5nTpjfbK8elaiPPgLTL3QvJ08FB3PPK2lAj1GPWe8O8kWvePKOztiTmo8c1CKPGKzVz3dkig9wOlFvTpkKT2mD986TAkwvIrINj0W7/28eyQnvYT87brnmTc8mnBwO4GLAr371h08KixkvKVwojyMmuW8A+HfO9sw7rtBNBw8xFd+PDb6GjxREvu86WvmOwbi1jw+BF28tn1JvHBPkzlOcsc80/djPNSLmbtmGTy9brezOw+vFjw+BN08CneDvNhaFb3mlQ09NGK7PDf+xDyKme68HFbZPLUUMjw3YzI9mDnUvC33NT2oRvs8O574uiGO7Lsjhw+8723UvPaeirsCeMg801zRuxyM/jvdkig7EkugPBbv/bugct47D6+WvGJO6rsGER88C39XO/pC6Dybnzg7VUK6O/M4pjwlIxk8CH5gvCGKwjsKdwM9SQQPvf1D37yH/eS7toHzvJ4FHbysrN88KcNMvSMmzLv3QfG42fnRPLQQiDxInyG7+AvMvBKwjTtyIUK8pabHu+DJRLyCj6w88qTwvOT5AzyF9ZC8bekuPHZRAb16u4+8wksAvKBy3rjHgxO9TAWGvKOp+jmuSGk6Ov+7vO02uDu5SJs8l5qXvZxpEzzqNcG8CnstPKM5hrwMSTK7zb9QPKHXS71GotQ8jJY7vexs3bxDZ447wksAvJX+Dby5HX28JPAmPEZohbwX6KC8RZqAPKaq8Tv/QCw9nZyFvC/FOruLLaS70e8Pvd3IzbwI36M8+t36uzZfiDzEHS89RAbLPPMCATymD187ak0lOyYnQzt3HwY9gSYVu64OGr3ezPe5PQAzvdkoGrzezPc8YrPXPH6KC7yWMYA7850TvP+lmTySYoQ8ZRWSPOtos7zn/qQ8Rj1nu7mtCLxm4xY8fI2+vFGiBrzO7pi776N5OmgWibyV02+8BRh8unwoUTv3ojS9st2VvFILHjydnIU8lzWqu1faGby651c8Oy4EPNJYJ7wO5Tu76wPGvC8qKLylcKK6o9hCO/nZUDwRHFg83vcVvaejFD0GER89JIs5vHmMRzwXg7O8gWBkvIBYEDzkM1O8tErXu4JZh7y3sLu8PzMlPePKO7y85KQ6H431PBNT9DuEJww9KFq1OfM8UDxfrja7c4rZO0TQpbwFfem7H/JiPKYP3zxxU707qEb7u1d51rt8KFE8FlRrPaBy3rzvo/m8gFiQPLewO73k+QM9K1ssPFytPzxQ1AE8wrv0vNLzObyRzk48NstSvBdNjjyUNDO8vB50vc2FAb01x6g79wciPe0Ak7vVWR48CnstvCos5LwJrai99weivIuSkTxcTPy80YoiPMlRmDy0gPy7Ca0oPNVZnrxasPI89NCFO1JBw7w7A+a4ntbUvHhdfzzRiqK8d1UrPbdLzrxUE/K8rq1WPMGBJbyNLhs85ceIPSfxnTye1lS9axuquVES+7uuc4e8QTQcvGNHDTuzq5q8F02OvCG5irwD4V88hl6oPOH8trycaRO8kv2WO4L0GT1/xFq6QwKhPGJO6rwJ4828GfB0vFN0NT01LJa7c8D+O4zFA7wCp5A83CkRvW2IazrkM1M5o6n6uI1kwLy5gmo83S07Pdn5UTy5Hf27WRE2vGsXAD3kmMC88qTwPA9KqTtUPpC7MmVuPA6287sl9FC8/UPfPBO0t7x+igu9mnBwPKULNbvuaSo9q0fyO2fnQL2ZzYm8p6MUPWnkDT3Zw6w6Z+dAPbBFNj0ovyI9rHa6uhYanDz3pl68x4OTO5X+jbxJo0u9v0oJvdkomrtAO3k8MWHEvIQnjLwuXKM8H411uBmAgLxOdnE8njtCveGXybo1kYO8yh8dPSOHjzz93nG8OGfcvKgMLL1n50C8RmgFPC2SyDzellK6dFS0OhJPyjsZVWI8MWHEO5pwcLxmfim9/QkQvEo3AbzEghw9G+1BPHcfBrtDPHC8BNqCPdbCtTxREvu88aBGvXAkdTqYA687v+UbOuGXyby8SZI8URJ7vAEPMT3szSC89p6KvQPh3zyWZ6U8uHqWu9z6SDy05Wm9IvPZu/UKVTzdyM28pnTMvHMl7LvH6IC8zfV1PLOrGr2/H+s8sniou5X+Db25fkC8dYemPGIUm7wTtDe8LfOLPAkSlrzeXIO7v0oJPOtoszwtksg80r0UOgp7LTyabMa87NFKvAsa6jxBoGa8IIaYvB8dAT1aFeC8tID8uxhROL2pq2g8wuq8O1gNDLtOdvE8jPuoPBSCvDuSYoQ8elaiPF9N8zrAsyA9qavoPEbYebqcCFA825XbORu3HD2eoC87xYZGvYb5Oru7Gso8J5DavG5SxjyBJpU78m5LPIn6sTuBxdG8bIAXu/emXjya0TM7oaGmvPemXj3S87k7GbrPO95cg7wtksi8tRQyu+zNoDzTIoI8Ov+7vInEjDxnTC482cMsPD6f7zwghpg7v0oJvf3ecTyPNm+9QaBmvEBmlzwB2Ys8WA2MuhtSrzyxSeC8KPXHu1Z1LDykoh08LyooPTJlbrzxzw47nQx6O/vWHb1I1UY7MsaxPEo3Ab1LOys8PcoNPGJO6rzcxCO9VD4QPQtFiLxX3kM87NFKOwh+YDySN+a8A+FfuiqRUbz52VC7KFo1PfRrGDz1b8I8+m0GPGuH9LvgLrK7LyoovSfGfzzGtQ48IIaYvGYZPLy6sTI9rkhpO0w/1TplsKQ8kpzTPAbiVr0Ae3s7aBYJPEo3gbzZ+dG8VnGCvE48IjxeSck88zxQPXOKWTuD+EO71vhau0KZCTuuSGm8a+xhPDqaTj0ZVWI7txWpvNb4Wrx5J9o8WrDyulfewzxjRw297ZulvH+ONTypq2g8QGYXO/pthryvQYy7fMNjvJrRs7xPpTm6WtsQPci94ruE/O28xeuzPKYP3ztiTuo8Qc8uvCS6gTwLGmq8cIU4vBVMlzzoY5I8Pp/vvOH4DL2AWBC8PzOluTWRAzzvo/k8ybYFvKM5Bj3eMeU76v8bOyS6gbxxUz27786Xu6mr6LwE2gK8SzsrvD2bxTzZw6w6nGmTPFLcVT0TU3S8EbfqPIRh2zxmGTw88aBGvJ9qCrsyKx+8j2ENvbDgSDqbOku8IiIivMKFT722gXO8bSP+u/ShvTypdcO8Sm0mO4X1kLyv3B48l295O/TQBT0vKig8YxjFOzbLUj0TfpK8HSA0vKgMLDzlxwg8c4pZu70Xl7zraLM8ptk5vbQQiLyxD5G5hZAjPd4xZbvellK8kpzTPHdVqzw2X4i8rECVvFtEKDxwJHU6zSCUO3G4KrvrZIm6bYhrPD83T7xVQrq7eL7CvEABqjxfE6Q8EFL9PNz6yLzblds8ntZUOQtFCDxUPpA83jFlPP7XFL34OhQ9OfsRu4qZbrytpYK8RZqAvFeve7sST0q8ST7evGexG7yacHC7F4Mzvd0tuzxkSzc8+qfVOgu1/DzI7Cq9CH7gO1gNDD3qmi69723Uuo4yRTyxqiM9qRBWvNP34zwZgAA9mWicvB/y4jyHYlK81pPturJCg7veMWU8wBiOPDPKWz36p9U8UXfoPKbVj7ydcee8iv7bN80glDyeBZ08lgI4vMAYDr37Ows9BhGfvGqDSjpqTaU72JRkPZnNCbxi6fw7SzsrPNEltbxmfqk86pouPaQHC7uY/4S8X01zO8jsqjrvbdS7+HA5vB0gtDuAXLq8ciFCPTRekTtg4ag8LyooPGGrA72VOF09imPJO6DTIbwhVJ29hGFbO4HF0Tv1CtU8CxrqO4X1ELxs5YQ8cLSAunwo0bw0XhE9+DqUvGCy4Drb9p485JjAvDpkqbsvYE08TW4dPWKvrbwHerY88QW0vBm2Jby1FDI7/jwCO9BbWrxV3Uw9XbFpvI3/Uru35uA7cbgqPRvtQTr2PUc8CRIWvRxW2Tsqx/Y8nQz6OwYRnzxk5sk8ISl/POEyXD0PSqm63yqIu/RrmLjTXFG9h2JSO3UiObyhawG9hfWQvJLS+DxJPt48v0qJPFF3aDzqNUE8jcmtPFtEqLzWXci7Y+Ifu9wpkbzun888MPisux5TJjwCfPI8gcGnvJbMEjuhBpQ8P5iSPEBml7sZ8PQ8e7+5PIz7qLwBdB69ee0KPOlr5jzOJD69oHLeuydWizxaek28VHjfvJc1qjuuqay79aXnPGtRzzzVvou8t7C7OrnjLTlLcVA8blLGu5EzvLwARda7blLGvKIKvrt9W0O9THV6vH76f7zyCV48yL3iu2kas7ttiOs8aLVFu1FzPj3raLM8coKFvJGYqTuM+6i8dx+GOgh+YD296M68ST5eOgWoB7sSSyA9mAMvu52cBTwIRJG8oaEmvMjsqryvEsQ738WaPGpNpTxygoW8dLmhvHiIHTzQkX88iV+fvP3e8Tq7ew08nZyFvCcrbb3YvwK97TY4PIb5ujvQW1q83sz3u+/OFz1dsWk89aVnvIGLAr3sMg68fMPjPIFgZDzwAQq7WaxIuoGLgrkBdB48xlChvOH4jLyBJhU8pqrxPIfHv7v63fq8KSg6vdtbjLsahKq8C7X8OjD4rLx3Vau8axcAvUGgZruMxQM976N5uzP5Izx6uw+9qRBWu3QeDzyXNSq81PAGPW1OHDx/xNq8HeoOvW1OnLzrZIm8kpzTPCpXgjwhVJ28NZGDO3bwPb2s2ye7Hu44vBZU67yz4T+7hyiDPGLp/LuYOdQ7paZHPF17RLyMmmW8Hx0BO3nCbLzmMCC9w0+qvIBcurxpf6A8e+6BvHRUtDwG4ta8fVtDvPY9x7zn/iQ9U3ALPYD3TDvTknY6F02OuiIiorxbDgM9HPFrPP1D3zwn8R296jVBPKaq8TuurVY7KPXHPLOrmjx1vUu8eYxHPH/EWjwwLtI8kC8SvEx1ejw0XhE8yh+dujto0zwR4gi94JMfPT7ON7ymqvE8XbHpPE528Ty546282JRkPByMfjw0/U09xFd+vJrRM7tFOb080CGLPKl1Q70kKva86GOSPOc0SjulcCK8RgMYPDvJFrrkzuW8Ps63vCgkkDwWGhy9mJ5BO1qwcjwvZPc8DRe3vIz7qLyKme48/g26PBjsSjq5rQg82PWnuofHP7ww9AK6EFJ9PPg6lLyaNiG8uR39vBlV4rwEdZW7ogq+PCqR0bw2lS2962gzPZ2cBT2abMa8brezNy3zi7xfeJG9J/EdvBeDMzuAXDq9/d5xPN9grTshVB29ylnsui0tW7o1kYM81fQwPMDpxby54y08"
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 9,
"total_tokens": 9
}
}
headers:
CF-RAY:
- 99ac1f2bcf0c5a01-MXP
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Fri, 07 Nov 2025 10:24:35 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-allow-origin:
- '*'
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '8414'
openai-model:
- text-embedding-3-small
openai-organization: test_openai_org_id
openai-processing-ms:
- '90'
openai-project:
- proj_Pf1eM5R55Z35wBy4rt8PxAGq
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- envoy-router-545c575f45-dndxq
x-envoy-upstream-service-time:
- '307'
x-openai-proxy-wasm:
- v0.1
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '5000000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '4999988'
x-ratelimit-reset-requests:
- 6ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_8c7cc42f2a184e4cbf905a2f3830b7ca
status:
code: 200
message: OK
version: 1
test_responses_create_aggregates_cache_tokens[content_mode0].yaml 0000664 0000000 0000000 00000011071 15270700723 0054242 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "Say this is a test",
"instructions": "You are a helpful assistant.",
"model": "gpt-4o-mini"
}
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '103'
Content-Type:
- application/json
Host:
- api.openai.com
User-Agent:
- OpenAI/Python 1.109.1
X-Stainless-Arch:
- arm64
X-Stainless-Async:
- 'false'
X-Stainless-Lang:
- python
X-Stainless-OS:
- MacOS
X-Stainless-Package-Version:
- 1.109.1
X-Stainless-Runtime:
- CPython
X-Stainless-Runtime-Version:
- 3.12.12
authorization:
- Bearer test_openai_api_key
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
method: POST
uri: https://api.openai.com/v1/responses
response:
body:
string: |-
{
"id": "resp_0a8171a24e10956f0069e2f3f03a4c819da6eca7c5d387a3b8",
"object": "response",
"created_at": 1776481264,
"status": "completed",
"background": false,
"billing": {
"payer": "developer"
},
"completed_at": 1776481265,
"error": null,
"frequency_penalty": 0.0,
"incomplete_details": null,
"instructions": "You are a helpful assistant.",
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-4o-mini-2024-07-18",
"output": [
{
"id": "msg_0a8171a24e10956f0069e2f3f0f640819d9b572b43c703a798",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "This is a test."
}
],
"role": "assistant"
}
],
"parallel_tool_calls": true,
"presence_penalty": 0.0,
"previous_response_id": null,
"prompt_cache_key": null,
"prompt_cache_retention": "in_memory",
"reasoning": {
"effort": null,
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"top_logprobs": 0,
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 22,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 6,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 28
},
"user": null,
"metadata": {}
}
headers:
CF-RAY:
- 9ee06c3d2ae3f2f9-EWR
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 18 Apr 2026 03:01:05 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '1575'
openai-organization: test_openai_org_id
openai-processing-ms:
- '917'
openai-project:
- proj_s74VWObPgWXRchv2sHdrOTPY
openai-version:
- '2020-10-01'
set-cookie:
- __cf_bm=nawHaNe2Gcjnf3PnJWOe7eCMcuL4GfmHJjNVPemFYOE-1776481264.1903315-1.0.1.1-cmimAw8su.1UpRhI8dWFr6DhgPw2Z2sJi8cKNV_tHFMFijmHK3ND45DjgKsf_ur_EZexZIAN.O__1bqzwnC_acPUsfxzivCaUIWeL1ThD2hWwU2mRBTfDdUDbR04KBsW;
HttpOnly; Secure; Path=/; Domain=api.openai.com; Expires=Sat, 18 Apr 2026
03:31:05 GMT
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9996'
x-ratelimit-remaining-tokens:
- '199959'
x-ratelimit-reset-requests:
- 34.066s
x-ratelimit-reset-tokens:
- 12ms
x-request-id:
- req_07ac89c9040840a6be685694eacd3288
status:
code: 200
message: OK
version: 1
test_responses_create_api_error[content_mode0].yaml 0000664 0000000 0000000 00000004524 15270700723 0051412 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "Hello",
"model": "this-model-does-not-exist"
}
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '56'
Content-Type:
- application/json
Host:
- api.openai.com
User-Agent:
- OpenAI/Python 1.109.1
X-Stainless-Arch:
- arm64
X-Stainless-Async:
- 'false'
X-Stainless-Lang:
- python
X-Stainless-OS:
- MacOS
X-Stainless-Package-Version:
- 1.109.1
X-Stainless-Runtime:
- CPython
X-Stainless-Runtime-Version:
- 3.12.12
authorization:
- Bearer test_openai_api_key
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
method: POST
uri: https://api.openai.com/v1/responses
response:
body:
string: |-
{
"error": {
"message": "The requested model 'this-model-does-not-exist' does not exist.",
"type": "invalid_request_error",
"param": "model",
"code": "model_not_found"
}
}
headers:
CF-RAY:
- 9ee06c562f5c0f7d-EWR
Connection:
- keep-alive
Content-Length:
- '191'
Content-Type:
- application/json
Date:
- Sat, 18 Apr 2026 03:01:08 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
X-Content-Type-Options:
- nosniff
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
openai-organization: test_openai_org_id
openai-processing-ms:
- '107'
openai-project:
- proj_s74VWObPgWXRchv2sHdrOTPY
openai-version:
- '2020-10-01'
set-cookie:
- __cf_bm=sImUBrv0bwxemWtgUZK8rUGOArohh1idXm1s6ve.9PM-1776481268.1848395-1.0.1.1-wfALia92HJtSuU5STTxRZGW0Cd1tZtPVOpbKTSFoiJLjLOcwVrsTA4C4j2yaYyhAqXvYCG9Ns.EIIhy5ZQv_PNuB11_p2HjTGRNJGtclgs_deByUIWyOSuE2JuY9zxD.;
HttpOnly; Secure; Path=/; Domain=api.openai.com; Expires=Sat, 18 Apr 2026
03:31:08 GMT
x-request-id:
- req_48f6dc739d654972b34e069edb97d2dc
status:
code: 400
message: Bad Request
version: 1
test_responses_create_basic[content_mode0].yaml 0000664 0000000 0000000 00000011120 15270700723 0050477 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "Say this is a test",
"instructions": "You are a helpful assistant.",
"model": "gpt-4o-mini",
"stream": false
}
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '120'
Content-Type:
- application/json
Host:
- api.openai.com
User-Agent:
- OpenAI/Python 1.109.1
X-Stainless-Arch:
- arm64
X-Stainless-Async:
- 'false'
X-Stainless-Lang:
- python
X-Stainless-OS:
- MacOS
X-Stainless-Package-Version:
- 1.109.1
X-Stainless-Runtime:
- CPython
X-Stainless-Runtime-Version:
- 3.12.12
authorization:
- Bearer test_openai_api_key
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
method: POST
uri: https://api.openai.com/v1/responses
response:
body:
string: |-
{
"id": "resp_0f4faba17dcd0f1e0069e2f3e4907881909179832ba1237025",
"object": "response",
"created_at": 1776481253,
"status": "completed",
"background": false,
"billing": {
"payer": "developer"
},
"completed_at": 1776481257,
"error": null,
"frequency_penalty": 0.0,
"incomplete_details": null,
"instructions": "You are a helpful assistant.",
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-4o-mini-2024-07-18",
"output": [
{
"id": "msg_0f4faba17dcd0f1e0069e2f3e7b2b88190bff23981628ac362",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "This is a test."
}
],
"role": "assistant"
}
],
"parallel_tool_calls": true,
"presence_penalty": 0.0,
"previous_response_id": null,
"prompt_cache_key": null,
"prompt_cache_retention": "in_memory",
"reasoning": {
"effort": null,
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"top_logprobs": 0,
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 22,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 6,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 28
},
"user": null,
"metadata": {}
}
headers:
CF-RAY:
- 9ee06be8ab20d481-EWR
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 18 Apr 2026 03:00:58 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '1575'
openai-organization: test_openai_org_id
openai-processing-ms:
- '7177'
openai-project:
- proj_s74VWObPgWXRchv2sHdrOTPY
openai-version:
- '2020-10-01'
set-cookie:
- __cf_bm=ckwOJyTtv0EpPspvwSIW3P1dXrhIU1GtdL9BNBJlNbA-1776481250.670554-1.0.1.1-7j2fYPA6kw.SMgF3tYMODcA6O.P9Xwu6N6jolKR9OG0AJczT7a1Jr5HlRnJ6T.tXJ5HYV_jtosjzUCBM1yHZTiRTwGTtu6Klyq1ldSG5hFV4MRK9StK_zmCKjmIbqO9d;
HttpOnly; Secure; Path=/; Domain=api.openai.com; Expires=Sat, 18 Apr 2026
03:30:58 GMT
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '199958'
x-ratelimit-reset-requests:
- 8.64s
x-ratelimit-reset-tokens:
- 12ms
x-request-id:
- req_d6009916bd4447188ce5baaea187709b
status:
code: 200
message: OK
version: 1
test_responses_create_captures_content[content_mode0].yaml 0000664 0000000 0000000 00000011314 15270700723 0053003 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "Say this is a test",
"instructions": "You are a helpful assistant.",
"model": "gpt-4o-mini",
"stream": false,
"text": {
"format": {
"type": "text"
}
}
}
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '158'
Content-Type:
- application/json
Host:
- api.openai.com
User-Agent:
- OpenAI/Python 1.109.1
X-Stainless-Arch:
- arm64
X-Stainless-Async:
- 'false'
X-Stainless-Lang:
- python
X-Stainless-OS:
- MacOS
X-Stainless-Package-Version:
- 1.109.1
X-Stainless-Runtime:
- CPython
X-Stainless-Runtime-Version:
- 3.12.12
authorization:
- Bearer test_openai_api_key
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
method: POST
uri: https://api.openai.com/v1/responses
response:
body:
string: |-
{
"id": "resp_0d6d73520bd9405c0069e2f3eb1108819590a9e98dba6a746d",
"object": "response",
"created_at": 1776481259,
"status": "completed",
"background": false,
"billing": {
"payer": "developer"
},
"completed_at": 1776481260,
"error": null,
"frequency_penalty": 0.0,
"incomplete_details": null,
"instructions": "You are a helpful assistant.",
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-4o-mini-2024-07-18",
"output": [
{
"id": "msg_0d6d73520bd9405c0069e2f3eba7f081958368e178f0078326",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "This is a test. How can I assist you further?"
}
],
"role": "assistant"
}
],
"parallel_tool_calls": true,
"presence_penalty": 0.0,
"previous_response_id": null,
"prompt_cache_key": null,
"prompt_cache_retention": "in_memory",
"reasoning": {
"effort": null,
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"top_logprobs": 0,
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 22,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 13,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 35
},
"user": null,
"metadata": {}
}
headers:
CF-RAY:
- 9ee06c1ccc4b0f93-EWR
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 18 Apr 2026 03:01:00 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '1606'
openai-organization: test_openai_org_id
openai-processing-ms:
- '1097'
openai-project:
- proj_s74VWObPgWXRchv2sHdrOTPY
openai-version:
- '2020-10-01'
set-cookie:
- __cf_bm=eRjb5xrZMpFJHlBLeAzQEHihWjr.Mb5bNSgOGzGSnwA-1776481259.0045145-1.0.1.1-fAERlGPpEWHNuG0MiIcvmzII8t4Xj7yC_HgjLktqdKXPJmbHLtPtT_beeOd8sCcZVQYjGOH0QcF0w4Hz9S.t29trpZuNiezPTQNuyMSy51F2kKYkypy9Eromd2kQp9Cj;
HttpOnly; Secure; Path=/; Domain=api.openai.com; Expires=Sat, 18 Apr 2026
03:31:00 GMT
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9998'
x-ratelimit-remaining-tokens:
- '199958'
x-ratelimit-reset-requests:
- 13.065s
x-ratelimit-reset-tokens:
- 12ms
x-request-id:
- req_9191bbf984a54a3281f8f335b87e7aeb
status:
code: 200
message: OK
version: 1
test_responses_create_captures_tool_call_content[content_mode0].yaml 0000664 0000000 0000000 00000013505 15270700723 0055037 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "What's the weather in Seattle right now?",
"model": "gpt-4o-mini",
"tool_choice": {
"type": "function",
"name": "get_current_weather"
},
"tools": [
{
"type": "function",
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. Boston, MA"
}
},
"required": [
"location"
],
"additionalProperties": false
},
"strict": true
}
]
}
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '480'
Content-Type:
- application/json
Host:
- api.openai.com
User-Agent:
- OpenAI/Python 1.109.1
X-Stainless-Arch:
- arm64
X-Stainless-Async:
- 'false'
X-Stainless-Lang:
- python
X-Stainless-OS:
- MacOS
X-Stainless-Package-Version:
- 1.109.1
X-Stainless-Runtime:
- CPython
X-Stainless-Runtime-Version:
- 3.12.12
authorization:
- Bearer test_openai_api_key
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
method: POST
uri: https://api.openai.com/v1/responses
response:
body:
string: |-
{
"id": "resp_0bedf6e1ffba28050069e2f401ae1c8196be360fd5993c96de",
"object": "response",
"created_at": 1776481281,
"status": "completed",
"background": false,
"billing": {
"payer": "developer"
},
"completed_at": 1776481282,
"error": null,
"frequency_penalty": 0.0,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-4o-mini-2024-07-18",
"output": [
{
"id": "fc_0bedf6e1ffba28050069e2f402203c8196b45065342d00ed17",
"type": "function_call",
"status": "completed",
"arguments": "{\"location\":\"Seattle, WA\"}",
"call_id": "call_90uO5LcGP5vTBTCrjyhYtWsA",
"name": "get_current_weather"
}
],
"parallel_tool_calls": true,
"presence_penalty": 0.0,
"previous_response_id": null,
"prompt_cache_key": null,
"prompt_cache_retention": "in_memory",
"reasoning": {
"effort": null,
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": {
"type": "function",
"name": "get_current_weather"
},
"tools": [
{
"type": "function",
"description": "Get the current weather in a given location",
"name": "get_current_weather",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. Boston, MA"
}
},
"required": [
"location"
],
"additionalProperties": false
},
"strict": true
}
],
"top_logprobs": 0,
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 72,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 8,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 80
},
"user": null,
"metadata": {}
}
headers:
CF-RAY:
- 9ee06caa3d06c745-EWR
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 18 Apr 2026 03:01:22 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '2034'
openai-organization: test_openai_org_id
openai-processing-ms:
- '713'
openai-project:
- proj_s74VWObPgWXRchv2sHdrOTPY
openai-version:
- '2020-10-01'
set-cookie:
- __cf_bm=77TblxQ40FwSWcmbiooIxTpBbJWtYa4Sa8xnnuOb8P4-1776481281.6342883-1.0.1.1-wYyCi1iDQ3bB4g5c2Jj1pldvzLmLS9NtJ1ryP99rJkxwR77VRG3qXvTHSKzUAQk9LBvwdBumDx4dWSKvmBqXsb7K2O8zcH3uxfGFCw4SLKIaQIsDy2SGcb9JuoVZMe4r;
HttpOnly; Secure; Path=/; Domain=api.openai.com; Expires=Sat, 18 Apr 2026
03:31:22 GMT
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9987'
x-ratelimit-remaining-tokens:
- '199711'
x-ratelimit-reset-requests:
- 1m51.595s
x-ratelimit-reset-tokens:
- 86ms
x-request-id:
- req_66f20a8d196540e7928ba09ef1baad00
status:
code: 200
message: OK
version: 1
test_responses_create_event_only_no_content_in_span.yaml 0000664 0000000 0000000 00000011122 15270700723 0052570 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "Say this is a test",
"instructions": "You are a helpful assistant.",
"model": "gpt-4o-mini",
"stream": false
}
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '120'
Content-Type:
- application/json
Host:
- api.openai.com
User-Agent:
- OpenAI/Python 1.109.1
X-Stainless-Arch:
- arm64
X-Stainless-Async:
- 'false'
X-Stainless-Lang:
- python
X-Stainless-OS:
- MacOS
X-Stainless-Package-Version:
- 1.109.1
X-Stainless-Runtime:
- CPython
X-Stainless-Runtime-Version:
- 3.12.12
authorization:
- Bearer test_openai_api_key
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
method: POST
uri: https://api.openai.com/v1/responses
response:
body:
string: |-
{
"id": "resp_0da562f2b64fdb7e0069e2f40b28e081909487104de4d4c8c0",
"object": "response",
"created_at": 1776481291,
"status": "completed",
"background": false,
"billing": {
"payer": "developer"
},
"completed_at": 1776481291,
"error": null,
"frequency_penalty": 0.0,
"incomplete_details": null,
"instructions": "You are a helpful assistant.",
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-4o-mini-2024-07-18",
"output": [
{
"id": "msg_0da562f2b64fdb7e0069e2f40ba8bc8190a803f1b565d49c7c",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "This is a test."
}
],
"role": "assistant"
}
],
"parallel_tool_calls": true,
"presence_penalty": 0.0,
"previous_response_id": null,
"prompt_cache_key": null,
"prompt_cache_retention": "in_memory",
"reasoning": {
"effort": null,
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"top_logprobs": 0,
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 22,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 6,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 28
},
"user": null,
"metadata": {}
}
headers:
CF-RAY:
- 9ee06ce2aead41b2-EWR
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Sat, 18 Apr 2026 03:01:31 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '1575'
openai-organization: test_openai_org_id
openai-processing-ms:
- '698'
openai-project:
- proj_s74VWObPgWXRchv2sHdrOTPY
openai-version:
- '2020-10-01'
set-cookie:
- __cf_bm=5Y3wm6qm03P0G7_SigGuGob8rfE0X7eMfHOJDLR_E5o-1776481290.6632602-1.0.1.1-2QRz.JRmnCza_Xtkyqwgj1IPTwrSSA5LHyD9chhvKiCoHNE9_.I5_0qopgAV60mriRXdX99CCxozoio7VqvW.wnvklHzb6gwZDEsQCAlBqZGcIHrBfFk4jkvspj4sMO0;
HttpOnly; Secure; Path=/; Domain=api.openai.com; Expires=Sat, 18 Apr 2026
03:31:31 GMT
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '200000'
x-ratelimit-remaining-requests:
- '9985'
x-ratelimit-remaining-tokens:
- '199959'
x-ratelimit-reset-requests:
- 2m7.93s
x-ratelimit-reset-tokens:
- 12ms
x-request-id:
- req_76d5ef520a6b4d74975dae1ade822de9
status:
code: 200
message: OK
version: 1
test_responses_create_instrumentation_error_swallowed[content_mode0].yaml 0000664 0000000 0000000 00000020002 15270700723 0056152 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": "Say this is a test",
"instructions": "You are a helpful assistant.",
"model": "gpt-4o-mini",
"stream": true
}
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '119'
Content-Type:
- application/json
Host:
- api.openai.com
User-Agent:
- OpenAI/Python 1.109.1
X-Stainless-Arch:
- arm64
X-Stainless-Async:
- 'false'
X-Stainless-Lang:
- python
X-Stainless-OS:
- MacOS
X-Stainless-Package-Version:
- 1.109.1
X-Stainless-Runtime:
- CPython
X-Stainless-Runtime-Version:
- 3.12.12
authorization:
- Bearer test_openai_api_key
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
method: POST
uri: https://api.openai.com/v1/responses
response:
body:
string: |+
event: response.created
data: {"type":"response.created","response":{"id":"resp_052003e5c7cd2fe10069e2f400498c819f943227bcc94a63a6","object":"response","created_at":1776481280,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":0}
event: response.in_progress
data: {"type":"response.in_progress","response":{"id":"resp_052003e5c7cd2fe10069e2f400498c819f943227bcc94a63a6","object":"response","created_at":1776481280,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":1}
event: response.output_item.added
data: {"type":"response.output_item.added","item":{"id":"msg_052003e5c7cd2fe10069e2f400ec70819f90c4df2a4b73f05c","type":"message","status":"in_progress","content":[],"role":"assistant"},"output_index":0,"sequence_number":2}
event: response.content_part.added
data: {"type":"response.content_part.added","content_index":0,"item_id":"msg_052003e5c7cd2fe10069e2f400ec70819f90c4df2a4b73f05c","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""},"sequence_number":3}
event: response.output_text.delta
data: {"type":"response.output_text.delta","content_index":0,"delta":"This","item_id":"msg_052003e5c7cd2fe10069e2f400ec70819f90c4df2a4b73f05c","logprobs":[],"obfuscation":"hmEwhe4L8nm4","output_index":0,"sequence_number":4}
event: response.output_text.delta
data: {"type":"response.output_text.delta","content_index":0,"delta":" is","item_id":"msg_052003e5c7cd2fe10069e2f400ec70819f90c4df2a4b73f05c","logprobs":[],"obfuscation":"u3Q5kHUIahzcI","output_index":0,"sequence_number":5}
event: response.output_text.delta
data: {"type":"response.output_text.delta","content_index":0,"delta":" a","item_id":"msg_052003e5c7cd2fe10069e2f400ec70819f90c4df2a4b73f05c","logprobs":[],"obfuscation":"0ZnBkOCdgrlbIT","output_index":0,"sequence_number":6}
event: response.output_text.delta
data: {"type":"response.output_text.delta","content_index":0,"delta":" test","item_id":"msg_052003e5c7cd2fe10069e2f400ec70819f90c4df2a4b73f05c","logprobs":[],"obfuscation":"hYsQ5M0hWLs","output_index":0,"sequence_number":7}
event: response.output_text.delta
data: {"type":"response.output_text.delta","content_index":0,"delta":".","item_id":"msg_052003e5c7cd2fe10069e2f400ec70819f90c4df2a4b73f05c","logprobs":[],"obfuscation":"PyM68hgEwGGLkTN","output_index":0,"sequence_number":8}
event: response.output_text.done
data: {"type":"response.output_text.done","content_index":0,"item_id":"msg_052003e5c7cd2fe10069e2f400ec70819f90c4df2a4b73f05c","logprobs":[],"output_index":0,"sequence_number":9,"text":"This is a test."}
event: response.content_part.done
data: {"type":"response.content_part.done","content_index":0,"item_id":"msg_052003e5c7cd2fe10069e2f400ec70819f90c4df2a4b73f05c","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"This is a test."},"sequence_number":10}
event: response.output_item.done
data: {"type":"response.output_item.done","item":{"id":"msg_052003e5c7cd2fe10069e2f400ec70819f90c4df2a4b73f05c","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"This is a test."}],"role":"assistant"},"output_index":0,"sequence_number":11}
event: response.completed
data: {"type":"response.completed","response":{"id":"resp_052003e5c7cd2fe10069e2f400498c819f943227bcc94a63a6","object":"response","created_at":1776481280,"status":"completed","background":false,"completed_at":1776481280,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[{"id":"msg_052003e5c7cd2fe10069e2f400ec70819f90c4df2a4b73f05c","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"This is a test."}],"role":"assistant"}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":22,"input_tokens_details":{"cached_tokens":0},"output_tokens":6,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":28},"user":null,"metadata":{}},"sequence_number":12}
headers:
CF-RAY:
- 9ee06ca19ad7606a-EWR
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Sat, 18 Apr 2026 03:01:20 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
openai-organization: test_openai_org_id
openai-processing-ms:
- '51'
openai-project:
- proj_s74VWObPgWXRchv2sHdrOTPY
openai-version:
- '2020-10-01'
set-cookie:
- __cf_bm=zeme85udcp85MpYWX94kpho5aA4pRXRhhWbljEzlyKg-1776481280.2544615-1.0.1.1-DxHmuQ9bjw1.C_t_MZ23Az8WRay9CC2Wh0GbHPNN41zA5npmFYATDR2lI7uN061efp8b0vaq0viZms.aHHjkxiiNYFhewlDgEVLyFCa4F1mVx1iKbXQcmUJWbaXjFOtV;
HttpOnly; Secure; Path=/; Domain=api.openai.com; Expires=Sat, 18 Apr 2026
03:31:20 GMT
x-request-id:
- req_4e7549325e3f4abaa4ac13b74667292e
status:
code: 200
message: OK
version: 1
test_responses_create_reports_reasoning_tokens[content_mode0].yaml 0000664 0000000 0000000 00000013555 15270700723 0054562 0 ustar 00root root 0000000 0000000 opentelemetry-python-contrib-0.66b2/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes interactions:
- request:
body: |-
{
"input": [
{
"role": "user",
"content": "\nWrite a bash script that takes a matrix represented as a string with\nformat '[1,2],[3,4],[5,6]' and prints the transpose in the same format.\n"
}
],
"max_output_tokens": 300,
"model": "gpt-5.4",
"reasoning": {
"effort": "low"
}
}
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '267'
Content-Type:
- application/json
Host:
- api.openai.com
User-Agent:
- OpenAI/Python 1.109.1
X-Stainless-Arch:
- arm64
X-Stainless-Async:
- 'false'
X-Stainless-Lang:
- python
X-Stainless-OS:
- MacOS
X-Stainless-Package-Version:
- 1.109.1
X-Stainless-Runtime:
- CPython
X-Stainless-Runtime-Version:
- 3.12.12
authorization:
- Bearer test_openai_api_key
x-stainless-read-timeout:
- '30.0'
x-stainless-retry-count:
- '0'
method: POST
uri: https://api.openai.com/v1/responses
response:
body:
string: |-
{
"id": "resp_05177a4994c7df3a0069e2f402f00881a1b9eda520cb779fef",
"object": "response",
"created_at": 1776481282,
"status": "completed",
"background": false,
"billing": {
"payer": "developer"
},
"completed_at": 1776481288,
"error": null,
"frequency_penalty": 0.0,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": 300,
"max_tool_calls": null,
"model": "gpt-5.4-2026-03-05",
"output": [
{
"id": "rs_05177a4994c7df3a0069e2f403351c81a1ae31439661e8e976",
"type": "reasoning",
"summary": []
},
{
"id": "msg_05177a4994c7df3a0069e2f403633481a1a824dd7ecef75116",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "```bash\n#!/usr/bin/env bash\n\n# Usage:\n# ./transpose.sh '[1,2],[3,4],[5,6]'\n\ninput=\"$1\"\n\n# Extract rows into an array\nIFS='|' read -r -a rows <<< \"$(echo \"$input\" | sed 's/],\\[/]|[/g')\"\n\n# Remove leading/trailing brackets and split first row to get column count\nfirst_row=\"${rows[0]#[}\"\nfirst_row=\"${first_row%]}\"\nIFS=',' read -r -a first_vals <<< \"$first_row\"\ncols=\"${#first_vals[@]}\"\n\n# Build transpose\nresult=\"\"\nfor ((c=0; c