1
0
mirror of https://github.com/fumiama/deepinfra.git synced 2026-06-05 00:32:46 +08:00
Files
deepinfra/model/api.go
2025-12-22 00:36:10 +08:00

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
}