ai-chat 0.0.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.
Files changed (6) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.adoc +134 -0
  3. data/README.adoc +89 -0
  4. data/ai-chat.gemspec +31 -0
  5. data/lib/ai/chat.rb +19 -0
  6. metadata +79 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ebe5b2ee9d1ebdfc0d308f9aef2240d626734c924c8228e80d0c6ba83435c91a
4
+ data.tar.gz: 8a6c10396a4e409acf279b096f48bbaff0cd0398dc1896a052cb6132417fcfde
5
+ SHA512:
6
+ metadata.gz: ebd885918a961b513e5ed66b2ee932fc3cc80b38da4992235b520769c694b732629d832251ddc42d449a4b67ae745d4eb300e4c7347cbca835829649f75fb112
7
+ data.tar.gz: 84d2324af27fccee7532a555c827e6acd8bc9ba64a8b2eb10e178bb0cfdf61cd43ccb2a239b981be0ea70171138c9e1e0d573b99975d653ab1634da5b0ec722a
data/LICENSE.adoc ADDED
@@ -0,0 +1,134 @@
1
+ = Hippocratic License
2
+
3
+ Version: 2.1.0.
4
+
5
+ Purpose. The purpose of this License is for the Licensor named above to
6
+ permit the Licensee (as defined below) broad permission, if consistent
7
+ with Human Rights Laws and Human Rights Principles (as each is defined
8
+ below), to use and work with the Software (as defined below) within the
9
+ full scope of Licensor’s copyright and patent rights, if any, in the
10
+ Software, while ensuring attribution and protecting the Licensor from
11
+ liability.
12
+
13
+ Permission and Conditions. The Licensor grants permission by this
14
+ license ("License"), free of charge, to the extent of Licensor’s
15
+ rights under applicable copyright and patent law, to any person or
16
+ entity (the "Licensee") obtaining a copy of this software and
17
+ associated documentation files (the "Software"), to do everything with
18
+ the Software that would otherwise infringe (i) the Licensor’s copyright
19
+ in the Software or (ii) any patent claims to the Software that the
20
+ Licensor can license or becomes able to license, subject to all of the
21
+ following terms and conditions:
22
+
23
+ * Acceptance. This License is automatically offered to every person and
24
+ entity subject to its terms and conditions. Licensee accepts this
25
+ License and agrees to its terms and conditions by taking any action with
26
+ the Software that, absent this License, would infringe any intellectual
27
+ property right held by Licensor.
28
+ * Notice. Licensee must ensure that everyone who gets a copy of any part
29
+ of this Software from Licensee, with or without changes, also receives
30
+ the License and the above copyright notice (and if included by the
31
+ Licensor, patent, trademark and attribution notice). Licensee must cause
32
+ any modified versions of the Software to carry prominent notices stating
33
+ that Licensee changed the Software. For clarity, although Licensee is
34
+ free to create modifications of the Software and distribute only the
35
+ modified portion created by Licensee with additional or different terms,
36
+ the portion of the Software not modified must be distributed pursuant to
37
+ this License. If anyone notifies Licensee in writing that Licensee has
38
+ not complied with this Notice section, Licensee can keep this License by
39
+ taking all practical steps to comply within 30 days after the notice. If
40
+ Licensee does not do so, Licensee’s License (and all rights licensed
41
+ hereunder) shall end immediately.
42
+ * Compliance with Human Rights Principles and Human Rights Laws.
43
+ [arabic]
44
+ . Human Rights Principles.
45
+ [loweralpha]
46
+ .. Licensee is advised to consult the articles of the United Nations
47
+ Universal Declaration of Human Rights and the United Nations Global
48
+ Compact that define recognized principles of international human rights
49
+ (the "Human Rights Principles"). Licensee shall use the Software in a
50
+ manner consistent with Human Rights Principles.
51
+ .. Unless the Licensor and Licensee agree otherwise, any dispute,
52
+ controversy, or claim arising out of or relating to (i) Section 1(a)
53
+ regarding Human Rights Principles, including the breach of Section 1(a),
54
+ termination of this License for breach of the Human Rights Principles,
55
+ or invalidity of Section 1(a) or (ii) a determination of whether any Law
56
+ is consistent or in conflict with Human Rights Principles pursuant to
57
+ Section 2, below, shall be settled by arbitration in accordance with the
58
+ Hague Rules on Business and Human Rights Arbitration (the "Rules");
59
+ provided, however, that Licensee may elect not to participate in such
60
+ arbitration, in which event this License (and all rights licensed
61
+ hereunder) shall end immediately. The number of arbitrators shall be one
62
+ unless the Rules require otherwise.
63
+ +
64
+ Unless both the Licensor and Licensee agree to the contrary: (1) All
65
+ documents and information concerning the arbitration shall be public and
66
+ may be disclosed by any party; (2) The repository referred to under
67
+ Article 43 of the Rules shall make available to the public in a timely
68
+ manner all documents concerning the arbitration which are communicated
69
+ to it, including all submissions of the parties, all evidence admitted
70
+ into the record of the proceedings, all transcripts or other recordings
71
+ of hearings and all orders, decisions and awards of the arbitral
72
+ tribunal, subject only to the arbitral tribunal’s powers to take such
73
+ measures as may be necessary to safeguard the integrity of the arbitral
74
+ process pursuant to Articles 18, 33, 41 and 42 of the Rules; and (3)
75
+ Article 26(6) of the Rules shall not apply.
76
+ . Human Rights Laws. The Software shall not be used by any person or
77
+ entity for any systems, activities, or other uses that violate any Human
78
+ Rights Laws. "Human Rights Laws" means any applicable laws,
79
+ regulations, or rules (collectively, "Laws") that protect human,
80
+ civil, labor, privacy, political, environmental, security, economic, due
81
+ process, or similar rights; provided, however, that such Laws are
82
+ consistent and not in conflict with Human Rights Principles (a dispute
83
+ over the consistency or a conflict between Laws and Human Rights
84
+ Principles shall be determined by arbitration as stated above). Where
85
+ the Human Rights Laws of more than one jurisdiction are applicable or in
86
+ conflict with respect to the use of the Software, the Human Rights Laws
87
+ that are most protective of the individuals or groups harmed shall
88
+ apply.
89
+ . Indemnity. Licensee shall hold harmless and indemnify Licensor (and
90
+ any other contributor) against all losses, damages, liabilities,
91
+ deficiencies, claims, actions, judgments, settlements, interest, awards,
92
+ penalties, fines, costs, or expenses of whatever kind, including
93
+ Licensor’s reasonable attorneys’ fees, arising out of or relating to
94
+ Licensee’s use of the Software in violation of Human Rights Laws or
95
+ Human Rights Principles.
96
+ * Failure to Comply. Any failure of Licensee to act according to the
97
+ terms and conditions of this License is both a breach of the License and
98
+ an infringement of the intellectual property rights of the Licensor
99
+ (subject to exceptions under Laws, e.g., fair use). In the event of a
100
+ breach or infringement, the terms and conditions of this License may be
101
+ enforced by Licensor under the Laws of any jurisdiction to which
102
+ Licensee is subject. Licensee also agrees that the Licensor may enforce
103
+ the terms and conditions of this License against Licensee through
104
+ specific performance (or similar remedy under Laws) to the extent
105
+ permitted by Laws. For clarity, except in the event of a breach of this
106
+ License, infringement, or as otherwise stated in this License, Licensor
107
+ may not terminate this License with Licensee.
108
+ * Enforceability and Interpretation. If any term or provision of this
109
+ License is determined to be invalid, illegal, or unenforceable by a
110
+ court of competent jurisdiction, then such invalidity, illegality, or
111
+ unenforceability shall not affect any other term or provision of this
112
+ License or invalidate or render unenforceable such term or provision in
113
+ any other jurisdiction; provided, however, subject to a court
114
+ modification pursuant to the immediately following sentence, if any term
115
+ or provision of this License pertaining to Human Rights Laws or Human
116
+ Rights Principles is deemed invalid, illegal, or unenforceable against
117
+ Licensee by a court of competent jurisdiction, all rights in the
118
+ Software granted to Licensee shall be deemed null and void as between
119
+ Licensor and Licensee. Upon a determination that any term or provision
120
+ is invalid, illegal, or unenforceable, to the extent permitted by Laws,
121
+ the court may modify this License to affect the original purpose that
122
+ the Software be used in compliance with Human Rights Principles and
123
+ Human Rights Laws as closely as possible. The language in this License
124
+ shall be interpreted as to its fair meaning and not strictly for or
125
+ against any party.
126
+ * Disclaimer. TO THE FULL EXTENT ALLOWED BY LAW, THIS SOFTWARE COMES
127
+ "AS IS," WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED, AND LICENSOR AND
128
+ ANY OTHER CONTRIBUTOR SHALL NOT BE LIABLE TO ANYONE FOR ANY DAMAGES OR
129
+ OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE
130
+ OR THIS LICENSE, UNDER ANY KIND OF LEGAL CLAIM.
131
+
132
+ This Hippocratic License is an link:https://ethicalsource.dev[Ethical Source license] and is offered
133
+ for use by licensors and licensees at their own risk, on an "AS IS" basis, and with no warranties
134
+ express or implied, to the maximum extent permitted by Laws.
data/README.adoc ADDED
@@ -0,0 +1,89 @@
1
+ :toc: macro
2
+ :toclevels: 5
3
+ :figure-caption!:
4
+
5
+ = Ai Chat
6
+
7
+ toc::[]
8
+
9
+ == Features
10
+
11
+ == Requirements
12
+
13
+ . link:https://www.ruby-lang.org[Ruby].
14
+
15
+ == Setup
16
+
17
+ To install _with_ security, run:
18
+
19
+ [source,bash]
20
+ ----
21
+ # 💡 Skip this line if you already have the public certificate installed.
22
+ gem cert --add <(curl --compressed --location https://undefined.io/gems.pem)
23
+ gem install ai-chat --trust-policy HighSecurity
24
+ ----
25
+
26
+ To install _without_ security, run:
27
+
28
+ [source,bash]
29
+ ----
30
+ gem install ai-chat
31
+ ----
32
+
33
+ You can also add the gem directly to your project:
34
+
35
+ [source,bash]
36
+ ----
37
+ bundle add ai-chat
38
+ ----
39
+
40
+ Once the gem is installed, you only need to require it:
41
+
42
+ [source,ruby]
43
+ ----
44
+ require "ai/chat"
45
+ ----
46
+
47
+ == Usage
48
+
49
+ == Development
50
+
51
+ To contribute, run:
52
+
53
+ [source,bash]
54
+ ----
55
+ git clone https://github.com/undefined/ai-chat
56
+ cd ai-chat
57
+ bin/setup
58
+ ----
59
+
60
+ You can also use the IRB console for direct access to all objects:
61
+
62
+ [source,bash]
63
+ ----
64
+ bin/console
65
+ ----
66
+
67
+ == Tests
68
+
69
+ To test, run:
70
+
71
+ [source,bash]
72
+ ----
73
+ bin/rake
74
+ ----
75
+
76
+ == link:https://undefined.io/policies/license[License]
77
+
78
+ == link:https://undefined.io/policies/security[Security]
79
+
80
+ == link:https://undefined.io/policies/code_of_conduct[Code of Conduct]
81
+
82
+ == link:https://undefined.io/policies/contributions[Contributions]
83
+
84
+ == link:https://undefined.io/projects/ai-chat/versions[Versions]
85
+
86
+ == Credits
87
+
88
+ * Built with link:https://alchemists.io/projects/gemsmith[Gemsmith].
89
+ * Engineered by link:https://undefined.io/team/undefined[Raghu Betina].
data/ai-chat.gemspec ADDED
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "ai-chat"
5
+ spec.version = "0.0.0"
6
+ spec.authors = ["Raghu Betina"]
7
+ spec.email = ["raghu@firstdraft.com"]
8
+ spec.homepage = "https://github.com/firstdraft/ai-chat"
9
+ spec.summary = "A library that makes it as easy as possible to use Chat Completion endpoints in your Ruby application."
10
+ spec.license = "Hippocratic-2.1"
11
+
12
+ spec.metadata = {
13
+ "bug_tracker_uri" => "https://github.com/firstdraft/ai-chat/issues",
14
+ "changelog_uri" => "https://github.com/firstdraft/ai-chat/releases",
15
+ "homepage_uri" => "https://github.com/firstdraft/ai-chat",
16
+ # "funding_uri" => "https://github.com/sponsors/undefined",
17
+ "label" => "AI::Chat",
18
+ # "rubygems_mfa_required" => "true",
19
+ "source_code_uri" => "https://github.com/firstdraft/ai-chat"
20
+ }
21
+
22
+ # spec.signing_key = Gem.default_key_path
23
+ # spec.cert_chain = [Gem.default_cert_path]
24
+
25
+ spec.required_ruby_version = "~> 3.3"
26
+ spec.add_dependency "refinements", "~> 12.10"
27
+ spec.add_dependency "zeitwerk", "~> 2.7"
28
+
29
+ spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
30
+ spec.files = Dir["*.gemspec", "lib/**/*"]
31
+ end
data/lib/ai/chat.rb ADDED
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "zeitwerk"
4
+
5
+ Zeitwerk::Loader.new.then do |loader|
6
+ loader.tag = "ai-chat"
7
+ loader.push_dir "#{__dir__}/.."
8
+ loader.setup
9
+ end
10
+
11
+ module Ai
12
+ # Main namespace.
13
+ module Chat
14
+ def self.loader registry = Zeitwerk::Registry
15
+ @loader ||= registry.loaders.find { |loader| loader.tag == "ai-chat" }
16
+ end
17
+
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ai-chat
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Raghu Betina
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2025-03-05 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: refinements
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '12.10'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '12.10'
26
+ - !ruby/object:Gem::Dependency
27
+ name: zeitwerk
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.7'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.7'
40
+ email:
41
+ - raghu@firstdraft.com
42
+ executables: []
43
+ extensions: []
44
+ extra_rdoc_files:
45
+ - README.adoc
46
+ - LICENSE.adoc
47
+ files:
48
+ - LICENSE.adoc
49
+ - README.adoc
50
+ - ai-chat.gemspec
51
+ - lib/ai/chat.rb
52
+ homepage: https://github.com/firstdraft/ai-chat
53
+ licenses:
54
+ - Hippocratic-2.1
55
+ metadata:
56
+ bug_tracker_uri: https://github.com/firstdraft/ai-chat/issues
57
+ changelog_uri: https://github.com/firstdraft/ai-chat/releases
58
+ homepage_uri: https://github.com/firstdraft/ai-chat
59
+ label: AI::Chat
60
+ source_code_uri: https://github.com/firstdraft/ai-chat
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.3'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubygems_version: 3.6.5
76
+ specification_version: 4
77
+ summary: A library that makes it as easy as possible to use Chat Completion endpoints
78
+ in your Ruby application.
79
+ test_files: []