1
0
mirror of https://github.com/fumiama/deepinfra.git synced 2026-06-12 22:40:14 +08:00

feat: add custom

This commit is contained in:
源文雨
2025-02-14 16:29:37 +09:00
parent 507e407127
commit 12ba460588
6 changed files with 155 additions and 26 deletions

33
model/api.go Normal file
View File

@@ -0,0 +1,33 @@
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"`
}