33 lines
774 B
Go
33 lines
774 B
Go
package copilot
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/gofrs/uuid"
|
|
"net/http"
|
|
"os"
|
|
)
|
|
|
|
// GetAgents 获取代理列表
|
|
func GetAgents(c *gin.Context) {
|
|
requestID := uuid.Must(uuid.NewV4()).String()
|
|
c.Header("x-github-request-id", requestID)
|
|
|
|
modelName := os.Getenv("CODEX_API_MODEL_NAME")
|
|
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"agents": []gin.H{
|
|
{
|
|
"id": "github/copilot-workspace",
|
|
"name": "@workspace",
|
|
"description": "Ask questions and get answers about your codebase.",
|
|
"version": "1.0.0",
|
|
"publisher": "github",
|
|
"model": modelName,
|
|
"capabilities": "workspace",
|
|
"default_model": modelName,
|
|
"capabilities_model": modelName,
|
|
},
|
|
},
|
|
})
|
|
}
|