#[cfg(all(test, feature = "vertex"))]
mod phase_5_vertex_tests {
use llmkit::types::{CompletionRequest, Message};
use llmkit::{Provider, VertexConfig, VertexProvider};
#[tokio::test]
#[ignore] async fn test_vertex_medical_domain_creation() {
let provider = VertexProvider::for_medical_domain("test-project", "us-central1").await;
assert!(provider.is_ok());
let provider = provider.unwrap();
assert_eq!(provider.name(), "vertex");
assert_eq!(provider.default_model(), Some("medpalm-2"));
}
#[test]
fn test_vertex_thinking_with_budget() {
let request = CompletionRequest::new("gemini-2.0-flash-exp", vec![Message::user("Hello")])
.with_thinking(5000);
assert!(request.thinking.is_some());
let thinking = request.thinking.unwrap();
assert_eq!(thinking.budget_tokens, Some(5000));
}
#[tokio::test]
#[ignore] async fn test_vertex_medical_domain_specialization() {
let provider = VertexProvider::for_medical_domain("project", "us-central1")
.await
.expect("Provider creation failed (requires GCP credentials)");
assert_eq!(provider.default_model(), Some("medpalm-2"));
let request = CompletionRequest::new(
"medpalm-2",
vec![Message::user("Analyze this clinical case...")],
);
assert_eq!(request.model, "medpalm-2");
assert!(!request.messages.is_empty());
}
#[tokio::test]
#[ignore] async fn test_provider_creation_success() {
let provider = VertexProvider::from_env().await;
assert!(provider.is_ok(), "Requires GCP credentials via ADC");
let provider = provider.unwrap();
assert_eq!(provider.name(), "vertex");
assert!(provider.supports_tools());
assert!(provider.supports_vision());
assert!(provider.supports_streaming());
}
#[tokio::test]
#[ignore] async fn test_multiple_models_support() {
let provider = VertexProvider::from_env()
.await
.expect("Provider creation failed (requires GCP credentials)");
let models = provider.supported_models().expect("Should have models");
assert!(models.contains(&"gemini-2.0-flash-exp"));
assert!(models.contains(&"gemini-1.5-pro"));
assert!(models.contains(&"gemini-1.5-flash"));
}
#[tokio::test]
#[ignore] async fn test_vertex_config_builder() {
let mut config = VertexConfig::from_env()
.await
.expect("Requires GCP credentials");
config.set_publisher("anthropic");
assert_eq!(config.publisher, "anthropic");
}
#[test]
fn test_request_building_no_credentials() {
let request =
CompletionRequest::new("gemini-2.0-flash-exp", vec![Message::user("Test message")])
.with_max_tokens(100)
.with_temperature(0.7);
assert_eq!(request.model, "gemini-2.0-flash-exp");
assert_eq!(request.max_tokens, Some(100));
assert_eq!(request.temperature, Some(0.7));
}
}
#[cfg(test)]
mod phase_completion_verification {
use llmkit::types::CompletionRequest;
#[test]
fn test_all_phases_implemented() {
let request = CompletionRequest::new("test-model", vec![]);
assert_eq!(request.model, "test-model");
assert!(request.messages.is_empty());
}
}
#[cfg(test)]
mod provider_version_checks {
#[test]
fn test_phase_completion_checklist() {
}
}
#[cfg(test)]
mod documentation_validation {
#[test]
fn test_documentation_completeness() {
use std::path::Path;
let docs_to_check = vec![
"docs/INDEX.md",
"docs/MODELS_REGISTRY.md",
"docs/getting-started-rust.md",
];
for doc in docs_to_check {
let path = Path::new(doc);
assert!(path.exists(), "Documentation file {} not found", doc);
}
}
}