community[patch]: Fix docstring for ollama parameter "keep_alive" (#23973)

Fix doc-string for ollama integration
This commit is contained in:
frob 2024-07-16 16:48:38 +02:00 committed by GitHub
parent 0c1889c713
commit c59e663365
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,18 +112,20 @@ class _OllamaCommon(BaseLanguageModel):
"""Timeout for the request stream""" """Timeout for the request stream"""
keep_alive: Optional[Union[int, str]] = None keep_alive: Optional[Union[int, str]] = None
"""How long the model will stay loaded into memory.""" """How long the model will stay loaded into memory.
raw: Optional[bool] = None
"""raw or not.""
The parameter (Default: 5 minutes) can be set to: The parameter (Default: 5 minutes) can be set to:
1. a duration string in Golang (such as "10m" or "24h"); 1. a duration string in Golang (such as "10m" or "24h");
2. a number in seconds (such as 3600); 2. a number in seconds (such as 3600);
3. any negative number which will keep the model loaded \ 3. any negative number which will keep the model loaded \
in memory (e.g. -1 or "-1m"); in memory (e.g. -1 or "-1m");
4. 0 which will unload the model immediately after generating a response; 4. 0 which will unload the model immediately after generating a response;
See the [Ollama documents](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-keep-a-model-loaded-in-memory-or-make-it-unload-immediately)""" See the [Ollama documents](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-keep-a-model-loaded-in-memory-or-make-it-unload-immediately)"""
raw: Optional[bool] = None
"""raw or not."""
headers: Optional[dict] = None headers: Optional[dict] = None
"""Additional headers to pass to endpoint (e.g. Authorization, Referer). """Additional headers to pass to endpoint (e.g. Authorization, Referer).
This is useful when Ollama is hosted on cloud services that require This is useful when Ollama is hosted on cloud services that require