feat: impl. multi-model / attachments, images

This commit is contained in:
Eugen Eisler 2024-10-29 22:03:47 +01:00
parent 9e8ad44cdf
commit 9c9897706b
3 changed files with 3 additions and 21 deletions

View File

@ -87,22 +87,3 @@ func TestBuildChatOptionsDefaultSeed(t *testing.T) {
options := flags.BuildChatOptions()
assert.Equal(t, expectedOptions, options)
}
func TestBuildChatRequest(t *testing.T) {
flags := &Flags{
Context: "test-context",
Session: "test-session",
Pattern: "test-pattern",
Message: "test-message",
}
expectedRequest := &common.ChatRequest{
ContextName: "test-context",
SessionName: "test-session",
PatternName: "test-pattern",
Messages: "test-message",
Meta: "test",
}
request := flags.BuildChatRequest("test")
assert.Equal(t, expectedRequest, request)
}

View File

@ -7,7 +7,7 @@ import (
)
func TestNormalizeMessages(t *testing.T) {
msgs := []*Message{
msgs := []*goopenai.ChatCompletionMessage{
{Role: goopenai.ChatMessageRoleUser, Content: "Hello"},
{Role: goopenai.ChatMessageRoleAssistant, Content: "Hi there!"},
{Role: goopenai.ChatMessageRoleUser, Content: ""},
@ -15,7 +15,7 @@ func TestNormalizeMessages(t *testing.T) {
{Role: goopenai.ChatMessageRoleUser, Content: "How are you?"},
}
expected := []*Message{
expected := []*goopenai.ChatCompletionMessage{
{Role: goopenai.ChatMessageRoleUser, Content: "Hello"},
{Role: goopenai.ChatMessageRoleAssistant, Content: "Hi there!"},
{Role: goopenai.ChatMessageRoleUser, Content: "How are you?"},

View File

@ -1,6 +1,7 @@
package fsdb
import (
goopenai "github.com/sashabaranov/go-openai"
"testing"
)