|
package localai |
|
|
|
import ( |
|
"github.com/gofiber/fiber/v2" |
|
"github.com/mudler/LocalAI/core/config" |
|
"github.com/mudler/LocalAI/core/p2p" |
|
"github.com/mudler/LocalAI/core/schema" |
|
) |
|
|
|
|
|
|
|
|
|
|
|
func ShowP2PNodes(c *fiber.Ctx) error { |
|
|
|
return c.JSON(schema.P2PNodesResponse{ |
|
Nodes: p2p.GetAvailableNodes(""), |
|
FederatedNodes: p2p.GetAvailableNodes(p2p.FederatedID), |
|
}) |
|
} |
|
|
|
|
|
|
|
|
|
|
|
func ShowP2PToken(appConfig *config.ApplicationConfig) func(*fiber.Ctx) error { |
|
return func(c *fiber.Ctx) error { return c.Send([]byte(appConfig.P2PToken)) } |
|
} |
|
|