Skip to content

Commit d096d71

Browse files
Fixes
1 parent 12ef3b6 commit d096d71

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

lib/langchainrb_rails/generators/langchainrb_rails/assistant_generator.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,15 @@ def copy_stylesheets
8282

8383
# TODO: Depending on the LLM provider, we may need to add additional gems
8484
def add_to_gemfile
85-
inside Rails.root do
86-
run "bundle add turbo-rails"
85+
gem_name = "turbo-rails"
86+
gemfile_content = File.read(Rails.root.join("Gemfile"))
87+
88+
if gemfile_content.include?(gem_name)
89+
say_status :skipped, "#{gem_name} already exists in Gemfile"
90+
else
91+
inside Rails.root do
92+
run "bundle add #{gem_name}"
93+
end
8794
end
8895
end
8996

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<%%= form_with(model: [@assistant, Message.new], url: chat_assistant_path(@assistant), method: :post, class: "chat-form") do |form| %>
2-
<%%= form.text_area :content, class: "chat-input", placeholder: "Type your message..." %>
2+
<%%= form.text_field :content, class: "chat-input", placeholder: "Type your message..." %>
33
<%%= form.submit 'Send', class: "chat-submit" %>
44
<%% end %>

lib/langchainrb_rails/generators/langchainrb_rails/templates/assistant/views/show.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="chat-interface">
22
<aside class="sidebar">
33
<div class="sidebar-header">
4-
<h1>ChatGPT</h1>
4+
<h1>Langchain.rb</h1>
55
</div>
66
<nav class="assistants-nav">
77
<h2>Assistants</h2>
@@ -29,7 +29,7 @@
2929

3030
<footer class="chat-footer">
3131
<%%= form_with(model: [@assistant, Message.new], url: chat_assistant_path(@assistant), method: :post, class: "chat-form") do |form| %>
32-
<%%= form.text_area :content, class: "chat-input", placeholder: "Message ChatGPT", rows: 1 %>
32+
<%%= form.text_field :content, class: "chat-input", placeholder: "Type your message...", rows: 1 %>
3333
<%%= button_tag(type: "submit", class: "send-button") do %>
3434
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="send-icon">
3535
<path d="M3.478 2.405a.75.75 0 00-.926.94l2.432 7.905H13.5a.75.75 0 010 1.5H4.984l-2.432 7.905a.75.75 0 00.926.94 60.519 60.519 0 0018.445-8.986.75.75 0 000-1.218A60.517 60.517 0 003.478 2.405z" />

0 commit comments

Comments
 (0)