Merge branch 'feature/1.6-liujian' into 'main'

Feature/1.6 liujian

See merge request apipark/APIPark!252
This commit is contained in:
刘健
2025-03-10 14:54:42 +08:00
7 changed files with 20 additions and 8 deletions
@@ -17,6 +17,17 @@ supported_model_types:
- text-embedding
configurate_methods:
- customizable-model
provider_credential_schema:
credential_form_schemas:
- variable: base_url
label:
zh_Hans: API Base
en_US: API Base
type: text-input
required: false
placeholder:
zh_Hans: 在此输入您的 API Base, 如:http://127.0.0.1:11434
en_US: Enter your API Base, e.g. http://127.0.0.1:11434
model_credential_schema:
model:
label:
+2
View File
@@ -63,6 +63,7 @@ func (i *imlAPIController) Create(ctx *gin.Context, serviceId string, input *ai_
_, err = i.routerModule.Create(ctx, serviceId, &router_dto.Create{
Id: input.Id,
Name: input.Name,
Path: input.Path,
Methods: []string{
http.MethodPost,
@@ -130,6 +131,7 @@ func (i *imlAPIController) Edit(ctx *gin.Context, serviceId string, apiId string
}
_, err = i.routerModule.Edit(ctx, serviceId, apiId, &router_dto.Edit{
Name: input.Name,
Description: input.Description,
Proxy: proxy,
Path: input.Path,
-3
View File
@@ -17,7 +17,6 @@ require (
github.com/influxdata/influxdb-client-go/v2 v2.14.0
github.com/nsqio/go-nsq v1.1.0
github.com/ollama/ollama v0.5.8
github.com/stretchr/testify v1.9.0
github.com/urfave/cli v1.22.16
golang.org/x/crypto v0.31.0
gopkg.in/yaml.v3 v3.0.1
@@ -32,7 +31,6 @@ require (
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
@@ -61,7 +59,6 @@ require (
github.com/oapi-codegen/runtime v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/redis/go-redis/v9 v9.5.3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
+1
View File
@@ -40,6 +40,7 @@ github.com/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3
github.com/getkin/kin-openapi v0.127.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/gzip v1.0.1 h1:HQ8ENHODeLY7a4g1Au/46Z92bdGFl74OhxcZble9WJE=
github.com/gin-contrib/gzip v1.0.1/go.mod h1:njt428fdUNRvjuJf16tZMYZ2Yl+WQB53X5wmhDwXvC4=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
+4 -5
View File
@@ -4,12 +4,13 @@ import (
"context"
"errors"
"fmt"
ai_model "github.com/APIParkLab/APIPark/service/ai-model"
"github.com/google/uuid"
"net/http"
"sort"
"time"
ai_model "github.com/APIParkLab/APIPark/service/ai-model"
"github.com/google/uuid"
ai_provider_local "github.com/APIParkLab/APIPark/ai-provider/local"
"github.com/eolinker/go-common/register"
@@ -586,7 +587,7 @@ func (i *imlProviderModule) UpdateProviderConfig(ctx context.Context, id string,
return err
}
}
_, has := p.GetModel(input.DefaultLLM)
model, has := p.GetModel(input.DefaultLLM)
if !has {
return fmt.Errorf("ai provider model not found")
}
@@ -647,7 +648,6 @@ func (i *imlProviderModule) UpdateProviderConfig(ctx context.Context, id string,
p.SetURI(uri)
}
}
/**
if *pInfo.Status == 0 {
return i.syncGateway(ctx, cluster.DefaultClusterID, []*gateway.DynamicRelease{
{
@@ -682,7 +682,6 @@ func (i *imlProviderModule) UpdateProviderConfig(ctx context.Context, id string,
Attr: cfg,
}, newKey(defaultKey),
}, true)
*/
return nil
})
+1
View File
@@ -63,6 +63,7 @@ func (a *Create) Validate() error {
}
type Edit struct {
Name *string `json:"name"`
Description *string `json:"description"`
Proxy *InputProxy `json:"proxy"`
Path *string `json:"path"`
+1
View File
@@ -324,6 +324,7 @@ func (i *imlRouterModule) Edit(ctx context.Context, serviceId string, apiId stri
match = &m
}
err = i.apiService.Save(ctx, apiId, &api.Edit{
Name: dto.Name,
Description: dto.Description,
Methods: dto.Methods,
Protocols: dto.Protocols,