mirror of
https://github.com/fumiama/deepinfra.git
synced 2026-06-05 00:32:46 +08:00
41 lines
598 B
Go
41 lines
598 B
Go
package model
|
|
|
|
import (
|
|
"bytes"
|
|
"io"
|
|
"net/http"
|
|
)
|
|
|
|
type Inputer interface {
|
|
Body() *bytes.Buffer
|
|
Parse(io.Reader) error
|
|
}
|
|
|
|
type Outputer interface {
|
|
Output() Contents
|
|
OutputRaw() Contents
|
|
}
|
|
|
|
type Requester interface {
|
|
API(api, key string) string // API decorator
|
|
Header(key string, h http.Header) // Header decorator
|
|
}
|
|
|
|
type Cloner interface {
|
|
Clone() Protocol
|
|
}
|
|
|
|
type MessageBuilder[T any] interface {
|
|
System(prompt string) T
|
|
User(prompt ...Content) T
|
|
Assistant(prompt ...Content) T
|
|
}
|
|
|
|
type Protocol interface {
|
|
Inputer
|
|
Outputer
|
|
Requester
|
|
MessageBuilder[Protocol]
|
|
Cloner
|
|
}
|