deepseek-rails 0.1.0 → 0.2.0

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: 96548579565e97fa0e450061a14fd4f819f960e6aa5b221d1ca1489994cfc729
4
- data.tar.gz: 1d343e832da359be4f8709d28e4fcee7b3b3dc56ec265b1de344b52e99337a7f
3
+ metadata.gz: d0ef1a87540f2181ced861e4614ad030cce7e59dbd6a9806932288b7bd4acf19
4
+ data.tar.gz: 7beea957aea36e18d3fdf1aef524bbee820ccd0d01e6d0e1c7eed00c8ca41248
5
5
  SHA512:
6
- metadata.gz: afc5fda0e77eb2252dd8fcd8371c4cdf1db4d716c05d1d8bc48783df0aab9d789f55ac0a187022085ec1c7e3b15a112cf56f3fb7118bad03b10ac83a4caacbbe
7
- data.tar.gz: 72bc1b5869a277db1d05b3886c490933a3009801a955e20cc223f231d474e767839407a3b3fdc1371d4c8cf565c9cbaf2dfcbe2146fc17ec9d8253754eff9279
6
+ metadata.gz: de8f3f4d390b5627568d789281c83c3b4722a874ac660a65c9b1d9a2e8faec34af1a89202f6a58ecbbf3aa7e515e86f99bbf633cc323229ba94d32c4bf253b14
7
+ data.tar.gz: 0fe32b0ea3695d817f10298891aeb8f1469d098c03bbefd2455b7af4795de14b6e4cdfaabc94d4416380cf1a455cb20b4cda9605f10bf9ac1d6e0c052d132b7e
data/lib/deepseek.rb CHANGED
@@ -1,14 +1,17 @@
1
1
  require 'net/http'
2
2
  require 'json'
3
3
  module Deepseek
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
+ class << self
6
+ attr_accessor :configuration
7
+ end
5
8
  class Client
6
- BASE_URI = URI('https://api.deepseek.com')
7
9
  def initialize
8
10
  end
9
11
 
10
12
  def chat(parameters:)
11
- uri = BASE_URI + '/chat/completions'
13
+ base_uri = URI(Deepseek.configuration.base_uri || "https://api.deepseek.com")
14
+ uri = base_uri + '/chat/completions'
12
15
  request = Net::HTTP::Post.new(uri, headers)
13
16
  request.body = parameters.to_json
14
17
 
@@ -33,11 +36,9 @@ module Deepseek
33
36
  class DeepseekClientError < StandardError; end
34
37
 
35
38
  class Configuration
36
- attr_accessor :api_key
37
- end
38
-
39
- class << self
40
- attr_accessor :configuration
39
+ attr_accessor :api_key, :base_uri
40
+ def initialize
41
+ end
41
42
  end
42
43
 
43
44
  def self.configure
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deepseek-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - amr elhewi
@@ -17,8 +17,6 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
- - README.md
21
- - deepseek-rails.gemspec
22
20
  - lib/deepseek.rb
23
21
  homepage: https://github.com/amrelhewy09/deepseek-rails
24
22
  licenses:
data/README.md DELETED
@@ -1,39 +0,0 @@
1
- # Deepseek::Rails
2
-
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/deepseek/rails`. To experiment with that code, run `bin/console` for an interactive prompt.
6
-
7
- ## Installation
8
-
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
12
-
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
14
-
15
- If bundler is not being used to manage dependencies, install the gem by executing:
16
-
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
18
-
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
22
-
23
- ## Development
24
-
25
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
-
27
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
-
29
- ## Contributing
30
-
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/deepseek-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/deepseek-rails/blob/master/CODE_OF_CONDUCT.md).
32
-
33
- ## License
34
-
35
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
36
-
37
- ## Code of Conduct
38
-
39
- Everyone interacting in the Deepseek::Rails project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/deepseek-rails/blob/master/CODE_OF_CONDUCT.md).
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/deepseek"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "deepseek-rails"
7
- spec.version = Deepseek::VERSION
8
- spec.authors = ["amr elhewi"]
9
- spec.email = ["amrelhewi@gmail.com"]
10
-
11
- spec.summary = "Deepseek wrapper for ruby"
12
- spec.homepage = "https://github.com/amrelhewy09/deepseek-rails"
13
- spec.license = "MIT"
14
- spec.required_ruby_version = ">= 3.0.0"
15
-
16
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
17
-
18
- spec.metadata["homepage_uri"] = spec.homepage
19
- spec.metadata["source_code_uri"] = "https://github.com/amrelhewy09/deepseek-rails"
20
- spec.metadata["changelog_uri"] = "https://github.com/amrelhewy09/deepseek-rails"
21
-
22
- # Specify which files should be added to the gem when it is released.
23
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
- gemspec = File.basename(__FILE__)
25
- spec.files = Dir.glob("lib/**/*") + ["deepseek-rails.gemspec", "README.md"]
26
- spec.bindir = "exe"
27
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
- spec.require_paths = ["lib"]
29
-
30
- # Uncomment to register a new dependency of your gem
31
- # spec.add_dependency "example-gem", "~> 1.0"
32
-
33
- # For more information and examples about making a new gem, check out our
34
- # guide at: https://bundler.io/guides/creating_gem.html
35
- end