forked from phoenix/litellm-mirror
fix(langsmith.py): fix langsmith quickstart
Fixes https://github.com/BerriAI/litellm/issues/6861
This commit is contained in:
parent
147dfa61b0
commit
b9585d2016
1 changed files with 5 additions and 1 deletions
|
@ -68,7 +68,11 @@ class LangsmithLogger(CustomBatchLogger):
|
||||||
if _batch_size:
|
if _batch_size:
|
||||||
self.batch_size = int(_batch_size)
|
self.batch_size = int(_batch_size)
|
||||||
self.log_queue: List[LangsmithQueueObject] = []
|
self.log_queue: List[LangsmithQueueObject] = []
|
||||||
asyncio.create_task(self.periodic_flush())
|
loop = asyncio.get_event_loop_policy().get_event_loop()
|
||||||
|
if not loop.is_running():
|
||||||
|
loop = asyncio.new_event_loop()
|
||||||
|
asyncio.set_event_loop(loop)
|
||||||
|
loop.create_task(self.periodic_flush())
|
||||||
self.flush_lock = asyncio.Lock()
|
self.flush_lock = asyncio.Lock()
|
||||||
|
|
||||||
super().__init__(**kwargs, flush_lock=self.flush_lock)
|
super().__init__(**kwargs, flush_lock=self.flush_lock)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue