New provider and models API and CLI (#13865)

### What problem does this PR solve?

As title.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Refactoring

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-03-31 18:42:12 +08:00
committed by GitHub
parent 68b4287892
commit efd6ecc3e5
13 changed files with 528 additions and 99 deletions

View File

@@ -237,13 +237,13 @@ func (c *RAGFlowClient) Logout() (ResponseIf, error) {
return &result, nil
}
func (c *RAGFlowClient) ListPoolProviders(cmd *Command) (ResponseIf, error) {
func (c *RAGFlowClient) ListAvailableProviders(cmd *Command) (ResponseIf, error) {
var endPoint string
if c.ServerType == "admin" {
endPoint = fmt.Sprintf("/admin/providers")
endPoint = fmt.Sprintf("/admin/providers?available=true")
} else {
endPoint = fmt.Sprintf("/providers")
endPoint = fmt.Sprintf("/providers?available=true")
}
resp, err := c.HTTPClient.Request("GET", endPoint, true, "web", nil, nil)
@@ -267,7 +267,7 @@ func (c *RAGFlowClient) ListPoolProviders(cmd *Command) (ResponseIf, error) {
return &result, nil
}
func (c *RAGFlowClient) ShowPoolProvider(cmd *Command) (ResponseIf, error) {
func (c *RAGFlowClient) ShowProvider(cmd *Command) (ResponseIf, error) {
providerName, ok := cmd.Params["provider_name"].(string)
if !ok {
return nil, fmt.Errorf("provider_name not provided")
@@ -301,7 +301,7 @@ func (c *RAGFlowClient) ShowPoolProvider(cmd *Command) (ResponseIf, error) {
return &result, nil
}
func (c *RAGFlowClient) ListPoolModels(cmd *Command) (ResponseIf, error) {
func (c *RAGFlowClient) ListModels(cmd *Command) (ResponseIf, error) {
providerName, ok := cmd.Params["provider_name"].(string)
if !ok {
@@ -336,7 +336,7 @@ func (c *RAGFlowClient) ListPoolModels(cmd *Command) (ResponseIf, error) {
return &result, nil
}
func (c *RAGFlowClient) ShowPoolModel(cmd *Command) (ResponseIf, error) {
func (c *RAGFlowClient) ShowModel(cmd *Command) (ResponseIf, error) {
providerName, ok := cmd.Params["provider_name"].(string)
if !ok {
return nil, fmt.Errorf("provider_name not provided")