Add testimonials
This commit is contained in:
parent
06e943d478
commit
40223a12b5
7 changed files with 318 additions and 101 deletions
69
cmd/test_provider/test_provider.go
Normal file
69
cmd/test_provider/test_provider.go
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
// this package provides a wrapper to test completion provider implementations.
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"git.chandlerswift.com/chandlerswift/svs-services-server/completion/openrouter"
|
||||
)
|
||||
|
||||
var provider = openrouter.OpenRouterProvider{
|
||||
Token: os.Getenv("OPENROUTER_API_KEY"),
|
||||
Model: "openai/gpt-oss-120b",
|
||||
}
|
||||
|
||||
func main() {
|
||||
prompt := "Generate a sample weather report."
|
||||
|
||||
// {
|
||||
// name: 'weather',
|
||||
// strict: true,
|
||||
// schema: {
|
||||
// type: 'object',
|
||||
// properties: {
|
||||
// location: {
|
||||
// type: 'string',
|
||||
// description: 'City or location name',
|
||||
// },
|
||||
// temperature: {
|
||||
// type: 'number',
|
||||
// description: 'Temperature in Celsius',
|
||||
// },
|
||||
// conditions: {
|
||||
// type: 'string',
|
||||
// description: 'Weather conditions description',
|
||||
// },
|
||||
// },
|
||||
// required: ['location', 'temperature', 'conditions'],
|
||||
// additionalProperties: false,
|
||||
// },
|
||||
// },
|
||||
// }
|
||||
schema := map[string]any{
|
||||
"name": "weather",
|
||||
"strict": true,
|
||||
"schema": map[string]any{
|
||||
"type": "object",
|
||||
"properties": map[string]any{
|
||||
"location": map[string]any{
|
||||
"type": "string",
|
||||
"description": "City or location name",
|
||||
},
|
||||
"temperature": map[string]any{
|
||||
"type": "number",
|
||||
"description": "Temperature in Celsius",
|
||||
},
|
||||
"conditions": map[string]any{
|
||||
"type": "string",
|
||||
"description": "Weather conditions description",
|
||||
},
|
||||
},
|
||||
"required": []string{"location", "temperature", "conditions"},
|
||||
"additionalProperties": false,
|
||||
},
|
||||
}
|
||||
result, err := provider.Complete(context.TODO(), prompt, schema)
|
||||
fmt.Println(err, result)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue