Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions core/providers/replicate/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ func ToReplicateImageGenerationInput(bifrostReq *schemas.BifrostImageGenerationR
input.AspectRatio = params.AspectRatio
}

if params.Resolution != nil {
input.Resolution = params.Resolution
}

// Map OutputFormat
if params.OutputFormat != nil {
input.OutputFormat = params.OutputFormat
Expand Down
2 changes: 0 additions & 2 deletions core/providers/replicate/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ type ReplicatePredictionRequestInput struct {
// Image generation parameters
AspectRatio *string `json:"aspect_ratio,omitempty"`
OutputFormat *string `json:"output_format,omitempty"`
Resolution *string `json:"resolution,omitempty"` // e.g., "1 MP"
InputImages []string `json:"input_images,omitempty"` // Image input for image-to-image models
ImagePrompt *string `json:"image_prompt,omitempty"` // Image prompt for image models (flux family)
ImageInput []string `json:"image_input,omitempty"` // Image input for chat models (openai family)
Expand Down Expand Up @@ -155,7 +154,6 @@ func (r *ReplicatePredictionRequestInput) UnmarshalJSON(data []byte) error {
"frequency_penalty": true,
"aspect_ratio": true,
"output_format": true,
"resolution": true,
"input_images": true,
"image_prompt": true,
"input_image": true,
Expand Down
1 change: 0 additions & 1 deletion core/schemas/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ type ImageGenerationParameters struct {
User *string `json:"user,omitempty"`
InputImages []string `json:"input_images,omitempty"` // input images for image generation, base64 encoded or URL
AspectRatio *string `json:"aspect_ratio,omitempty"` // aspect ratio of the image
Resolution *string `json:"resolution,omitempty"` // resolution of the image
ExtraParams map[string]interface{} `json:"-"`
}

Expand Down
29 changes: 25 additions & 4 deletions transports/bifrost-http/handlers/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/fasthttp/router"
"github.com/google/uuid"
bifrost "github.com/maximhq/bifrost/core"
"github.com/maximhq/bifrost/core/mcp"
"github.com/maximhq/bifrost/core/schemas"
configstoreTables "github.com/maximhq/bifrost/framework/configstore/tables"
"github.com/maximhq/bifrost/transports/bifrost-http/lib"
Expand Down Expand Up @@ -234,12 +235,33 @@ func (h *MCPHandler) addMCPClient(ctx *fasthttp.RequestCtx) {
return
}

toolSyncInterval := mcp.DefaultToolSyncInterval
if req.ToolSyncInterval != 0 {
toolSyncInterval = time.Duration(req.ToolSyncInterval) * time.Minute
} else {
config, err := h.store.ConfigStore.GetClientConfig(ctx)
if err != nil {
SendError(ctx, fasthttp.StatusInternalServerError, fmt.Sprintf("failed to get client config: %v", err))
return
}
if config != nil {
toolSyncInterval = time.Duration(config.MCPToolSyncInterval) * time.Minute
}
}
Comment thread
Pratham-Mishra04 marked this conversation as resolved.
Comment thread
Pratham-Mishra04 marked this conversation as resolved.

isPingAvailable := true
if req.IsPingAvailable != nil {
isPingAvailable = *req.IsPingAvailable
}

// Store MCP client config in OAuth provider memory (not in database)
// It will be stored in database only after OAuth completion
pendingConfig := schemas.MCPClientConfig{
ID: req.ClientID,
Name: req.Name,
IsCodeModeClient: req.IsCodeModeClient,
IsPingAvailable: isPingAvailable,
ToolSyncInterval: toolSyncInterval,
ConnectionType: schemas.MCPConnectionType(req.ConnectionType),
ConnectionString: req.ConnectionString,
StdioConfig: req.StdioConfig,
Expand Down Expand Up @@ -269,7 +291,7 @@ func (h *MCPHandler) addMCPClient(ctx *fasthttp.RequestCtx) {
return
}

toolSyncInterval := 10 * time.Minute
toolSyncInterval := mcp.DefaultToolSyncInterval
if req.ToolSyncInterval != 0 {
toolSyncInterval = time.Duration(req.ToolSyncInterval) * time.Minute
} else {
Expand All @@ -281,8 +303,8 @@ func (h *MCPHandler) addMCPClient(ctx *fasthttp.RequestCtx) {
if config != nil {
toolSyncInterval = time.Duration(config.MCPToolSyncInterval) * time.Minute
}

}

// Convert to schemas.MCPClientConfig for runtime bifrost client (without tool_pricing)
// Dereference IsPingAvailable pointer, defaulting to true if nil (new clients default to ping available)
isPingAvailable := true
Expand Down Expand Up @@ -404,7 +426,7 @@ func (h *MCPHandler) updateMCPClient(ctx *fasthttp.RequestCtx) {
return
}
}
toolSyncInterval := 10 * time.Minute
toolSyncInterval := mcp.DefaultToolSyncInterval
if req.ToolSyncInterval != 0 {
toolSyncInterval = time.Duration(req.ToolSyncInterval) * time.Minute
} else {
Expand All @@ -416,7 +438,6 @@ func (h *MCPHandler) updateMCPClient(ctx *fasthttp.RequestCtx) {
if config != nil {
toolSyncInterval = time.Duration(config.MCPToolSyncInterval) * time.Minute
}

}
// Convert to schemas.MCPClientConfig for runtime bifrost client (without tool_pricing)
isPingAvailable := true
Expand Down
Loading