mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-09-07 17:58:55 +08:00
Go: fix test and remove unused code (#15909)
### What problem does this PR solve? 1. Fix go test, some cases still failed. 2. Remove unused code. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -28,7 +28,6 @@ import (
|
||||
"ragflow/internal/common"
|
||||
"ragflow/internal/dao"
|
||||
"ragflow/internal/entity"
|
||||
"ragflow/internal/mcpclient"
|
||||
"ragflow/internal/utility"
|
||||
|
||||
"gorm.io/gorm"
|
||||
@@ -491,7 +490,7 @@ func (s *MCPService) ImportServers(tenantID string, servers map[string]map[strin
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
tools, fetchErr := mcpclient.FetchTools(ctx, mcpclient.FetchOptions{
|
||||
tools, fetchErr := utility.FetchTools(ctx, utility.FetchOptions{
|
||||
URL: url,
|
||||
ServerType: stype,
|
||||
Headers: headers,
|
||||
@@ -597,7 +596,7 @@ func (s *MCPService) TestServer(mcpID string, req *TestServerRequest) ([]map[str
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer cancel()
|
||||
tools, err := mcpclient.FetchTools(ctx, mcpclient.FetchOptions{
|
||||
tools, err := utility.FetchTools(ctx, utility.FetchOptions{
|
||||
URL: req.URL,
|
||||
ServerType: req.ServerType,
|
||||
Headers: headers,
|
||||
@@ -628,7 +627,7 @@ func (s *MCPService) TestServer(mcpID string, req *TestServerRequest) ([]map[str
|
||||
|
||||
// toolsAsMap mirrors Python's `{tool["name"]: tool ...}` shape used when
|
||||
// persisting variables.tools.
|
||||
func toolsAsMap(tools []mcpclient.Tool) map[string]interface{} {
|
||||
func toolsAsMap(tools []utility.Tool) map[string]interface{} {
|
||||
m := map[string]interface{}{}
|
||||
for _, t := range tools {
|
||||
if t.Raw != nil {
|
||||
|
||||
Reference in New Issue
Block a user