You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Retries for transient errors are implemented for OpenAIClientV0, but not for OpenAIClientV1
To Reproduce
Steps to reproduce the behavior:
import guardrails as gd
import openai
from multiprocessing.pool import ThreadPool as Pool
text_chunk = <Chunk of text that’s ~4k tokens>
def call_gd(text_chunk):
guard = gd.Guard(prompt="summarize this chunk of text: ${chunk}", num_reasks=5)
result = guard(
openai.chat.completions.create,
prompt_params={"chunk": text_chunk},
max_tokens=1024,
temperature=0.1
)
with Pool(16) as p:
results = list(p.imap_unordered(call_gd, text_chunk))
Expected behavior
Calls should retry when receiving a RateLimitError.
Describe the bug
Retries for transient errors are implemented for OpenAIClientV0, but not for OpenAIClientV1
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Calls should retry when receiving a RateLimitError.
Library version:
guardrails-ai==0.4.1
openai==1.13.3
Additional context
See this conversation
The text was updated successfully, but these errors were encountered: