Skip to content

Commit 82e6680

Browse files
Views use turbo so we need to add turbo-rails to the host Gemfile
1 parent 59514dd commit 82e6680

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ prompt.render(adjective: "funny", subject: "elephants")
147147
# => "Tell me a funny joke about elephants."
148148
```
149149

150-
### Assistant Generator - adds assistant capabilities to your ActiveRecord model
150+
### Assistant Generator - adds Langchain::Assistant capabilities to your Rails app
151+
152+
This generator adds Langchain::Assistant-related ActiveRecord models, migrations, controllers, views and route to your Rails app. You can start creating assistants and chatting with them in immediately.
153+
151154
```bash
152-
rails generate langchainrb_rails:assistant
155+
rails generate langchainrb_rails:assistant --llm=openai
153156
```

lib/langchainrb_rails/generators/langchainrb_rails/assistant_generator.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ def copy_stylesheets
7979
template "assistant/stylesheets/chat.css", "app/assets/stylesheets/chat.css"
8080
end
8181

82-
# TODO: Do we need to add turbo-rails to the gemfile?
8382
# TODO: Depending on the LLM provider, we may need to add additional gems
84-
# def add_to_gemfile
85-
# end
83+
def add_to_gemfile
84+
inside Rails.root do
85+
run "bundle add turbo-rails"
86+
end
87+
end
8688

8789
def post_install_message
8890
say "1. Set an environment variable ENV['#{llm.upcase}_API_KEY'] for your #{llm_class}."

0 commit comments

Comments
 (0)