File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed
common/src/tools/params/tool Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,7 @@ export async function runProgrammaticStep(
232232 state,
233233 userId,
234234 autoInsertEndStepParam : true ,
235+ validateInputSchema : false ,
235236 } )
236237
237238 // TODO: Remove messages from state and always use agentState.messageHistory.
Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ export interface ExecuteToolCallParams<T extends string = ToolName> {
126126 state : Record < string , any >
127127 userId : string | undefined
128128 autoInsertEndStepParam ?: boolean
129+ validateInputSchema ?: boolean
129130}
130131
131132export function executeToolCall < T extends ToolName > ( {
@@ -145,15 +146,16 @@ export function executeToolCall<T extends ToolName>({
145146 state,
146147 userId,
147148 autoInsertEndStepParam = false ,
149+ validateInputSchema = true
148150} : ExecuteToolCallParams < T > ) : Promise < void > {
149- const toolCall : CodebuffToolCall < T > | ToolCallError = parseRawToolCall < T > (
151+ const toolCall : CodebuffToolCall < T > | ToolCallError = validateInputSchema ? parseRawToolCall < T > (
150152 {
151153 toolName,
152154 toolCallId : generateCompactId ( ) ,
153155 input,
154156 } ,
155157 autoInsertEndStepParam ,
156- )
158+ ) : { toolName , toolCallId : generateCompactId ( ) , input } as CodebuffToolCall < T >
157159 if ( 'error' in toolCall ) {
158160 toolResults . push ( {
159161 type : 'tool-result' ,
Original file line number Diff line number Diff line change @@ -14,14 +14,7 @@ export const setMessagesParams = {
1414 // Make sure to pass through any additional properties!
1515 . looseObject ( {
1616 role : z . enum ( [ 'user' , 'assistant' ] ) ,
17- content : z . string ( ) . or (
18- z . array (
19- z . object ( {
20- type : z . enum ( [ 'text' ] ) ,
21- text : z . string ( ) ,
22- } ) ,
23- ) ,
24- ) ,
17+ content : z . string ( )
2518 } ) ,
2619 ) ,
2720 } )
You can’t perform that action at this time.
0 commit comments