mirror of
https://github.com/fumiama/deepinfra.git
synced 2026-06-06 17:20:34 +08:00
34 lines
532 B
Go
34 lines
532 B
Go
package model
|
|
|
|
import (
|
|
"bytes"
|
|
"io"
|
|
)
|
|
|
|
type Inputer interface {
|
|
Body() *bytes.Buffer
|
|
Parse(io.Reader) error
|
|
}
|
|
|
|
type Outputer interface {
|
|
Output() string
|
|
OutputRaw() string
|
|
}
|
|
|
|
type MessageBuilder[T any] interface {
|
|
System(prompt string) T
|
|
User(prompt string) T
|
|
Assistant(prompt string) T
|
|
}
|
|
|
|
type Message struct {
|
|
Role string `json:"role"`
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
type Choice struct {
|
|
Index int `json:"index"`
|
|
Message Message `json:"message"`
|
|
FinishReason string `json:"finish_reason"`
|
|
}
|