- Updated .env.example to include new configuration options for the UltiAI branding and API endpoints. - Enhanced Nginx configuration to support new API routes for the MCP and WebSocket connections. - Introduced sub-filters for branding adjustments in Nginx responses. - Added new JavaScript patch for API endpoint adjustments. - Implemented tests for new API functionalities and improved error handling in the AI gateway.
38 lines
733 B
Go
38 lines
733 B
Go
package admin
|
|
|
|
import "strings"
|
|
|
|
func buildWebSearchProviderSecretsStatus(policy map[string]any) map[string]any {
|
|
searchSection, ok := policy["search"].(map[string]any)
|
|
if !ok {
|
|
return nil
|
|
}
|
|
webSearch, ok := searchSection["web_search"].(map[string]any)
|
|
if !ok {
|
|
return nil
|
|
}
|
|
providers, ok := webSearch["providers"].([]any)
|
|
if !ok {
|
|
return nil
|
|
}
|
|
out := map[string]any{}
|
|
for _, item := range providers {
|
|
pm, ok := item.(map[string]any)
|
|
if !ok {
|
|
continue
|
|
}
|
|
id, _ := pm["id"].(string)
|
|
if strings.TrimSpace(id) == "" {
|
|
continue
|
|
}
|
|
apiKey, _ := pm["api_key"].(string)
|
|
out[id] = map[string]any{
|
|
"configured": strings.TrimSpace(apiKey) != "",
|
|
}
|
|
}
|
|
if len(out) == 0 {
|
|
return nil
|
|
}
|
|
return out
|
|
}
|