contai 0.1.3 → 0.1.4

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: 9c026d4af37a140281b3e748f4b39e9048fb5c20663e24351c01adfffa0e87d6
4
- data.tar.gz: c8566608a69e050edd6f2bbd751dae23c0a68ac898cc1c9b086b7caf7bd87d9a
3
+ metadata.gz: 02ecfd260d772ebe66ef602cdc8851dde9888702d472ff1bb89bf0475e512e1f
4
+ data.tar.gz: d1cf1905f34923a63b89a59c3b13406986ade567b796760197534184c1728c2a
5
5
  SHA512:
6
- metadata.gz: 9b8e0778ffa6f20ac08e39bf2b4e9d92b61401dc24c3569862ed59e2d823c714a2e288c9a8e2e49191df8ee8b8688696b77bab81ed4c225c8cff10ac1db9ff7f
7
- data.tar.gz: 4824a07aa53a719742a5af2e3698399c72757a22aefb1239e7004b045d6a53863464d3aebbcf10909d054d227f3231c86b99f8a569c2af67fcab573ca5718537
6
+ metadata.gz: e5bbf7146978ceef8ca59b2bd9a5d7e38052460bc1c22e420ee48672a56f7f1f4d92235f9dabadc32d716f1e68fe12d0752e828ebedc80d777af6af082e0c15b
7
+ data.tar.gz: 7fbe7f53862f6704d2fa55901254594449b1de72936a27a80e604544ade67d90f92e0c5eeff210b179487e0c815a2d5cce3890a9e0c0e899b6e53dbe9276fac7
@@ -1,11 +1,12 @@
1
1
  module Contai
2
2
  class Configuration
3
- attr_accessor :default_provider, :default_template, :timeout
3
+ attr_accessor :default_provider, :default_template, :timeout, :default_headers
4
4
 
5
5
  def initialize
6
6
  @default_provider = :http
7
7
  @default_template = "Generate content based on: {{prompt}}"
8
8
  @timeout = 30
9
+ @default_headers = { "Content-Type" => "application/json" }
9
10
  end
10
11
  end
11
12
  end
@@ -10,7 +10,7 @@ module Contai
10
10
  method = (@options[:method] || :post).to_s.downcase
11
11
 
12
12
  request_options = {
13
- headers: @options[:headers] || { "Content-Type" => "application/json" },
13
+ headers: Contai.configuration.default_headers.merge(@options[:headers] || {}),
14
14
  timeout: @options[:timeout] || Contai.configuration.timeout
15
15
  }
16
16
 
@@ -7,7 +7,6 @@ module Contai
7
7
  super({
8
8
  url: webhook_url,
9
9
  method: :post,
10
- headers: { "Content-Type" => "application/json" },
11
10
  body_template: { prompt: "{{prompt}}" },
12
11
  response_path: options[:response_path] || "output"
13
12
  }.merge(options))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Contai
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
@@ -7,6 +7,13 @@ Contai.configure do |config|
7
7
 
8
8
  # Request timeout in seconds
9
9
  config.timeout = 30
10
+
11
+ # Default headers for HTTP requests
12
+ config.default_headers = {
13
+ "Content-Type" => "application/json",
14
+ # Uncomment and set your default Authorization header if needed
15
+ # "Authorization" => "Bearer #{ENV['DEFAULT_API_KEY']}"
16
+ }
10
17
  end
11
18
 
12
19
  # Configure your AI providers here:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Panasenkov A.