Skip to content

Commit a705230

Browse files
authored
fix prompt dirs in readme (#3)
1 parent 2929df2 commit a705230

1 file changed

Lines changed: 19 additions & 17 deletions

File tree

README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
Organize prompts into easy-to-use templates for [RubyLLM](https://github.com/crmne/ruby_llm).
88

99
```ruby
10-
# prompts/
11-
# extract_metadata/
12-
# ├── system.txt.erb # System message
13-
# ├── user.txt.erb # User prompt
14-
# ├── assistant.txt.erb # Assistant message (optional)
15-
# └── schema.rb # RubyLLM::Schema definition (optional)
10+
# app/
11+
# prompts/
12+
# extract_metadata/
13+
# ├── system.txt.erb # System message
14+
# ├── user.txt.erb # User prompt
15+
# ├── assistant.txt.erb # Assistant message (optional)
16+
# └── schema.rb # RubyLLM::Schema definition (optional)
1617

1718
chat = RubyLLM.chat
1819
chat.with_template(:extract_metadata, document: @document).complete
@@ -63,22 +64,23 @@ This will:
6364
Create a directory structure like this:
6465

6566
```
66-
prompts/
67-
extract_metadata/
68-
├── system.txt.erb # System message
69-
├── user.txt.erb # User prompt
70-
├── assistant.txt.erb # Assistant message (optional)
71-
└── schema.rb # RubyLLM::Schema definition (optional)
67+
app/
68+
prompts/
69+
extract_metadata/
70+
├── system.txt.erb # System message
71+
├── user.txt.erb # User prompt
72+
├── assistant.txt.erb # Assistant message (optional)
73+
└── schema.rb # RubyLLM::Schema definition (optional)
7274
```
7375

7476
### 2. Write Your Templates
7577

76-
**`prompts/extract_metadata/system.txt.erb`**:
78+
**`app/prompts/extract_metadata/system.txt.erb`**:
7779
```erb
7880
You are an expert document analyzer. Extract metadata from documents in a structured format.
7981
```
8082

81-
**`prompts/extract_metadata/user.txt.erb`**:
83+
**`app/prompts/extract_metadata/user.txt.erb`**:
8284
```erb
8385
Please analyze this document: <%= document %>
8486
@@ -87,7 +89,7 @@ Additional context: <%= additional_context %>
8789
<% end %>
8890
```
8991

90-
**`prompts/extract_metadata/schema.rb`**:
92+
**`app/prompts/extract_metadata/schema.rb`**:
9193
```ruby
9294
# Using RubyLLM::Schema DSL for clean, type-safe schemas
9395
RubyLLM::Schema.create do
@@ -164,7 +166,7 @@ chat.with_template(:message, name: "Alice", urgent: true, documents: @documents)
164166
```
165167

166168
```erb
167-
<!-- /prompts/message/user.txt.erb -->
169+
<!-- app/prompts/message/user.txt.erb -->
168170
Hello <%= name %>!
169171
170172
<% if urgent %>
@@ -209,7 +211,7 @@ chat.ask("What should we focus on first?")
209211
The gem integrates with [RubyLLM::Schema](https://github.com/danielfriis/ruby_llm-schema) to provide a clean Ruby DSL for defining JSON schemas. Use `schema.rb` files instead of JSON:
210212

211213
```ruby
212-
# prompts/analyze_results/schema.rb
214+
# app/prompts/analyze_results/schema.rb
213215
RubyLLM::Schema.create do
214216
number :confidence, minimum: 0, maximum: 1, description: "Analysis confidence"
215217

0 commit comments

Comments
 (0)