Documentation
¶
Index ¶
- type ApiLoggerConfig
- type Config
- type CorsConfig
- type DataType
- type InputValue
- type KeyAuthConfig
- type LlmLoggerConfig
- type LoggerConfig
- type OpenAiConfig
- type OpenAiMessageRole
- type OpenAiModel
- type OpenAiPrompt
- type OpenAiRouteConfig
- type Protocol
- type Provider
- type RateLimitConfig
- type RouteConfig
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiLoggerConfig ¶
func (*ApiLoggerConfig) GetHideHeaders ¶
func (alc *ApiLoggerConfig) GetHideHeaders() bool
func (*ApiLoggerConfig) GetHideIp ¶
func (alc *ApiLoggerConfig) GetHideIp() bool
type Config ¶
type Config struct {
LoggerConfig *LoggerConfig `yaml:"logger"`
Routes []*RouteConfig `yaml:"routes"`
Server *ServerConfig `yaml:"server"`
OpenAiConfig *OpenAiConfig `yaml:"openai"`
}
type CorsConfig ¶
type CorsConfig struct {
AllowedOrgins []string `yaml:"allowed_origins"`
AllowedCredentials bool `yaml:"allowed_credentials"`
}
func (*CorsConfig) Enabled ¶
func (cc *CorsConfig) Enabled() bool
func (*CorsConfig) GetAllowedCredentials ¶
func (cc *CorsConfig) GetAllowedCredentials() bool
func (*CorsConfig) GetAllowedOrigins ¶
func (cc *CorsConfig) GetAllowedOrigins() []string
type InputValue ¶
type KeyAuthConfig ¶
type KeyAuthConfig struct {
Key string `yaml:"key"`
}
func (*KeyAuthConfig) Enabled ¶
func (kac *KeyAuthConfig) Enabled() bool
func (*KeyAuthConfig) GetKey ¶
func (kac *KeyAuthConfig) GetKey() string
type LlmLoggerConfig ¶
type LlmLoggerConfig struct {
HideHeaders bool `yaml:"hide_headers"`
HideResponseContent bool `yaml:"hide_response_content"`
HidePromptContent bool `yaml:"hide_prompt_content"`
}
func (*LlmLoggerConfig) GetHideHeaders ¶
func (llc *LlmLoggerConfig) GetHideHeaders() bool
func (*LlmLoggerConfig) GetHidePromptContent ¶
func (llc *LlmLoggerConfig) GetHidePromptContent() bool
func (*LlmLoggerConfig) GetHideResponseContent ¶
func (llc *LlmLoggerConfig) GetHideResponseContent() bool
type LoggerConfig ¶
type LoggerConfig struct {
Api *ApiLoggerConfig `yaml:"api"`
Llm *LlmLoggerConfig `yaml:"llm"`
}
type OpenAiConfig ¶
type OpenAiConfig struct {
ApiCredential string `yaml:"api_credential"`
}
type OpenAiMessageRole ¶
type OpenAiMessageRole string
const ( SystemMessageRole OpenAiMessageRole = "system" UserMessageRole OpenAiMessageRole = "user" AssitantMessageRole OpenAiMessageRole = "assistant" FunctionMessageRole OpenAiMessageRole = "function" )
func (OpenAiMessageRole) Valid ¶
func (r OpenAiMessageRole) Valid() bool
type OpenAiModel ¶
type OpenAiModel string
const ( Gpt35Turbo OpenAiModel = "gpt-3.5-turbo" Gpt35Turbo16k OpenAiModel = "gpt-3.5-turbo-16k" Gpt35Turbo0613 OpenAiModel = "gpt-3.5-turbo-0613" Gpt35Turbo16k0613 OpenAiModel = "gpt-3.5-turbo-16k-0613" Gpt4 OpenAiModel = "gpt-4" Gpt40613 OpenAiModel = "gpt-4-0613" Gpt432k OpenAiModel = "gpt-4-32k" Gpt432k0613 OpenAiModel = "gpt-4-32k-0613" )
func (OpenAiModel) Valid ¶
func (m OpenAiModel) Valid() bool
type OpenAiPrompt ¶
type OpenAiPrompt struct {
Role OpenAiMessageRole `yaml:"role"`
Content string `yaml:"content"`
}
type OpenAiRouteConfig ¶
type OpenAiRouteConfig struct {
ApiCredential string `yaml:"api_credential"`
Model OpenAiModel `yaml:"model"`
Prompts []*OpenAiPrompt `yaml:"prompts"`
}
type RateLimitConfig ¶
type RouteConfig ¶
type RouteConfig struct {
Path string `yaml:"path"`
CorsConfig *CorsConfig `yaml:"cors"`
Input map[string]InputValue `yaml:"input"`
Provider Provider `yaml:"provider"`
OpenAiConfig *OpenAiRouteConfig `yaml:"openai_config"`
Description string `yaml:"description"`
Protocol Protocol `yaml:"protocol"`
CertFile string `yaml:"cert_file"`
KeyFile string `yaml:"key_file"`
KeyAuthConfig *KeyAuthConfig `yaml:"key_auth"`
UpstreamSendTimeout time.Duration `yaml:"upstream_send_time"`
}
type ServerConfig ¶
type ServerConfig struct {
Port int `yaml:"port"`
}
Click to show internal directories.
Click to hide internal directories.