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_region_name=aws_region_name,
|
||||||
aws_bedrock_runtime_endpoint=aws_bedrock_runtime_endpoint,
|
aws_bedrock_runtime_endpoint=aws_bedrock_runtime_endpoint,
|
||||||
)
|
)
|
||||||
|
if type(input) == str:
|
||||||
## Embedding Call
|
embeddings = [
|
||||||
embeddings = [
|
_embedding_func_single(
|
||||||
_embedding_func_single(
|
model,
|
||||||
model,
|
input,
|
||||||
i,
|
optional_params=optional_params,
|
||||||
optional_params=optional_params,
|
client=client,
|
||||||
client=client,
|
logging_obj=logging_obj,
|
||||||
logging_obj=logging_obj,
|
)
|
||||||
)
|
]
|
||||||
for i in input
|
else:
|
||||||
] # [TODO]: make these parallel calls
|
## 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
|
## Populate OpenAI compliant dictionary
|
||||||
embedding_response = []
|
embedding_response = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue