Skip to content

Commit 5340c93

Browse files
committed
Update documentation for chat.with_instructions and prepare for v1.1.0 release
1 parent 9d8522d commit 5340c93

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ chat.ask "Tell me a story about a Ruby programmer" do |chunk|
135135
print chunk.content
136136
end
137137

138-
# Set personality or behavior with instructions (aka system prompts)
138+
# Set personality or behavior with instructions (aka system prompts) - available from 1.1.0
139139
chat.with_instructions "You are a friendly Ruby expert who loves to help beginners"
140140

141141
# Understand content in multiple forms
@@ -171,7 +171,7 @@ end
171171
# In a background job
172172
chat = Chat.create! model_id: "gpt-4o-mini"
173173

174-
# Set personality or behavior with instructions (aka system prompts) - they're persisted too!
174+
# Set personality or behavior with instructions (aka system prompts) - they're persisted too! - available from 1.1.0
175175
chat.with_instructions "You are a friendly Ruby expert who loves to help beginners"
176176

177177
chat.ask("What's your favorite Ruby gem?") do |chunk|

docs/guides/chat.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ See [Working with Models]({% link guides/models.md %}) for more details on model
6969

7070
## Instructions (aka System Prompts)
7171

72+
{: .warning-title }
73+
> Coming in v1.1.0
74+
>
75+
> chat.with_instructions is coming in 1.1.0. 1.0.x users should use `add_message role: system, content: PROMPT`
76+
7277
System prompts allow you to set specific instructions or context that guide the AI's behavior throughout the conversation. These prompts are not directly visible to the user but help shape the AI's responses:
7378

7479
```ruby
@@ -81,7 +86,7 @@ chat.with_instructions "You are a helpful Ruby programming assistant. Always inc
8186
# Now the AI will follow these instructions in all responses
8287
response = chat.ask "How do I handle file operations in Ruby?"
8388

84-
# You can add multiple system messages or update them during the conversation
89+
# You can add multiple system messages or update them during the conversation - available from 1.1.0
8590
chat.with_instructions "Always format your code using proper Ruby style conventions and include comments."
8691

8792
# System prompts are especially useful for:

docs/guides/rails.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,25 @@ end
130130

131131
## Instructions (aka System Prompts)
132132

133+
{: .warning-title }
134+
> Coming in v1.1.0
135+
>
136+
> chat.with_instructions is coming in 1.1.0. 1.0.x users should use `chat.messages.create! role: system, content: PROMPT`
137+
133138
Instructions help guide the AI's behavior throughout a conversation. With Rails integration, these messages are automatically persisted just like regular chat messages:
134139

135140
```ruby
136141
# Create a new chat
137142
chat = Chat.create!(model_id: 'gpt-4o-mini')
138143

139-
# Add instructions (these are persisted)
144+
# Add instructions (these are persisted) - available from 1.1.0
140145
chat.with_instructions("You are a helpful Ruby programming assistant. Always include code examples in your responses and explain them line by line.")
141146

142147
# Ask questions - the AI will follow the instructions
143148
response = chat.ask("How do I handle file operations in Ruby?")
144149
puts response.content # Will include detailed code examples
145150

146-
# Add additional instructions
151+
# Add additional instructions - available from 1.1.0
147152
chat.with_instructions("Always format your code using proper Ruby style conventions and include comments.")
148153
# Both instructions are now persisted and active
149154

lib/ruby_llm/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module RubyLLM
4-
VERSION = '1.0.1'
4+
VERSION = '1.1.0rc1'
55
end

0 commit comments

Comments
 (0)