1
0
mirror of https://github.com/fumiama/deepinfra.git synced 2026-06-10 13:00:31 +08:00

feat: add Google GenAI API

This commit is contained in:
源文雨
2025-03-30 01:48:52 +09:00
parent bf0f65bcaa
commit db7712b6d2
7 changed files with 153 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ package model
import (
"bytes"
"io"
"net/http"
)
type Inputer interface {
@@ -15,6 +16,11 @@ type Outputer interface {
OutputRaw() string
}
type Requester interface {
API(api, key string) string // API decorator
Header(key string, h http.Header) // Header decorator
}
type MessageBuilder[T any] interface {
System(prompt string) T
User(prompt string) T
@@ -24,5 +30,6 @@ type MessageBuilder[T any] interface {
type Protocol interface {
Inputer
Outputer
Requester
MessageBuilder[Protocol]
}