mirror of https://github.com/buster-so/buster.git
tests passing
This commit is contained in:
parent
5838285c81
commit
84445efa60
|
@ -307,13 +307,8 @@ export const analystAgentTask: ReturnType<
|
|||
const braintrustMetadataPromise = getBraintrustMetadata({ messageId: payload.message_id });
|
||||
|
||||
// Wait for all operations to complete
|
||||
const [
|
||||
messageContext,
|
||||
conversationHistory,
|
||||
dataSource,
|
||||
datasets,
|
||||
braintrustMetadata,
|
||||
] = await Promise.all([
|
||||
const [messageContext, conversationHistory, dataSource, datasets, braintrustMetadata] =
|
||||
await Promise.all([
|
||||
messageContextPromise,
|
||||
conversationHistoryPromise,
|
||||
dataSourcePromise,
|
||||
|
|
|
@ -89,13 +89,13 @@ describe('re-ask-strategy', () => {
|
|||
input: JSON.stringify(correctedToolCall.input), // FIXED: Now returns stringified input
|
||||
});
|
||||
|
||||
// Verify the tool input is properly formatted as a string in the messages
|
||||
// Verify the tool input is properly formatted as an object in the messages
|
||||
const calls = mockGenerateText.mock.calls[0];
|
||||
const messages = calls?.[0]?.messages;
|
||||
const assistantMessage = messages?.find((m: any) => m.role === 'assistant');
|
||||
const content = assistantMessage?.content?.[0];
|
||||
if (content && typeof content === 'object' && 'input' in content) {
|
||||
expect(content.input).toEqual(JSON.stringify({ param: 'value' }));
|
||||
expect(content.input).toEqual({ param: 'value' });
|
||||
}
|
||||
|
||||
expect(mockGenerateText).toHaveBeenCalledWith(
|
||||
|
@ -338,7 +338,7 @@ describe('re-ask-strategy', () => {
|
|||
const assistantMessage = messages?.find((m: any) => m.role === 'assistant');
|
||||
const content = assistantMessage?.content?.[0];
|
||||
if (content && typeof content === 'object' && 'input' in content) {
|
||||
expect(content.input).toEqual('{"already":"valid"}'); // Now expects stringified JSON
|
||||
expect(content.input).toEqual({ already: 'valid' }); // Expects parsed object
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -90,6 +90,7 @@ describe('structured-output-strategy', () => {
|
|||
model: 'mock-model',
|
||||
schema: tool?.inputSchema,
|
||||
prompt: expect.stringContaining('Fix these tool arguments'),
|
||||
mode: 'json',
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue