-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from sergiobayona/dry-rb-approach
Dry rb approach
- Loading branch information
Showing
14 changed files
with
153 additions
and
510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative "lib/instructor/version" | ||
require_relative 'lib/instructor/version' | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "instructor-rb" | ||
spec.name = 'instructor-rb' | ||
spec.version = Instructor::VERSION | ||
spec.authors = ["Jason Liu", "Sergio Bayona"] | ||
spec.email = ["[email protected]", "[email protected]"] | ||
spec.authors = ['Jason Liu', 'Sergio Bayona'] | ||
spec.email = ['[email protected]', '[email protected]'] | ||
|
||
spec.summary = "Structured extraction in Ruby, powered by llms." | ||
spec.summary = 'Structured extraction in Ruby, powered by llms.' | ||
spec.description = "Explore the power of structured extraction in Ruby with the Instructor gem. Leveraging OpenAI's function calling API." | ||
spec.homepage = "https://github.com/instructor-ai/instructor-rb" | ||
spec.license = "MIT" | ||
spec.required_ruby_version = ">= 2.7.0" | ||
spec.homepage = 'https://github.com/instructor-ai/instructor-rb' | ||
spec.license = 'MIT' | ||
spec.required_ruby_version = '>= 2.7.0' | ||
|
||
spec.metadata["allowed_push_host"] = "https://rubygems.pkg.github.com/instructor-ai" | ||
spec.metadata['allowed_push_host'] = 'https://rubygems.pkg.github.com/instructor-ai' | ||
|
||
spec.metadata["homepage_uri"] = spec.homepage | ||
spec.metadata["source_code_uri"] = "https://github.com/instructor-ai/instructor-rb" | ||
spec.metadata["changelog_uri"] = "https://github.com/instructor-ai/instructor-rb/blob/main/CHANGELOG.md" | ||
spec.metadata['homepage_uri'] = spec.homepage | ||
spec.metadata['source_code_uri'] = 'https://github.com/instructor-ai/instructor-rb' | ||
spec.metadata['changelog_uri'] = 'https://github.com/instructor-ai/instructor-rb/blob/main/CHANGELOG.md' | ||
|
||
# Specify which files should be added to the gem when it is released. | ||
# The `git ls-files -z` loads the files in the RubyGem that have been added into git. | ||
|
@@ -29,9 +29,9 @@ Gem::Specification.new do |spec| | |
end | ||
end | ||
|
||
spec.require_paths = ["lib"] | ||
spec.require_paths = ['lib'] | ||
|
||
spec.add_dependency "activemodel", "~> 6.1" | ||
spec.add_dependency "activesupport", "~> 6.1" | ||
spec.add_dependency "ruby-openai", "~> 0.1.0" | ||
spec.add_dependency 'activesupport', '~> 6.1.3' | ||
spec.add_dependency 'dry-validation', '~> 1.10' | ||
spec.add_dependency 'ruby-openai', '~> 0.1.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
require "active_model" | ||
require "active_support" | ||
require_relative "instructor/version" | ||
require_relative "instructor/type/array" | ||
require_relative "instructor/model_serializer" | ||
require_relative "instructor/base_model" | ||
require 'openai' | ||
require 'active_support/all' | ||
require_relative 'instructor/version' | ||
require_relative 'instructor/model' | ||
require_relative 'instructor/openai/client' | ||
|
||
module Instructor | ||
class Error < StandardError; end | ||
|
||
# Register the custom array type with ActiveModel | ||
ActiveModel::Type.register(:array, Instructor::Type::Array) | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'dry-validation' | ||
|
||
Dry::Schema.load_extensions(:json_schema) | ||
class Instructor::Model < Dry::Validation::Contract | ||
end |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.