2024-03-23 13:24:18 +00:00
|
|
|
//go:build integration
|
|
|
|
|
|
|
|
package integration
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
2024-03-26 20:04:17 +00:00
|
|
|
"github.com/ollama/ollama/api"
|
2024-03-23 13:24:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// TODO - this would ideally be in the llm package, but that would require some refactoring of interfaces in the server
|
|
|
|
// package to avoid circular dependencies
|
|
|
|
|
|
|
|
var (
|
|
|
|
stream = false
|
|
|
|
req = [2]api.GenerateRequest{
|
|
|
|
{
|
|
|
|
Model: "orca-mini",
|
|
|
|
Prompt: "why is the ocean blue?",
|
|
|
|
Stream: &stream,
|
|
|
|
Options: map[string]interface{}{
|
|
|
|
"seed": 42,
|
|
|
|
"temperature": 0.0,
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
Model: "orca-mini",
|
|
|
|
Prompt: "what is the origin of the us thanksgiving holiday?",
|
|
|
|
Stream: &stream,
|
|
|
|
Options: map[string]interface{}{
|
|
|
|
"seed": 42,
|
|
|
|
"temperature": 0.0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2024-03-24 23:22:38 +00:00
|
|
|
resp = [2][]string{
|
2024-08-05 23:34:54 +00:00
|
|
|
{"sunlight"},
|
|
|
|
{"england", "english", "massachusetts", "pilgrims"},
|
2024-03-23 13:24:18 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestIntegrationSimpleOrcaMini(t *testing.T) {
|
2024-03-24 23:22:38 +00:00
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second*120)
|
2024-03-23 13:24:18 +00:00
|
|
|
defer cancel()
|
2024-03-30 16:50:05 +00:00
|
|
|
GenerateTestHelper(ctx, t, req[0], resp[0])
|
2024-03-23 13:24:18 +00:00
|
|
|
}
|