P
Peekr Cloud
DemoAcme Agents

← Traces

agent.run

trace_id: trace_00003u · tenant: globex

7 spans·7405mserror

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.

Now (sequential)After fix (parallel)

5.9s

~2.4s

Fix: run calls in parallel

fix.py
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 › runerror

agent.run

user: u_427
openai › chat › completions › create

openai.chat.completions.create

gpt-4o1.4k tok$0.012faithful 0.09user: u_427
Input

Summarize the Q3 earnings report attached. Focus on revenue, margin, and guidance.

Output

Q3 revenue hit $4.2B, a 38% YoY jump, with operating margin expanding to 27%…

openai › chat › completions › create

openai.chat.completions.create

gpt-4o1.4k tok$0.013faithful 0.36user: u_427
Input

Given the customer ticket below, draft a refund response that follows policy P-204.

Output

Refund approved under policy P-204(b), $189.99 returned to card ending 4421 within 3 days…

openai › chat › completions › create

openai.chat.completions.create

gpt-4o1.5k tok$0.013faithful 0.45user: u_427
Input

Translate the user manual section to Japanese, preserving the table structure.

Output

ユーザーマニュアルの全章を翻訳しました。表は問題なく保持されています…

Tool: search

tool.search

user: u_427
Tool: web_fetch

tool.web_fetch

user: u_427
Tool: code_execerror

tool.code_exec

user: u_427

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.