Skip to content

Commit 1d31688

Browse files
authored
Assistant generator UI (#125)
* remove os files and ignore globally * ignore ruby-version * add destroy instructions * test that the views get generated * readme update
1 parent 9dfadbf commit 1d31688

File tree

8 files changed

+42
-3
lines changed

8 files changed

+42
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
/pkg/
77
/spec/reports/
88
/tmp/
9+
.ruby-version
910

1011
# rspec failure tracking
1112
.rspec_status
12-
.DS_Store
13+
**/.DS_Store

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,12 @@ This generator adds Langchain::Assistant-related ActiveRecord models, migrations
153153

154154
```bash
155155
rails generate langchainrb_rails:assistant --llm=openai
156-
```
156+
```
157+
158+
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.
159+
160+
To remove the generated files, run:
161+
162+
```bash
163+
rails destroy langchainrb_rails:assistant
164+
```

lib/langchainrb_rails/.DS_Store

-6 KB
Binary file not shown.
-6 KB
Binary file not shown.
-6 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

spec/langchainrb_rails/generators/langchainrb_rails/assistant_generator_spec.rb

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
end
1313

1414
after(:all) do
15-
FileUtils.rm_rf(destination_root)
15+
delete_directory(destination_root)
1616
end
1717

1818
it "creates an assistant model" do
@@ -30,4 +30,34 @@
3030
it "creates an assistants migration" do
3131
assert_migration "db/migrate/create_assistants.rb"
3232
end
33+
34+
describe "views" do
35+
it "creates index view" do
36+
assert_file "app/views/assistants/index.html.erb"
37+
end
38+
39+
it "creates show view" do
40+
assert_file "app/views/assistants/show.html.erb"
41+
end
42+
43+
it "creates edit view" do
44+
assert_file "app/views/assistants/edit.html.erb"
45+
end
46+
47+
it "creates new view" do
48+
assert_file "app/views/assistants/new.html.erb"
49+
end
50+
51+
it "creates chat partial" do
52+
assert_file "app/views/assistants/_message.html.erb"
53+
end
54+
55+
it "creates message form partial" do
56+
assert_file "app/views/assistants/_message_form.html.erb"
57+
end
58+
59+
it "creates chat stream template" do
60+
assert_file "app/views/assistants/chat.turbo_stream.erb"
61+
end
62+
end
3363
end

0 commit comments

Comments
 (0)