* Introduced EmbeddingModel method in Client and Provider interfaces * Updated InsertThought and SearchThoughts methods to handle embedding models * Created embeddings table and updated match_thoughts function for model filtering * Removed embedding column from thoughts table * Adjusted permissions for new embeddings table
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package mcpserver
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/google/jsonschema-go/jsonschema"
|
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
|
|
|
"git.warky.dev/wdevs/amcs/internal/tools"
|
|
)
|
|
|
|
func TestSetToolSchemasUsesStringUUIDsInListOutput(t *testing.T) {
|
|
tool := &mcp.Tool{Name: "list_thoughts"}
|
|
|
|
if err := setToolSchemas[tools.ListInput, tools.ListOutput](tool); err != nil {
|
|
t.Fatalf("set tool schemas: %v", err)
|
|
}
|
|
|
|
schema, ok := tool.OutputSchema.(*jsonschema.Schema)
|
|
if !ok {
|
|
t.Fatalf("output schema type = %T, want *jsonschema.Schema", tool.OutputSchema)
|
|
}
|
|
|
|
thoughtsSchema := schema.Properties["thoughts"]
|
|
if thoughtsSchema == nil {
|
|
t.Fatal("missing thoughts schema")
|
|
}
|
|
if thoughtsSchema.Items == nil {
|
|
t.Fatal("missing thoughts item schema")
|
|
}
|
|
|
|
idSchema := thoughtsSchema.Items.Properties["id"]
|
|
if idSchema == nil {
|
|
t.Fatal("missing id schema")
|
|
}
|
|
if idSchema.Type != "string" {
|
|
t.Fatalf("id schema type = %q, want %q", idSchema.Type, "string")
|
|
}
|
|
if idSchema.Format != "uuid" {
|
|
t.Fatalf("id schema format = %q, want %q", idSchema.Format, "uuid")
|
|
}
|
|
}
|