better checking for OLLAMA_HOST variable (#3661)

This commit is contained in:
Patrick Devine 2024-04-29 19:14:07 -04:00 committed by GitHub
parent d4ac57e240
commit 9009bedf13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 83 additions and 15 deletions

View file

@ -309,6 +309,7 @@ func (m *Metrics) Summary() {
}
var ErrInvalidOpts = errors.New("invalid options")
var ErrInvalidHostPort = errors.New("invalid port specified in OLLAMA_HOST")
func (opts *Options) FromMap(m map[string]interface{}) error {
valueOpts := reflect.ValueOf(opts).Elem() // names of the fields in the options struct