newrelic / newrelic-python-agent

New Relic Python Agent
https://docs.newrelic.com/docs/agents/python-agent
Apache License 2.0
176 stars 99 forks source link

Test embedding streaming openai v1 #1105

Closed hmstepanek closed 6 months ago

hmstepanek commented 6 months ago

Overview

Add early exit condition to not wrap embedding streaming in openai v1. It appears that streaming for embeddings isn't support in openai v0 though I'm keeping the early exit condition for that in place just in case.

Note no mocked response was added specifically for streamed embeddings. This is because the response in streamed vs unstreamed is the same format, it just sends the data in chunks instead of all at once. In other words: the non-streamed mock response will also work when mocking streaming mode.

github-actions[bot] commented 6 months ago

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON bandit 1 0 4.84s
✅ PYTHON black 3 0 0 1.18s
✅ PYTHON flake8 3 0 0.59s
✅ PYTHON isort 3 0 0 0.27s
✅ PYTHON pylint 3 0 4.23s

See detailed report in MegaLinter reports _Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff_

_MegaLinter is graciously provided by OX Security_