omniai-mistral 1.9.3 → 1.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +11 -10
- data/lib/omniai/mistral/chat.rb +22 -22
- data/lib/omniai/mistral/client.rb +1 -1
- data/lib/omniai/mistral/config.rb +3 -3
- data/lib/omniai/mistral/embed.rb +2 -2
- data/lib/omniai/mistral/version.rb +1 -1
- data/lib/omniai/mistral.rb +3 -3
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b796770534ec1420fe7c017383e4434ef0130424c6ad2e0e8dfbe3d57022329b
|
4
|
+
data.tar.gz: c0be52f361b1607061717010fcc7fdea4fc25a60c7928c328d08bf95a0d4d3e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69edf5267d53f42e23c9e963ea9c252e09b3760282dbf8f7c64de112284f610f2bc749a52809f33ab52b2da3466b66ff9f5011afcc0a7f66f2936339ad995e15
|
7
|
+
data.tar.gz: 8941b02a911f0db34a07bdab7c510584dec15cd889eb47e49428baed0266ca2edb03401dbf45355e0f3551c031e4d5a62302ff3a0946ec37e5bef3aa7921e80e
|
data/Gemfile
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source
|
3
|
+
source "https://rubygems.org"
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
gem
|
8
|
-
gem
|
9
|
-
gem
|
10
|
-
gem
|
11
|
-
gem
|
12
|
-
gem
|
13
|
-
gem
|
14
|
-
gem
|
15
|
-
gem
|
7
|
+
gem "rake"
|
8
|
+
gem "rspec"
|
9
|
+
gem "rspec_junit_formatter"
|
10
|
+
gem "rubocop"
|
11
|
+
gem "rubocop-basic"
|
12
|
+
gem "rubocop-rake"
|
13
|
+
gem "rubocop-rspec"
|
14
|
+
gem "simplecov"
|
15
|
+
gem "webmock"
|
16
|
+
gem "yard"
|
data/lib/omniai/mistral/chat.rb
CHANGED
@@ -13,23 +13,23 @@ module OmniAI
|
|
13
13
|
# chat.completion([{ role: 'system', content: 'Tell me a joke.' }])
|
14
14
|
class Chat < OmniAI::Chat
|
15
15
|
module Model
|
16
|
-
MISTRAL_SMALL_2409 =
|
17
|
-
MISTRAL_SMALL_LATEST =
|
18
|
-
MISTRAL_MEDIUM_2312 =
|
19
|
-
MISTRAL_MEDIUM_LATEST =
|
20
|
-
MISTRAL_LARGE_2411 =
|
21
|
-
MISTRAL_LARGE_LATEST =
|
22
|
-
CODESTRAL_2405 =
|
23
|
-
CODESTRAL_LATEST =
|
24
|
-
MINISTRAL_3B_2410 =
|
25
|
-
MINISTRAL_3B_LATEST =
|
26
|
-
MINISTRAL_8B_2410 =
|
27
|
-
MINISTRAL_8B_LATEST =
|
28
|
-
MISTRAL_MODERATION_2411 =
|
29
|
-
MISTRAL_MODERATION_LATEST =
|
30
|
-
MISTRAL_EMBED =
|
31
|
-
PIXTRAL_LARGE_2411 =
|
32
|
-
PIXTRAL_LARGE_LATEST =
|
16
|
+
MISTRAL_SMALL_2409 = "mistral-small-2409"
|
17
|
+
MISTRAL_SMALL_LATEST = "mistral-small-latest"
|
18
|
+
MISTRAL_MEDIUM_2312 = "mistral-medium-2312" # LEGACY
|
19
|
+
MISTRAL_MEDIUM_LATEST = "mistral-medium-latest" # LEGACY
|
20
|
+
MISTRAL_LARGE_2411 = "mistral-large-2411"
|
21
|
+
MISTRAL_LARGE_LATEST = "mistral-large-latest"
|
22
|
+
CODESTRAL_2405 = "codestral-2405"
|
23
|
+
CODESTRAL_LATEST = "codestral-latest"
|
24
|
+
MINISTRAL_3B_2410 = "ministral-3b-2410"
|
25
|
+
MINISTRAL_3B_LATEST = "ministral-3b-latest"
|
26
|
+
MINISTRAL_8B_2410 = "ministral-8b-2410"
|
27
|
+
MINISTRAL_8B_LATEST = "ministral-8b-latest"
|
28
|
+
MISTRAL_MODERATION_2411 = "mistral-moderation-2411"
|
29
|
+
MISTRAL_MODERATION_LATEST = "mistral-moderation-latest"
|
30
|
+
MISTRAL_EMBED = "mistral-embed"
|
31
|
+
PIXTRAL_LARGE_2411 = "pixtral-large-2411"
|
32
|
+
PIXTRAL_LARGE_LATEST = "pixtral-large-latest"
|
33
33
|
SMALL = MISTRAL_SMALL_LATEST
|
34
34
|
MEDIUM = MISTRAL_MEDIUM_LATEST # LEGACY
|
35
35
|
LARGE = MISTRAL_LARGE_LATEST
|
@@ -40,14 +40,14 @@ module OmniAI
|
|
40
40
|
DEFAULT_MODEL = Model::PIXTRAL_LARGE_LATEST
|
41
41
|
|
42
42
|
module Role
|
43
|
-
ASSISTANT =
|
44
|
-
USER =
|
45
|
-
SYSTEM =
|
43
|
+
ASSISTANT = "assistant"
|
44
|
+
USER = "user"
|
45
|
+
SYSTEM = "system"
|
46
46
|
end
|
47
47
|
|
48
|
-
JSON_RESPONSE_FORMAT = { type:
|
48
|
+
JSON_RESPONSE_FORMAT = { type: "json_object" }.freeze
|
49
49
|
|
50
|
-
|
50
|
+
protected
|
51
51
|
|
52
52
|
# @return [Hash]
|
53
53
|
def payload
|
@@ -20,7 +20,7 @@ module OmniAI
|
|
20
20
|
#
|
21
21
|
# client = OmniAI::Mistral::Client.new
|
22
22
|
class Client < OmniAI::Client
|
23
|
-
VERSION =
|
23
|
+
VERSION = "v1"
|
24
24
|
|
25
25
|
# @param api_key [String] optional - defaults to `OmniAI::Mistral.config.api_key`
|
26
26
|
# @param host [String] optional - defaults to `OmniAI::Mistral.config.host`
|
@@ -4,15 +4,15 @@ module OmniAI
|
|
4
4
|
module Mistral
|
5
5
|
# Configuration for Mistral.
|
6
6
|
class Config < OmniAI::Config
|
7
|
-
DEFAULT_HOST =
|
7
|
+
DEFAULT_HOST = "https://api.mistral.ai"
|
8
8
|
|
9
9
|
# @param api_key [String, nil] optional - defaults to `ENV['MISTRAL_API_KEY']`
|
10
10
|
# @param host [String, nil] optional - defaults to `ENV['MISTRAL_HOST'] w/ fallback to `DEFAULT_HOST`
|
11
11
|
# @param logger [Logger, nil] optional - defaults to
|
12
12
|
# @param timeout [Integer, Hash, nil] optional
|
13
13
|
def initialize(
|
14
|
-
api_key: ENV.fetch(
|
15
|
-
host: ENV.fetch(
|
14
|
+
api_key: ENV.fetch("MISTRAL_API_KEY", nil),
|
15
|
+
host: ENV.fetch("MISTRAL_HOST", DEFAULT_HOST),
|
16
16
|
logger: nil,
|
17
17
|
timeout: nil
|
18
18
|
)
|
data/lib/omniai/mistral/embed.rb
CHANGED
@@ -11,12 +11,12 @@ module OmniAI
|
|
11
11
|
# response.embedding [0.0, ...]
|
12
12
|
class Embed < OmniAI::Embed
|
13
13
|
module Model
|
14
|
-
EMBED =
|
14
|
+
EMBED = "mistral-embed"
|
15
15
|
end
|
16
16
|
|
17
17
|
DEFAULT_MODEL = Model::EMBED
|
18
18
|
|
19
|
-
|
19
|
+
protected
|
20
20
|
|
21
21
|
# @return [Hash]
|
22
22
|
def payload
|
data/lib/omniai/mistral.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniai-mistral
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Sylvestre
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-18 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: event_stream_parser
|
@@ -74,7 +73,6 @@ metadata:
|
|
74
73
|
homepage_uri: https://github.com/ksylvest/omniai-mistral
|
75
74
|
changelog_uri: https://github.com/ksylvest/omniai-mistral/releases
|
76
75
|
rubygems_mfa_required: 'true'
|
77
|
-
post_install_message:
|
78
76
|
rdoc_options: []
|
79
77
|
require_paths:
|
80
78
|
- lib
|
@@ -89,8 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
87
|
- !ruby/object:Gem::Version
|
90
88
|
version: '0'
|
91
89
|
requirements: []
|
92
|
-
rubygems_version: 3.
|
93
|
-
signing_key:
|
90
|
+
rubygems_version: 3.6.2
|
94
91
|
specification_version: 4
|
95
92
|
summary: A generalized framework for interacting with Mistral
|
96
93
|
test_files: []
|