mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
remove useless mapping
This commit is contained in:
parent
d3823622e9
commit
ea4b5d18a6
3 changed files with 4 additions and 7 deletions
|
@ -394,6 +394,7 @@ together_ai_models: List = [
|
||||||
"WizardLM/WizardLM-70B-V1.0",
|
"WizardLM/WizardLM-70B-V1.0",
|
||||||
] # supports all together ai models, just pass in the model id e.g. completion(model="together_computer/replit_code_3b",...)
|
] # supports all together ai models, just pass in the model id e.g. completion(model="together_computer/replit_code_3b",...)
|
||||||
|
|
||||||
|
|
||||||
baseten_models: List = [
|
baseten_models: List = [
|
||||||
"qvv0xeq",
|
"qvv0xeq",
|
||||||
"q841o8w",
|
"q841o8w",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""
|
"""
|
||||||
Translates from OpenAI's `/v1/embeddings` to BitdeerAI's `/v1/embeddings`
|
Translates from OpenAI's `/v1/embeddings` to BitdeerAI's `/v1/embeddings`
|
||||||
"""
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
class BitdeerAIEmbeddingConfig:
|
class BitdeerAIEmbeddingConfig:
|
||||||
|
@ -17,3 +17,4 @@ class BitdeerAIEmbeddingConfig:
|
||||||
drop_params: Optional[dict] = None,
|
drop_params: Optional[dict] = None,
|
||||||
) -> dict:
|
) -> dict:
|
||||||
return optional_params
|
return optional_params
|
||||||
|
"""
|
|
@ -21,14 +21,13 @@ class TestBitdeerAIEmbeddingConfig:
|
||||||
assert len(supported_params) == 0, "Expected empty list"
|
assert len(supported_params) == 0, "Expected empty list"
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"non_default_params, optional_params, model, drop_params, expected",
|
"non_default_params, optional_params, model, expected",
|
||||||
[
|
[
|
||||||
# 基础测试:直接返回 optional_params
|
# 基础测试:直接返回 optional_params
|
||||||
(
|
(
|
||||||
{"temperature": 0.5},
|
{"temperature": 0.5},
|
||||||
{"input": "test text", "model": "bitdeerai/test"},
|
{"input": "test text", "model": "bitdeerai/test"},
|
||||||
"model",
|
"model",
|
||||||
{"drop": "this"},
|
|
||||||
{"input": "test text", "model": "bitdeerai/test"},
|
{"input": "test text", "model": "bitdeerai/test"},
|
||||||
),
|
),
|
||||||
# 测试无 optional_params(空字典)
|
# 测试无 optional_params(空字典)
|
||||||
|
@ -36,7 +35,6 @@ class TestBitdeerAIEmbeddingConfig:
|
||||||
{},
|
{},
|
||||||
{},
|
{},
|
||||||
"model",
|
"model",
|
||||||
None,
|
|
||||||
{},
|
{},
|
||||||
),
|
),
|
||||||
# 测试非默认参数与 model 的存在不影响结果
|
# 测试非默认参数与 model 的存在不影响结果
|
||||||
|
@ -44,7 +42,6 @@ class TestBitdeerAIEmbeddingConfig:
|
||||||
{"user": "test_user"},
|
{"user": "test_user"},
|
||||||
{"input": "another text"},
|
{"input": "another text"},
|
||||||
"another_model",
|
"another_model",
|
||||||
{"unknown_param": "value"},
|
|
||||||
{"input": "another text"},
|
{"input": "another text"},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -54,7 +51,6 @@ class TestBitdeerAIEmbeddingConfig:
|
||||||
non_default_params,
|
non_default_params,
|
||||||
optional_params,
|
optional_params,
|
||||||
model,
|
model,
|
||||||
drop_params,
|
|
||||||
expected,
|
expected,
|
||||||
):
|
):
|
||||||
"""验证 map_openai_params 正确返回 optional_params(直通)"""
|
"""验证 map_openai_params 正确返回 optional_params(直通)"""
|
||||||
|
@ -62,6 +58,5 @@ class TestBitdeerAIEmbeddingConfig:
|
||||||
non_default_params,
|
non_default_params,
|
||||||
optional_params,
|
optional_params,
|
||||||
model,
|
model,
|
||||||
drop_params=drop_params,
|
|
||||||
)
|
)
|
||||||
assert result == expected, f"Expected {expected}, got {result}"
|
assert result == expected, f"Expected {expected}, got {result}"
|
Loading…
Add table
Add a link
Reference in a new issue