Schema generation and crawler-options generation try up to three times, meant to be at temperatures 0, 0.1 and 0.3.
The temperature is never sent (the line is commented out in one function and absent in the other, and generateCompletions does not read options.temperature), so each retry is the same request. Every error, including permanent ones, is retried.
- What to change
- Either pass the temperature through to the request, or stop the loop after a failure that cannot change (a 4xx or an invalid key), and keep retries only for the unsupported-schema case.
- Why it matters
- A retry that sends the same request at the default temperature costs a full call and mostly repeats the failure; a permanent error costs three calls instead of one.
- How often it happens
- The code shows the problem; how often it happens is assumed. To measure it: how often schema or crawler-options generation fails or yields an unsupported schema, from their logs
- Estimate
- up to 2 extra small calls per failing schema or crawler-options generation; size is small
What the estimate assumes
these two functions are rare paths and the prompts are about 400 to 900 tokens, so the share of the whole app is tiny