Martin Bär
commited on
Commit
·
596707c
1
Parent(s):
615b507
Add sleep to avoid rate limits
Browse files- basic_agent.py +4 -0
basic_agent.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import os
|
2 |
import re
|
|
|
3 |
|
4 |
from tavily import AsyncTavilyClient
|
5 |
from llama_index.core.tools import FunctionTool
|
@@ -179,6 +180,9 @@ class BasicAgent:
|
|
179 |
print(f"🔨 Calling Tool: {event.tool_name}")
|
180 |
print(f" With arguments: {event.tool_kwargs}")
|
181 |
|
|
|
|
|
|
|
182 |
if self.langfuse:
|
183 |
self.instrumentor.flush()
|
184 |
|
|
|
1 |
import os
|
2 |
import re
|
3 |
+
import asyncio
|
4 |
|
5 |
from tavily import AsyncTavilyClient
|
6 |
from llama_index.core.tools import FunctionTool
|
|
|
180 |
print(f"🔨 Calling Tool: {event.tool_name}")
|
181 |
print(f" With arguments: {event.tool_kwargs}")
|
182 |
|
183 |
+
# Avoid ratelimits
|
184 |
+
await asyncio.sleep(0.5)
|
185 |
+
|
186 |
if self.langfuse:
|
187 |
self.instrumentor.flush()
|
188 |
|