qodex-rails 0.1.1 → 0.1.2
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 +4 -4
- data/lib/qodex/rails/version.rb +1 -1
- data/lib/qodex-rails/middleware.rb +11 -2
- data/lib/qodex-rails/version.rb +1 -1
- data/qodex-rails-0.1.1.gem +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d080fca50aa62a0fd87df635167b95cc00c08daf13c66ece7967b623bd40d4f
|
4
|
+
data.tar.gz: bc4bbe33dad3f8cabb516452d7f15953db58fb60419dc66cfe3ece4b6e2298c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ddfeddfa0c02ee396284a0d606a70120266b9483734d69b06fb9f771152b02e29697b9799cb2586f8c48f43491ebe3f4f41b5def8a0bcc04dbeacdc09716d02
|
7
|
+
data.tar.gz: '09ef8c37d89a0ec3fb07759e79320dff24d415ff0659502502b5c515ce6fb468e0d140787cf307a8659f5d797c9f025f5c48b700da11e03e0bec44b2f5eaee64'
|
data/lib/qodex/rails/version.rb
CHANGED
@@ -10,6 +10,15 @@ module QodexRails
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def call(env)
|
13
|
+
# Exit early if collection_name or api_key are not configured
|
14
|
+
unless QodexRails.configuration.collection_name && QodexRails.configuration.api_key
|
15
|
+
Rails.logger.warn "QodexRails: collection_name or api_key not configured. Skipping middleware."
|
16
|
+
return @app.call(env)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Print the initializer keys to the output
|
20
|
+
Rails.logger.info "QodexRails Initializer Keys: Collection Name: #{QodexRails.configuration.collection_name}, API Key: #{QodexRails.configuration.api_key}"
|
21
|
+
|
13
22
|
start_time = Time.now
|
14
23
|
|
15
24
|
# Capture the request details
|
@@ -59,7 +68,7 @@ module QodexRails
|
|
59
68
|
end
|
60
69
|
|
61
70
|
def send_to_api(logs)
|
62
|
-
uri = URI("
|
71
|
+
uri = URI("https://api.app.qodex.ai/api/v1/collections/create_with_folder/#{QodexRails.configuration.api_key}")
|
63
72
|
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
|
64
73
|
request.body = JSON.generate(logs)
|
65
74
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
@@ -67,7 +76,7 @@ module QodexRails
|
|
67
76
|
end
|
68
77
|
|
69
78
|
# Optionally log the response from the external API
|
70
|
-
Rails.logger.info "API Response: #{response.body}" if response
|
79
|
+
Rails.logger.info "URI: #{uri}, API Response: #{response.body}" if response
|
71
80
|
end
|
72
81
|
end
|
73
82
|
end
|
data/lib/qodex-rails/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qodex-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sid
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Intercept your rails application to power Qodex.ai AI copilot.
|
14
14
|
email:
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- lib/qodex/rails.rb
|
32
32
|
- lib/qodex/rails/version.rb
|
33
33
|
- qodex-rails-0.1.0.gem
|
34
|
+
- qodex-rails-0.1.1.gem
|
34
35
|
- sig/qodex/rails.rbs
|
35
36
|
homepage: https://qodex.ai
|
36
37
|
licenses:
|