File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ impl OllamaConfig {
38
38
///
39
39
/// If not found, defaults to `DEFAULT_OLLAMA_HOST` and `DEFAULT_OLLAMA_PORT`.
40
40
pub fn new ( ) -> Self {
41
- let host = std:: env:: var ( "OLLAMA_HOST" ) . unwrap_or ( DEFAULT_OLLAMA_HOST . to_string ( ) ) ;
41
+ let host = std:: env:: var ( "OLLAMA_HOST" )
42
+ . map ( |h| h. trim_matches ( '"' ) . to_string ( ) )
43
+ . unwrap_or ( DEFAULT_OLLAMA_HOST . to_string ( ) ) ;
42
44
let port = std:: env:: var ( "OLLAMA_PORT" )
43
45
. and_then ( |port_str| port_str. parse ( ) . map_err ( |_| std:: env:: VarError :: NotPresent ) )
44
46
. unwrap_or ( DEFAULT_OLLAMA_PORT ) ;
@@ -66,7 +68,7 @@ impl OllamaConfig {
66
68
if self . auto_pull { "on" } else { "off" }
67
69
) ;
68
70
69
- let ollama = Ollama :: new ( self . host . trim_matches ( '"' ) , self . port ) ;
71
+ let ollama = Ollama :: new ( & self . host , self . port ) ;
70
72
71
73
// the list of required models is those given in DKN_MODELS and the hardcoded ones
72
74
let mut required_models = self . hardcoded_models . clone ( ) ;
You can’t perform that action at this time.
0 commit comments