Skip to content

Commit

Permalink
Merge pull request #22 from tungnt1203/param_datasource
Browse files Browse the repository at this point in the history
fix param update datasource
  • Loading branch information
tungnt1203 authored Nov 9, 2024
2 parents 04ba7e6 + b2b663d commit 61d6f2b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
4 changes: 0 additions & 4 deletions lib/minds/datasources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def initialize(client:)
@client = client
end

##
# Create a new datasource and return it
#
# @param ds_config [DatabaseConfig] datasource configuration
Expand Down Expand Up @@ -67,7 +66,6 @@ def create(ds_config, replace = false)
find(name)
end

##
# Return a list of datasources
#
# @return [Array<Datasource>] An array of Datasource objects
Expand All @@ -87,7 +85,6 @@ def all
end
end

##
# Find a datasource by name
#
# @param name [String] The name of the datasource to find
Expand All @@ -106,7 +103,6 @@ def find(name)
Datasource.new(**data.transform_keys(&:to_sym))
end

##
# Delete a datasource
#
# @param name [String] Datasource name to delete
Expand Down
10 changes: 1 addition & 9 deletions lib/minds/minds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def initialize(client, attributes = {})
@datasources = attributes["datasources"]
end

##
# Update mind
#
# @param name [String, nil] New name of the mind (optional)
Expand All @@ -44,7 +43,7 @@ def update(name: nil, model_name: nil, provider: nil, prompt_template: nil, data
ds_names << ds_name
end if datasources

data["datasources"] = ds_names
data["datasources"] = ds_names if !ds_names.empty?
data["name"] = name if name
data["model_name"] = model_name if model_name
data["provider"] = provider if provider
Expand All @@ -66,7 +65,6 @@ def update(name: nil, model_name: nil, provider: nil, prompt_template: nil, data
@updated_at = updated_mind.updated_at
end

##
# Add datasource to mind
#
# @param datasource [String, Datasource, DatabaseConfig] Datasource to add
Expand All @@ -84,7 +82,6 @@ def add_datasources(datasource)
@datasources = mind.datasources
end

##
# Remove datasource from mind
#
# @param datasource [String, Datasource] Datasource to remove
Expand All @@ -105,7 +102,6 @@ def destroy_datasources(datasource)
@datasources = mind.datasources
end

##
# Call mind completion
#
# @param message [String] The input question or prompt
Expand Down Expand Up @@ -141,7 +137,6 @@ def initialize(client:)
@project = "mindsdb"
end

##
# Lists minds
#
# @return [Array<Mind>] List of minds
Expand All @@ -157,7 +152,6 @@ def all
data.map { |item| Mind.new(@client, item) }
end

##
# Find a mind by name
#
# @param name [String] The name of the mind to find
Expand All @@ -172,7 +166,6 @@ def find(name)
Mind.new(@client, data)
end

##
# Delete a mind
#
# @param name [String] The name of the mind to delete
Expand All @@ -185,7 +178,6 @@ def destroy(name)
@client.delete(path: "projects/#{@project}/minds/#{name}")
end

##
# Create a new mind and return it
#
# @param name [String] The name of the mind
Expand Down

0 comments on commit 61d6f2b

Please sign in to comment.