Private
Public Access
1
0

Add metadata json field to Message, store generation model/provider

This commit is contained in:
2024-09-30 17:37:50 +00:00
parent 327a128b2f
commit 5d13c3e056
4 changed files with 44 additions and 21 deletions

View File

@@ -6,8 +6,6 @@ import (
"git.mlow.ca/mlow/lmcli/pkg/api"
)
type ReplyCallback func(api.Message)
type Chunk struct {
Content string
TokenCount uint
@@ -24,9 +22,8 @@ type RequestParameters struct {
}
type ChatCompletionProvider interface {
// CreateChatCompletion requests a response to the provided messages.
// Replies are appended to the given replies struct, and the
// complete user-facing response is returned as a string.
// CreateChatCompletion generates a chat completion response to the
// provided messages.
CreateChatCompletion(
ctx context.Context,
params RequestParameters,
@@ -34,7 +31,7 @@ type ChatCompletionProvider interface {
) (*api.Message, error)
// Like CreateChageCompletion, except the response is streamed via
// the output channel as it's received.
// the output channel.
CreateChatCompletionStream(
ctx context.Context,
params RequestParameters,