mistral_rb 0.1.5 → 0.1.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8226b8266c5e6f6b99abb42bb7703b440221a2687870c65d67e5a9aa93c6e3d
|
4
|
+
data.tar.gz: 6ebc354b74961374e00e254e455e81cfceb06dfda60134554738017f5c2b41c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
data/lib/mistral_rb/version.rb
CHANGED
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
|