From 039d05c808065b959915bf6f5054ece4ab1bc695 Mon Sep 17 00:00:00 2001 From: Dennis Aumiller Date: Mon, 13 Mar 2023 17:08:32 +0100 Subject: [PATCH] Update types in cohere.py (#1635) Adjust argument type and clarification on parameter limits for attributes `frequency_penalty` and `presence_penalty`. --- langchain/llms/cohere.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/langchain/llms/cohere.py b/langchain/llms/cohere.py index 66bff40e..2335dba7 100644 --- a/langchain/llms/cohere.py +++ b/langchain/llms/cohere.py @@ -41,11 +41,11 @@ class Cohere(LLM, BaseModel): p: int = 1 """Total probability mass of tokens to consider at each step.""" - frequency_penalty: int = 0 - """Penalizes repeated tokens according to frequency.""" + frequency_penalty: float = 0.0 + """Penalizes repeated tokens according to frequency. Between 0 and 1.""" - presence_penalty: int = 0 - """Penalizes repeated tokens.""" + presence_penalty: float = 0.0 + """Penalizes repeated tokens. Between 0 and 1.""" truncate: Optional[str] = None """Specify how the client handles inputs longer than the maximum token