Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
/pkg/
/spec/reports/
/tmp/
.ruby-version

# rspec failure tracking
.rspec_status
.DS_Store
**/.DS_Store
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,12 @@ This generator adds Langchain::Assistant-related ActiveRecord models, migrations

```bash
rails generate langchainrb_rails:assistant --llm=openai
```
```

Available `--llm` options: `anthropic`, `cohere`, `google_palm`, `google_gemini`, `google_vertex_ai`, `hugging_face`, `llama_cpp`, `mistral_ai`, `ollama`, `openai`, and `replicate`. The selected LLM will be used to generate completions.

To remove the generated files, run:

```bash
rails destroy langchainrb_rails:assistant
```
Binary file removed lib/langchainrb_rails/.DS_Store
Binary file not shown.
Binary file removed lib/langchainrb_rails/generators/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
end

after(:all) do
FileUtils.rm_rf(destination_root)
delete_directory(destination_root)
end

it "creates an assistant model" do
Expand All @@ -30,4 +30,34 @@
it "creates an assistants migration" do
assert_migration "db/migrate/create_assistants.rb"
end

describe "views" do
it "creates index view" do
assert_file "app/views/assistants/index.html.erb"
end

it "creates show view" do
assert_file "app/views/assistants/show.html.erb"
end

it "creates edit view" do
assert_file "app/views/assistants/edit.html.erb"
end

it "creates new view" do
assert_file "app/views/assistants/new.html.erb"
end

it "creates chat partial" do
assert_file "app/views/assistants/_message.html.erb"
end

it "creates message form partial" do
assert_file "app/views/assistants/_message_form.html.erb"
end

it "creates chat stream template" do
assert_file "app/views/assistants/chat.turbo_stream.erb"
end
end
end