| 96 | } |
| 97 | |
| 98 | func (p *Server) resolveModelRouteForConfig( |
| 99 | ctx context.Context, |
| 100 | ownerID uuid.UUID, |
| 101 | modelConfig database.ChatModelConfig, |
| 102 | fallbackKeys chatprovider.ProviderAPIKeys, |
| 103 | ) (resolvedModelRoute, error) { |
| 104 | if p.shouldUseAIGatewayRouting() { |
| 105 | return p.resolveAIGatewayModelRouteForConfig(ctx, ownerID, modelConfig) |
| 106 | } |
| 107 | return p.resolveDirectModelRouteForConfig(ctx, ownerID, modelConfig, fallbackKeys) |
| 108 | } |
| 109 | |
| 110 | func (p *Server) resolveModelRouteForProviderType( |
| 111 | ctx context.Context, |