mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-04-24 09:10:27 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af543238aa | ||
|
|
2de27c560b | ||
|
|
a594338bc5 | ||
|
|
1fa5514d56 |
@@ -1195,17 +1195,6 @@ func GetGitHubCopilotModels() []*ModelInfo {
|
|||||||
// GetKiroModels returns the Kiro (AWS CodeWhisperer) model definitions
|
// GetKiroModels returns the Kiro (AWS CodeWhisperer) model definitions
|
||||||
func GetKiroModels() []*ModelInfo {
|
func GetKiroModels() []*ModelInfo {
|
||||||
return []*ModelInfo{
|
return []*ModelInfo{
|
||||||
{
|
|
||||||
ID: "kiro-auto",
|
|
||||||
Object: "model",
|
|
||||||
Created: 1732752000, // 2024-11-28
|
|
||||||
OwnedBy: "aws",
|
|
||||||
Type: "kiro",
|
|
||||||
DisplayName: "Kiro Auto",
|
|
||||||
Description: "Automatic model selection by AWS CodeWhisperer",
|
|
||||||
ContextLength: 200000,
|
|
||||||
MaxCompletionTokens: 64000,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
ID: "kiro-claude-opus-4.5",
|
ID: "kiro-claude-opus-4.5",
|
||||||
Object: "model",
|
Object: "model",
|
||||||
|
|||||||
@@ -547,8 +547,6 @@ func kiroCredentials(auth *cliproxyauth.Auth) (accessToken, profileArn string) {
|
|||||||
// Agentic variants (-agentic suffix) map to the same backend model IDs.
|
// Agentic variants (-agentic suffix) map to the same backend model IDs.
|
||||||
func (e *KiroExecutor) mapModelToKiro(model string) string {
|
func (e *KiroExecutor) mapModelToKiro(model string) string {
|
||||||
modelMap := map[string]string{
|
modelMap := map[string]string{
|
||||||
// Proxy format (kiro- prefix)
|
|
||||||
"kiro-auto": "auto",
|
|
||||||
"kiro-claude-opus-4.5": "claude-opus-4.5",
|
"kiro-claude-opus-4.5": "claude-opus-4.5",
|
||||||
"kiro-claude-sonnet-4.5": "claude-sonnet-4.5",
|
"kiro-claude-sonnet-4.5": "claude-sonnet-4.5",
|
||||||
"kiro-claude-sonnet-4": "claude-sonnet-4",
|
"kiro-claude-sonnet-4": "claude-sonnet-4",
|
||||||
|
|||||||
@@ -1272,7 +1272,7 @@ func (w *Watcher) SnapshotCoreAuths() []*coreauth.Auth {
|
|||||||
}
|
}
|
||||||
for i := range cfg.KiroKey {
|
for i := range cfg.KiroKey {
|
||||||
kk := cfg.KiroKey[i]
|
kk := cfg.KiroKey[i]
|
||||||
var accessToken, profileArn string
|
var accessToken, profileArn, refreshToken string
|
||||||
|
|
||||||
// Try to load from token file first
|
// Try to load from token file first
|
||||||
if kk.TokenFile != "" && kAuth != nil {
|
if kk.TokenFile != "" && kAuth != nil {
|
||||||
@@ -1282,6 +1282,7 @@ func (w *Watcher) SnapshotCoreAuths() []*coreauth.Auth {
|
|||||||
} else {
|
} else {
|
||||||
accessToken = tokenData.AccessToken
|
accessToken = tokenData.AccessToken
|
||||||
profileArn = tokenData.ProfileArn
|
profileArn = tokenData.ProfileArn
|
||||||
|
refreshToken = tokenData.RefreshToken
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1292,6 +1293,9 @@ func (w *Watcher) SnapshotCoreAuths() []*coreauth.Auth {
|
|||||||
if kk.ProfileArn != "" {
|
if kk.ProfileArn != "" {
|
||||||
profileArn = kk.ProfileArn
|
profileArn = kk.ProfileArn
|
||||||
}
|
}
|
||||||
|
if kk.RefreshToken != "" {
|
||||||
|
refreshToken = kk.RefreshToken
|
||||||
|
}
|
||||||
|
|
||||||
if accessToken == "" {
|
if accessToken == "" {
|
||||||
log.Warnf("kiro config[%d] missing access_token, skipping", i)
|
log.Warnf("kiro config[%d] missing access_token, skipping", i)
|
||||||
@@ -1313,6 +1317,9 @@ func (w *Watcher) SnapshotCoreAuths() []*coreauth.Auth {
|
|||||||
if kk.AgentTaskType != "" {
|
if kk.AgentTaskType != "" {
|
||||||
attrs["agent_task_type"] = kk.AgentTaskType
|
attrs["agent_task_type"] = kk.AgentTaskType
|
||||||
}
|
}
|
||||||
|
if refreshToken != "" {
|
||||||
|
attrs["refresh_token"] = refreshToken
|
||||||
|
}
|
||||||
proxyURL := strings.TrimSpace(kk.ProxyURL)
|
proxyURL := strings.TrimSpace(kk.ProxyURL)
|
||||||
a := &coreauth.Auth{
|
a := &coreauth.Auth{
|
||||||
ID: id,
|
ID: id,
|
||||||
@@ -1324,6 +1331,14 @@ func (w *Watcher) SnapshotCoreAuths() []*coreauth.Auth {
|
|||||||
CreatedAt: now,
|
CreatedAt: now,
|
||||||
UpdatedAt: now,
|
UpdatedAt: now,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if refreshToken != "" {
|
||||||
|
if a.Metadata == nil {
|
||||||
|
a.Metadata = make(map[string]any)
|
||||||
|
}
|
||||||
|
a.Metadata["refresh_token"] = refreshToken
|
||||||
|
}
|
||||||
|
|
||||||
out = append(out, a)
|
out = append(out, a)
|
||||||
}
|
}
|
||||||
for i := range cfg.OpenAICompatibility {
|
for i := range cfg.OpenAICompatibility {
|
||||||
|
|||||||
Reference in New Issue
Block a user