claude-ruby 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +55 -1
- data/lib/claude/ruby/version.rb +1 -1
- metadata +1 -2
- data/claude-ruby-0.2.1.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0914fd554c4c01686d477c44cf2de423f0faad30d673e39a767d0296da1cac4
|
4
|
+
data.tar.gz: fe9e0aa7f262c1af5fe3b0036136739a87f718c040f107c7ad792cb1492fe752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dba3fa917472c533a8d515624346ec40ccd95ebd79e803ad9d0fd536a4aaab3b4bb0c9281d97a9baf0c12c87c7c2849b23dec5a51128e28a2099f47274fbf05
|
7
|
+
data.tar.gz: a0e033b78ced858eae7d8fb196f40ecb04ef540dadcd76e77ba8e2cff177b12642579cbcb0114d27da1336dd26846fa10ebb3cfa2ae0641870e0db33b2c278e0
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -83,7 +83,7 @@ response['content'][0]['text']
|
|
83
83
|
messages = [
|
84
84
|
{
|
85
85
|
role: "user",
|
86
|
-
content: "
|
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.
|
data/lib/claude/ruby/version.rb
CHANGED
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.
|
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
|
data/claude-ruby-0.2.1.gem
DELETED
Binary file
|