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
[inference] add maxRetries parameter and retry mechanism (elastic#211096)
## Summary
Fixelastic#210859
- Add a retry-on-error mechanism to the `chatComplete` API
- defaults to retrying only "non-fatal" errors 3 times, but configurable
per call
- Wire the retry option to the `output` API and to the `NL-to-ESQL` task
### Example
```ts
const response = await chatComplete({
connectorId: 'my-connector',
system: "You are a helpful assistant",
messages: [
{ role: MessageRole.User, content: "Some question?"},
],
maxRetries: 3, // optional, 3 is the default value
retryConfiguration: { // everything here is optional, showing default values
retryOn: 'auto',
initialDelay: 1000,
backoffMultiplier: 2,
}
});
```
0 commit comments