cleaned up logs and fixed issue with connectivity for llm gateway in weather forecast demo

This commit is contained in:
Salman Paracha 2025-09-05 09:09:17 -07:00
parent 04208e9cd1
commit 2895a07088
3 changed files with 26 additions and 19 deletions

View file

@ -22,6 +22,7 @@
//! ```
use crate::{apis::{AnthropicApi, ApiDefinition, OpenAIApi}, ProviderId};
use std::fmt;
/// Unified enum representing all supported API endpoints across providers
#[derive(Debug, Clone, PartialEq)]
@ -30,6 +31,15 @@ pub enum SupportedAPIs {
AnthropicMessagesAPI(AnthropicApi),
}
impl fmt::Display for SupportedAPIs {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
SupportedAPIs::OpenAIChatCompletions(api) => write!(f, "OpenAI API ({})", api.endpoint()),
SupportedAPIs::AnthropicMessagesAPI(api) => write!(f, "Anthropic API ({})", api.endpoint()),
}
}
}
impl SupportedAPIs {
/// Create a SupportedApi from an endpoint path
pub fn from_endpoint(endpoint: &str) -> Option<Self> {