Root cause: sequential execution of "chat.completions.create"
3 "openai.chat.completions.create" spans ran one after another — each started only after the previous one finished. Total: 5.9s, slowest single call: 2.4s. Running them concurrently saves 3.6s — a 2.5× speedup.
5.9s
~2.4s
Fix: run calls in parallel
from concurrent.futures import ThreadPoolExecutor
# Before — sequential, each call blocks the next:
for item in items:
result = process(item)
# After — all calls run concurrently:
with ThreadPoolExecutor(max_workers=8) as pool:
results = list(pool.map(process, items))
# Cost unchanged. Output unchanged. Time = slowest single call.Waterfall
agent.run
openai.chat.completions.create
Summarize the Q3 earnings report attached. Focus on revenue, margin, and guidance.
Q3 revenue hit $4.2B, a 38% YoY jump, with operating margin expanding to 27%…
openai.chat.completions.create
Given the customer ticket below, draft a refund response that follows policy P-204.
Refund approved under policy P-204(b), $189.99 returned to card ending 4421 within 3 days…
openai.chat.completions.create
Translate the user manual section to Japanese, preserving the table structure.
ユーザーマニュアルの全章を翻訳しました。表は問題なく保持されています…
tool.search
tool.web_fetch
tool.code_exec
Faithfulness · openai.chat.completions.create0.50
2 supported · 1 contradicted · 1 unsupported of 4 claims
- supported
Policy P-204(b) applies to this request.
- contradicted
The refund amount is $189.99.
- unsupported
The card on file ends in 4421.
- supported
Refunds settle within 3 business days.