Skip to content
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

Langchain::Tool::Database#describe_table with COMMENT #891

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ GEM
rubyzip (2.3.2)
safe_ruby (1.0.4)
childprocess (>= 0.3.9)
sequel (5.68.0)
sequel (5.87.0)
bigdecimal
signet (0.19.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
Expand Down Expand Up @@ -480,7 +481,7 @@ DEPENDENCIES
rubocop
ruby-openai (~> 7.1.0)
safe_ruby (~> 1.0.4)
sequel (~> 5.68.0)
sequel (~> 5.87.0)
standard (>= 1.35.1)
vcr
weaviate-ruby (~> 0.9.2)
Expand Down
2 changes: 1 addition & 1 deletion langchain.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "roo-xls", "~> 1.2.0"
spec.add_development_dependency "ruby-openai", "~> 7.1.0"
spec.add_development_dependency "safe_ruby", "~> 1.0.4"
spec.add_development_dependency "sequel", "~> 5.68.0"
spec.add_development_dependency "sequel", "~> 5.87.0"
spec.add_development_dependency "weaviate-ruby", "~> 0.9.2"
spec.add_development_dependency "wikipedia-client", "~> 1.17.0"
spec.add_development_dependency "power_point_pptx", "~> 0.1.0"
Expand Down
3 changes: 2 additions & 1 deletion lib/langchain/tool/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Langchain::Tool
# Connects to a SQL database, executes SQL queries, and outputs DB schema for Agents to use
#
# Gem requirements:
# gem "sequel", "~> 5.68.0"
# gem "sequel", "~> 5.87.0"
#
# Usage:
# database = Langchain::Tool::Database.new(connection_string: "postgres://user:password@localhost:5432/db_name")
Expand Down Expand Up @@ -115,6 +115,7 @@ def describe_table(table)
else
primary_key_columns << column[0]
end
schema << " COMMENT '#{column[1][:comment]}'" if column[1][:comment]
schema << ",\n" unless column == db.schema(table).last && primary_key_column_count == 1
end
if primary_key_column_count > 1
Expand Down
2 changes: 1 addition & 1 deletion lib/langchain/vectorsearch/pgvector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Pgvector < Base
# The PostgreSQL vector search adapter
#
# Gem requirements:
# gem "sequel", "~> 5.68.0"
# gem "sequel", "~> 5.87.0"
# gem "pgvector", "~> 0.2"
#
# Usage:
Expand Down
Loading