mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
feat(wip): code completion with llm
This commit is contained in:
parent
63fb823344
commit
a57748a432
22 changed files with 623 additions and 31 deletions
26
internal/llm/messages_test.go
Normal file
26
internal/llm/messages_test.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
package llm
|
||||
|
||||
import (
|
||||
"github.com/sashabaranov/go-openai"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestChatCompletionWithContext(t *testing.T) {
|
||||
filename := "test"
|
||||
messages := []openai.ChatCompletionMessage{
|
||||
{
|
||||
Role: openai.ChatMessageRoleSystem,
|
||||
},
|
||||
{
|
||||
Role: openai.ChatMessageRoleUser,
|
||||
},
|
||||
{
|
||||
Role: openai.ChatMessageRoleAssistant,
|
||||
},
|
||||
}
|
||||
|
||||
messages = ChatCompletionWithContext(filename, messages)
|
||||
|
||||
assert.NotNil(t, messages[1].MultiContent)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue