mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-25 01:02:15 +00:00
feat(providers): expose Prism responses and messages
This commit is contained in:
parent
b649aab02e
commit
b87ffa2dc8
6 changed files with 45 additions and 9 deletions
|
|
@ -205,6 +205,6 @@
|
|||
"base_url": "https://api.prisminference.com/v1",
|
||||
"api_key_env": "PRISM_API_KEY",
|
||||
"api_base_env": "PRISM_API_BASE",
|
||||
"supported_endpoints": ["/v1/chat/completions"]
|
||||
"supported_endpoints": ["/v1/chat/completions", "/v1/responses", "/v1/messages"]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74794,7 +74794,9 @@
|
|||
"output_cost_per_token": 2.8e-07,
|
||||
"source": "https://prisminference.com/pricing",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions"
|
||||
"/v1/chat/completions",
|
||||
"/v1/responses",
|
||||
"/v1/messages"
|
||||
],
|
||||
"supports_function_calling": true,
|
||||
"supports_native_streaming": true,
|
||||
|
|
|
|||
|
|
@ -1930,8 +1930,8 @@
|
|||
"url": "https://docs.litellm.ai/docs/providers/prism",
|
||||
"endpoints": {
|
||||
"chat_completions": true,
|
||||
"messages": false,
|
||||
"responses": false,
|
||||
"messages": true,
|
||||
"responses": true,
|
||||
"embeddings": false,
|
||||
"image_generations": false,
|
||||
"audio_transcriptions": false,
|
||||
|
|
|
|||
|
|
@ -74794,7 +74794,9 @@
|
|||
"output_cost_per_token": 2.8e-07,
|
||||
"source": "https://prisminference.com/pricing",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions"
|
||||
"/v1/chat/completions",
|
||||
"/v1/responses",
|
||||
"/v1/messages"
|
||||
],
|
||||
"supports_function_calling": true,
|
||||
"supports_native_streaming": true,
|
||||
|
|
|
|||
|
|
@ -2147,8 +2147,8 @@
|
|||
"url": "https://docs.litellm.ai/docs/providers/prism",
|
||||
"endpoints": {
|
||||
"chat_completions": true,
|
||||
"messages": false,
|
||||
"responses": false,
|
||||
"messages": true,
|
||||
"responses": true,
|
||||
"embeddings": false,
|
||||
"image_generations": false,
|
||||
"audio_transcriptions": false,
|
||||
|
|
|
|||
|
|
@ -83,8 +83,8 @@ def test_prism_supported_endpoints():
|
|||
|
||||
assert providers["prism"]["endpoints"] == {
|
||||
"chat_completions": True,
|
||||
"messages": False,
|
||||
"responses": False,
|
||||
"messages": True,
|
||||
"responses": True,
|
||||
"embeddings": False,
|
||||
"image_generations": False,
|
||||
"audio_transcriptions": False,
|
||||
|
|
@ -94,3 +94,35 @@ def test_prism_supported_endpoints():
|
|||
"rerank": False,
|
||||
"a2a": False,
|
||||
}
|
||||
|
||||
|
||||
def test_prism_resolves_responses_and_messages_configs():
|
||||
from litellm.llms.openai_like.json_loader import JSONProviderRegistry
|
||||
from litellm.llms.openai_like.messages.transformation import (
|
||||
JSONProviderAnthropicMessagesConfig,
|
||||
)
|
||||
from litellm.utils import ProviderConfigManager
|
||||
|
||||
assert JSONProviderRegistry.supports_responses_api("prism") is True
|
||||
responses_config = ProviderConfigManager.get_provider_responses_api_config(
|
||||
provider="prism",
|
||||
model="deepseek-v4-flash",
|
||||
)
|
||||
messages_config = ProviderConfigManager.get_provider_anthropic_messages_config(
|
||||
provider=litellm.LlmProviders.PRISM,
|
||||
model="deepseek-v4-flash",
|
||||
)
|
||||
|
||||
assert responses_config is not None
|
||||
assert responses_config.custom_llm_provider == "prism"
|
||||
assert isinstance(messages_config, JSONProviderAnthropicMessagesConfig)
|
||||
assert (
|
||||
messages_config.get_complete_url(
|
||||
api_base=None,
|
||||
api_key="prism-test-key",
|
||||
model="deepseek-v4-flash",
|
||||
optional_params={},
|
||||
litellm_params={},
|
||||
)
|
||||
== "https://api.prisminference.com/v1/messages"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue