Repository navigation
✨ add RAG document management #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ianardee
wants to merge
3
commits into
main
Choose a base branch
from
rag-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,118
−135
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,2 @@ | ||
| ## Typing | ||
| When adding or changing a class, make sure to modify the corresponding .rbs file in the `./sig/mindee` folder. |
This file contains hidden or 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 hidden or 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 hidden or 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
30 changes: 30 additions & 0 deletions
30
lib/mindee/v2/client_options/base_annotation_parameters.rb
This file contains hidden or 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,30 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module Mindee | ||
| module V2 | ||
| module ClientOptions | ||
| # Base parameters for document annotations. | ||
| class BaseAnnotationParameters | ||
| # UUID of the annotated document. | ||
| # @return [String] | ||
| attr_reader :document_id | ||
|
|
||
| # Default constructor. | ||
| # @param document_id [String] UUID of the annotated document. | ||
| def initialize(document_id) | ||
| trimmed_id = document_id&.strip | ||
| raise Error::MindeeError, 'Document ID must be provided' if trimmed_id.nil? || trimmed_id.empty? | ||
|
|
||
| # NOTE: document_id is included in the request URL path, it is not a parameter. | ||
| @document_id = trimmed_id | ||
| end | ||
|
|
||
| # Gets the request parameters for the upload request. | ||
| # @return [Hash[String, String]] | ||
| def request_parameters | ||
| raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end |
29 changes: 29 additions & 0 deletions
29
lib/mindee/v2/client_options/base_rag_document_upload_parameters.rb
This file contains hidden or 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,29 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module Mindee | ||
| module V2 | ||
| module ClientOptions | ||
| # Base parameters for document upload operations. | ||
| class BaseRagDocumentUploadParameters | ||
| # UUID of the model that the uploaded RAG document is linked to. | ||
| # @return [String] | ||
| attr_reader :model_id | ||
|
|
||
| # Default constructor. | ||
| # @param model_id [String] UUID of the model that the uploaded RAG document is linked to. | ||
| def initialize(model_id) | ||
| trimmed_id = model_id&.strip | ||
| raise Error::MindeeError, 'Model ID must be provided' if trimmed_id.nil? || trimmed_id.empty? | ||
|
|
||
| @model_id = trimmed_id | ||
| end | ||
|
|
||
| # Gets the request parameters for the upload request. | ||
| # @return [Hash[String, String]] | ||
| def request_parameters | ||
| { 'model_id' => @model_id } | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,15 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| require_relative 'base_response' | ||
|
|
||
| module Mindee | ||
| module V2 | ||
| module Parsing | ||
| # Base class for V2 inference responses. | ||
| class BaseInferenceResponse < Mindee::V2::Parsing::BaseResponse | ||
| # @return [BaseInference] The inference result for a split utility request | ||
| attr_reader :inference | ||
| end | ||
| end | ||
| end | ||
| end |
This file contains hidden or 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,40 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| require 'time' | ||
| require_relative 'base_inference_response' | ||
|
|
||
| module Mindee | ||
| module V2 | ||
| module Parsing | ||
| # Base class for all RAG document responses from the V2 API. | ||
| class BaseRagAnnotationResponse < BaseInferenceResponse | ||
| # Unique identifier of the RAG document. | ||
| # @return [String] | ||
| attr_reader :id | ||
|
|
||
| # Original filename of the uploaded document. | ||
| # @return [String] | ||
| attr_reader :filename | ||
|
|
||
| # Date and time of the document creation. | ||
| # @return [Time] | ||
| attr_reader :created_at | ||
|
|
||
| # Current status of the RAG document. | ||
| # @return [String] | ||
| attr_reader :status | ||
|
|
||
| # Default constructor. | ||
| # @param server_response [Hash[String | Symbol, untyped]] | ||
| def initialize(server_response) | ||
| super | ||
|
|
||
| @id = server_response['id'] | ||
| @filename = server_response['filename'] | ||
| @created_at = Time.parse(server_response['created_at']) | ||
| @status = server_response['status'] | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,6 +1,5 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| require_relative 'common_response' | ||
| require_relative 'job' | ||
|
|
||
| module Mindee | ||
|
|
||
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.