mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-02-14 07:55:03 -05:00
### CHANGES - Introduce `cmd` directory for all main application binaries. - Move all Go packages into the `internal` directory. - Rename the `restapi` package to `server` for clarity. - Consolidate patterns and strategies into a new `data` directory. - Group all auxiliary scripts into a new `scripts` directory. - Move all documentation and images into a `docs` directory. - Update all Go import paths to reflect the new structure. - Adjust CI/CD workflows and build commands for new layout.
45 lines
860 B
Go
45 lines
860 B
Go
package gemini
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/google/generative-ai-go/genai"
|
|
)
|
|
|
|
// Test generated using Keploy
|
|
func TestBuildModelNameSimple(t *testing.T) {
|
|
client := &Client{}
|
|
fullModelName := "models/chat-bison-001"
|
|
expected := "chat-bison-001"
|
|
|
|
result := client.buildModelNameSimple(fullModelName)
|
|
|
|
if result != expected {
|
|
t.Errorf("Expected %v, got %v", expected, result)
|
|
}
|
|
}
|
|
|
|
// Test generated using Keploy
|
|
func TestExtractText(t *testing.T) {
|
|
client := &Client{}
|
|
response := &genai.GenerateContentResponse{
|
|
Candidates: []*genai.Candidate{
|
|
{
|
|
Content: &genai.Content{
|
|
Parts: []genai.Part{
|
|
genai.Text("Hello, "),
|
|
genai.Text("world!"),
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
expected := "Hello, world!"
|
|
|
|
result := client.extractText(response)
|
|
|
|
if result != expected {
|
|
t.Errorf("Expected %v, got %v", expected, result)
|
|
}
|
|
}
|