Declarative providers (#5084)
Co-authored-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Michael Neale <michael.neale@gmail.com>
This commit is contained in:
@@ -10,8 +10,8 @@ use goose::providers::base::Provider;
|
||||
use goose::providers::{
|
||||
anthropic::AnthropicProvider, azure::AzureProvider, bedrock::BedrockProvider,
|
||||
databricks::DatabricksProvider, gcpvertexai::GcpVertexAIProvider, google::GoogleProvider,
|
||||
groq::GroqProvider, ollama::OllamaProvider, openai::OpenAiProvider,
|
||||
openrouter::OpenRouterProvider, xai::XaiProvider,
|
||||
ollama::OllamaProvider, openai::OpenAiProvider, openrouter::OpenRouterProvider,
|
||||
xai::XaiProvider,
|
||||
};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
@@ -24,7 +24,6 @@ enum ProviderType {
|
||||
Databricks,
|
||||
GcpVertexAI,
|
||||
Google,
|
||||
Groq,
|
||||
Ollama,
|
||||
OpenRouter,
|
||||
Xai,
|
||||
@@ -43,7 +42,6 @@ impl ProviderType {
|
||||
ProviderType::Bedrock => &["AWS_PROFILE"],
|
||||
ProviderType::Databricks => &["DATABRICKS_HOST"],
|
||||
ProviderType::Google => &["GOOGLE_API_KEY"],
|
||||
ProviderType::Groq => &["GROQ_API_KEY"],
|
||||
ProviderType::Ollama => &[],
|
||||
ProviderType::OpenRouter => &["OPENROUTER_API_KEY"],
|
||||
ProviderType::GcpVertexAI => &["GCP_PROJECT_ID", "GCP_LOCATION"],
|
||||
@@ -80,7 +78,6 @@ impl ProviderType {
|
||||
Arc::new(GcpVertexAIProvider::from_env(model_config).await?)
|
||||
}
|
||||
ProviderType::Google => Arc::new(GoogleProvider::from_env(model_config).await?),
|
||||
ProviderType::Groq => Arc::new(GroqProvider::from_env(model_config).await?),
|
||||
ProviderType::Ollama => Arc::new(OllamaProvider::from_env(model_config).await?),
|
||||
ProviderType::OpenRouter => Arc::new(OpenRouterProvider::from_env(model_config).await?),
|
||||
ProviderType::Xai => Arc::new(XaiProvider::from_env(model_config).await?),
|
||||
@@ -305,16 +302,6 @@ mod tests {
|
||||
.await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_agent_with_groq() -> Result<()> {
|
||||
run_test_with_config(TestConfig {
|
||||
provider_type: ProviderType::Groq,
|
||||
model: "gemma2-9b-it",
|
||||
context_window: 9_000,
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_agent_with_openrouter() -> Result<()> {
|
||||
run_test_with_config(TestConfig {
|
||||
|
||||
@@ -9,7 +9,6 @@ use goose::providers::create_with_named_model;
|
||||
use goose::providers::databricks::DATABRICKS_DEFAULT_MODEL;
|
||||
use goose::providers::errors::ProviderError;
|
||||
use goose::providers::google::GOOGLE_DEFAULT_MODEL;
|
||||
use goose::providers::groq::GROQ_DEFAULT_MODEL;
|
||||
use goose::providers::litellm::LITELLM_DEFAULT_MODEL;
|
||||
use goose::providers::ollama::OLLAMA_DEFAULT_MODEL;
|
||||
use goose::providers::openai::OPEN_AI_DEFAULT_MODEL;
|
||||
@@ -501,11 +500,6 @@ async fn test_ollama_provider() -> Result<()> {
|
||||
test_provider("Ollama", OLLAMA_DEFAULT_MODEL, &["OLLAMA_HOST"], None).await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_groq_provider() -> Result<()> {
|
||||
test_provider("Groq", GROQ_DEFAULT_MODEL, &["GROQ_API_KEY"], None).await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_anthropic_provider() -> Result<()> {
|
||||
test_provider(
|
||||
|
||||
Reference in New Issue
Block a user