2024-04-30 18:02:08 +00:00
|
|
|
// Package errtypes contains custom error types
|
|
|
|
package errtypes
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
const UnknownOllamaKeyErrMsg = "unknown ollama key"
|
2024-05-14 01:48:28 +00:00
|
|
|
const InvalidModelNameErrMsg = "invalid model name"
|
2024-04-30 18:02:08 +00:00
|
|
|
|
|
|
|
// TODO: This should have a structured response from the API
|
|
|
|
type UnknownOllamaKey struct {
|
|
|
|
Key string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *UnknownOllamaKey) Error() string {
|
|
|
|
return fmt.Sprintf("unauthorized: %s %q", UnknownOllamaKeyErrMsg, strings.TrimSpace(e.Key))
|
|
|
|
}
|