Skip to content

Commit

Permalink
107
Browse files Browse the repository at this point in the history
  • Loading branch information
ronidas39 committed Jul 31, 2024
1 parent 05216bf commit f3a917d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tutorial107/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from langchain_core.rate_limiters import InMemoryRateLimiter
from langchain_openai import ChatOpenAI
from datetime import datetime

rate_limiters=InMemoryRateLimiter(
requests_per_second = .05,
check_every_n_seconds = 0.1,
max_bucket_size = 10
)
llm=ChatOpenAI(model="gpt-4o",rate_limiter=rate_limiters)
for i in range(10):
response=llm.invoke("hello")
print(response.content)
print(datetime.now())


Binary file added tutorial107/tutorial107.pptx
Binary file not shown.

0 comments on commit f3a917d

Please sign in to comment.