Skip to content
Closed
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
10 changes: 8 additions & 2 deletions crates/goose-server/src/routes/providers_and_keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"models": ["gemini-1.5-flash"],
"required_keys": ["GOOGLE_API_KEY"]
},
"grok": {
"groq": {
"name": "Groq",
"description": "Lorem ipsum",
"models": ["llama-3.3-70b-versatile"],
Expand Down Expand Up @@ -58,5 +58,11 @@
"description": "Connect to LLMs via AWS Bedrock",
"models": ["us.anthropic.claude-3-7-sonnet-20250219-v1:0"],
"required_keys": ["AWS_PROFILE"]
}
},
"xai": {
"name": "Xai",
"description": "Lorem ipsum",
"models": ["grok-3"],
"required_keys": ["XAI_API_KEY"]
},
}
15 changes: 14 additions & 1 deletion crates/goose/tests/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use goose::providers::{
anthropic::AnthropicProvider, azure::AzureProvider, bedrock::BedrockProvider,
databricks::DatabricksProvider, gcpvertexai::GcpVertexAIProvider, google::GoogleProvider,
groq::GroqProvider, ollama::OllamaProvider, openai::OpenAiProvider,
openrouter::OpenRouterProvider,
openrouter::OpenRouterProvider, xai::XaiProvider,
};

#[derive(Debug, PartialEq)]
Expand All @@ -27,6 +27,7 @@ enum ProviderType {
Groq,
Ollama,
OpenRouter,
Xai,
}

impl ProviderType {
Expand All @@ -46,6 +47,7 @@ impl ProviderType {
ProviderType::Ollama => &[],
ProviderType::OpenRouter => &["OPENROUTER_API_KEY"],
ProviderType::GcpVertexAI => &["GCP_PROJECT_ID", "GCP_LOCATION"],
ProviderType::Xai => &["XAI_API_KEY"],
}
}

Expand Down Expand Up @@ -79,6 +81,7 @@ impl ProviderType {
ProviderType::Groq => Arc::new(GroqProvider::from_env(model_config)?),
ProviderType::Ollama => Arc::new(OllamaProvider::from_env(model_config)?),
ProviderType::OpenRouter => Arc::new(OpenRouterProvider::from_env(model_config)?),
ProviderType::Xai => Arc::new(XaiProvider::from_env(model_config)?),
})
}
}
Expand Down Expand Up @@ -326,4 +329,14 @@ mod tests {
})
.await
}

#[tokio::test]
async fn test_agent_with_xai() -> Result<()> {
run_test_with_config(TestConfig {
provider_type: ProviderType::Xai,
model: "grok-3",
context_window: 9_000,
})
.await
}
}
13 changes: 12 additions & 1 deletion crates/goose/tests/providers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use goose::message::{Message, MessageContent};
use goose::providers::base::Provider;
use goose::providers::errors::ProviderError;
use goose::providers::{
anthropic, azure, bedrock, databricks, google, groq, ollama, openai, openrouter, snowflake,
anthropic, azure, bedrock, databricks, google, groq, ollama, openai, openrouter, snowflake, xai,
};
use mcp_core::content::Content;
use mcp_core::tool::Tool;
Expand Down Expand Up @@ -501,6 +501,17 @@ async fn test_sagemaker_tgi_provider() -> Result<()> {
.await
}

#[tokio::test]
async fn test_xai_provider() -> Result<()> {
test_provider(
"Xai",
&["XAI_API_KEY"],
None,
xai::XaiProvider::default,
)
.await
}

// Print the final test report
#[ctor::dtor]
fn print_test_report() {
Expand Down