Skip to content

Commit

Permalink
Split ErrorClass to separate File (#913)
Browse files Browse the repository at this point in the history
* Split Error to seperate file to ensure its accessible via Rails console by default

* Fix Linting issue

---------

Co-authored-by: Rishi J <[email protected]>
  • Loading branch information
rishirajkumar97 and Rishi J authored Feb 2, 2025
1 parent 4305119 commit 6f235f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
11 changes: 0 additions & 11 deletions lib/langchain/output_parsers/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,4 @@ def get_format_instructions
raise NotImplementedError
end
end

class OutputParserException < StandardError
def initialize(message, text)
@message = message
@text = text
end

def to_s
"#{@message}\nText: #{@text}"
end
end
end
10 changes: 10 additions & 0 deletions lib/langchain/output_parsers/output_parser_exception.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class Langchain::OutputParsers::OutputParserException < StandardError
def initialize(message, text)
@message = message
@text = text
end

def to_s
"#{@message}\nText: #{@text}"
end
end

0 comments on commit 6f235f2

Please sign in to comment.