Skip to content

Commit

Permalink
fix(mssql): fix mssql tool kind to mssql-sql
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuan325 committed Jan 29, 2025
1 parent 497fb06 commit c2cf747
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions internal/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
postgressrc "github.com/googleapis/genai-toolbox/internal/sources/postgres"
spannersrc "github.com/googleapis/genai-toolbox/internal/sources/spanner"
"github.com/googleapis/genai-toolbox/internal/tools"
"github.com/googleapis/genai-toolbox/internal/tools/mssql"
"github.com/googleapis/genai-toolbox/internal/tools/mssqlsql"
"github.com/googleapis/genai-toolbox/internal/tools/mysql"
neo4jtool "github.com/googleapis/genai-toolbox/internal/tools/neo4j"
"github.com/googleapis/genai-toolbox/internal/tools/postgressql"
Expand Down Expand Up @@ -272,8 +272,8 @@ func (c *ToolConfigs) UnmarshalYAML(unmarshal func(interface{}) error) error {
return fmt.Errorf("unable to parse as %q: %w", k.Kind, err)
}
(*c)[name] = actual
case mssql.ToolKind:
actual := mssql.Config{Name: name}
case mssqlsql.ToolKind:
actual := mssqlsql.Config{Name: name}
if err := u.Unmarshal(&actual); err != nil {
return fmt.Errorf("unable to parse as %q: %w", k.Kind, err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package mssql
package mssqlsql

import (
"database/sql"
Expand All @@ -24,7 +24,7 @@ import (
"github.com/googleapis/genai-toolbox/internal/tools"
)

const ToolKind string = "mssql"
const ToolKind string = "mssql-sql"

type compatibleSource interface {
MSSQLDB() *sql.DB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package mssql_test
package mssqlsql_test

import (
"testing"
Expand All @@ -21,7 +21,7 @@ import (
"github.com/googleapis/genai-toolbox/internal/server"
"github.com/googleapis/genai-toolbox/internal/testutils"
"github.com/googleapis/genai-toolbox/internal/tools"
"github.com/googleapis/genai-toolbox/internal/tools/mssql"
"github.com/googleapis/genai-toolbox/internal/tools/mssqlsql"
"gopkg.in/yaml.v3"
)

Expand All @@ -36,7 +36,7 @@ func TestParseFromYamlMssql(t *testing.T) {
in: `
tools:
example_tool:
kind: mssql
kind: mssql-sql
source: my-instance
description: some description
statement: |
Expand All @@ -55,9 +55,9 @@ func TestParseFromYamlMssql(t *testing.T) {
field: user_id
`,
want: server.ToolConfigs{
"example_tool": mssql.Config{
"example_tool": mssqlsql.Config{
Name: "example_tool",
Kind: mssql.ToolKind,
Kind: mssqlsql.ToolKind,
Source: "my-instance",
Description: "some description",
Statement: "SELECT * FROM SQL_STATEMENT;\n",
Expand Down

0 comments on commit c2cf747

Please sign in to comment.