mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
(fix) bedrock - embedding - support str input
This commit is contained in:
parent
a876748bf5
commit
a9d812eb8d
1 changed files with 22 additions and 12 deletions
|
@ -737,18 +737,28 @@ def embedding(
|
|||
aws_region_name=aws_region_name,
|
||||
aws_bedrock_runtime_endpoint=aws_bedrock_runtime_endpoint,
|
||||
)
|
||||
|
||||
## Embedding Call
|
||||
embeddings = [
|
||||
_embedding_func_single(
|
||||
model,
|
||||
i,
|
||||
optional_params=optional_params,
|
||||
client=client,
|
||||
logging_obj=logging_obj,
|
||||
)
|
||||
for i in input
|
||||
] # [TODO]: make these parallel calls
|
||||
if type(input) == str:
|
||||
embeddings = [
|
||||
_embedding_func_single(
|
||||
model,
|
||||
input,
|
||||
optional_params=optional_params,
|
||||
client=client,
|
||||
logging_obj=logging_obj,
|
||||
)
|
||||
]
|
||||
else:
|
||||
## Embedding Call
|
||||
embeddings = [
|
||||
_embedding_func_single(
|
||||
model,
|
||||
i,
|
||||
optional_params=optional_params,
|
||||
client=client,
|
||||
logging_obj=logging_obj,
|
||||
)
|
||||
for i in input
|
||||
] # [TODO]: make these parallel calls
|
||||
|
||||
## Populate OpenAI compliant dictionary
|
||||
embedding_response = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue