Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 35 additions & 10 deletions tests/transports-integrations/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bifrost Integration Tests

Production-ready end-to-end test suite for testing AI integrations through Bifrost proxy. This test suite provides uniform testing across multiple AI integrations with comprehensive coverage of chat, tool calling, image processing, and multimodal workflows.
Production-ready end-to-end test suite for testing AI integrations through Bifrost proxy. This test suite provides uniform testing across multiple AI integrations with comprehensive coverage of chat, tool calling, image processing, embeddings, speech synthesis, and multimodal workflows.
Comment thread
Pratham-Mishra04 marked this conversation as resolved.

## 🌉 Architecture Overview

Expand All @@ -27,15 +27,16 @@ The Bifrost integration tests use a centralized configuration system that routes
- **🌉 Bifrost Gateway Integration**: All integrations route through Bifrost proxy
- **🤖 Centralized Configuration**: YAML-based configuration with environment variable support
- **🔧 Integration-Specific Clients**: Type-safe, integration-optimized implementations
- **📋 Comprehensive Test Coverage**: 13 categories covering all major AI functionality
- **📋 Comprehensive Test Coverage**: 14 categories covering all major AI functionality
- **⚙️ Flexible Execution**: Selective test running with command-line flags
Comment thread
Pratham-Mishra04 marked this conversation as resolved.
- **🛡️ Robust Error Handling**: Graceful error handling and detailed error reporting
- **🎯 Production-Ready**: Async support, timeouts, retries, and logging
- **🎵 Speech & Audio Support**: Text-to-speech synthesis and speech-to-text transcription testing
- **🔗 Embeddings Support**: Text-to-vector conversion and similarity analysis testing

## 📋 Test Categories

Our test suite covers 21 comprehensive scenarios for each integration:
Our test suite covers 30 comprehensive scenarios for each integration:

### Core Chat & Conversation Tests
1. **Simple Chat** - Basic single-message conversations
Expand All @@ -62,10 +63,22 @@ Our test suite covers 21 comprehensive scenarios for each integration:
16. **Transcription Error Handling** - Invalid audio format and model error handling
17. **Voice & Format Testing** - Multiple voices and audio format validation

### Embeddings Tests (OpenAI)
18. **Single Text Embedding** - Basic text-to-vector conversion
19. **Batch Text Embeddings** - Multiple text embeddings in single request
20. **Embedding Similarity Analysis** - Cosine similarity testing for similar texts
21. **Embedding Dissimilarity Analysis** - Validation of different topic embeddings
22. **Different Embedding Models** - Testing various embedding model capabilities
23. **Long Text Embedding** - Handling of longer text inputs and token usage
24. **Embedding Error Handling** - Invalid model and input error processing
25. **Dimensionality Reduction** - Custom embedding dimensions (if supported)
26. **Encoding Format Testing** - Different embedding output formats
27. **Usage Tracking** - Token consumption and batch processing validation

### Integration & Error Tests
19. **Complex End-to-End** - Comprehensive multimodal workflows
20. **Integration-Specific Features** - Integration-unique capabilities
21. **Error Handling** - Invalid request error processing and propagation
28. **Complex End-to-End** - Comprehensive multimodal workflows
29. **Integration-Specific Features** - Integration-unique capabilities
30. **Error Handling** - Invalid request error processing and propagation

## 📁 Directory Structure

Expand Down Expand Up @@ -649,10 +662,10 @@ vision_model = get_model("anthropic", "vision")
#### OpenAI

- ✅ **Full Bifrost Integration**: Complete base URL support
- ✅ **Models**: gpt-3.5-turbo, gpt-4, gpt-4o, gpt-4o-mini
- ✅ **Features**: Chat, tools, vision
- ✅ **Models**: gpt-3.5-turbo, gpt-4, gpt-4o, gpt-4o-mini, text-embedding-3-small, tts-1, whisper-1
- ✅ **Features**: Chat, tools, vision, speech synthesis, transcription, embeddings
- ✅ **Settings**: Organization/project IDs, timeouts, retries
- ✅ **All Test Categories**: 11/11 scenarios supported
- ✅ **All Test Categories**: 30/30 scenarios supported (including speech & embeddings)

#### Anthropic

Expand Down Expand Up @@ -815,6 +828,12 @@ pytest tests/integrations/test_google.py::TestGoogleIntegration::test_07_image_u

# Test 9: Multiple Images
pytest tests/integrations/test_litellm.py::TestLiteLLMIntegration::test_09_multiple_images -v

# Test 21: Single Text Embedding (OpenAI only)
pytest tests/integrations/test_openai.py::TestOpenAIIntegration::test_21_single_text_embedding -v

# Test 23: Embedding Similarity Analysis (OpenAI only)
pytest tests/integrations/test_openai.py::TestOpenAIIntegration::test_23_embedding_similarity_analysis -v
```

#### Running Test Categories by Pattern
Expand All @@ -829,11 +848,17 @@ pytest tests/integrations/ -k "tool_call" -v
# Run all image-related tests
pytest tests/integrations/ -k "image" -v

# Run all embedding tests (OpenAI only)
pytest tests/integrations/test_openai.py -k "embedding" -v

# Run all speech and audio tests (OpenAI only)
pytest tests/integrations/test_openai.py -k "speech or transcription" -v

# Run all end-to-end tests
pytest tests/integrations/ -k "end2end" -v

# Run integration-specific feature tests
pytest tests/integrations/ -k "test_11_integration_specific" -v
pytest tests/integrations/ -k "integration_specific" -v
```

#### Running Tests by Integration
Expand Down
43 changes: 43 additions & 0 deletions tests/transports-integrations/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ models:
tools: "gpt-3.5-turbo"
speech: "tts-1"
transcription: "whisper-1"
embeddings: "text-embedding-3-small"
alternatives:
- "gpt-4"
- "gpt-4-turbo-preview"
Expand All @@ -43,6 +44,9 @@ models:
- "tts-1-hd"
transcription_alternatives:
- "whisper-1"
embeddings_alternatives:
- "text-embedding-3-large"
- "text-embedding-ada-002"

anthropic:
chat: "claude-3-haiku-20240307"
Expand Down Expand Up @@ -144,9 +148,47 @@ model_capabilities:
streaming: false
speech: false
transcription: true
embeddings: false
max_tokens: null
context_window: null

# OpenAI Embedding Models
"text-embedding-3-small":
chat: false
tools: false
vision: false
streaming: false
speech: false
transcription: false
embeddings: true
max_tokens: null
context_window: 8191
dimensions: 1536

"text-embedding-3-large":
chat: false
tools: false
vision: false
streaming: false
speech: false
transcription: false
embeddings: true
max_tokens: null
context_window: 8191
dimensions: 3072

"text-embedding-ada-002":
chat: false
tools: false
vision: false
streaming: false
speech: false
transcription: false
embeddings: true
max_tokens: null
context_window: 8191
dimensions: 1536

# Anthropic Models
"claude-3-haiku-20240307":
chat: true
Expand Down Expand Up @@ -207,6 +249,7 @@ test_settings:
complex: 300
speech: null # Speech doesn't use token limits
transcription: null # Transcription doesn't use token limits
embeddings: null # Embeddings don't use token limits (text is the input)

# Timeout settings for tests
timeouts:
Expand Down
Loading