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

Conversation

jasonkneen
Copy link

@jasonkneen jasonkneen commented Feb 5, 2025

Fixes #937

Update the post method in crates/goose/src/providers/groq.rs to handle the API request correctly and return a successful response if the API key is valid.

  • Change the return type of the post method to Result<Value, ProviderError> and add error handling for invalid API key or insufficient permissions.
  • Change the return type of the send_message method to Result<(Message, ProviderUsage), ProviderError>.

Update the configure_provider_dialog function in crates/goose-cli/src/commands/configure.rs to handle the provider configuration process correctly.

  • Change the condition to check if the configuration exists using parentheses.

For more details, open the Copilot Workspace session.

Fixes block#937

Update the `post` method in `crates/goose/src/providers/groq.rs` to handle the API request correctly and return a successful response if the API key is valid.

* Change the return type of the `post` method to `Result<Value, ProviderError>` and add error handling for invalid API key or insufficient permissions.
* Change the return type of the `send_message` method to `Result<(Message, ProviderUsage), ProviderError>`.

Update the `configure_provider_dialog` function in `crates/goose-cli/src/commands/configure.rs` to handle the provider configuration process correctly.

* Change the condition to check if the configuration exists using parentheses.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/block/goose/issues/937?shareId=XXXX-XXXX-XXXX-XXXX).
@@ -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?

@michaelneale
Copy link
Collaborator

autogenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't save the groq api key
3 participants