claude-ruby 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acba80183a9f1ade551f7c6b948f24b02e0f3d1eedf784a50715c48e4bfbec78
4
- data.tar.gz: 35f49c5e0f3e51da700808a48ecd017dbe5251ab0eaaddccab7439a82a5947fb
3
+ metadata.gz: f0914fd554c4c01686d477c44cf2de423f0faad30d673e39a767d0296da1cac4
4
+ data.tar.gz: fe9e0aa7f262c1af5fe3b0036136739a87f718c040f107c7ad792cb1492fe752
5
5
  SHA512:
6
- metadata.gz: af50a4ec445fe61a69a53e2a5408924fccdd5a229caf5b7d8ee1e6216760ac29d72be36eff6f7e4e7f78150020fa2dbd0807a27af6e414e81d056e613c168012
7
- data.tar.gz: 4540eb9f231f5a366c230e570beeffaa5d0082b90b84dc85a67ad5c33dd94114a6b21b5c017545d815c37e12fb93d1c8a6b2cdf818109abf0ad8c86e00f3b77f
6
+ metadata.gz: 5dba3fa917472c533a8d515624346ec40ccd95ebd79e803ad9d0fd536a4aaab3b4bb0c9281d97a9baf0c12c87c7c2849b23dec5a51128e28a2099f47274fbf05
7
+ data.tar.gz: a0e033b78ced858eae7d8fb196f40ecb04ef540dadcd76e77ba8e2cff177b12642579cbcb0114d27da1336dd26846fa10ebb3cfa2ae0641870e0db33b2c278e0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [0.3.1] - 2024-06-29
2
+ - Updated documentation
3
+
1
4
  ## [0.3.0] - 2024-06-29
2
5
 
3
6
  - Added constants for the main Claude models
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- claude-ruby (0.2.1)
4
+ claude-ruby (0.3.1)
5
5
  httparty
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -83,7 +83,7 @@ response['content'][0]['text']
83
83
  messages = [
84
84
  {
85
85
  role: "user",
86
- content: "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
86
+ content: "In which year was the first ever rugby world cup? (A) 1983 (B) 1987 (C) 1991"
87
87
  },
88
88
  {
89
89
  role: "assistant",
@@ -130,6 +130,60 @@ messages = [
130
130
  response = claude_client.messages(messages, { system: system })
131
131
  ```
132
132
 
133
+ ## Models
134
+
135
+ If you don't specify a model, then the gem will use the latest version of Clause Sonnet by default, which is currently ```claude-3-5-sonnet-20240620```
136
+
137
+ You can use a different model by specifying it as a parameter in the messages call:
138
+
139
+ ```ruby
140
+ response = claude_client.messages(messages, { model: 'claude-3-haiku-20240307' })
141
+ ````
142
+
143
+ There are some constants defined so you can choose an appropriate model for your use-case and not have to worry about updating it when new Claude models are released:
144
+
145
+ ```ruby
146
+ Claude::Client::MODEL_CLAUDE_OPUS_LATEST
147
+ Claude::Client::MODEL_CLAUDE_SONNET_LATEST
148
+ Claude::Client::MODEL_CLAUDE_HAIKU_LATEST
149
+
150
+ Claude::Client::MODEL_CLAUDE_FASTEST
151
+ Claude::Client::MODEL_CLAUDE_CHEAPEST
152
+ Claude::Client::MODEL_CLAUDE_BALANCED
153
+ Claude::Client::MODEL_CLAUDE_SMARTEST
154
+ ````
155
+
156
+ Example usage:
157
+
158
+ ```ruby
159
+ response = claude_client.messages(messages, { model: Claude::Client::MODEL_CLAUDE_CHEAPEST })
160
+ ````
161
+
162
+ ## Parameters
163
+
164
+ You can pass in any of the following parameters, which will be included in the Anthropic API call:
165
+
166
+ ```ruby
167
+ model
168
+ system
169
+ max_tokens
170
+ metadata
171
+ stop_sequences
172
+ stream
173
+ temperature
174
+ top_p
175
+ top_k
176
+ ````
177
+
178
+ Example:
179
+
180
+ ```ruby
181
+ response = claude_client.messages(messages,
182
+ { model: Claude::Client::MODEL_CLAUDE_SMARTEST,
183
+ max_tokens: 500,
184
+ temperature: 0.1 })
185
+ ````
186
+
133
187
  ## Vision
134
188
 
135
189
  It's possible to pass an image to the Anthropic API and have Claude describe the image for you.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Claude
4
4
  module Ruby
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: claude-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Web Ventures Ltd
@@ -38,7 +38,6 @@ files:
38
38
  - LICENSE.txt
39
39
  - README.md
40
40
  - Rakefile
41
- - claude-ruby-0.2.1.gem
42
41
  - lib/claude/client.rb
43
42
  - lib/claude/ruby.rb
44
43
  - lib/claude/ruby/version.rb
Binary file