mistral_rb 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8826573e4021a69c7f6c560357c79a75fc80a63ff97b6610143fe3505f4d9138
4
- data.tar.gz: 04bf840637ab24c388b28b175b987083f9786579d58dec9f8e5366f0f7a1d541
3
+ metadata.gz: 2e43cdb7fa62132f8342d13ec666a4fe48571dc0dbf5b64a2476c23d4da86aa5
4
+ data.tar.gz: 402b62dfe6f4ca6a2b77d3e13127b673037374fe75ffbe874c4cafef2fbdaeb3
5
5
  SHA512:
6
- metadata.gz: b3aee45181ce35cd5b34df3b10f091ef084bc00bba078452f0a5485e47eb0b19374d07219f6a8a258884410c9cc4557d4e8ac07f0bf0cfcccbe25def5f5baea4
7
- data.tar.gz: 886665f3b0e2db01b155421c6680b6523cbae26c61ef260de303cb9ad90a6e69c1a60b433d2fcfc78167d450e842016629f40a02d51d714cf4d89bfb58d98bd4
6
+ metadata.gz: 921683a278ab7f4d9f443c2db7a0dd16dd08b81752e6d99ac49fe619fb23e7d2cd145d30e8760988786ffa81647f9d666a73d0ac3a56e6c34ce921bd61a8339e
7
+ data.tar.gz: cbc90300023388689b9b5572f25dec507de1cc956f90c7406cfe8fbe685011200a248bbbb7574e564b3ff0b89a9726c60890c9175ac8e4832018b4766d1dabaf
data/README.md CHANGED
@@ -24,15 +24,15 @@ Here is a quick example to get you started:
24
24
  require 'mistral_rb'
25
25
 
26
26
  # Initialize the API with your API key
27
- mistral = MistralAPI.new("your_api_key_here")
27
+ mistral = MistralAPI.new(api_key: "your_api_key_here")
28
28
 
29
29
  # Create Chat Completion
30
- response = mistral.create_chat_completion("mistral-tiny", [{role: "user", content: "Who is Macron?"}])
30
+ response = mistral.create_chat_completion(model: "mistral-tiny", messages: [{role: "user", content: "Who is Macron?"}])
31
31
  puts response.choices.to_s
32
32
 
33
33
  # Create Embeddings
34
- embedding_response = mistral.create_embeddings("mistral-embed", ["Hello", "world"])
35
- puts embedding_response.data.first.embedding
34
+ embedding_response = mistral.create_embeddings(model: "mistral-embed", input: ["Hello", "world"])
35
+ puts embedding_response.data.first.inspect
36
36
 
37
37
  # List Available Models
38
38
  model_list_response = mistral.list_available_models
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MistralRb
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/mistral_rb.rb CHANGED
@@ -8,7 +8,7 @@ require_relative "mistral_rb/response_models"
8
8
  class MistralAPI
9
9
  include HTTParty
10
10
 
11
- def initialize(api_key, base_uri = "https://api.mistral.ai/v1")
11
+ def initialize(api_key:, base_uri: "https://api.mistral.ai/v1")
12
12
  @headers = {
13
13
  "Authorization" => "Bearer #{api_key}",
14
14
  "Content-Type" => "application/json"
@@ -42,7 +42,7 @@ class MistralAPI
42
42
  end
43
43
  end
44
44
 
45
- def create_embeddings(model, input, encoding_format = "float")
45
+ def create_embeddings(model:, input:, encoding_format: "float")
46
46
  body = {
47
47
  model: model,
48
48
  input: input,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mistral_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franck Stephane Ndzomga