mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(feat) add setting input_type for cohere
This commit is contained in:
parent
724e169f32
commit
03860984eb
2 changed files with 7 additions and 0 deletions
|
@ -195,6 +195,7 @@ def embedding(
|
|||
logging_obj=None,
|
||||
model_response=None,
|
||||
encoding=None,
|
||||
optional_params=None,
|
||||
):
|
||||
headers = validate_environment(api_key)
|
||||
embed_url = "https://api.cohere.ai/v1/embed"
|
||||
|
@ -202,8 +203,13 @@ def embedding(
|
|||
data = {
|
||||
"model": model,
|
||||
"texts": input,
|
||||
**optional_params
|
||||
}
|
||||
|
||||
if "3" in model and "input_type" not in data:
|
||||
# cohere v3 embedding models require input_type, if no input_type is provided, default to "search_document"
|
||||
data["input_type"] = "search_document"
|
||||
|
||||
## LOGGING
|
||||
logging_obj.pre_call(
|
||||
input=input,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue