49 lines
1.1 KiB
Go
49 lines
1.1 KiB
Go
// Package protocol defines protocol identifiers shared by runtime domains.
|
|
package protocol
|
|
|
|
type Protocol string
|
|
|
|
const (
|
|
OpenAICompletions Protocol = "openai-completions"
|
|
OpenAIResponses Protocol = "openai-responses"
|
|
OpenAIImages Protocol = "openai-images"
|
|
OpenAIEmbeddings Protocol = "openai-embeddings"
|
|
Rerank Protocol = "rerank"
|
|
Anthropic Protocol = "anthropic"
|
|
Gemini Protocol = "gemini"
|
|
)
|
|
|
|
func (p Protocol) Valid() bool {
|
|
switch p {
|
|
case OpenAICompletions, OpenAIResponses, OpenAIImages, OpenAIEmbeddings, Rerank, Anthropic, Gemini:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
func (p Protocol) DataPlaneEnabled() bool {
|
|
switch p {
|
|
case OpenAICompletions, OpenAIResponses, OpenAIImages, OpenAIEmbeddings, Rerank, Anthropic, Gemini:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
func (p Protocol) SupportsModelOptionalRequests() bool {
|
|
return p == OpenAIResponses
|
|
}
|
|
|
|
func DataPlaneProtocols() []Protocol {
|
|
return []Protocol{
|
|
OpenAICompletions,
|
|
OpenAIResponses,
|
|
OpenAIImages,
|
|
OpenAIEmbeddings,
|
|
Rerank,
|
|
Anthropic,
|
|
Gemini,
|
|
}
|
|
}
|