Skip to content

Commit

Permalink
Generator is for Rails apps
Browse files Browse the repository at this point in the history
  • Loading branch information
drnic committed Apr 26, 2024
1 parent 5b1792e commit f040b90
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ gem install groq
- Place in env var `GROQ_API_KEY`, or explicitly pass into configuration below.
- Use the `Groq::Client` to interact with Groq and your favourite model.

```plain
rails g groq:install
```
to generate inializer file

```ruby
client = Groq::Client.new # uses ENV["GROQ_API_KEY"] and "llama3-8b-8192"
client = Groq::Client.new(api_key: "...", model_id: "llama3-8b-8192")
Expand All @@ -91,6 +86,12 @@ end
client = Groq::Client.new
```

In a Rails application, you can generate a `config/initializer/groq.rb` file with:

```plain
rails g groq:install
```

There is a simple chat function to send messages to a model:

```ruby
Expand Down

0 comments on commit f040b90

Please sign in to comment.