Skip to content

Commit

Permalink
feat(llm):
Browse files Browse the repository at this point in the history
- concurrent request
- update llm functions
  • Loading branch information
MorvanZhou committed Jul 18, 2024
1 parent cf5583d commit 6e5ffe1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_core_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def fetch(url: str):
await asyncio.gather(*tasks)
total_time = time.time() - st
self.assertGreaterEqual(total_time, 0.3)
self.assertLess(total_time, 0.4)
self.assertLess(total_time, 0.45)
self.assertEqual(11, count)

@patch("httpx.AsyncClient.get")
Expand All @@ -53,7 +53,7 @@ async def fetch(url: str):
await asyncio.gather(*tasks)
total_time = time.time() - st
self.assertGreaterEqual(total_time, 1)
self.assertLess(total_time, 2)
self.assertLess(total_time, 2.5)
self.assertEqual(16, count)

async def test_concurrent_limiter(self):
Expand All @@ -72,7 +72,7 @@ async def fetch():
await asyncio.gather(*tasks)
total_time = time.time() - st
self.assertGreaterEqual(total_time, 0.3)
self.assertLess(total_time, 0.4)
self.assertLess(total_time, 0.45)
self.assertEqual(5, count)

async def test_concurrent_with_rate_limiter(self):
Expand All @@ -93,5 +93,5 @@ async def fetch():
await asyncio.gather(*tasks)
total_time = time.time() - st
self.assertGreaterEqual(total_time, 0.3)
self.assertLess(total_time, 0.4)
self.assertLess(total_time, 0.45)
self.assertEqual(4, count)

0 comments on commit 6e5ffe1

Please sign in to comment.