Harrison/cohere params (#1278)

Co-authored-by: Stefano Faraggi <40745694+stepp1@users.noreply.github.com>
docker-utility-pexpect
Harrison Chase 1 year ago committed by GitHub
parent a8e88e1874
commit 7e8f832cd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save