copilot2gpt 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 32606e9a7161ded307d99a403172d093d146430c4babbab94ae676954df475fa
4
+ data.tar.gz: 3d437a887449e4ae990680b1ccd727725b6aea6050e258b670ef0b65afad6d54
5
+ SHA512:
6
+ metadata.gz: d3ca1d79ef92340459b286c8a4cca4dd29f8ba120238989d0ba2c59f5f6afa49a77d25e17a02ad3813338ab299fd07e3548875cfc8ce7e001e7e1fdbbeb0ca8f
7
+ data.tar.gz: 5a408834c49b8349d4a12b765d28e79033f8e7cd9894c8454f93a42663c733df84e424e5e2663a7bae55caf419d846732c025edb5f8912f0f71f8a4e0d9e601b
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,21 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "type": "rdbg",
6
+ "name": "Debug current file with rdbg",
7
+ "request": "launch",
8
+ "script": "exe/copilot2gpt",
9
+ "command": "bundle exec",
10
+ "useTerminal": true,
11
+ "args": ["-p", "8080"],
12
+ "askParameters": false
13
+ },
14
+ {
15
+ "type": "rdbg",
16
+ "name": "Attach with rdbg",
17
+ "request": "attach"
18
+ }
19
+ ]
20
+ }
21
+
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at liuxiang@ktjr.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Dockerfile ADDED
@@ -0,0 +1,13 @@
1
+ FROM rubylane/ruby:3.2
2
+
3
+ LABEL maintainer="Liu Xiang<liuxiang921@gmail.com>"
4
+
5
+ RUN gem install copilot2gpt
6
+
7
+ WORKDIR /
8
+
9
+ EXPOSE 4567
10
+
11
+ ENTRYPOINT ["copilot2gpt"]
12
+
13
+ CMD ["-p", "4567"]
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in copilot2gpt.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,71 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ copilot2gpt (0.1.0)
5
+ activesupport (~> 7.0.0)
6
+ faraday (~> 2.8.1)
7
+ puma (~> 6.3.0)
8
+ sinatra (~> 3.1.0)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ activesupport (7.0.8)
14
+ concurrent-ruby (~> 1.0, >= 1.0.2)
15
+ i18n (>= 1.6, < 2)
16
+ minitest (>= 5.1)
17
+ tzinfo (~> 2.0)
18
+ base64 (0.2.0)
19
+ concurrent-ruby (1.2.2)
20
+ diff-lcs (1.5.0)
21
+ faraday (2.8.1)
22
+ base64
23
+ faraday-net_http (>= 2.0, < 3.1)
24
+ ruby2_keywords (>= 0.0.4)
25
+ faraday-net_http (3.0.2)
26
+ i18n (1.14.1)
27
+ concurrent-ruby (~> 1.0)
28
+ minitest (5.20.0)
29
+ mustermann (3.0.0)
30
+ ruby2_keywords (~> 0.0.1)
31
+ nio4r (2.7.0)
32
+ puma (6.3.0)
33
+ nio4r (~> 2.0)
34
+ rack (2.2.8)
35
+ rack-protection (3.1.0)
36
+ rack (~> 2.2, >= 2.2.4)
37
+ rake (13.0.6)
38
+ rspec (3.12.0)
39
+ rspec-core (~> 3.12.0)
40
+ rspec-expectations (~> 3.12.0)
41
+ rspec-mocks (~> 3.12.0)
42
+ rspec-core (3.12.2)
43
+ rspec-support (~> 3.12.0)
44
+ rspec-expectations (3.12.3)
45
+ diff-lcs (>= 1.2.0, < 2.0)
46
+ rspec-support (~> 3.12.0)
47
+ rspec-mocks (3.12.5)
48
+ diff-lcs (>= 1.2.0, < 2.0)
49
+ rspec-support (~> 3.12.0)
50
+ rspec-support (3.12.0)
51
+ ruby2_keywords (0.0.5)
52
+ sinatra (3.1.0)
53
+ mustermann (~> 3.0)
54
+ rack (~> 2.2, >= 2.2.4)
55
+ rack-protection (= 3.1.0)
56
+ tilt (~> 2.0)
57
+ tilt (2.3.0)
58
+ tzinfo (2.0.6)
59
+ concurrent-ruby (~> 1.0)
60
+
61
+ PLATFORMS
62
+ arm64-darwin-23
63
+ x86_64-darwin-22
64
+
65
+ DEPENDENCIES
66
+ copilot2gpt!
67
+ rake (~> 13.0)
68
+ rspec (~> 3.0)
69
+
70
+ BUNDLED WITH
71
+ 2.4.1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Liu Xiang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # Copilot2gpt
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/copilot2gpt`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ ## Installation
8
+
9
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_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_PRIOR_TO_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_PRIOR_TO_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. Then, run `rake spec` to run the tests. 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/lululau/copilot2gpt. 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/lululau/copilot2gpt/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 Copilot2gpt project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/lululau/copilot2gpt/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
data/exe/copilot2gpt ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "sinatra"
5
+ require "copilot2gpt"
6
+ require "copilot2gpt/app"
@@ -0,0 +1,179 @@
1
+ require 'copilot2gpt/token'
2
+ require 'faraday'
3
+ require 'json'
4
+ require 'active_support/all'
5
+
6
+ MODEL = { "id": "gpt-4", "object": "model", "created": 1687882411, "owned_by": "openai" }
7
+
8
+ before do
9
+ headers 'Access-Control-Allow-Origin' => '*',
10
+ 'Access-Control-Allow-Methods' => ['OPTIONS', 'GET', 'POST'],
11
+ 'Access-Control-Allow-Headers' => 'Content-Type'
12
+ halt 200 if request.request_method == 'OPTIONS'
13
+ @user_agent = request.env['HTTP_USER_AGENT'].to_s
14
+ @chatbox = @user_agent.include?('chatbox')
15
+ end
16
+
17
+ get('/openai/models') do
18
+ {
19
+ object: 'list',
20
+ data: [MODEL]
21
+ }.to_json
22
+ end
23
+
24
+ post('/openai/chat/completions') do
25
+ @mock_ai_gateway = true
26
+ complete
27
+ end
28
+
29
+ post('/v1/chat/completions') do
30
+ complete
31
+ end
32
+
33
+ def complete
34
+ github_token = request.env['HTTP_AUTHORIZATION'].to_s.sub('Bearer ', '')
35
+ if github_token.empty?
36
+ halt 401, {'Content-Type' => 'application/json'}, {:message => 'Unauthorized'}.to_json
37
+ end
38
+ @copilot_token = Copilot2gpt::Token.get_copilot_token(github_token)
39
+ content = params['content']
40
+ url = "https://api.githubcopilot.com/chat/completions"
41
+ chat_request = ChatRequest.with_default(content, JSON.parse(request.body.read, symbolize_names: true))
42
+ conn = Faraday.new(url: url)
43
+
44
+ if !chat_request.one_time_return
45
+ stream do |response_stream|
46
+ resp = conn.post do |req|
47
+ req.headers = build_headers(@copilot_token)
48
+ req.body = chat_request.to_json
49
+ buffered_line = ""
50
+ req.options.on_data = Proc.new do |chunk, overall_received_bytes, env|
51
+ chunk.each_line do |line|
52
+ line.chomp!
53
+ next unless line.present?
54
+ if line.start_with?("data: ")
55
+ buffered_line = line
56
+ message = JSON.parse(line.sub(/^data: /, '')) rescue next
57
+ else
58
+ buffered_line += line
59
+ message = JSON.parse(buffered_line.sub(/^data: /, '')) rescue next
60
+ end
61
+ message = message.with_indifferent_access
62
+ if @chatbox
63
+ message[:choices].select! do |choice|
64
+ choice.dig(:delta, :content)
65
+ end
66
+ next unless message[:choices].any?
67
+ end
68
+ if @mock_ai_gateway
69
+ message.merge!(object: "chat.completion.chunk", model: "gpt-4")
70
+ end
71
+ message_json = message.to_json + "\n\n"
72
+ message_json = "data: " + message_json unless @mock_ai_gateway
73
+ response_stream << message_json
74
+ end
75
+ end
76
+ end
77
+
78
+ if resp.status != 200
79
+ halt resp.status, {'Content-Type' => 'application/json'}, {:error => resp.body}.to_json
80
+ return
81
+ end
82
+ end
83
+ else
84
+ resp = conn.post do |req|
85
+ req.headers = build_headers(@copilot_token)
86
+ req.body = chat_request.to_json
87
+ end
88
+
89
+ if resp.status != 200
90
+ halt resp.status, {'Content-Type' => 'application/json'}, {:error => resp.body}.to_json
91
+ return
92
+ end
93
+
94
+ buffer = ""
95
+ res.body.each_line do |line|
96
+ if line.start_with?("data: ")
97
+ data = line.sub("data: ", "")
98
+ obj = JSON.parse(data)
99
+ if obj.key?("choices") && obj["choices"].is_a?(Array) && !obj["choices"].empty?
100
+ choice = obj["choices"][0]
101
+ if choice.is_a?(Hash) && choice.key?("delta") && choice["delta"].is_a?(Hash)
102
+ delta = choice["delta"]
103
+ if delta.key?("content") && delta["content"].is_a?(String)
104
+ buffer += delta["content"]
105
+ end
106
+ end
107
+ end
108
+ end
109
+ end
110
+ return [200, {'Content-Type' => 'text/event-stream; charset=utf-8'}, buffer]
111
+ end
112
+ end
113
+
114
+
115
+ class ChatRequest
116
+ attr_accessor :messages, :model, :temperature, :top_p, :n, :stream, :intent, :one_time_return
117
+
118
+ def initialize(args)
119
+ @messages = args[:messages]
120
+ @model = args[:model]
121
+ @temperature = args[:temperature]
122
+ @top_p = args[:top_p]
123
+ @n = args[:n]
124
+ @stream = args[:stream]
125
+ @intent = args[:intent]
126
+ @one_time_return = args[:one_time_return]
127
+ end
128
+
129
+ def to_json
130
+ {
131
+ messages: @messages,
132
+ model: @model,
133
+ temperature: @temperature,
134
+ top_p: @top_p,
135
+ n: @n,
136
+ stream: @stream,
137
+ intent: @intent,
138
+ one_time_return: @one_time_return
139
+ }.to_json
140
+ end
141
+
142
+ class << self
143
+ def with_default(content, params)
144
+ default = {
145
+ messages: [
146
+ {"role" => "system", "content" => "\nYou are ChatGPT, a large language model trained by OpenAI.\nKnowledge cutoff: 2021-09\nCurrent model: gpt-4\nCurrent time: 2023/11/7 11: 39: 14\n"},
147
+ {"role" => "user", "content" => content}
148
+ ],
149
+ model: "gpt-4", temperature: 0.5,
150
+ top_p: 1, n: 1,
151
+ stream: true, intent: true,
152
+ one_time_return: false
153
+ }.merge(params)
154
+ new(default)
155
+ end
156
+ end
157
+ end
158
+
159
+ def gen_hex_str(length)
160
+ SecureRandom.hex(length / 2)
161
+ end
162
+
163
+ def build_headers(copilot_token)
164
+ {
165
+ "Authorization" => "Bearer #{copilot_token}",
166
+ "X-Request-Id" => "#{gen_hex_str(8)}-#{gen_hex_str(4)}-#{gen_hex_str(4)}-#{gen_hex_str(4)}-#{gen_hex_str(12)}",
167
+ "Vscode-Sessionid" => "#{gen_hex_str(8)}-#{gen_hex_str(4)}-#{gen_hex_str(4)}-#{gen_hex_str(4)}-#{gen_hex_str(25)}",
168
+ "Vscode-Machineid" => gen_hex_str(64),
169
+ "Editor-Version" => "vscode/1.83.1",
170
+ "Editor-Plugin-Version" => "copilot-chat/0.8.0",
171
+ "Openai-Organization" => "github-copilot",
172
+ "Openai-Intent" => "conversation-panel",
173
+ "Content-Type" => "text/event-stream; charset=utf-8",
174
+ "User-Agent" => "GitHubCopilotChat/0.8.0",
175
+ "Accept" => "*/*",
176
+ "Accept-Encoding" => "gzip,deflate,br",
177
+ "Connection" => "close"
178
+ }
179
+ end
@@ -0,0 +1,11 @@
1
+ require 'sinatra'
2
+ require 'faraday'
3
+
4
+ get '/test' do
5
+ stream do |s|
6
+ 200.times do |i|
7
+ s << "data #{i}\n"
8
+ sleep 0.1
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,48 @@
1
+ require 'json'
2
+ require 'net/http'
3
+ require 'uri'
4
+
5
+ module Copilot2gpt
6
+
7
+ class Token
8
+ attr_accessor :token, :expires_at
9
+
10
+ CACHE = {}
11
+
12
+ def initialize(token, expires_at)
13
+ @token = token
14
+ @expires_at = expires_at
15
+ end
16
+
17
+ class << self
18
+ def get_token_from_cache(github_token)
19
+ extra_time = rand(600) + 300
20
+ if CACHE.key?(github_token) && CACHE[github_token].expires_at > Time.now.to_i + extra_time
21
+ return CACHE[github_token]
22
+ end
23
+ Token.new("", 0)
24
+ end
25
+
26
+ def get_copilot_token(github_token)
27
+ token = get_token_from_cache(github_token)
28
+ if token.token.empty?
29
+ get_token_url = "https://api.github.com/copilot_internal/v2/token"
30
+ uri = URI(get_token_url)
31
+ req = Net::HTTP::Get.new(uri)
32
+ req['Authorization'] = "token #{github_token}"
33
+ res = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => uri.scheme == 'https') {|http|
34
+ http.request(req)
35
+ }
36
+ if res.code != "200"
37
+ raise "Failed to get copilot token: #{res.code} #{res.body}"
38
+ end
39
+ copilot_token = JSON.parse(res.body, object_class: OpenStruct)
40
+ token.token = copilot_token.token
41
+ CACHE[github_token] = Token.new(copilot_token.token, copilot_token.expires_at)
42
+ end
43
+ token.token
44
+ end
45
+ end
46
+ end
47
+
48
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Copilot2gpt
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "copilot2gpt/version"
4
+
5
+ module Copilot2gpt
6
+ class Error < StandardError; end
7
+ end
@@ -0,0 +1,4 @@
1
+ module Copilot2gpt
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: copilot2gpt
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Liu Xiang
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-12-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sinatra
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: puma
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 6.3.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 6.3.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: activesupport
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 7.0.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 7.0.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: faraday
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.8.1
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.8.1
69
+ description: Proxy Copilot API to GPT-4 API
70
+ email:
71
+ - liuxiang921@gmail.com
72
+ executables:
73
+ - copilot2gpt
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".rspec"
78
+ - ".vscode/launch.json"
79
+ - CODE_OF_CONDUCT.md
80
+ - Dockerfile
81
+ - Gemfile
82
+ - Gemfile.lock
83
+ - LICENSE.txt
84
+ - README.md
85
+ - Rakefile
86
+ - exe/copilot2gpt
87
+ - lib/copilot2gpt.rb
88
+ - lib/copilot2gpt/app.rb
89
+ - lib/copilot2gpt/test.rb
90
+ - lib/copilot2gpt/token.rb
91
+ - lib/copilot2gpt/version.rb
92
+ - sig/copilot2gpt.rbs
93
+ homepage: https://github.com/lululau/copilot2gpt
94
+ licenses:
95
+ - MIT
96
+ metadata:
97
+ homepage_uri: https://github.com/lululau/copilot2gpt
98
+ source_code_uri: https://github.com/lululau/copilot2gpt
99
+ post_install_message:
100
+ rdoc_options: []
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: 2.6.0
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ requirements: []
114
+ rubygems_version: 3.4.1
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: Proxy Copilot API to GPT-4 API
118
+ test_files: []