- Convert test files to use Bun's test framework and mocking utilities - Update import statements and test syntax - Add comprehensive test utilities and mock implementations - Create test migration guide documentation - Implement helper functions for consistent test setup and teardown - Add type definitions for improved type safety in tests
12 lines
423 B
TypeScript
12 lines
423 B
TypeScript
/**
|
|
* Formats a tool call response into a standardized structure
|
|
* @param obj The object to format
|
|
* @param isError Whether this is an error response
|
|
* @returns Formatted response object
|
|
*/
|
|
export const formatToolCall = (obj: any, isError: boolean = false) => {
|
|
const text = obj === undefined ? 'undefined' : JSON.stringify(obj, null, 2);
|
|
return {
|
|
content: [{ type: "text", text, isError }],
|
|
};
|
|
};
|