-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]Unawaited Coroutine Warning in openinference: AsyncAPIResponse.parse #1134
Labels
Comments
Thanks @SiyuanQi. Do you have a code snippet to reproduce the issue? Or can you let us know which interface you are using when you hit the issue? |
axiomofjoy
added
needs information
and removed
triage
Issues that require triage
labels
Nov 25, 2024
Sure! Below is a code snippet that reproduces the issue: import os
import dotenv
import asyncio
from openai import AsyncClient
from phoenix.otel import register
from openinference.instrumentation.openai import OpenAIInstrumentor
dotenv.load_dotenv("../.env.local")
tracer_provider = register(
project_name="openinference-test",
endpoint=os.getenv("PHOENIX_COLLECTOR_ENDPOINT"),
)
OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)
async def run_tts():
client = AsyncClient(api_key=os.getenv("OPENAI_API_KEY"))
async with client.audio.speech.with_streaming_response.create(
input="Hello",
model="tts-1",
voice="alloy",
) as audio_stream:
async for data in audio_stream.iter_bytes():
pass
if __name__ == "__main__":
asyncio.run(run_tts()) |
Thanks @SiyuanQi, we'll take a look. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A RuntimeWarning is raised during the execution of the program, indicating that a coroutine was never awaited. Specifically, the error occurs in the file openinference/instrumentation/openai/_request.py at line 191. The warning message is:
RuntimeWarning: coroutine 'AsyncAPIResponse.parse' was never awaited.
Environment:
The text was updated successfully, but these errors were encountered: