mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
fix(main.py): expose custom llm provider for text completions
This commit is contained in:
parent
a652f05bb3
commit
943f9d9432
2 changed files with 3 additions and 11 deletions
|
@ -496,7 +496,8 @@ def completion(
|
|||
additional_args={"headers": headers},
|
||||
)
|
||||
elif (
|
||||
model in litellm.open_ai_text_completion_models
|
||||
custom_llm_provider == "text-completion-openai"
|
||||
or model in litellm.open_ai_text_completion_models
|
||||
or "ft:babbage-002" in model
|
||||
or "ft:davinci-002" in model # support for finetuned completion models
|
||||
# NOTE: Do NOT add custom_llm_provider == "openai".
|
||||
|
|
|
@ -426,21 +426,12 @@ def test_completion_hf_prompt_array():
|
|||
# test_completion_hf_prompt_array()
|
||||
|
||||
def test_completion_text_openai():
|
||||
try:
|
||||
# litellm.set_verbose=True
|
||||
response = completion(model="text-davinci-003", messages=messages)
|
||||
# Add any assertions here to check the response
|
||||
print(response)
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
def test_completion_gpt_instruct():
|
||||
try:
|
||||
response = completion(model="gpt-3.5-turbo-instruct", messages=messages)
|
||||
print(response)
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
# test_completion_gpt_instruct()
|
||||
test_completion_text_openai()
|
||||
|
||||
def test_completion_openai_with_optional_params():
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue