-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
767bcb8
commit 05d4b12
Showing
8 changed files
with
57 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...angchainrb_rails/generators/langchainrb_rails/templates/assistant/views/_message.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<div id="<%= dom_id message %>" class="message <%= message.role %>"> | ||
<div id="<%%= dom_id message %>" class="message <%%= message.role %>"> | ||
<div class="message-content"> | ||
<%= message.content %> | ||
<%%= message.content %> | ||
</div> | ||
</div> |
8 changes: 4 additions & 4 deletions
8
...ainrb_rails/generators/langchainrb_rails/templates/assistant/views/_message_form.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<%= form_with(model: [@assistant, Message.new], url: chat_assistant_path(@assistant), method: :post, class: "chat-form") do |form| %> | ||
<%= form.text_area :content, class: "chat-input", placeholder: "Type your message..." %> | ||
<%= form.submit 'Send', class: "chat-submit" %> | ||
<% end %> | ||
<%%= form_with(model: [@assistant, Message.new], url: chat_assistant_path(@assistant), method: :post, class: "chat-form") do |form| %> | ||
<%%= form.text_area :content, class: "chat-input", placeholder: "Type your message..." %> | ||
<%%= form.submit 'Send', class: "chat-submit" %> | ||
<%% end %> |
8 changes: 4 additions & 4 deletions
8
lib/langchainrb_rails/generators/langchainrb_rails/templates/assistant/views/index.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<div class="assistant-list-container"> | ||
<h1 class="list-header">Assistants</h1> | ||
|
||
<%= link_to 'Create New Assistant', new_assistant_path, class: "new-assistant-link" %> | ||
<%%= link_to 'Create New Assistant', new_assistant_path, class: "new-assistant-link" %> | ||
|
||
<ul class="assistant-list"> | ||
<% @assistants.each do |assistant| %> | ||
<%% @assistants.each do |assistant| %> | ||
<li class="assistant-item"> | ||
<%= link_to assistant.instructions, assistant_path(assistant), class: "assistant-link" %> | ||
<%%= link_to assistant.instructions, assistant_path(assistant), class: "assistant-link" %> | ||
</li> | ||
<% end %> | ||
<%% end %> | ||
</ul> | ||
</div> |
35 changes: 22 additions & 13 deletions
35
lib/langchainrb_rails/generators/langchainrb_rails/templates/assistant/views/new.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
<div class="assistant-form-container"> | ||
<h1 class="form-header">Create New Assistant</h1> | ||
|
||
<%= form_with(model: @assistant, local: true, class: "assistant-form") do |form| %> | ||
<% if @assistant.errors.any? %> | ||
<%%= form_with(model: @assistant, local: true, class: "assistant-form") do |form| %> | ||
<%% if @assistant.errors.any? %> | ||
<div class="error-messages"> | ||
<h2><%= pluralize(@assistant.errors.count, "error") %> prohibited this assistant from being saved:</h2> | ||
<h2><%%= pluralize(@assistant.errors.count, "error") %> prohibited this assistant from being saved:</h2> | ||
<ul> | ||
<% @assistant.errors.full_messages.each do |message| %> | ||
<li><%= message %></li> | ||
<% end %> | ||
<%% @assistant.errors.full_messages.each do |message| %> | ||
<li><%%= message %></li> | ||
<%% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
<%% end %> | ||
|
||
<div class="form-group"> | ||
<%= form.label :instructions, "Instructions for the Assistant" %> | ||
<%= form.text_area :instructions, rows: 5, placeholder: "Enter instructions for the assistant..." %> | ||
<%%= form.label :instructions, "Instructions for the Assistant" %> | ||
<%%= form.text_area :instructions, rows: 5, placeholder: "Enter instructions for the assistant..." %> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<%%= form.label :tool_choice, "Tool Choice" %> | ||
<%%= form.select :tool_choice, options_for_select([ | ||
['Auto', 'auto'], | ||
['None', 'none'], | ||
['Any', 'any'] | ||
]), {}, { class: 'tool-choice-select' } %> | ||
</div> | ||
|
||
<div class="form-actions"> | ||
<%= form.submit "Create Assistant", class: "submit-button" %> | ||
<%= link_to 'Back to Assistants', assistants_path, class: "back-link" %> | ||
<%%= form.submit "Create Assistant", class: "submit-button" %> | ||
<%%= link_to 'Back to Assistants', assistants_path, class: "back-link" %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<%% end %> | ||
</div> |
10 changes: 5 additions & 5 deletions
10
lib/langchainrb_rails/generators/langchainrb_rails/templates/assistant/views/show.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<div class="chat-container"> | ||
<h1 class="chat-header">Assistant: <%= @assistant.id %></h1> | ||
<h1 class="chat-header">Assistant: <%%= @assistant.id %></h1> | ||
|
||
<div id="chat-messages" class="chat-messages"> | ||
<%= render partial: "assistants/message", collection: @messages %> | ||
<%%= render partial: "assistants/message", collection: @messages %> | ||
</div> | ||
|
||
<%= turbo_frame_tag "new_message" do %> | ||
<%= render "assistants/message_form" %> | ||
<% end %> | ||
<%%= turbo_frame_tag "new_message" do %> | ||
<%%= render "assistants/message_form" %> | ||
<%% end %> | ||
</div> |