README.md in human_sql-0.1.1 vs README.md in human_sql-0.1.2
- old
+ new
@@ -1,43 +1,72 @@
# HumanSql
-TODO: Delete this and the text below, and describe your gem
+`HumanSql` is a gem that converts natural language queries into ActiveRecord queries using the OpenAI API. This gem allows developers to execute complex database queries by simply providing instructions in plain English (or another supported language).
-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/human_sql`. To experiment with that code, run `bin/console` for an interactive prompt.
-
## Installation
-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.
+After releasing to RubyGems.org, you can install the gem and add it to your application's Gemfile by executing:
-Install the gem and add to the application's Gemfile by executing:
-
```bash
-bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
+bundle add human_sql
```
-If bundler is not being used to manage dependencies, install the gem by executing:
+If Bundler is not being used to manage dependencies, you can install the gem by executing:
```bash
-gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
+gem install human_sql
```
-## Usage
+### Post Installation
+Once the gem is installed, you'll need to configure it by creating an initializer. In your Rails application, create a file named config/initializers/human_sql.rb and add the following:
-TODO: Write usage instructions here
+```ruby
+HumanSQLConfig = {
+ api_key: 'your_openai_api_key', # Replace with your actual OpenAI API key
+ default_language: 'english' # You can change this to 'spanish', 'japanese', etc.
+}
+```
-## Development
+Make sure to replace 'your_openai_api_key' with your actual API key from OpenAI. The default_language setting controls the language used for the natural language responses.
-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.
+### Usage
-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).
+To use HumanSql in your application, simply call the run method on HumanSQL::QueryBuilder with a natural language query. For example:
-## Contributing
+```ruby
+result = HumanSQL::QueryBuilder.run("Give me the first user from my database")
+puts result
+```
-Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/human_sql. 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]/human_sql/blob/main/CODE_OF_CONDUCT.md).
+This will convert the natural language query into an ActiveRecord query, execute it, and return the results formatted in the specified language.
-## License
+### Disclaimer
-The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
+IMPORTANT: By using this gem, you agree that the author is not responsible for any kind of data loss, damage, or issues that may arise from the use of this software. You are solely responsible for verifying the safety of the generated queries before running them in your production environment or on critical data. Use at your own risk.
-## Code of Conduct
+### Development
-Everyone interacting in the HumanSql project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/human_sql/blob/main/CODE_OF_CONDUCT.md).
+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.
+
+To install this gem onto your local machine, run:
+
+```bash
+bundle
+```
+
+To release a new version, update the version number in version.rb, and then run:
+
+```bash
+bundle exec rake release
+```
+
+This will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.
+
+### Contributing
+
+Bug reports and pull requests are welcome on GitHub at https://github.com/nicobertin/human_sql. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
+
+### License
+The gem is available as open source under the terms of the MIT License.
+
+### Code of Conduct
+Everyone interacting in the HumanSql project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the code of conduct.
\ No newline at end of file