Add configurable low-speed timeout for OpenAI provider (#11668)

This PR adds a setting to allow configuring the low-speed timeout for
the Assistant when using the OpenAI provider.

The `low_speed_timeout_in_seconds` accepts a number of seconds that the
HTTP client can go below a minimum speed limit (currently set to 100
bytes/second) before it times out.

```json
{
  "assistant": {
    "version": "1",
    "provider": { "name": "openai", "low_speed_timeout_in_seconds": 60 }
  },
}
```

This should help the case where the `openai` provider is being used with
a local model that requires higher timeouts.

Issue: https://github.com/zed-industries/zed/issues/9913

Release Notes:

- Added a `low_speed_timeout_in_seconds` setting to the Assistant's
OpenAI provider
([#9913](https://github.com/zed-industries/zed/issues/9913)).
This commit is contained in:
Marshall Bowers
2024-05-10 13:19:21 -04:00
committed by GitHub
parent 19994fc190
commit 0d26beb91b
7 changed files with 59 additions and 9 deletions
Generated
+1
View File
@@ -6826,6 +6826,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"futures 0.3.28",
"isahc",
"schemars",
"serde",
"serde_json",