mistral-ai 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +6 -6
- data/components/errors.rb +0 -1
- data/controllers/client.rb +3 -3
- data/static/gem.rb +1 -1
- data/template.md +6 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d35454c7499ef405271de5ccb410f77dcc4bbc6be2c5727e73113630c8991f5d
|
4
|
+
data.tar.gz: 88e62dfaf6d8e6c22c23dfcec8c8677f546e204d7a0e5f53d87eeeb2349a1886
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74aaaced1816ab4ef2270284013e9101a48a4d9d3a74b151f6075b787a16870f31b5b212113c6f2c7dadd2fa1b82a0b22d73360d4972a867a58c91cb42310dee
|
7
|
+
data.tar.gz: 26246a45258074c3a78b9cf817cf32ff9c15760ab3906485067223b7fa21446cb036d5b3d4e6a1f50bf0ffa1ecee62fe1f028213ae0f89429fe66c7be728bf6d
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mistral-ai (1.1.
|
4
|
+
mistral-ai (1.1.1)
|
5
5
|
event_stream_parser (~> 1.0)
|
6
6
|
faraday (~> 2.8, >= 2.8.1)
|
7
7
|
|
@@ -22,7 +22,7 @@ GEM
|
|
22
22
|
language_server-protocol (3.17.0.3)
|
23
23
|
method_source (1.0.0)
|
24
24
|
parallel (1.24.0)
|
25
|
-
parser (3.
|
25
|
+
parser (3.3.0.0)
|
26
26
|
ast (~> 2.4.1)
|
27
27
|
racc
|
28
28
|
pry (0.14.2)
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ A Ruby gem for interacting with [Mistral AI](https://mistral.ai)'s large languag
|
|
9
9
|
## TL;DR and Quick Start
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'mistral-ai', '~> 1.1.
|
12
|
+
gem 'mistral-ai', '~> 1.1.1'
|
13
13
|
```
|
14
14
|
|
15
15
|
```ruby
|
@@ -85,11 +85,11 @@ Result:
|
|
85
85
|
### Installing
|
86
86
|
|
87
87
|
```sh
|
88
|
-
gem install mistral-ai -v 1.1.
|
88
|
+
gem install mistral-ai -v 1.1.1
|
89
89
|
```
|
90
90
|
|
91
91
|
```sh
|
92
|
-
gem 'mistral-ai', '~> 1.1.
|
92
|
+
gem 'mistral-ai', '~> 1.1.1'
|
93
93
|
```
|
94
94
|
|
95
95
|
### Credentials
|
@@ -410,7 +410,8 @@ Mistral may launch a new endpoint that we haven't covered in the Gem yet. If tha
|
|
410
410
|
result = client.request(
|
411
411
|
'v1/chat/completions',
|
412
412
|
{ model: 'mistral-medium',
|
413
|
-
messages: [{ role: 'user', content: 'hi!' }] }
|
413
|
+
messages: [{ role: 'user', content: 'hi!' }] },
|
414
|
+
request_method: 'POST', server_sent_events: true
|
414
415
|
)
|
415
416
|
```
|
416
417
|
|
@@ -494,7 +495,6 @@ MistralError
|
|
494
495
|
|
495
496
|
MissingAPIKeyError
|
496
497
|
BlockWithoutServerSentEventsError
|
497
|
-
UnsupportedError
|
498
498
|
|
499
499
|
RequestError
|
500
500
|
```
|
@@ -517,7 +517,7 @@ gem build mistral-ai.gemspec
|
|
517
517
|
|
518
518
|
gem signin
|
519
519
|
|
520
|
-
gem push mistral-ai-1.1.
|
520
|
+
gem push mistral-ai-1.1.1.gem
|
521
521
|
```
|
522
522
|
|
523
523
|
### Updating the README
|
data/components/errors.rb
CHANGED
data/controllers/client.rb
CHANGED
@@ -51,7 +51,7 @@ module Mistral
|
|
51
51
|
request('v1/models', nil, server_sent_events: false, request_method: 'GET', &callback)
|
52
52
|
end
|
53
53
|
|
54
|
-
def request(path, payload, server_sent_events: nil, request_method: 'POST', &callback)
|
54
|
+
def request(path, payload = nil, server_sent_events: nil, request_method: 'POST', &callback)
|
55
55
|
server_sent_events_enabled = server_sent_events.nil? ? @server_sent_events : server_sent_events
|
56
56
|
url = "#{@address}#{path}"
|
57
57
|
|
@@ -62,7 +62,7 @@ module Mistral
|
|
62
62
|
|
63
63
|
results = []
|
64
64
|
|
65
|
-
method_to_call = request_method
|
65
|
+
method_to_call = request_method.to_s.strip.downcase.to_sym
|
66
66
|
|
67
67
|
response = Faraday.new(request: @request_options) do |faraday|
|
68
68
|
faraday.response :raise_error
|
@@ -114,7 +114,7 @@ module Mistral
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def safe_parse_json(raw)
|
117
|
-
raw.start_with?('{', '[') ? JSON.parse(raw) : raw
|
117
|
+
raw.to_s.lstrip.start_with?('{', '[') ? JSON.parse(raw) : raw
|
118
118
|
rescue JSON::ParserError
|
119
119
|
raw
|
120
120
|
end
|
data/static/gem.rb
CHANGED
data/template.md
CHANGED
@@ -9,7 +9,7 @@ A Ruby gem for interacting with [Mistral AI](https://mistral.ai)'s large languag
|
|
9
9
|
## TL;DR and Quick Start
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'mistral-ai', '~> 1.1.
|
12
|
+
gem 'mistral-ai', '~> 1.1.1'
|
13
13
|
```
|
14
14
|
|
15
15
|
```ruby
|
@@ -55,11 +55,11 @@ Result:
|
|
55
55
|
### Installing
|
56
56
|
|
57
57
|
```sh
|
58
|
-
gem install mistral-ai -v 1.1.
|
58
|
+
gem install mistral-ai -v 1.1.1
|
59
59
|
```
|
60
60
|
|
61
61
|
```sh
|
62
|
-
gem 'mistral-ai', '~> 1.1.
|
62
|
+
gem 'mistral-ai', '~> 1.1.1'
|
63
63
|
```
|
64
64
|
|
65
65
|
### Credentials
|
@@ -380,7 +380,8 @@ Mistral may launch a new endpoint that we haven't covered in the Gem yet. If tha
|
|
380
380
|
result = client.request(
|
381
381
|
'v1/chat/completions',
|
382
382
|
{ model: 'mistral-medium',
|
383
|
-
messages: [{ role: 'user', content: 'hi!' }] }
|
383
|
+
messages: [{ role: 'user', content: 'hi!' }] },
|
384
|
+
request_method: 'POST', server_sent_events: true
|
384
385
|
)
|
385
386
|
```
|
386
387
|
|
@@ -464,7 +465,6 @@ MistralError
|
|
464
465
|
|
465
466
|
MissingAPIKeyError
|
466
467
|
BlockWithoutServerSentEventsError
|
467
|
-
UnsupportedError
|
468
468
|
|
469
469
|
RequestError
|
470
470
|
```
|
@@ -487,7 +487,7 @@ gem build mistral-ai.gemspec
|
|
487
487
|
|
488
488
|
gem signin
|
489
489
|
|
490
|
-
gem push mistral-ai-1.1.
|
490
|
+
gem push mistral-ai-1.1.1.gem
|
491
491
|
```
|
492
492
|
|
493
493
|
### Updating the README
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mistral-ai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gbaptista
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: event_stream_parser
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
requirements: []
|
91
|
-
rubygems_version: 3.
|
91
|
+
rubygems_version: 3.3.3
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Interact with Mistral AI.
|