File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -431,19 +431,13 @@ export const openRouterProvider: ProviderConfig = {
431431 const accumulatedCost = calculateCost ( requestedModel , tokens . input , tokens . output )
432432
433433 const streamingParams : ChatCompletionCreateParamsStreaming & { provider ?: any } = {
434- model : payload . model ,
434+ ... payload ,
435435 messages : [ ...currentMessages ] ,
436+ tool_choice : 'auto' ,
436437 stream : true ,
437438 stream_options : { include_usage : true } ,
438439 }
439440
440- if ( payload . temperature !== undefined ) {
441- streamingParams . temperature = payload . temperature
442- }
443- if ( payload . max_tokens !== undefined ) {
444- streamingParams . max_tokens = payload . max_tokens
445- }
446-
447441 if ( request . responseFormat ) {
448442 ; ( streamingParams as any ) . messages = await applyResponseFormat (
449443 streamingParams as any ,
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
1414} from '@/lib/workflows/subblocks/visibility'
1515import { getBlock } from '@/blocks'
1616import type { SubBlockConfig } from '@/blocks/types'
17+ import { getProviderFromModel } from '@/providers/utils'
1718import type { SerializedBlock , SerializedWorkflow } from '@/serializer/types'
1819import type { BlockState , Loop , Parallel } from '@/stores/workflows/workflow/types'
1920import { generateLoopBlocks , generateParallelBlocks } from '@/stores/workflows/workflow/utils'
@@ -524,6 +525,16 @@ export class Serializer {
524525 const canonicalId = canonicalIndex . canonicalIdBySubBlockId [ subBlockConfig . id ]
525526 const fieldValue = canonicalId ? params [ canonicalId ] : params [ subBlockConfig . id ]
526527 if ( fieldValue === undefined || fieldValue === null || fieldValue === '' ) {
528+ if ( subBlockConfig . id === 'apiKey' && params . model ) {
529+ try {
530+ const provider = getProviderFromModel ( params . model as string )
531+ if ( provider === 'ollama' || provider === 'vllm' ) {
532+ return
533+ }
534+ } catch {
535+ // If provider resolution fails, continue with validation
536+ }
537+ }
527538 missingFields . push ( subBlockConfig . title || subBlockConfig . id )
528539 }
529540 } )
You can’t perform that action at this time.
0 commit comments