X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/496569ab5b179932c60b2924bf4c61176c8be004..959c24478e2c3a596a81cca359fd784c897f46a2:/model_test.go?ds=inline diff --git a/model_test.go b/model_test.go index 3ea82d4..97be6e2 100644 --- a/model_test.go +++ b/model_test.go @@ -65,12 +65,12 @@ func TestClientSendsTheSessionHeaderToChatGPT(t *testing.T) { want string }{ { - name: "ChatGPT backend", + name: "sends the session header to ChatGPT", auth: auth, want: "agent-key", }, { - name: "OpenAI API", + name: "omits the session header for the API", auth: ModelAPIKey(modelTestKey), want: "", }, @@ -237,22 +237,22 @@ func TestClientFailsWhenTheResponseFails(t *testing.T) { want string }{ { - name: "failed response", + name: "reports the response failure cause", events: []any{map[string]any{"type": "response.failed", "response": map[string]any{"error": map[string]any{"code": "server_error", "message": "busy"}}}}, want: "server_error: busy", }, { - name: "incomplete response", + name: "reports why the response is incomplete", events: []any{map[string]any{"type": "response.incomplete", "response": map[string]any{"incomplete_details": map[string]any{"reason": "content_filter"}}}}, want: "content_filter", }, { - name: "error event", + name: "reports the stream error cause", events: []any{map[string]any{"type": "error", "code": "rate_limit", "message": "too many"}}, want: "rate_limit: too many", }, { - name: "stream ends early", + name: "refuses an unfinished response stream", events: []any{map[string]any{"type": "response.output_item.done", "item": modelMessageItem("cut")}}, want: "ended before the response completed", },