mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-25 08:03:39 +00:00
Harrison/cohere params (#1278)
Co-authored-by: Stefano Faraggi <40745694+stepp1@users.noreply.github.com>
This commit is contained in:
parent
a8e88e1874
commit
7e8f832cd6
@ -25,7 +25,7 @@ class CohereEmbeddings(BaseModel, Embeddings):
|
||||
model: str = "large"
|
||||
"""Model name to use."""
|
||||
|
||||
truncate: str = "NONE"
|
||||
truncate: Optional[str] = None
|
||||
"""Truncate embeddings that are too long from start or end ("NONE"|"START"|"END")"""
|
||||
|
||||
cohere_api_key: Optional[str] = None
|
||||
|
@ -47,6 +47,10 @@ class Cohere(LLM, BaseModel):
|
||||
presence_penalty: int = 0
|
||||
"""Penalizes repeated tokens."""
|
||||
|
||||
truncate: Optional[str] = None
|
||||
"""Specify how the client handles inputs longer than the maximum token
|
||||
length: Truncate from START, END or NONE"""
|
||||
|
||||
cohere_api_key: Optional[str] = None
|
||||
|
||||
stop: Optional[List[str]] = None
|
||||
@ -83,6 +87,7 @@ class Cohere(LLM, BaseModel):
|
||||
"p": self.p,
|
||||
"frequency_penalty": self.frequency_penalty,
|
||||
"presence_penalty": self.presence_penalty,
|
||||
"truncate": self.truncate,
|
||||
}
|
||||
|
||||
@property
|
||||
|
Loading…
Reference in New Issue
Block a user