fix: add goose execution override for h5 chat
This commit is contained in:
+20
-1
@@ -114,8 +114,26 @@ function withAgentRunValidationMetadata(
|
||||
|
||||
function prepareAgentRunUserMessage(message: Message, options: AgentRunCreateOptions): Message {
|
||||
const normalized = normalizeUserMessageForApi(message);
|
||||
const withValidation = withAgentRunValidationMetadata(normalized, options.validation);
|
||||
const withRunMetadata = options.forceGoose
|
||||
? {
|
||||
...withValidation,
|
||||
metadata: {
|
||||
...withValidation.metadata,
|
||||
memindRun: {
|
||||
...(
|
||||
withValidation.metadata?.memindRun &&
|
||||
typeof withValidation.metadata.memindRun === 'object'
|
||||
? withValidation.metadata.memindRun
|
||||
: {}
|
||||
),
|
||||
forceGoose: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
: withValidation;
|
||||
return appendAgentRunValidationInstruction(
|
||||
withAgentRunValidationMetadata(normalized, options.validation),
|
||||
withRunMetadata,
|
||||
options.toolMode === 'code' ? options.validationInstruction : null,
|
||||
);
|
||||
}
|
||||
@@ -2440,6 +2458,7 @@ export async function createAgentRun(
|
||||
user_message: userMessagePayload,
|
||||
...(options.toolMode ? { tool_mode: options.toolMode } : {}),
|
||||
...(options.taskType ? { task_type: options.taskType } : {}),
|
||||
...(options.forceGoose ? { force_goose: true } : {}),
|
||||
}),
|
||||
},
|
||||
{ timeoutMs: AGENT_CONNECT_TIMEOUT_MS },
|
||||
|
||||
Reference in New Issue
Block a user