Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix groq API key saving issue #1082

Closed
wants to merge 1 commit into from
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
2 changes: 1 addition & 1 deletion crates/goose-cli/src/commands/configure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::error::Error;
pub async fn handle_configure() -> Result<(), Box<dyn Error>> {
let config = Config::global();

if !config.exists() {
if (!config.exists()) {
// First time setup flow
println!();
println!(
Expand Down
4 changes: 2 additions & 2 deletions crates/goose/src/providers/groq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl GroqProvider {
})
}

async fn post(&self, payload: Value) -> anyhow::Result<Value, ProviderError> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does it fix the Groq API key issue? use anyhow::Result; is imported at the top, so i think this is a syntactical change?

async fn post(&self, payload: Value) -> Result<Value, ProviderError> {
let base_url = Url::parse(&self.host)
.map_err(|e| ProviderError::RequestFailed(format!("Invalid base URL: {e}")))?;
let url = base_url.join("openai/v1/chat/completions").map_err(|e| {
Expand Down Expand Up @@ -127,7 +127,7 @@ impl Provider for GroqProvider {
system: &str,
messages: &[Message],
tools: &[Tool],
) -> anyhow::Result<(Message, ProviderUsage), ProviderError> {
) -> Result<(Message, ProviderUsage), ProviderError> {
let payload = create_request(
&self.model,
system,
Expand Down
Loading