From 5182a1dfb1407d8e47b6fb19e6b10b66baec1e14 Mon Sep 17 00:00:00 2001 From: Blake Mizerany Date: Sun, 31 Mar 2024 11:04:20 -0700 Subject: [PATCH] client/ollama: document Do --- client/ollama/ollama.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/ollama/ollama.go b/client/ollama/ollama.go index 6e8b6f94..9edfc73c 100644 --- a/client/ollama/ollama.go +++ b/client/ollama/ollama.go @@ -105,6 +105,9 @@ func (e *Error) Error() string { return b.String() } +// Do encodes in and sends it in a request to the Ollama server and decodes +// the response into Res, or an error response (non-2xx) into an *Error, or +// any error encounted decoding the response. func Do[Res any](ctx context.Context, c *Client, method, path string, in any) (*Res, error) { var body bytes.Buffer // TODO(bmizerany): pool and reuse this buffer AND the encoder