Documentation ¶
Index ¶
- Constants
- func ParseEmbeddingProviderSettings(providerType types.EmbeddingProviderType, settingsJSON json.RawMessage) (types.EmbeddingProviderSettings, error)
- func ParseLLMProviderSettings(providerType types.LLMProviderType, settingsJSON json.RawMessage) (types.LLMProviderSettings, error)
- func ParseSettings(sourceType types.DatasourceType, settingsJSON json.RawMessage) (types.DatasourceSettings, error)
- func SendAPIErrorResponse(w http.ResponseWriter, statusCode int, err *APIError)
- func SendErrorResponse(w http.ResponseWriter, statusCode int, message string, logger *logrus.Logger, ...)
- func SendSuccessResponse(w http.ResponseWriter, statusCode int, data interface{}, logger *logrus.Logger, ...)
- type APIError
- type Response
Constants ¶
View Source
const (
JsonErroFoundUnknownField = "Found unknown field"
)
Variables ¶
This section is empty.
Functions ¶
func ParseEmbeddingProviderSettings ¶
func ParseEmbeddingProviderSettings(providerType types.EmbeddingProviderType, settingsJSON json.RawMessage) (types.EmbeddingProviderSettings, error)
func ParseLLMProviderSettings ¶
func ParseLLMProviderSettings(providerType types.LLMProviderType, settingsJSON json.RawMessage) (types.LLMProviderSettings, error)
func ParseSettings ¶
func ParseSettings(sourceType types.DatasourceType, settingsJSON json.RawMessage) (types.DatasourceSettings, error)
func SendAPIErrorResponse ¶
func SendAPIErrorResponse(w http.ResponseWriter, statusCode int, err *APIError)
SendAPIErrorResponse sends a success response with data
func SendErrorResponse ¶
func SendErrorResponse(w http.ResponseWriter, statusCode int, message string, logger *logrus.Logger, span trace.Span)
SendErrorResponse sends an error response with a message @deprecated
func SendSuccessResponse ¶
func SendSuccessResponse(w http.ResponseWriter, statusCode int, data interface{}, logger *logrus.Logger, span trace.Span)
SendSuccessResponse sends a success response with data
Types ¶
type APIError ¶
type APIError struct { Message string `json:"message"` Err string `json:"error"` // contains filtered or unexported fields }
func DecodeJSONBody ¶
func NewAPIError ¶
func (*APIError) GetRawError ¶
Click to show internal directories.
Click to hide internal directories.