Open dsblank opened 1 month ago
Also, it might be related to the logger. It looks like if I reuse the logger, it keeps add the "openai" tag over and over.
Regarding the traceback, and looking at https://github.com/BerriAI/litellm/blob/main/litellm/integrations/opik/opik.py#L67-L74
It doesn't seem like this is a situation where we should show a traceback, but just info. I don't understand the consequences, but it seems everything works correctly if async periodic flushing is not enabled.
try:
asyncio.create_task(self.periodic_flush())
self.flush_lock = asyncio.Lock()
except Exception as e:
verbose_logger.exception(
f"OpikLogger - Asynchronous processing not initialized as we are not running in an async context {str(e)}"
)
self.flush_lock = None
Willingness to contribute
Yes. I can contribute a fix for this bug independently.
What component(s) are affected?
Opik version
Describe the problem
When I run the below code, the tag "openai" is repeated multiple times.
Above you can see two "openai". Sometimes it shows 15.
And two other items can be seen when running the code:
and:
But it appears to log everything.
Reproduction steps
Here is the stripped down code:
This shows the tag "openai" added from litellm integration twice. Sometimes it adds 15 or more.