examples: remove codified examples (#8267)

This commit is contained in:
Parth Sareen 2025-01-13 11:26:22 -08:00 committed by GitHub
parent 17fcdea698
commit 84a2314463
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
85 changed files with 23 additions and 8775 deletions

View file

@ -0,0 +1,31 @@
package main
import (
"context"
"fmt"
"log"
"github.com/ollama/ollama/api"
)
func main() {
client, err := api.ClientFromEnvironment()
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
req := &api.PullRequest{
Model: "mistral",
}
progressFunc := func(resp api.ProgressResponse) error {
fmt.Printf("Progress: status=%v, total=%v, completed=%v\n", resp.Status, resp.Total, resp.Completed)
return nil
}
err = client.Pull(ctx, req, progressFunc)
if err != nil {
log.Fatal(err)
}
}