test fixes: TestArizePhoenixConfig

This commit is contained in:
Ishaan Jaff 2025-05-13 17:27:05 -07:00
parent b5e864be2e
commit c5277b6714
2 changed files with 53 additions and 20 deletions

View file

@ -1578,6 +1578,17 @@
"supported_output_modalities": ["audio"],
"supported_endpoints": ["/v1/audio/speech"]
},
"azure/gpt-4o-mini-tts": {
"mode": "audio_speech",
"input_cost_per_token": 2.5e-6,
"output_cost_per_token": 10e-6,
"output_cost_per_audio_token": 12e-6,
"output_cost_per_second": 0.00025,
"litellm_provider": "azure",
"supported_modalities": ["text", "audio"],
"supported_output_modalities": ["audio"],
"supported_endpoints": ["/v1/audio/speech"]
},
"azure/computer-use-preview": {
"max_tokens": 1024,
"max_input_tokens": 8192,
@ -3433,6 +3444,19 @@
"supports_embedding_image_input": true,
"source":"https://azuremarketplace.microsoft.com/en-us/marketplace/apps/cohere.cohere-embed-v3-english-offer?tab=PlansAndPrice"
},
"azure_ai/embed-v-4-0": {
"max_tokens": 128000,
"max_input_tokens": 128000,
"output_vector_size": 3072,
"input_cost_per_token": 0.00000012,
"output_cost_per_token": 0.0,
"litellm_provider": "azure_ai",
"mode": "embedding",
"supports_embedding_image_input": true,
"supported_endpoints": ["/v1/embeddings"],
"supported_modalities": ["text", "image"],
"source":"https://azuremarketplace.microsoft.com/pt-br/marketplace/apps/cohere.cohere-embed-4-offer?tab=PlansAndPrice"
},
"babbage-002": {
"max_tokens": 16384,
"max_input_tokens": 16384,

View file

@ -1,34 +1,43 @@
import unittest
from unittest.mock import patch
from litellm.integrations.arize.arize_phoenix import ArizePhoenixLogger
class TestArizePhoenixConfig(unittest.TestCase):
@patch.dict('os.environ', {
'PHOENIX_API_KEY': 'test_api_key',
'PHOENIX_COLLECTOR_HTTP_ENDPOINT': 'http://test.endpoint'
})
@patch.dict(
"os.environ",
{
"PHOENIX_API_KEY": "test_api_key",
"PHOENIX_COLLECTOR_HTTP_ENDPOINT": "http://test.endpoint",
},
)
def test_get_arize_phoenix_config_http(self):
# Call the function to get the configuration
config = ArizePhoenixLogger.get_arize_phoenix_config()
# Verify the configuration
self.assertEqual(config.otlp_auth_headers, 'Authorization=Bearer%20test_api_key')
self.assertEqual(config.endpoint, 'http://test.endpoint')
self.assertEqual(config.protocol, 'otlp_http')
@patch.dict('os.environ', {
'PHOENIX_API_KEY': 'test_api_key',
'PHOENIX_COLLECTOR_ENDPOINT': 'grpc://test.endpoint'
})
# Verify the configuration
self.assertEqual(config.otlp_auth_headers, "Authorization=Bearer test_api_key")
self.assertEqual(config.endpoint, "http://test.endpoint")
self.assertEqual(config.protocol, "otlp_http")
@patch.dict(
"os.environ",
{
"PHOENIX_API_KEY": "test_api_key",
"PHOENIX_COLLECTOR_ENDPOINT": "grpc://test.endpoint",
},
)
def test_get_arize_phoenix_config_grpc(self):
# Call the function to get the configuration
config = ArizePhoenixLogger.get_arize_phoenix_config()
# Verify the configuration
self.assertEqual(config.otlp_auth_headers, 'Authorization=Bearer%20test_api_key')
self.assertEqual(config.endpoint, 'grpc://test.endpoint')
self.assertEqual(config.protocol, 'otlp_grpc')
if __name__ == '__main__':
unittest.main()
# Verify the configuration
self.assertEqual(config.otlp_auth_headers, "Authorization=Bearer test_api_key")
self.assertEqual(config.endpoint, "grpc://test.endpoint")
self.assertEqual(config.protocol, "otlp_grpc")
if __name__ == "__main__":
unittest.main()