Files
Luminary/internal/model/ingress_protocol.go
T
renjue 9988ac9b5f
CI / docker (push) Successful in 4m19s
Split ingress keys into text and image protocols with dedicated API docs.
Text keys use OpenAI routes; image keys use Replicate predictions and model listing, with admin UI whitelist filtering and per-key documentation pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 21:41:06 +08:00

22 lines
586 B
Go

package model
// IngressKeyProtocol distinguishes OpenAI-compatible text APIs from Replicate-compatible image APIs.
type IngressKeyProtocol string
const (
IngressProtocolText IngressKeyProtocol = "text"
IngressProtocolImage IngressKeyProtocol = "image"
)
func (p IngressKeyProtocol) Valid() bool {
return p == IngressProtocolText || p == IngressProtocolImage
}
// EffectiveProtocol returns text for legacy rows without an explicit protocol.
func (k IngressKey) EffectiveProtocol() IngressKeyProtocol {
if k.Protocol == "" {
return IngressProtocolText
}
return k.Protocol
}