mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
Fixes to bedrock
This commit is contained in:
parent
8c48af11c2
commit
d49a36004c
5 changed files with 6 additions and 6 deletions
Binary file not shown.
Binary file not shown.
|
@ -1,4 +1,4 @@
|
||||||
import json
|
import json, copy
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
import time
|
import time
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
|
@ -85,7 +85,6 @@ def completion(
|
||||||
encoding,
|
encoding,
|
||||||
logging_obj,
|
logging_obj,
|
||||||
optional_params=None,
|
optional_params=None,
|
||||||
stream=False,
|
|
||||||
litellm_params=None,
|
litellm_params=None,
|
||||||
logger_fn=None,
|
logger_fn=None,
|
||||||
):
|
):
|
||||||
|
@ -99,10 +98,12 @@ def completion(
|
||||||
model = model
|
model = model
|
||||||
provider = model.split(".")[0]
|
provider = model.split(".")[0]
|
||||||
prompt = convert_messages_to_prompt(messages, provider)
|
prompt = convert_messages_to_prompt(messages, provider)
|
||||||
|
inference_params = copy.deepcopy(optional_params)
|
||||||
|
stream = inference_params.pop("stream", False)
|
||||||
if provider == "anthropic":
|
if provider == "anthropic":
|
||||||
data = json.dumps({
|
data = json.dumps({
|
||||||
"prompt": prompt,
|
"prompt": prompt,
|
||||||
**optional_params
|
**inference_params
|
||||||
})
|
})
|
||||||
elif provider == "ai21":
|
elif provider == "ai21":
|
||||||
data = json.dumps({
|
data = json.dumps({
|
||||||
|
@ -112,7 +113,7 @@ def completion(
|
||||||
else: # amazon titan
|
else: # amazon titan
|
||||||
data = json.dumps({
|
data = json.dumps({
|
||||||
"inputText": prompt,
|
"inputText": prompt,
|
||||||
"textGenerationConfig": optional_params,
|
"textGenerationConfig": inference_params,
|
||||||
})
|
})
|
||||||
## LOGGING
|
## LOGGING
|
||||||
logging_obj.pre_call(
|
logging_obj.pre_call(
|
||||||
|
|
|
@ -1003,7 +1003,6 @@ def completion(
|
||||||
logger_fn=logger_fn,
|
logger_fn=logger_fn,
|
||||||
encoding=encoding,
|
encoding=encoding,
|
||||||
logging_obj=logging,
|
logging_obj=logging,
|
||||||
stream=stream,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "litellm"
|
name = "litellm"
|
||||||
version = "0.1.812"
|
version = "0.1.813"
|
||||||
description = "Library to easily interface with LLM API providers"
|
description = "Library to easily interface with LLM API providers"
|
||||||
authors = ["BerriAI"]
|
authors = ["BerriAI"]
|
||||||
license = "MIT License"
|
license = "MIT License"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue