Skip to content

Commit 0f62d5b

Browse files
committed
Formatted code
1 parent 901715a commit 0f62d5b

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

ollama.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import (
44
"bytes"
55
"encoding/json"
66
"fmt"
7+
"github.com/AlecAivazis/survey/v2"
8+
"github.com/BurntSushi/toml"
9+
"github.com/santhosh-tekuri/jsonschema/v5"
710
"io"
811
"net/http"
912
"os/exec"
1013
"runtime"
1114
"strings"
1215
"time"
13-
"github.com/AlecAivazis/survey/v2"
14-
"github.com/BurntSushi/toml"
15-
"github.com/santhosh-tekuri/jsonschema/v5"
1616
)
1717

1818
func LoadLLMConfig(configPath string) (*LLMConfig, error) {
@@ -42,7 +42,7 @@ func CallOllama(
4242
// Build request
4343
req := map[string]any{
4444
"model": llmConfig.Model,
45-
"stream": true,
45+
"stream": true,
4646
"messages": []map[string]string{
4747
{"role": "system", "content": basePrompt},
4848
{"role": "user", "content": prompt},
@@ -96,7 +96,6 @@ func CallOllama(
9696
fullContent.WriteString(chunk.Message.Content)
9797
}
9898

99-
10099
output := fullContent.String()
101100

102101
// schema validation (fail job if invalid)
@@ -238,9 +237,6 @@ func waitForOllama(timeout time.Duration) error {
238237
return fmt.Errorf("ollama did not start within %s", timeout)
239238
}
240239

241-
242-
243-
244240
func validateJSONAgainstSchema(output string, schema any) error {
245241
if schema == nil {
246242
return nil
@@ -272,5 +268,3 @@ func validateJSONAgainstSchema(output string, schema any) error {
272268

273269
return nil
274270
}
275-
276-

0 commit comments

Comments
 (0)