mistral_rb 0.1.5 → 0.1.6

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: 1c775af119701a9e79b9aed5e79049ffcb5d3b434d8730d51e857443d1cdeb84
4
- data.tar.gz: 43141631a0f888a09e85259832a2d30a8c3c02c8659327ff97bc859317795340
3
+ metadata.gz: e8226b8266c5e6f6b99abb42bb7703b440221a2687870c65d67e5a9aa93c6e3d
4
+ data.tar.gz: 6ebc354b74961374e00e254e455e81cfceb06dfda60134554738017f5c2b41c6
5
5
  SHA512:
6
- metadata.gz: 2f8513858962d88312898f29be0d2fb786d0c0e693877e404aca529c5589d0e077b267066f297b5b2b238f77507c1a3eb93e5703d63513f31bccbff386000441
7
- data.tar.gz: 155f73296b4de0a124531c3e2c26babba0636b61ae6a39c328b815dd44b47f7124cf64ae46dc1dedfa6fc58feb099925224af1df33bb590a8587913e32d2528f
6
+ metadata.gz: 60759474220fa3ed9946731c64745938124f0e69a7b4f7e3dbe8bcfee178e3f87efbb5897687b056775af8e0e2a5fd928f67075a39e70ed9d4aeb95d4e6f1a75
7
+ data.tar.gz: eca253391a1a3c2714c00f0bd7dae098fdb580ac502b1f4d086ffdabd5b26203414598f45dcdb97a234e6791ac82671d0d7b3cc53ad5242c248bb2a8a6851c29
@@ -9,6 +9,7 @@ class MistralEmbeddingCreator
9
9
  @chunker = chunker
10
10
  @model = model
11
11
  @api_key = api_key || ENV['MISTRAL_API_KEY']
12
+ raise 'API key not found. Please set the MISTRAL_API_KEY environment variable.' if api_key.nil? || api_key.empty?
12
13
 
13
14
  if @api_key
14
15
  @llm = MistralAPI.new(api_key: @api_key)
@@ -9,6 +9,7 @@ class OpenaiEmbeddingCreator
9
9
  @chunker = chunker
10
10
  @model = model
11
11
  @api_key = api_key || ENV['OPENAI_API_KEY']
12
+ raise 'API key not found. Please set the OPENAI_API_KEY environment variable.' if api_key.nil? || api_key.empty?
12
13
 
13
14
  if @api_key
14
15
  @llm = OpenAI::Client.new(access_token: @api_key)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MistralRb
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
data/lib/mistral_rb.rb CHANGED
@@ -12,6 +12,7 @@ class MistralAPI
12
12
  include HTTParty
13
13
 
14
14
  def initialize(api_key: ENV["MISTRAL_API_KEY"], base_uri: "https://api.mistral.ai/v1")
15
+ raise 'API key not found. Please set the MISTRAL_API_KEY environment variable.' if api_key.nil? || api_key.empty?
15
16
  @headers = {
16
17
  "Authorization" => "Bearer #{api_key}",
17
18
  "Content-Type" => "application/json"
@@ -7,6 +7,8 @@ Dotenv.load()
7
7
  class PineconeService
8
8
  attr_reader :index
9
9
  def initialize(pinecone_key: ENV['PINECONE_API_KEY'], pinecone_env: ENV['PINECONE_ENV'], index_name:)
10
+ raise 'API key not found. Please set the PINECONE_API_KEY environment variable.' if pinecone_key.nil? || pinecone_key.empty?
11
+ raise 'ENV not found. Please set the PINECONE_ENV environment variable.' if pinecone_env.nil? || pinecone_env.empty?
10
12
  @pinecone_key = pinecone_key
11
13
  @pinecone_env = pinecone_env
12
14
  @index_name = index_name
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.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franck Stephane Ndzomga