File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1119,3 +1119,26 @@ func GetBudgetTokensFromReasoningEffort(
11191119
11201120 return budget , nil
11211121}
1122+ << << << < HEAD
1123+ == == == =
1124+
1125+ // ShouldAttemptIntegrationFallback checks if an integration fallback should be attempted.
1126+ // It returns:
1127+ // - modified context with fallback flag set (if fallback should proceed)
1128+ // - boolean indicating whether to proceed with fallback
1129+ func ShouldAttemptIntegrationFallback (ctx context.Context ) (context.Context , bool ) {
1130+ // Check if this is an integration request
1131+ if _ , ok := ctx .Value (schemas .BifrostContextKeyIntegrationRequest ).(bool ); ! ok {
1132+ return ctx , false
1133+ }
1134+
1135+ // Check if fallback has already been attempted
1136+ if attempted , _ := ctx .Value (schemas .BifrostContextKeyIntegrationFallbackAttempted ).(bool ); attempted {
1137+ return ctx , false
1138+ }
1139+
1140+ // Mark fallback as attempted and return modified context
1141+ ctx = context .WithValue (ctx , schemas .BifrostContextKeyIntegrationFallbackAttempted , true )
1142+ return ctx , true
1143+ }
1144+ >> >> >> > aed5a393 (fix : reroute requests incoming from integrations for full compatibility in custom providers )
You can’t perform that action at this time.
0 commit comments