b1394a2817
CI / docker (push) Successful in 3m49s
Text keys use OpenAI routes; image keys use predictions with ingress Model ID, OpenAPI input schemas, owner/name or short name resolution, protocol-aware admin whitelist, and in-app API docs aligned to UI conventions. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
586 B
Go
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
|
|
}
|